mirror of https://github.com/secdev/scapy.git
VXLAN: more layer bindings
This commit is contained in:
parent
d9be84f194
commit
113bdf5225
|
@ -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=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=6633) # New IANA assigned port for use with NSH
|
||||||
bind_layers(UDP, VXLAN, dport=8472) # Linux implementation port
|
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, Ether)
|
||||||
bind_layers(VXLAN, IP, NextProtocol=1)
|
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 /= IP(src="1.1.1.1", dst="2.2.2.2") / UDP(sport=1111)
|
||||||
p /= VXLAN(flags=0x8, vni=42) / Ether() / IP()
|
p /= VXLAN(flags=0x8, vni=42) / Ether() / IP()
|
||||||
p = Ether(str(p))
|
p = Ether(str(p))
|
||||||
assert(p[UDP].dport == 8472)
|
assert(p[UDP].dport == 4789)
|
||||||
assert(p[Ether:2].type == 0x800)
|
assert(p[Ether:2].type == 0x800)
|
||||||
|
|
||||||
= Build a VXLAN packet with next protocol field
|
= 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 /= 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 /= VXLAN(flags=0xC, vni=42, NextProtocol=3) / Ether() / IP()
|
||||||
p = Ether(str(p))
|
p = Ether(str(p))
|
||||||
assert(p[UDP].dport == 8472)
|
assert(p[UDP].dport == 4789)
|
||||||
assert(p[VXLAN].reserved0 == 0x0)
|
assert(p[VXLAN].reserved0 == 0x0)
|
||||||
assert(p[VXLAN].NextProtocol == 3)
|
assert(p[VXLAN].NextProtocol == 3)
|
||||||
assert(p[Ether:2].type == 0x800)
|
assert(p[Ether:2].type == 0x800)
|
||||||
|
|
Loading…
Reference in New Issue