Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
544fbb91
Commit
544fbb91
authored
7 years ago
by
Guillaume Valadon
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #823 from p-l-/fix-vxlan
VXLAN: more layer bindings
parents
d9be84f1
113bdf52
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scapy/layers/vxlan.py
+6
-0
6 additions, 0 deletions
scapy/layers/vxlan.py
test/regression.uts
+2
-2
2 additions, 2 deletions
test/regression.uts
with
8 additions
and
2 deletions
scapy/layers/vxlan.py
+
6
−
0
View file @
544fbb91
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
test/regression.uts
+
2
−
2
View file @
544fbb91
...
...
@@ -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 ==
8
47
2
)
assert(p[UDP].dport == 47
89
)
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 ==
8
47
2
)
assert(p[UDP].dport == 47
89
)
assert(p[VXLAN].reserved0 == 0x0)
assert(p[VXLAN].NextProtocol == 3)
assert(p[Ether:2].type == 0x800)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment