diff options
author | Jan Gelety <jgelety@cisco.com> | 2019-11-12 05:27:43 +0100 |
---|---|---|
committer | Jan Gelety <jgelety@cisco.com> | 2019-11-28 18:26:21 +0100 |
commit | d68951ac245150eeefa6e0f4156e4c1b5c9e9325 (patch) | |
tree | 487554a7547218d27f0a61ec02b70502c32cdcb4 /resources/traffic_scripts/vxlan.py | |
parent | ed0258a440cfad7023d643f717ab78ac568dc59b (diff) |
Python3: resources and libraries
Change-Id: I1392c06b1d64f62b141d24c0d42a8e36913b15e2
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/traffic_scripts/vxlan.py')
-rw-r--r-- | resources/traffic_scripts/vxlan.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/resources/traffic_scripts/vxlan.py b/resources/traffic_scripts/vxlan.py index bf86f179a8..eebfb9056e 100644 --- a/resources/traffic_scripts/vxlan.py +++ b/resources/traffic_scripts/vxlan.py @@ -1,17 +1,19 @@ 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 +from scapy.layers.l2 import Ether +from scapy.packet import Packet, bind_layers class VXLAN(Packet): - name = "VXLAN" - fields_desc = [BitField("flags", 0x08000000, 32), - X3BytesField("vni", 0), - XByteField("reserved", 0x00)] + name = u"VXLAN" + fields_desc = [ + BitField(u"flags", 0x08000000, 32), + X3BytesField(u"vni", 0), + XByteField(u"reserved", 0x00) + ] def mysummary(self): - return self.sprintf("VXLAN (vni=%VXLAN.vni%)") + return self.sprintf(f"VXLAN (vni={VXLAN.vni})") bind_layers(UDP, VXLAN, dport=4789) bind_layers(VXLAN, Ether) |