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
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
c1e3e8dc
Commit
c1e3e8dc
authored
10 years ago
by
Jochen Bartl
Browse files
Options
Downloads
Patches
Plain Diff
Changed FlagsField to 32 bit. Cleaned up imports
parent
426b78ac
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
scapy/contrib/eigrp.py
+5
-0
5 additions, 0 deletions
scapy/contrib/eigrp.py
scapy/contrib/vxlan.py
+14
-8
14 additions, 8 deletions
scapy/contrib/vxlan.py
scapy/contrib/vxlan.utscapy
+1
-1
1 addition, 1 deletion
scapy/contrib/vxlan.utscapy
scapy/fields.py
+0
-3
0 additions, 3 deletions
scapy/fields.py
with
20 additions
and
12 deletions
scapy/contrib/eigrp.py
+
5
−
0
View file @
c1e3e8dc
...
...
@@ -168,6 +168,11 @@ class EigrpIP6Field(StrField, IP6Field, EigrpIPField):
def
getfield
(
self
,
pkt
,
s
):
return
EigrpIPField
.
getfield
(
self
,
pkt
,
s
)
class
ThreeBytesField
(
X3BytesField
,
ByteField
):
def
i2repr
(
self
,
pkt
,
x
):
return
ByteField
.
i2repr
(
self
,
pkt
,
x
)
class
EIGRPGeneric
(
Packet
):
name
=
"
EIGRP Generic TLV
"
fields_desc
=
[
XShortField
(
"
type
"
,
0x0000
),
...
...
This diff is collapsed.
Click to expand it.
scapy/contrib/vxlan.py
+
14
−
8
View file @
c1e3e8dc
# Virtual eXtensible Local Area Network (VXLAN)
# https://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-06
# RFC 7348 - Virtual eXtensible Local Area Network (VXLAN):
# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks
# http://tools.ietf.org/html/rfc7348
# scapy.contrib.description = VXLAN
# scapy.contrib.status = loads
from
scapy.packet
import
*
from
scapy.fields
import
*
from
scapy.packet
import
Packet
,
bind_layers
from
scapy.layers.l2
import
Ether
from
scapy.layers.inet
import
UDP
from
scapy.fields
import
FlagsField
,
XByteField
from
scapy.contrib.eigrp
import
ThreeBytesField
_VXLAN_FLAGS
=
[
'
R
'
for
i
in
range
(
0
,
24
)]
+
[
'
R
'
,
'
R
'
,
'
R
'
,
'
I
'
,
'
R
'
,
'
R
'
,
'
R
'
,
'
R
'
,
'
R
'
]
class
VXLAN
(
Packet
):
name
=
"
VXLAN
"
fields_desc
=
[
FlagsField
(
"
flags
"
,
0x08
,
8
,
[
'
R
'
,
'
R
'
,
'
R
'
,
'
I
'
,
'
R
'
,
'
R
'
,
'
R
'
,
'
R
'
]),
X3BytesField
(
"
reserved1
"
,
0x000000
),
fields_desc
=
[
FlagsField
(
"
flags
"
,
0x08000000
,
32
,
_VXLAN_FLAGS
),
ThreeBytesField
(
"
vni
"
,
0
),
XByteField
(
"
reserved
2
"
,
0x00
)]
XByteField
(
"
reserved
"
,
0x00
)]
def
mysummary
(
self
):
return
self
.
sprintf
(
"
VXLAN (vni=%VXLAN.vni%)
"
)
...
...
This diff is collapsed.
Click to expand it.
scapy/contrib/vxlan.utscapy
+
1
−
1
View file @
c1e3e8dc
...
...
@@ -2,7 +2,7 @@
* Tests for the Scapy VXLAN layer
= Build a VXLAN packet with VNI of 42
str(UDP(sport=1024, dport=4789, len=None, chksum=None)/VXLAN(flags=0x08, vni=42)) == "\x04\x00\x12\xb5\x00\x10\x00\x00\x08\x00\x00\x00\x00\x00\x2a\x00"
str(UDP(sport=1024, dport=4789, len=None, chksum=None)/VXLAN(flags=0x08
000000
, vni=42)) == "\x04\x00\x12\xb5\x00\x10\x00\x00\x08\x00\x00\x00\x00\x00\x2a\x00"
= Verify VXLAN Ethernet Binding
str(VXLAN(vni=23)/Ether(dst="11:11:11:11:11:11", src="11:11:11:11:11:11", type=0x800)) == "\x08\x00\x00\x00\x00\x00\x17\x00\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x08\x00"
This diff is collapsed.
Click to expand it.
scapy/fields.py
+
0
−
3
View file @
c1e3e8dc
...
...
@@ -275,9 +275,6 @@ class X3BytesField(XByteField):
def
getfield
(
self
,
pkt
,
s
):
return
s
[
3
:],
self
.
m2i
(
pkt
,
struct
.
unpack
(
self
.
fmt
,
"
\x00
"
+
s
[:
3
])[
0
])
class
ThreeBytesField
(
X3BytesField
,
ByteField
):
def
i2repr
(
self
,
pkt
,
x
):
return
ByteField
.
i2repr
(
self
,
pkt
,
x
)
class
ShortField
(
Field
):
def
__init__
(
self
,
name
,
default
):
...
...
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