diff options
author | Damjan Marion <damarion@cisco.com> | 2016-10-03 19:44:57 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-10-03 19:58:19 +0000 |
commit | f56b77a0764222cc45a9df572df901067a273356 (patch) | |
tree | 7f11bcde6219608ad2a433655ea58cd11747025a /test/scapy_handlers | |
parent | 6c3ebcc2bfd36a5835a99225ad667e4403293ffb (diff) |
test: new test infrastructure
Change-Id: I73ca19c431743f6b39669c583d9222a6559346ef
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Signed-off-by: Stefan Kobza <skobza@cisco.com>
Signed-off-by: Matej Klotton <mklotton@cisco.com>
Signed-off-by: Maciek Konstantynowicz <mkonstan@cisco.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'test/scapy_handlers')
-rw-r--r-- | test/scapy_handlers/__init__.py | 0 | ||||
-rw-r--r-- | test/scapy_handlers/vxlan.py | 17 |
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) |