Lines Matching refs:addr
39 * @param string $addr A valid IPv6 address
42 function inet6_expand($addr)
45 if (strpos($addr, '::') !== false) {
46 $part = explode('::', $addr);
55 $part = explode(":", $addr);
77 * @param string $addr A valid IPv6 address
80 function inet6_compress($addr)
83 $result = inet_ntop(inet_pton($addr));
116 * @param string $addr A valid IPv6 address
120 function inet6_to_range($addr, $prefix)
123 $addr = gmp_init('0x' . str_replace(':', '', inet6_expand($addr)));
125 $prefix = gmp_and($addr, $mask);
147 * @param string $addr A valid IPv6 address
150 function inet6_to_int64($addr)
153 if (strlen($addr) != 39) {
154 $addr = inet6_expand($addr);
155 if ($addr == false) return false;
157 $addr = str_replace(':', '', $addr);
158 $p1 = '0x' . substr($addr, 0, 16);
159 $p2 = '0x' . substr($addr, 16);
183 $addr = $p1 . $p2;
185 $result .= substr($addr, $i * 4, 4);