aboutsummaryrefslogtreecommitdiffstats
path: root/resources/traffic_scripts/vxlan.py
diff options
context:
space:
mode:
authorMatej Klotton <mklotton@cisco.com>2017-03-20 09:38:02 +0100
committerJan Gelety <jgelety@cisco.com>2017-04-25 15:38:29 +0000
commit0fc813b1694a6ae70b759e7ca96741f21f81b051 (patch)
tree43ad70df6c030ad3e4b178f36a5147e848c3facf /resources/traffic_scripts/vxlan.py
parentf496b8dd088f9ba89710b8b6f8d0fb380740458f (diff)
Vhost tests
Change-Id: I03722afe13722941e084bc01161f7c2af30e3cb1 Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'resources/traffic_scripts/vxlan.py')
-rw-r--r--resources/traffic_scripts/vxlan.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/resources/traffic_scripts/vxlan.py b/resources/traffic_scripts/vxlan.py
new file mode 100644
index 0000000000..bf86f179a8
--- /dev/null
+++ b/resources/traffic_scripts/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)