def h2i(self, pkt, x): if type(x) is str: try: inet_aton(x) except socket.error: x = Net(x) elif type(x) is list: x = [self.h2i(pkt, n) for n in x] return x
def h2i(self, pkt, x): if isinstance(x, basestring): try: inet_aton(x) except socket.error: x = Net(x) elif type(x) is list: x = [self.h2i(pkt, n) for n in x] return x
def __init__(self, iptemplate="0.0.0.0/0"): self.ip = Net(iptemplate)