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
300298d1
Commit
300298d1
authored
9 years ago
by
Pierre LALET
Browse files
Options
Downloads
Patches
Plain Diff
LLTD: support LLTD Emit messages
parent
7a987201
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/layers/lltd.py
+27
-2
27 additions, 2 deletions
scapy/layers/lltd.py
with
27 additions
and
2 deletions
scapy/layers/lltd.py
+
27
−
2
View file @
300298d1
...
@@ -13,8 +13,8 @@ import struct
...
@@ -13,8 +13,8 @@ import struct
from
scapy.fields
import
BitField
,
FlagsField
,
ByteField
,
ByteEnumField
,
\
from
scapy.fields
import
BitField
,
FlagsField
,
ByteField
,
ByteEnumField
,
\
ShortField
,
IntField
,
IntEnumField
,
LongField
,
MultiEnumField
,
\
ShortField
,
IntField
,
IntEnumField
,
LongField
,
MultiEnumField
,
\
FieldLenField
,
FieldListField
,
StrLenField
,
MAC
Field
,
StrLenField
Utf16
,
\
FieldLenField
,
FieldListField
,
PacketList
Field
,
StrLenField
,
\
ConditionalField
StrLenFieldUtf16
,
ConditionalField
,
MACField
from
scapy.packet
import
Packet
,
Padding
,
bind_layers
from
scapy.packet
import
Packet
,
Padding
,
bind_layers
from
scapy.layers.l2
import
Ether
from
scapy.layers.l2
import
Ether
from
scapy.layers.inet
import
IPField
from
scapy.layers.inet
import
IPField
...
@@ -122,6 +122,30 @@ class LLTDDiscover(Packet):
...
@@ -122,6 +122,30 @@ class LLTDDiscover(Packet):
if
self
.
stations_list
else
"
No station
"
,
[
LLTD
])
if
self
.
stations_list
else
"
No station
"
,
[
LLTD
])
class
LLTDEmiteeDesc
(
Packet
):
name
=
"
LLTD - Emitee Desc
"
fields_desc
=
[
ByteEnumField
(
"
type
"
,
0
,
{
0
:
"
Train
"
,
1
:
"
Probe
"
}),
ByteField
(
"
pause
"
,
0
),
MACField
(
"
src
"
,
None
),
MACField
(
"
dst
"
,
ETHER_ANY
),
]
class
LLTDEmit
(
Packet
):
name
=
"
LLTD - Emit
"
fields_desc
=
[
FieldLenField
(
"
descs_count
"
,
None
,
count_of
=
"
descs_list
"
,
fmt
=
"
H
"
),
PacketListField
(
"
descs_list
"
,
[],
LLTDEmiteeDesc
,
count_from
=
lambda
pkt
:
pkt
.
descs_count
),
]
def
mysummary
(
self
):
return
"
,
"
.
join
(
desc
.
sprintf
(
"
%src% > %dst%
"
)
for
desc
in
self
.
descs_list
),
[
LLTD
]
class
LLTDAttribute
(
Packet
):
class
LLTDAttribute
(
Packet
):
name
=
"
LLTD Attribute
"
name
=
"
LLTD Attribute
"
show_indent
=
False
show_indent
=
False
...
@@ -607,6 +631,7 @@ bind_layers(LLTD, LLTDDiscover, tos=0, function=0)
...
@@ -607,6 +631,7 @@ bind_layers(LLTD, LLTDDiscover, tos=0, function=0)
bind_layers
(
LLTD
,
LLTDDiscover
,
tos
=
1
,
function
=
0
)
bind_layers
(
LLTD
,
LLTDDiscover
,
tos
=
1
,
function
=
0
)
bind_layers
(
LLTD
,
LLTDHello
,
tos
=
0
,
function
=
1
)
bind_layers
(
LLTD
,
LLTDHello
,
tos
=
0
,
function
=
1
)
bind_layers
(
LLTD
,
LLTDHello
,
tos
=
1
,
function
=
1
)
bind_layers
(
LLTD
,
LLTDHello
,
tos
=
1
,
function
=
1
)
bind_layers
(
LLTD
,
LLTDEmit
,
tos
=
0
,
function
=
2
)
bind_layers
(
LLTDHello
,
LLTDAttribute
)
bind_layers
(
LLTDHello
,
LLTDAttribute
)
bind_layers
(
LLTDAttribute
,
LLTDAttribute
)
bind_layers
(
LLTDAttribute
,
LLTDAttribute
)
bind_layers
(
LLTDAttribute
,
Padding
,
type
=
0
)
bind_layers
(
LLTDAttribute
,
Padding
,
type
=
0
)
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