def __init__(self, source, destination, payload='', proto=socket.IPPROTO_TCP):
self.version = 4
self.ihl = 5 # Internet Header Length
self.tos = 0 # Type of Service
self.tl = 20+len(payload)
self.id = 0#random.randint(0, 65535)
self.flags = 0 # Don't fragment
self.offset = 0
self.ttl = 255
self.protocol = proto
self.checksum = 2 # will be filled by kernel
self.source = socket.inet_aton(source)
self.destination = socket.inet_aton(destination)
评论列表
文章目录