class RandIP(RandString): """Generates a random IP address each time an instance is evaluated. Evaluate it manually by calling str() on it, or put it directly in a packet to generate a new random IP address each time the packet is evaluated. Call str() on it to get a single random IP address. Call str() on it again to get a different random IP address. The iptemplate field accepts a CIDR network mask.""" def __init__(self, iptemplate="0.0.0.0/0"): self.ip = Net(iptemplate) def _fix(self): return self.ip.choice()
class RandIP(RandString): def __init__(self, iptemplate="0.0.0.0/0"): self.ip = Net(iptemplate) def _fix(self): return self.ip.choice()