You are here

private function IpAddress::getFamily in IP address fields 8

Same name and namespace in other branches
  1. 2.0.x src/IpAddress.php \Drupal\field_ipaddress\IpAddress::getFamily()

Find if the IP family is IPv4 or IPv6.

2 calls to IpAddress::getFamily()
IpAddress::inRange in src/IpAddress.php
Checks if the stored IP is within $min and $max IPs.
IpAddress::parse in src/IpAddress.php
Find if the value given is an IP, IP range, or other.

File

src/IpAddress.php, line 118

Class

IpAddress
IpTools class.

Namespace

Drupal\field_ipaddress

Code

private function getFamily($ip) {
  if ($this
    ->isIpV4($ip)) {
    return self::IP_FAMILY_4;
  }
  return self::IP_FAMILY_6;
}