[dts] [PATCH V1] dep/vxlan: use the latest vxlan version instead old
lihong
lihongx.ma at intel.com
Thu Jan 9 23:07:58 CET 2020
Signed-off-by: lihong <lihongx.ma at intel.com>
---
dep/vxlan.py | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/dep/vxlan.py b/dep/vxlan.py
index f60f2a1..0683b42 100644
--- a/dep/vxlan.py
+++ b/dep/vxlan.py
@@ -12,7 +12,6 @@ from scapy.layers.l2 import Ether
vxlanmagic = "0x8"
-VXLAN_PORT=4789
_GP_FLAGS = ["R", "R", "R", "A", "R", "R", "D", "R"]
class VXLAN(Packet):
@@ -67,13 +66,26 @@ class VXLAN(Packet):
else:
return Packet.guess_payload_class(self, payload)
-split_layers(UDP, DNS, sport=53)
-bind_layers(UDP, VXLAN, dport=4789) # RFC standard port
+bind_layers(UDP, VXLAN, dport=4789) # RFC standard vxlan port
+bind_layers(UDP, VXLAN, dport=4790) # RFC standard vxlan-gpe port
bind_layers(UDP, VXLAN, dport=6633) # New IANA assigned port for use with NSH
bind_layers(UDP, VXLAN, dport=8472) # Linux implementation port
-bind_layers(VXLAN, Ether, {'flags': 0x8})
-bind_layers(VXLAN, Ether, {'flags': 0x88})
-bind_layers(VXLAN, Ether, {'flags': 0xC, 'NextProtocol': 0}, NextProtocol=0)
-bind_layers(VXLAN, IP, {'flags': 0xC, 'NextProtocol': 1}, NextProtocol=1)
-bind_layers(VXLAN, IPv6, {'flags': 0xC, 'NextProtocol': 2}, NextProtocol=2)
-bind_layers(VXLAN, Ether, {'flags': 0xC, 'NextProtocol': 3}, NextProtocol=3)
+bind_layers(UDP, VXLAN, dport=48879) # Cisco ACI
+bind_layers(UDP, VXLAN, sport=4789)
+bind_layers(UDP, VXLAN, sport=4790)
+bind_layers(UDP, VXLAN, sport=6633)
+bind_layers(UDP, VXLAN, sport=8472)
+# By default, set both ports to the RFC standard
+bind_layers(UDP, VXLAN, sport=4789, dport=4789)
+
+# Dissection
+bind_bottom_up(VXLAN, Ether, NextProtocol=0)
+bind_bottom_up(VXLAN, IP, NextProtocol=1)
+bind_bottom_up(VXLAN, IPv6, NextProtocol=2)
+bind_bottom_up(VXLAN, Ether, NextProtocol=3)
+bind_bottom_up(VXLAN, Ether, NextProtocol=None)
+# Build
+bind_top_down(VXLAN, Ether, flags=12, NextProtocol=0)
+bind_top_down(VXLAN, IP, flags=12, NextProtocol=1)
+bind_top_down(VXLAN, IPv6, flags=12, NextProtocol=2)
+bind_top_down(VXLAN, Ether, flags=12, NextProtocol=3)
--
2.7.4
More information about the dts
mailing list