Lines Matching refs:prefixlen
435 def _ip_int_from_prefix(cls, prefixlen): argument
445 return cls._ALL_ONES ^ (cls._ALL_ONES >> prefixlen)
462 prefixlen = cls._max_prefixlen - trailing_zeroes
464 all_ones = (1 << prefixlen) - 1
470 return prefixlen
495 prefixlen = int(prefixlen_str)
498 if not (0 <= prefixlen <= cls._max_prefixlen):
500 return prefixlen
686 return '%s/%d' % (self.network_address, self.prefixlen)
796 def prefixlen(self): member in _BaseNetwork
849 other.prefixlen))
1016 new_prefixlen = self.prefixlen - prefixlen_diff
1020 (self.prefixlen, prefixlen_diff))
1161 prefixlen = arg
1162 if not (0 <= prefixlen <= cls._max_prefixlen):
1163 cls._report_invalid_netmask(prefixlen)
1167 prefixlen = cls._prefix_from_prefix_string(arg)
1171 prefixlen = cls._prefix_from_ip_string(arg)
1172 netmask = IPv4Address(cls._ip_int_from_prefix(prefixlen))
1173 cls._netmask_cache[arg] = netmask, prefixlen
1600 prefixlen = arg
1601 if not (0 <= prefixlen <= cls._max_prefixlen):
1602 cls._report_invalid_netmask(prefixlen)
1604 prefixlen = cls._prefix_from_prefix_string(arg)
1605 netmask = IPv6Address(cls._ip_int_from_prefix(prefixlen))
1606 cls._netmask_cache[arg] = netmask, prefixlen