Lines Matching refs:mask_bits
42 # subnet. Each item is a tuple of (subnet_ip, mask_bits), e.g.,
48 ip, mask_bits = subnet.split(':')
49 RESTRICTED_SUBNETS.append((ip, int(mask_bits)))
593 def is_in_same_subnet(ip_1, ip_2, mask_bits=24):
600 @param mask_bits: Number of mask bits for subnet comparison. Default to 24.
605 mask = ((2L<<mask_bits-1) -1)<<(32-mask_bits)
626 def get_servers_in_same_subnet(host_ip, mask_bits, servers=None,
631 @param mask_bits: Number of mask bits.
633 host_ip and mask_bits.
648 if server_ip and is_in_same_subnet(server_ip, host_ip, mask_bits):
660 @return: A tuple of (subnet_ip, mask_bits), which defines a restricted
666 for subnet_ip, mask_bits in restricted_subnets:
667 if is_in_same_subnet(subnet_ip, host_ip, mask_bits):
668 return subnet_ip, mask_bits