blob: bf86f179a8eedb2cf250e32bf9d00b1c643f82c4 [file] [log] [blame]
Damjan Marionf56b77a2016-10-03 19:44:57 +02001from scapy.fields import BitField, XByteField, X3BytesField
2from scapy.packet import Packet, bind_layers
3from scapy.layers.l2 import Ether
4from scapy.layers.inet import UDP
5
6
7class VXLAN(Packet):
8 name = "VXLAN"
9 fields_desc = [BitField("flags", 0x08000000, 32),
10 X3BytesField("vni", 0),
11 XByteField("reserved", 0x00)]
12
13 def mysummary(self):
14 return self.sprintf("VXLAN (vni=%VXLAN.vni%)")
15
16bind_layers(UDP, VXLAN, dport=4789)
17bind_layers(VXLAN, Ether)