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
272e3bb7
Commit
272e3bb7
authored
8 years ago
by
Klement Sekera
Committed by
Guillaume Valadon
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
DHCP6 - support additional options
parent
38960ace
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/layers/dhcp6.py
+26
-2
26 additions, 2 deletions
scapy/layers/dhcp6.py
with
26 additions
and
2 deletions
scapy/layers/dhcp6.py
+
26
−
2
View file @
272e3bb7
...
@@ -75,7 +75,9 @@ dhcp6opts = { 1: "CLIENTID",
...
@@ -75,7 +75,9 @@ dhcp6opts = { 1: "CLIENTID",
36
:
"
OPTION_GEOCONF_CIVIC
"
,
#RFC-ietf-geopriv-dhcp-civil-09.txt
36
:
"
OPTION_GEOCONF_CIVIC
"
,
#RFC-ietf-geopriv-dhcp-civil-09.txt
37
:
"
OPTION_REMOTE_ID
"
,
#RFC4649
37
:
"
OPTION_REMOTE_ID
"
,
#RFC4649
38
:
"
OPTION_SUBSCRIBER_ID
"
,
#RFC4580
38
:
"
OPTION_SUBSCRIBER_ID
"
,
#RFC4580
39
:
"
OPTION_CLIENT_FQDN
"
}
#RFC4704
39
:
"
OPTION_CLIENT_FQDN
"
,
#RFC4704
68
:
"
OPTION_VSS
"
,
#RFC6607
79
:
"
OPTION_CLIENT_LINKLAYER_ADDR
"
}
#RFC6939
dhcp6opts_by_code
=
{
1
:
"
DHCP6OptClientId
"
,
dhcp6opts_by_code
=
{
1
:
"
DHCP6OptClientId
"
,
2
:
"
DHCP6OptServerId
"
,
2
:
"
DHCP6OptServerId
"
,
...
@@ -117,12 +119,14 @@ dhcp6opts_by_code = { 1: "DHCP6OptClientId",
...
@@ -117,12 +119,14 @@ dhcp6opts_by_code = { 1: "DHCP6OptClientId",
#40: "DHCP6OptPANAAgent", #RFC-ietf-dhc-paa-option-05.txt
#40: "DHCP6OptPANAAgent", #RFC-ietf-dhc-paa-option-05.txt
#41: "DHCP6OptNewPOSIXTimeZone, #RFC4833
#41: "DHCP6OptNewPOSIXTimeZone, #RFC4833
#42: "DHCP6OptNewTZDBTimeZone, #RFC4833
#42: "DHCP6OptNewTZDBTimeZone, #RFC4833
43
:
"
DHCP6OptRelayAgentERO
"
#RFC4994
43
:
"
DHCP6OptRelayAgentERO
"
,
#RFC4994
#44: "DHCP6OptLQQuery", #RFC5007
#44: "DHCP6OptLQQuery", #RFC5007
#45: "DHCP6OptLQClientData", #RFC5007
#45: "DHCP6OptLQClientData", #RFC5007
#46: "DHCP6OptLQClientTime", #RFC5007
#46: "DHCP6OptLQClientTime", #RFC5007
#47: "DHCP6OptLQRelayData", #RFC5007
#47: "DHCP6OptLQRelayData", #RFC5007
#48: "DHCP6OptLQClientLink", #RFC5007
#48: "DHCP6OptLQClientLink", #RFC5007
68
:
"
DHCP6OptVSS
"
,
#RFC6607
79
:
"
DHCP6OptClientLinkLayerAddr
"
,
#RFC6939
}
}
...
@@ -839,6 +843,26 @@ class DHCP6OptRelayAgentERO(_DHCP6OptGuessPayload): # RFC4994
...
@@ -839,6 +843,26 @@ class DHCP6OptRelayAgentERO(_DHCP6OptGuessPayload): # RFC4994
_OptReqListField
(
"
reqopts
"
,
[
23
,
24
],
_OptReqListField
(
"
reqopts
"
,
[
23
,
24
],
length_from
=
lambda
pkt
:
pkt
.
optlen
)
]
length_from
=
lambda
pkt
:
pkt
.
optlen
)
]
# "Client link-layer address type. The link-layer type MUST be a valid hardware
# type assigned by the IANA, as described in [RFC0826]
class
DHCP6OptClientLinkLayerAddr
(
_DHCP6OptGuessPayload
):
#RFC6939
name
=
"
DHCP6 Option - Client Link Layer address
"
fields_desc
=
[
ShortEnumField
(
"
optcode
"
,
79
,
dhcp6opts
),
FieldLenField
(
"
optlen
"
,
None
,
length_of
=
"
clladdr
"
,
adjust
=
lambda
pkt
,
x
:
x
+
1
),
ShortField
(
"
lltype
"
,
1
),
# ethernet
_LLAddrField
(
"
clladdr
"
,
ETHER_ANY
)
]
# Virtual Subnet selection
class
DHCP6OptVSS
(
_DHCP6OptGuessPayload
):
#RFC6607
name
=
"
DHCP6 Option - Virtual Subnet Selection
"
fields_desc
=
[
ShortEnumField
(
"
optcode
"
,
68
,
dhcp6opts
),
FieldLenField
(
"
optlen
"
,
None
,
length_of
=
"
data
"
,
adjust
=
lambda
pkt
,
x
:
x
+
1
),
ByteField
(
"
type
"
,
255
),
# Default Global/default table
StrLenField
(
"
data
"
,
""
,
length_from
=
lambda
pkt
:
pkt
.
optlen
)
]
#####################################################################
#####################################################################
### DHCPv6 messages ###
### DHCPv6 messages ###
#####################################################################
#####################################################################
...
...
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