Lines Matching refs:mask
88 * Generate an IPv6 mask from prefix notation
90 * This will convert a prefix to an IPv6 address mask (used for IPv6 math)
93 * @return string The IPv6 mask address for the prefix size
100 $mask = '0b';
101 for ($i = 0; $i < $prefix; $i++) $mask .= '1';
102 for ($i = strlen($mask) - 2; $i < 128; $i++) $mask .= '0';
103 $mask = gmp_strval(gmp_init($mask), 16);
105 $result .= substr($mask, $i * 4, 4);
124 $mask = gmp_init('0x' . str_replace(':', '', inet6_expand(inet6_prefix_to_mask($prefix))));
125 $prefix = gmp_and($addr, $mask);