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
8f6b9d3c
Commit
8f6b9d3c
authored
7 years ago
by
gpotter2
Committed by
Guillaume Valadon
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove duplicated fields
parent
3185c101
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/contrib/gtp.py
+73
-61
73 additions, 61 deletions
scapy/contrib/gtp.py
scapy/contrib/gtp.uts
+6
-1
6 additions, 1 deletion
scapy/contrib/gtp.uts
with
79 additions
and
62 deletions
scapy/contrib/gtp.py
+
73
−
61
View file @
8f6b9d3c
...
@@ -41,6 +41,8 @@ GTPmessageType = { 1: "echo_request",
...
@@ -41,6 +41,8 @@ GTPmessageType = { 1: "echo_request",
21
:
"
delete_pdp_context_res
"
,
21
:
"
delete_pdp_context_res
"
,
26
:
"
error_indication
"
,
26
:
"
error_indication
"
,
27
:
"
pdu_notification_req
"
,
27
:
"
pdu_notification_req
"
,
31
:
"
supported_extension_headers_notification
"
,
254
:
"
end_marker
"
,
255
:
"
g_pdu
"
}
255
:
"
g_pdu
"
}
IEType
=
{
1
:
"
Cause
"
,
IEType
=
{
1
:
"
Cause
"
,
...
@@ -177,20 +179,27 @@ class TBCDByteField(StrFixedLenField):
...
@@ -177,20 +179,27 @@ class TBCDByteField(StrFixedLenField):
TBCD_TO_ASCII
=
"
0123456789*#abc
"
TBCD_TO_ASCII
=
"
0123456789*#abc
"
class
GTP_UDPPort_ExtensionHeader
(
Packet
):
class
GTP_ExtensionHeader
(
Packet
):
fields_desc
=
[
ShortField
(
"
length
"
,
0x40
),
@classmethod
BitField
(
"
udp_port
"
,
None
,
48
),
def
dispatch_hook
(
cls
,
_pkt
=
None
,
*
args
,
**
kargs
):
if
_pkt
==
None
:
return
GTP_UDPPort_ExtensionHeader
return
cls
class
GTP_UDPPort_ExtensionHeader
(
GTP_ExtensionHeader
):
fields_desc
=
[
ByteField
(
"
length
"
,
0x40
),
ShortField
(
"
udp_port
"
,
None
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
]
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
]
class
GTP_PDCP_PDU_ExtensionHeader
(
Packet
):
class
GTP_PDCP_PDU_ExtensionHeader
(
GTP_ExtensionHeader
):
fields_desc
=
[
ShortField
(
"
length
"
,
0x01
),
fields_desc
=
[
ByteField
(
"
length
"
,
0x01
),
ByteField
(
"
pdcp_pdu
"
,
None
),
ShortField
(
"
pdcp_pdu
"
,
None
),
ByteField
(
"
pdcp_pdu
"
,
None
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
]
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
]
class
GTPHeader
(
Packet
):
class
GTPHeader
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Header
"
name
=
"
GTP
-C
Header
"
fields_desc
=
[
BitField
(
"
version
"
,
1
,
3
),
fields_desc
=
[
BitField
(
"
version
"
,
1
,
3
),
BitField
(
"
PT
"
,
1
,
1
),
BitField
(
"
PT
"
,
1
,
1
),
BitField
(
"
reserved
"
,
0
,
1
),
BitField
(
"
reserved
"
,
0
,
1
),
...
@@ -221,17 +230,39 @@ class GTPHeader(Packet):
...
@@ -221,17 +230,39 @@ class GTPHeader(Packet):
@classmethod
@classmethod
def
dispatch_hook
(
cls
,
_pkt
=
None
,
*
args
,
**
kargs
):
def
dispatch_hook
(
cls
,
_pkt
=
None
,
*
args
,
**
kargs
):
if
_pkt
and
len
(
_pkt
)
>=
1
:
if
(
struct
.
unpack
(
"
B
"
,
_pkt
[
0
])[
0
]
>>
5
)
&
0x7
==
2
:
import
gtp_v2
return
gtp_v2
.
GTPHeader
if
_pkt
and
len
(
_pkt
)
>=
8
:
if
_pkt
and
len
(
_pkt
)
>=
8
:
if
struct
.
unpack
(
"
!B
"
,
_pkt
[
1
:
2
])[
0
]
==
255
:
_gtp_type
=
struct
.
unpack
(
"
!B
"
,
_pkt
[
1
:
2
])[
0
]
return
GTP
_U_
Header
return
GTP
forcedTypes
.
get
(
_gtp_type
,
GTP
Header
)
return
cls
return
cls
class
GTP_U_Header
(
GTPHeader
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP-U Header
"
# GTP-U protocol is used to transmit T-PDUs between GSN pairs (or between an SGSN and an RNC in UMTS),
# encapsulated in G-PDUs. A G-PDU is a packet including a GTP-U header and a T-PDU. The Path Protocol
# defines the path and the GTP-U header defines the tunnel. Several tunnels may be multiplexed on a single path.
# Some gtp_types have to be associated with a certain type of header
GTPforcedTypes
=
{
16
:
GTPHeader
,
17
:
GTPHeader
,
18
:
GTPHeader
,
19
:
GTPHeader
,
20
:
GTPHeader
,
21
:
GTPHeader
,
26
:
GTP_U_Header
,
27
:
GTPHeader
,
254
:
GTP_U_Header
,
255
:
GTP_U_Header
}
class
GTPEchoRequest
(
Packet
):
class
GTPEchoRequest
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Echo Request
"
name
=
"
GTP Echo Request
"
fields_desc
=
[
XBitField
(
"
seq
"
,
0
,
16
),
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),]
def
hashret
(
self
):
def
hashret
(
self
):
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
...
@@ -658,6 +689,11 @@ class IE_PrivateExtension(IE_Base):
...
@@ -658,6 +689,11 @@ class IE_PrivateExtension(IE_Base):
StrLenField
(
"
extention_value
"
,
""
,
StrLenField
(
"
extention_value
"
,
""
,
length_from
=
lambda
x
:
x
.
length
)]
length_from
=
lambda
x
:
x
.
length
)]
class
IE_ExtensionHeaderList
(
IE_Base
):
name
=
"
Extension Header List
"
fields_desc
=
[
ByteEnumField
(
"
ietype
"
,
141
,
IEType
),
FieldLenField
(
"
length
"
,
None
,
length_of
=
"
extension_headers
"
),
FieldListField
(
"
extension_headers
"
,
[
64
,
192
],
ByteField
(
""
,
0
))]
class
IE_NotImplementedTLV
(
Packet
):
class
IE_NotImplementedTLV
(
Packet
):
name
=
"
IE not implemented
"
name
=
"
IE not implemented
"
...
@@ -688,6 +724,7 @@ ietypecls = {1: IE_Cause,
...
@@ -688,6 +724,7 @@ ietypecls = {1: IE_Cause,
133
:
IE_GSNAddress
,
133
:
IE_GSNAddress
,
134
:
IE_MSInternationalNumber
,
134
:
IE_MSInternationalNumber
,
135
:
IE_QoS
,
135
:
IE_QoS
,
141
:
IE_ExtensionHeaderList
,
148
:
IE_CommonFlags
,
148
:
IE_CommonFlags
,
149
:
IE_APNRestriction
,
149
:
IE_APNRestriction
,
151
:
IE_RATType
,
151
:
IE_RATType
,
...
@@ -718,10 +755,7 @@ def IE_Dispatcher(s):
...
@@ -718,10 +755,7 @@ def IE_Dispatcher(s):
class
GTPEchoResponse
(
Packet
):
class
GTPEchoResponse
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Echo Response
"
name
=
"
GTP Echo Response
"
fields_desc
=
[
XBitField
(
"
seq
"
,
0
,
16
),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
def
hashret
(
self
):
def
hashret
(
self
):
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
...
@@ -733,10 +767,7 @@ class GTPEchoResponse(Packet):
...
@@ -733,10 +767,7 @@ class GTPEchoResponse(Packet):
class
GTPCreatePDPContextRequest
(
Packet
):
class
GTPCreatePDPContextRequest
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Create PDP Context Request
"
name
=
"
GTP Create PDP Context Request
"
fields_desc
=
[
ShortField
(
"
seq
"
,
RandShort
()),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[
IE_TEIDI
(),
IE_NSAPI
(),
IE_GSNAddress
(),
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
PacketListField
(
"
IE_list
"
,
[
IE_TEIDI
(),
IE_NSAPI
(),
IE_GSNAddress
(),
IE_GSNAddress
(),
IE_GSNAddress
(),
IE_NotImplementedTLV
(
ietype
=
135
,
length
=
15
,
data
=
RandString
(
15
))
],
IE_NotImplementedTLV
(
ietype
=
135
,
length
=
15
,
data
=
RandString
(
15
))
],
IE_Dispatcher
)
]
IE_Dispatcher
)
]
...
@@ -746,10 +777,7 @@ class GTPCreatePDPContextRequest(Packet):
...
@@ -746,10 +777,7 @@ class GTPCreatePDPContextRequest(Packet):
class
GTPCreatePDPContextResponse
(
Packet
):
class
GTPCreatePDPContextResponse
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Create PDP Context Response
"
name
=
"
GTP Create PDP Context Response
"
fields_desc
=
[
ShortField
(
"
seq
"
,
RandShort
()),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
def
hashret
(
self
):
def
hashret
(
self
):
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
...
@@ -761,10 +789,7 @@ class GTPCreatePDPContextResponse(Packet):
...
@@ -761,10 +789,7 @@ class GTPCreatePDPContextResponse(Packet):
class
GTPUpdatePDPContextRequest
(
Packet
):
class
GTPUpdatePDPContextRequest
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Update PDP Context Request
"
name
=
"
GTP Update PDP Context Request
"
fields_desc
=
[
ShortField
(
"
seq
"
,
RandShort
()),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
PacketListField
(
"
IE_list
"
,
[
IE_Cause
(),
IE_Cause
(),
IE_Recovery
(),
IE_Recovery
(),
IE_TEIDI
(),
IE_TEIDI
(),
...
@@ -793,10 +818,7 @@ class GTPUpdatePDPContextRequest(Packet):
...
@@ -793,10 +818,7 @@ class GTPUpdatePDPContextRequest(Packet):
class
GTPUpdatePDPContextResponse
(
Packet
):
class
GTPUpdatePDPContextResponse
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Update PDP Context Response
"
name
=
"
GTP Update PDP Context Response
"
fields_desc
=
[
ShortField
(
"
seq
"
,
RandShort
()),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
None
,
IE_Dispatcher
)]
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
PacketListField
(
"
IE_list
"
,
None
,
IE_Dispatcher
)]
def
hashret
(
self
):
def
hashret
(
self
):
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
return
struct
.
pack
(
"
H
"
,
self
.
seq
)
...
@@ -805,49 +827,37 @@ class GTPUpdatePDPContextResponse(Packet):
...
@@ -805,49 +827,37 @@ class GTPUpdatePDPContextResponse(Packet):
class
GTPErrorIndication
(
Packet
):
class
GTPErrorIndication
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Error Indication
"
name
=
"
GTP Error Indication
"
fields_desc
=
[
XBitField
(
"
seq
"
,
0
,
16
),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
ByteField
(
"
npdu
"
,
0
),
ByteField
(
"
next_ex
"
,
0
),
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
class
GTPDeletePDPContextRequest
(
Packet
):
class
GTPDeletePDPContextRequest
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Delete PDP Context Request
"
name
=
"
GTP Delete PDP Context Request
"
fields_desc
=
[
XBitField
(
"
seq
"
,
0
,
16
),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
class
GTPDeletePDPContextResponse
(
Packet
):
class
GTPDeletePDPContextResponse
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Delete PDP Context Response
"
name
=
"
GTP Delete PDP Context Response
"
fields_desc
=
[
XBitField
(
"
seq
"
,
0
,
16
),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
ByteField
(
"
npdu
"
,
0
),
ByteField
(
"
next_ex
"
,
0
),
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
class
GTPPDUNotificationRequest
(
Packet
):
class
GTPPDUNotificationRequest
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP PDU Notification Request
"
name
=
"
GTP PDU Notification Request
"
fields_desc
=
[
XBitField
(
"
seq
"
,
0
,
16
),
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[
IE_IMSI
(),
ByteField
(
"
npdu
"
,
0
),
ByteEnumField
(
"
next_ex
"
,
0
,
ExtensionHeadersTypes
),
PacketListField
(
"
IE_list
"
,
[
IE_IMSI
(),
IE_TEICP
(
TEICI
=
RandInt
()),
IE_TEICP
(
TEICI
=
RandInt
()),
IE_EndUserAddress
(
PDPTypeNumber
=
0x21
),
IE_EndUserAddress
(
PDPTypeNumber
=
0x21
),
IE_AccessPointName
(),
IE_AccessPointName
(),
IE_GSNAddress
(
address
=
"
127.0.0.1
"
),
IE_GSNAddress
(
address
=
"
127.0.0.1
"
),
],
IE_Dispatcher
)
]
],
IE_Dispatcher
)
]
class
GTP_U_Header
(
GTPHeader
):
class
GTPSupportedExtensionHeadersNotification
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Supported Extension Headers Notification
"
name
=
"
GTP-U Header
"
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[
IE_ExtensionHeaderList
(),
# GTP-U protocol is used to transmit T-PDUs between GSN pairs (or between an SGSN and an RNC in UMTS),
],
IE_Dispatcher
)
]
# encapsulated in G-PDUs. A G-PDU is a packet including a GTP-U header and a T-PDU. The Path Protocol
# defines the path and the GTP-U header defines the tunnel. Several tunnels may be multiplexed on a single path.
pass
class
GTPErrorIndication
(
Packet
):
name
=
"
GTP Error Indication
"
fields_desc
=
[
PacketListField
(
"
IE_list
"
,
[],
IE_Dispatcher
)
]
class
GTPmorethan1500
(
Packet
):
class
GTPmorethan1500
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP More than 1500
"
name
=
"
GTP More than 1500
"
...
@@ -857,8 +867,8 @@ class GTPmorethan1500(Packet):
...
@@ -857,8 +867,8 @@ class GTPmorethan1500(Packet):
# Bind GTP-C
# Bind GTP-C
bind_layers
(
UDP
,
GTPHeader
,
dport
=
2123
)
bind_layers
(
UDP
,
GTPHeader
,
dport
=
2123
)
bind_layers
(
UDP
,
GTPHeader
,
sport
=
2123
)
bind_layers
(
UDP
,
GTPHeader
,
sport
=
2123
)
bind_layers
(
GTPHeader
,
GTPEchoRequest
,
gtp_type
=
1
)
bind_layers
(
GTPHeader
,
GTPEchoRequest
,
gtp_type
=
1
,
S
=
1
)
bind_layers
(
GTPHeader
,
GTPEchoResponse
,
gtp_type
=
2
)
bind_layers
(
GTPHeader
,
GTPEchoResponse
,
gtp_type
=
2
,
S
=
1
)
bind_layers
(
GTPHeader
,
GTPCreatePDPContextRequest
,
gtp_type
=
16
)
bind_layers
(
GTPHeader
,
GTPCreatePDPContextRequest
,
gtp_type
=
16
)
bind_layers
(
GTPHeader
,
GTPCreatePDPContextResponse
,
gtp_type
=
17
)
bind_layers
(
GTPHeader
,
GTPCreatePDPContextResponse
,
gtp_type
=
17
)
bind_layers
(
GTPHeader
,
GTPUpdatePDPContextRequest
,
gtp_type
=
18
)
bind_layers
(
GTPHeader
,
GTPUpdatePDPContextRequest
,
gtp_type
=
18
)
...
@@ -866,12 +876,14 @@ bind_layers(GTPHeader, GTPUpdatePDPContextResponse, gtp_type=19)
...
@@ -866,12 +876,14 @@ bind_layers(GTPHeader, GTPUpdatePDPContextResponse, gtp_type=19)
bind_layers
(
GTPHeader
,
GTPDeletePDPContextRequest
,
gtp_type
=
20
)
bind_layers
(
GTPHeader
,
GTPDeletePDPContextRequest
,
gtp_type
=
20
)
bind_layers
(
GTPHeader
,
GTPDeletePDPContextResponse
,
gtp_type
=
21
)
bind_layers
(
GTPHeader
,
GTPDeletePDPContextResponse
,
gtp_type
=
21
)
bind_layers
(
GTPHeader
,
GTPPDUNotificationRequest
,
gtp_type
=
27
)
bind_layers
(
GTPHeader
,
GTPPDUNotificationRequest
,
gtp_type
=
27
)
bind_layers
(
GTPHeader
,
GTP_UDPPort_ExtensionHeader
,
next_ex
=
64
,
E
=
1
)
bind_layers
(
GTPHeader
,
GTPSupportedExtensionHeadersNotification
,
gtp_type
=
31
,
S
=
1
)
bind_layers
(
GTPHeader
,
GTP_PDCP_PDU_ExtensionHeader
,
next_ex
=
192
,
E
=
1
)
bind_layers
(
GTPHeader
,
GTP_UDPPort_ExtensionHeader
,
next_ex
=
64
,
E
=
1
)
bind_layers
(
GTPHeader
,
GTP_PDCP_PDU_ExtensionHeader
,
next_ex
=
192
,
E
=
1
)
# Bind GTP-U
# Bind GTP-U
bind_layers
(
UDP
,
GTP_U_Header
,
dport
=
2152
)
bind_layers
(
UDP
,
GTP_U_Header
,
dport
=
2152
)
bind_layers
(
UDP
,
GTP_U_Header
,
sport
=
2152
)
bind_layers
(
UDP
,
GTP_U_Header
,
sport
=
2152
)
bind_layers
(
GTP_U_Header
,
GTPErrorIndication
,
gtp_type
=
26
,
S
=
1
)
bind_layers
(
GTP_U_Header
,
IP
,
gtp_type
=
255
)
bind_layers
(
GTP_U_Header
,
IP
,
gtp_type
=
255
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
scapy/contrib/gtp.uts
+
6
−
1
View file @
8f6b9d3c
...
@@ -11,6 +11,11 @@ a = GTPHeader()
...
@@ -11,6 +11,11 @@ a = GTPHeader()
assert a.version == 1
assert a.version == 1
assert a.E == a.S == a.PN == 0
assert a.E == a.S == a.PN == 0
= GTP_U_Header detection
a = GTPHeader(str(GTP_U_Header()/GTPErrorIndication()))
assert isinstance(a, GTP_U_Header)
= GTPCreatePDPContextRequest(), basic instanciation
= GTPCreatePDPContextRequest(), basic instanciation
gtp = IP()/UDP(dport=2123)/GTPHeader(teid=2807)/GTPCreatePDPContextRequest()
gtp = IP()/UDP(dport=2123)/GTPHeader(teid=2807)/GTPCreatePDPContextRequest()
gtp.dport == 2123 and gtp.teid == 2807 and len(gtp.IE_list) == 5
gtp.dport == 2123 and gtp.teid == 2807 and len(gtp.IE_list) == 5
...
@@ -294,4 +299,4 @@ ie.ietype == 251 and ie.ipv4_address == '127.0.0.1' and ie.ipv6_address == '::1'
...
@@ -294,4 +299,4 @@ ie.ietype == 251 and ie.ipv4_address == '127.0.0.1' and ie.ipv6_address == '::1'
= IE_PrivateExtension(), basic instantiation
= IE_PrivateExtension(), basic instantiation
ie = IE_PrivateExtension(extention_value='hello')
ie = IE_PrivateExtension(extention_value='hello')
ie.ietype == 255 and ie.extention_value == 'hello'
ie.ietype == 255 and ie.extention_value == 'hello'
\ No newline at end of file
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