aboutsummaryrefslogtreecommitdiffstats
path: root/test/scapy_handlers
diff options
context:
space:
mode:
Diffstat (limited to 'test/scapy_handlers')
-rw-r--r--test/scapy_handlers/__init__.py0
-rw-r--r--test/scapy_handlers/vxlan.py17
2 files changed, 17 insertions, 0 deletions
diff --git a/test/scapy_handlers/__init__.py b/test/scapy_handlers/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/test/scapy_handlers/__init__.py
diff --git a/test/scapy_handlers/vxlan.py b/test/scapy_handlers/vxlan.py
new file mode 100644
index 00000000000..bf86f179a8e
--- /dev/null
+++ b/test/scapy_handlers/vxlan.py
@@ -0,0 +1,17 @@
+from scapy.fields import BitField, XByteField, X3BytesField
+from scapy.packet import Packet, bind_layers
+from scapy.layers.l2 import Ether
+from scapy.layers.inet import UDP
+
+
+class VXLAN(Packet):
+ name = "VXLAN"
+ fields_desc = [BitField("flags", 0x08000000, 32),
+ X3BytesField("vni", 0),
+ XByteField("reserved", 0x00)]
+
+ def mysummary(self):
+ return self.sprintf("VXLAN (vni=%VXLAN.vni%)")
+
+bind_layers(UDP, VXLAN, dport=4789)
+bind_layers(VXLAN, Ether)