Advertisement
jfif_junior

icmp

Nov 27th, 2021
1,251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. class icmp:
  2.     def __init__(self, _type, code, checksum, data):
  3.         pass
  4.  
  5.     @classmethod
  6.     def from_bytes(cls, t):
  7.         pass
  8.         return cls(_type, code, checksum, data)
  9.    
  10.     @classmethod
  11.     def from_dict(cls, t):
  12.         pass
  13.         return cls(_type, code, checksum, data)
  14.    
  15.     @classmethod
  16.     def from_random(cls):
  17.         pass
  18.         return cls(_type, code, checksum, data)
  19.  
  20.  
  21. if __name__ == "__main__":
  22.     i0 = icmp(0, 0, b'\xde\xad', b'\xbe\xef')
  23.     i1 = icmp.from_bytes(b'\x00\x00\xde\xad\xbe\xef')
  24.     i2 = icmp.from_dict({'type': 0, 'code': 0, 'checksum': b'\xde\xad', 'data': b'\xbe\xef'})
  25.     i3 = icmp.from_random()
  26.  
  27.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement