Skip to content
Snippets Groups Projects
Commit 113bdf52 authored by Pierre LALET's avatar Pierre LALET
Browse files

VXLAN: more layer bindings

parent d9be84f1
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,12 @@ 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(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)
bind_layers(VXLAN, Ether)
bind_layers(VXLAN, IP, NextProtocol=1)
......
......@@ -7444,7 +7444,7 @@ p = Ether(dst="11:11:11:11:11:11", src="22:22:22:22:22:22")
p /= IP(src="1.1.1.1", dst="2.2.2.2") / UDP(sport=1111)
p /= VXLAN(flags=0x8, vni=42) / Ether() / IP()
p = Ether(str(p))
assert(p[UDP].dport == 8472)
assert(p[UDP].dport == 4789)
assert(p[Ether:2].type == 0x800)
= Build a VXLAN packet with next protocol field
......@@ -7452,7 +7452,7 @@ p = Ether(dst="11:11:11:11:11:11", src="22:22:22:22:22:22")
p /= IP(src="1.1.1.1", dst="2.2.2.2") / UDP(sport=1111)
p /= VXLAN(flags=0xC, vni=42, NextProtocol=3) / Ether() / IP()
p = Ether(str(p))
assert(p[UDP].dport == 8472)
assert(p[UDP].dport == 4789)
assert(p[VXLAN].reserved0 == 0x0)
assert(p[VXLAN].NextProtocol == 3)
assert(p[Ether:2].type == 0x800)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment