Adds a row with a IPv4 value to a detail table.

@param DetailTable     $table      The detail table.
@param string|int|null $header     The header text of this table row.
@param string|null     $ip4Address The IPv4 address.
978218
public static function addRow(DetailTable $table, $header, ?string $ip4Address): void
  {
    if ($ip4Address!==null && $ip4Address!=='')
    {
      $table->addRow($header, ['class' => 'ipv4'], $ip4Address);
    }
    else
    {
      $table->addRow($header);
    }
  }
1327207
public function addAddress(AddressInterface $address): void
    {
        if (!$this->hasAddress($address)) {
            if ($this->isIndividual()) {
                if ($address->getFirstName() === null || $address->getLastName() === null) {
                    $address->setFirstName($this->getFirstName());
                    $address->setLastName($this->getLastName());
                }
            } else {
                if ($address->getLastName() === null) {
                    $address->setLastName($this->getName());
                }
            }

            $this->addresses->add($address);
            $address->setCustomer($this);

            if (!$this->getDefaultAddress()) {
                $this->setDefaultAddress($address);
            }
        }
    }
48533
public static function isIpInCidr(string $ip, string $cidr): bool
    {
        if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            throw new \UnexpectedValueException(
                "invalid value for ip; expecting an IPv4 address"
            );
        }

        list($range, $netmask) = static::parseCidr($cidr);
        $netmask = ~((1 << (32 - $netmask)) - 1);
        return ((ip2long($ip) & $netmask) === ip2long($range));
    }
401606
public void addAddress(PeerAddress peerAddress) {
        int newMax;
        lock.lock();
        try {
            if (addInactive(peerAddress)) {
                newMax = getMaxConnections() + 1;
                setMaxConnections(newMax);
            }
        } finally {
            lock.unlock();
        }
    }
67112
protected function getIPv4Address()
    {
        return $this->{$this->ipTypeAttribute} == IP::IPv4 ? inet_ntop($this->{$this->ipAttribute}) : null;
    }
21207
@Override
    public void addRequestHeader(Header header) {
        LOG.trace("HttpMethodBase.addRequestHeader(Header)");

        if (header == null) {
            LOG.debug("null header value ignored");
        } else {
            getRequestHeaderGroup().addHeader(header);
        }
    }
985774
protected function validate_valid_ipv4($field, $input, $param = null)
    {
        if (!isset($input[$field]) || empty($input[$field])) {
            return;
        }

        if (!filter_var($input[$field], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            // removed !== FALSE

            return array(
                'field' => $field,
                'value' => $input[$field],
                'rule' => __FUNCTION__,
                'param' => $param,
            );
        }
    }
793097
public static function create($ip, $prefix = ''): IPBlock
    {
        try {
            return new IPv4Block($ip, $prefix);
        } catch (\InvalidArgumentException $e) {
            // do nothing
        }

        try {
            return new IPv6Block($ip, $prefix);
        } catch (\InvalidArgumentException $e) {
            // do nothing
        }

        throw new \InvalidArgumentException("$ip does not appear to be an IPv4 or IPv6 block");
    }
396237
function CIDR(addr, prefixLen) {
  if (prefixLen === undefined) {
    /* OK to pass pass string of "<addr>/<prefix>" */
    assert.string(addr);
    var fields = addr.match(/^([a-fA-F0-9:.]+)\/([0-9]+)$/);
    if (fields === null) {
      throw new Error('Invalid argument: <addr>/<prefix> expected');
    }
    addr = fields[1];
    prefixLen = parseInt(fields[2], 10);
  }
  assert.number(prefixLen);
  prefixLen = prefixLen | 0;
  addr = _toAddr(addr);

  /* Expand prefix to ipv6 length of bare ipv4 address provided */
  if (addr._attrs.ipv4Bare) {
    prefixLen += 96;
  }
  if (prefixLen < 0 || prefixLen > 128) {
    throw new Error('Invalid prefix length');
  }
  this._prefix = prefixLen;
  this._mask = _prefixToAddr(prefixLen);
  this._addr = addr.and(this._mask);
}
1182492
public function isValidIP4(string $ipAddress): bool
    {
        return (bool) filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_RES_RANGE);
    }
1342805
def add_address(ipaddress, rule)
      return false unless rule.is_a?(Rule)
      @addresses ||= {}
      (@addresses[ipaddress] ||= []) << rule
      rule
    end
941746
public function addTable( $table, $prefix = NULL )
	{
		$prefix	= $prefix === NULL ? $this->prefix : $prefix;
		if( is_array( $table ) )
			return $this->addTables( $table, $prefix );
		if( in_array( $prefix.$table, $this->tables ) )
			return FALSE;
		$this->tables[] = $prefix.$table;
		return TRUE;
	}
1239452
protected function addAddress()
    {
        if (!$this->isError()) {

            $id = $this->address->add($this->getSubmitted());

            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }

            $this->line($id);
        }
    }
885458
public void setIpv4Addresses(java.util.Collection<String> ipv4Addresses) {
        if (ipv4Addresses == null) {
            this.ipv4Addresses = null;
            return;
        }

        this.ipv4Addresses = new java.util.ArrayList<String>(ipv4Addresses);
    }
1323923
static public function GetIPv4NumberOfHostAddresses($ipAndCidr)
    {

        $ipAndCidrNetwork   = static::ConvertIPv4ToDecimal(
            static::GetIPv4NetworkAddress($ipAndCidr)
        );


        $ipAndCidrBroadcast = static::ConvertIPv4ToDecimal(
            static::GetIPv4BroadcastAddress($ipAndCidr)
        );

        return $ipAndCidrBroadcast - $ipAndCidrNetwork - 1;

    }
1267486
public function addHeader ($header, $value = null)
		{
			if ($value)
				$this->_headers[] = "$header: $value";
			else
				$this->_headers[] = $header;

			return $this;
		}
152299
public function getAddressInfo($ipAddress)
    {
        // This test is a trick to determine if we have a valid IPv4 address, the
        // only kind we can handle at the moment.
        $long = ip2long($ipAddress);
        if ($long == -1 || $long === false) {
            return null;
        }
        $result = $this->gateway->get(
            'ipv4address',
            ['ip_address' => $ipAddress, '_max_results' => 1]
        );
        return (isset($result[0])) ? $result[0] : null;
    }