Lines Matching refs:prefixlen
700 def prefixlen(self):
753 other = IPNetwork('%s/%s' % (str(other.network), str(other.prefixlen)),
842 def _ip_int_from_prefix(self, prefixlen=None):
846 prefixlen: An integer, the prefix length.
852 if not prefixlen and prefixlen != 0:
853 prefixlen = self._prefixlen
854 return self._ALL_ONES ^ (self._ALL_ONES >> prefixlen)
875 def _ip_string_from_prefix(self, prefixlen=None):
879 prefixlen: An integer, the netmask prefix length.
885 if not prefixlen:
886 prefixlen = self._prefixlen
887 return self._string_from_ip_int(self._ip_int_from_prefix(prefixlen))
973 ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have a
992 if self.prefixlen - prefixlen_diff < 0:
994 'current prefixlen is %d, cannot have a prefixlen_diff of %d' %
995 (self.prefixlen, prefixlen_diff))
997 str(self.prefixlen - prefixlen_diff)),
1226 .prefixlen: 27
1594 return '%s/%d' % (':'.join(parts), self.prefixlen)
1803 .prefixlen: 64
1878 def _is_valid_netmask(self, prefixlen):
1879 """Verify that the netmask/prefixlen is valid.
1882 prefixlen: A string, the netmask in prefix length format.
1890 prefixlen = int(prefixlen)
1893 return 0 <= prefixlen <= self._max_prefixlen