Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class icmp:
- def __init__(self, _type, code, checksum, data):
- pass
- @classmethod
- def from_bytes(cls, t):
- pass
- return cls(_type, code, checksum, data)
- @classmethod
- def from_dict(cls, t):
- pass
- return cls(_type, code, checksum, data)
- @classmethod
- def from_random(cls):
- pass
- return cls(_type, code, checksum, data)
- if __name__ == "__main__":
- i0 = icmp(0, 0, b'\xde\xad', b'\xbe\xef')
- i1 = icmp.from_bytes(b'\x00\x00\xde\xad\xbe\xef')
- i2 = icmp.from_dict({'type': 0, 'code': 0, 'checksum': b'\xde\xad', 'data': b'\xbe\xef'})
- i3 = icmp.from_random()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement