def ip_in_ip_mask(ip, mask_ip, mask):
ip = ip2hex(ip)<EOL>if ip is None: raise Exception("<STR_LIT>")<EOL>if (mask_ip & mask) == (ip & mask):<EOL><INDENT>return True<EOL><DEDENT>return False<EOL>
Checks whether an ip is contained in an ip subnet where the subnet is stated as an ip in the dotted format, and a hex mask