def routingprefixlength(self): """Return an integer.""" netmask = IPAddress.asList(self.netmask) # for an easy way to determine the highest bit set see https://wiki.python.org/moin/BitManipulation return 8 * len(netmask) - int( math.floor( math.log( IPAddress.asInteger(IPAddress.bitNot(netmask)) + 1, 2)))
def routingprefixlength(self): """Return an integer.""" netmask = IPAddress.asList(self.netmask) # for an easy way to determine the highest bit set see https://wiki.python.org/moin/BitManipulation return 8 * len(netmask) - int(math.floor(math.log(IPAddress.asInteger(IPAddress.bitNot(netmask)) + 1, 2)))