Returns the IP address throttles collection.

@param  string  $ipAddress
@return \Illuminate\Database\Eloquent\Collection
765306
protected function getIpThrottles($ipAddress)
    {
        if (! array_key_exists($ipAddress, $this->ipThrottles)) {
            $this->ipThrottles[$ipAddress] = $this->loadIpThrottles($ipAddress);
        }

        return $this->ipThrottles[$ipAddress];
    }
460303
public function ipToHex($ipAddress)
    {
        $hex = '';
        if (strpos($ipAddress, ',') !== false) {
            $splitIp = explode(',', $ipAddress);
            $ipAddress = trim($splitIp[0]);
        }
        $isIpV6 = false;
        $isIpV4 = false;
        if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false) {
            $isIpV6 = true;
        } elseif (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {
            $isIpV4 = true;
        }
        if (!$isIpV4 && !$isIpV6) {
            return false;
        }
        // IPv4 format
        if ($isIpV4) {
            $parts = explode('.', $ipAddress);
            for ($i = 0; $i < 4; $i++) {
                $parts[ $i ] = str_pad(dechex($parts[ $i ]), 2, '0', STR_PAD_LEFT);
            }
            $ipAddress = '::'.$parts[0].$parts[1].':'.$parts[2].$parts[3];
            $hex = implode('', $parts);
        } // IPv6 format
        else {
            $parts = explode(':', $ipAddress);
            // If this is mixed IPv6/IPv4, convert end to IPv6 value
            if (filter_var($parts[ count($parts) - 1 ], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false) {
                $partsV4 = explode('.', $parts[ count($parts) - 1 ]);
                for ($i = 0; $i < 4; $i++) {
                    $partsV4[ $i ] = str_pad(dechex($partsV4[ $i ]), 2, '0', STR_PAD_LEFT);
                }
                $parts[ count($parts) - 1 ] = $partsV4[0].$partsV4[1];
                $parts[] = $partsV4[2].$partsV4[3];
            }
            $numMissing = 8 - count($parts);
            $expandedParts = [];
            $expansionDone = false;
            foreach ($parts as $part) {
                if (!$expansionDone && $part == '') {
                    for ($i = 0; $i <= $numMissing; $i++) {
                        $expandedParts[] = '0000';
                    }
                    $expansionDone = true;
                } else {
                    $expandedParts[] = $part;
                }
            }
            foreach ($expandedParts as &$part) {
                $part = str_pad($part, 4, '0', STR_PAD_LEFT);
            }
            $ipAddress = implode(':', $expandedParts);
            $hex = implode('', $expandedParts);
        }
        // Validate the final IP
        if (!filter_var($ipAddress, FILTER_VALIDATE_IP)) {
            return false;
        }

        return strtolower(str_pad($hex, 32, '0', STR_PAD_LEFT));
    }
534883
public function getArrayAdresseFromIdAdresse($idAdresse = 0)
    {
        $req = "
				select ha.idAdresse as idAdresse,
				ha.date as date,
				ha.description as description,
				ha.nom as nom,
				ha.idHistoriqueAdresse as idHistoriqueAdresse,
				ha.numero as numero,
				IF(ha.idIndicatif='0','',i.nom) as nomIndicatif,
				ha.idRue,
				IF (ha.idSousQuartier != 0, ha.idSousQuartier, r.idSousQuartier) AS idSousQuartier,
				IF (ha.idQuartier != 0, ha.idQuartier, sq.idQuartier) AS idQuartier,
				IF (ha.idVille != 0, ha.idVille, q.idVille) AS idVille,
				IF (ha.idPays != 0, ha.idPays, v.idPays) AS idPays,

				r.prefixe as prefixeRue,
				r.nom as nomRue,
				sq.nom as nomSousQuartier,
				q.nom as nomQuartier,
				v.nom as nomVille,
				p.nom as nomPays

				from historiqueAdresse hab, historiqueAdresse ha

				LEFT JOIN rue r         ON r.idRue = ha.idRue
				LEFT JOIN sousQuartier sq   ON sq.idSousQuartier = IF(ha.idRue='0' and ha.idSousQuartier!='0' ,ha.idSousQuartier ,r.idSousQuartier )
				LEFT JOIN quartier q        ON q.idQuartier = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier!='0' ,ha.idQuartier ,sq.idQuartier )
				LEFT JOIN ville v       ON v.idVille = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille!='0' ,ha.idVille ,q.idVille )
				LEFT JOIN indicatif i ON i.idIndicatif = ha.idIndicatif
				LEFT JOIN pays p        ON p.idPays = IF(ha.idRue='0' and ha.idSousQuartier='0' and ha.idQuartier='0' and ha.idVille='0' and ha.idPays!='0' ,ha.idPays ,v.idPays )

				where ha.idAdresse = '".$idAdresse."'
						and hab.idAdresse = ha.idAdresse
						group by ha.idAdresse, ha.idHistoriqueAdresse
						having ha.idHistoriqueAdresse = max(hab.idHistoriqueAdresse)
						";
        $res=$this->connexionBdd->requete($req);
        return mysql_fetch_assoc($res);
    }
1119239
public function addIp(string $address): CollectionInterface
    {
        $this->collection->addIp($address);

        $this->clearCache();

        return $this;
    }
352359
public function ifIsIpAddress()
    {
        if ($this->value->isIpAddress()) {
            return $this->value->value();
        }

        $this->paramErrors->append($this->paramName, 'INVALID_IP_ADDRESS');
        return null;
    }
828536
def get_ipaddr(self):
        '''
        
        '''
        # Loopbacks - first interface
        if (len(self.loopbacks)):
            ips = self.loopbacks[0].ips
            if (len(ips)):
                ips.sort()
                return util.strip_slash_masklen(ips[0])

        # SVIs + all known - lowest address
        ips = []
        for svi in self.svis:
            ips.extend(svi.ip)
        ips.extend(self.ip)
        if (len(ips)):
            ips.sort()
            return util.strip_slash_masklen(ips[0])

        return ''
1139599
public function containsIp($ipAddress)
    {
        // if the mask is false this means we have a full IP address as a
        // range so compare against the whole string
        if (false === $this->mask) {
            return ($this->rangeSubstring === $this->convertToBinaryString($ipAddress));
        }

        // remove the masked part of the address
        $ipAddressSubstring = substr(
            $this->convertToBinaryString($ipAddress),
            0,
            $this->mask
        );
        return ($this->rangeSubstring === $ipAddressSubstring);
    }
1211713
protected function loadIpThrottles($ipAddress)
    {
        $interval = Carbon::now()
            ->subSeconds($this->ipInterval);

        return $this
            ->createModel()
            ->newQuery()
            ->where('type', 'ip')
            ->where('ip', $ipAddress)
            ->where('created_at', '>', $interval)
            ->get();
    }
781431
public static function getAllByName($host, $fetch = null)
    {
        if ($fetch === null) {
            $fetch = self::IPV4;
        }

        if (filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            return [self::getByAddress(inet_pton($host))];
        } elseif (filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
            return [self::getByAddress(inet_pton($host))];
        }

        $addrs = [];
        if ($fetch & self::IPV4) {
            $v4Addrs = @gethostbynamel($host);
            if ($v4Addrs !== false) {
                $v4Addrs = array_unique($v4Addrs); // gethostbynamel seems to returns duplicate values sometime
                foreach ($v4Addrs as $v4Addr) {
                    $addrs[] = self::getByAddress(inet_pton($v4Addr), $host);
                }
            }
        }
        if ($fetch & self::IPV6) {
            $v6Addrs = dns_get_record($host, DNS_AAAA);
            if ($v6Addrs !== false) {
                foreach ($v6Addrs as $v6Addr) {
                    $addrs[] = self::getByAddress(inet_pton($v6Addr['ipv6']), $host);
                }
            }
        }

        if (empty($addrs)) {
            throw new UnknownHostException($host);
        }

        return $addrs;
    }
482261
public function locate($ipAddress)
    {
        $response = $this->client->get("json/$ipAddress");

        $data = json_decode($response->getBody());

        return $this->hydrate([
            'ip'          => $ipAddress,
            'iso_code'    => $data->country_code,
            'country'     => $data->country_name,
            'city'        => $data->city,
            'state'       => $data->region_name,
            'state_code'  => $data->region_code,
            'postal_code' => $data->zip_code,
            'latitude'    => $data->latitude,
            'longitude'   => $data->longitude,
            'timezone'    => $data->time_zone,
            'continent'   => $this->continents->get($data->country_code, 'Unknown'),
        ]);
    }
1191484
function getFqdnForIpAddress(ipAddress, cb) {
  dns.reverse(ipAddress, function(err, fqdns) {
    if (err) {
      cb(err, fqdns);
    } else if (fqdns[0].toLowerCase() === localhostIdentifier) {
      getFqdn(localhostIdentifier, cb);
    } else {
      cb(err, fqdns[0]);
    }
  });
}
463940
def getIPaddresses(self):
        """"""
        if not self.ipAddress:
            self.ipAddress = ipAddresses.getAll() # update with IP address
        return self.ipAddress
385042
public function getRecord($ipAddress = 'me', $type = 'country', array $options = array())
    {
        $provider = isset($options['provider']) ? $options['provider'] : 'reader';
        $locales = isset($options['locales']) ? $options['locales'] : array('en');

        if ('client' == $provider) {
            $provider = $this->getClient($locales);
        } else {
            $provider = $this->getReader($type, $locales);
        }

        $method = preg_replace_callback('/_([a-z])/', function ($match) {
            return strtoupper($match[1]);
        }, $type);

        if (!method_exists($provider, $method)) {
            throw new GeoIpException(
                sprintf('The method "%s" does not exist for %s', $method, get_class($provider))
            );
        }

        return $provider->{$method}($ipAddress);
    }
1104879
protected static function checkIPAddressAgainstCIDRMask($ipAddress, $CIDRMask)
    {
        list( $mask, $CIDRSuffix ) = explode('/', $CIDRMask);

        return ( ip2long($ipAddress) & ~( ( 1 << ( 32 - $CIDRSuffix ) ) - 1 ) ) == ip2long($mask);
    }
811428
public static function ipAddress($ipAddress)
    {
        if (false === filter_var($ipAddress, FILTER_VALIDATE_IP)) {
            throw new InputValidationException('invalid "ip_address"');
        }

        // normalize the IP address (only makes a difference for IPv6)
        return inet_ntop(inet_pton($ipAddress));
    }
582484
public function findByUser(UserInterface $user, $ipAddress = null)
	{
		$model = $this->createModel();
		$query = $model->where('user_id', '=', ($userId = $user->getId()));

		if ($ipAddress)
		{
			$query->where(function($query) use ($ipAddress) {
				$query->where('ip_address', '=', $ipAddress);
				$query->orWhere('ip_address', '=', NULL);
			});
		}

		if ( ! $throttle = $query->first())
		{
			$throttle = $this->createModel();
			$throttle->user_id = $userId;
			if ($ipAddress) $throttle->ip_address = $ipAddress;
			$throttle->save();
		}

		return $throttle;
	}
832883
protected function ipIsTrustedProxy($ipAddress)
    {
        if (filter_var($ipAddress, FILTER_VALIDATE_IP) === false) {
            return false;
        }
        $allowedProxies = $this->settings['proxies'];
        if ($allowedProxies === '*') {
            return true;
        }
        if (is_string($allowedProxies)) {
            $allowedProxies = array_map('trim', explode(',', $allowedProxies));
        }
        if (!is_array($allowedProxies)) {
            return false;
        }
        foreach ($allowedProxies as $ipPattern) {
            if (IpUtility::cidrMatch($ipAddress, $ipPattern)) {
                return true;
            }
        }
        return false;
    }