* Remove unused python imports These changes have been auto-generated with: pip3 install isort autoflake isort -rc -sl . autoflake --remove-all-unused-imports -i -r . isort -rc -m 3 . Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> * python: remove redundant parenthesis Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
21 lines
380 B
Python
21 lines
380 B
Python
|
|
|
|
from scapy.all import *
|
|
|
|
TYPE_MYTUNNEL = 0x1212
|
|
TYPE_IPV4 = 0x0800
|
|
|
|
class MyTunnel(Packet):
|
|
name = "MyTunnel"
|
|
fields_desc = [
|
|
ShortField("pid", 0),
|
|
ShortField("dst_id", 0)
|
|
]
|
|
def mysummary(self):
|
|
return self.sprintf("pid=%pid%, dst_id=%dst_id%")
|
|
|
|
|
|
bind_layers(Ether, MyTunnel, type=TYPE_MYTUNNEL)
|
|
bind_layers(MyTunnel, IP, pid=TYPE_IPV4)
|
|
|