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
2b929cd1
Commit
2b929cd1
authored
10 years ago
by
Guillaume Valadon
Browse files
Options
Downloads
Patches
Plain Diff
Attempt to decode Routing Area Identity IE
--HG-- branch : GTP support
parent
3566ca7e
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/contrib/gtp.py
+8
-8
8 additions, 8 deletions
scapy/contrib/gtp.py
with
8 additions
and
8 deletions
scapy/contrib/gtp.py
+
8
−
8
View file @
2b929cd1
...
...
@@ -104,7 +104,7 @@ Selection_Mode = { 11111100: "MS or APN",
TeardownInd_value
=
{
254
:
"
False
"
,
255
:
"
True
"
}
class
TBCDField
(
StrFixedLenField
):
class
TBCD
Byte
Field
(
StrFixedLenField
):
def
i2h
(
self
,
pkt
,
val
):
ret
=
[]
...
...
@@ -131,7 +131,6 @@ class TBCDField(StrFixedLenField):
ret_string
+=
chr
(
int
(
"
F
"
+
tmp
[
0
],
16
))
return
ret_string
class
GTPHeader
(
Packet
):
# 3GPP TS 29.060 V9.1.0 (2009-12)
name
=
"
GTP Header
"
...
...
@@ -164,7 +163,7 @@ class IE_Cause(Packet):
fields_desc
=
[
ByteEnumField
(
"
ietype
"
,
1
,
IEType
),
BitField
(
"
Response
"
,
None
,
1
),
BitField
(
"
Rejection
"
,
None
,
1
),
BitEnumField
(
"
CauseValue
"
,
None
,
6
,
CauseValues
)
,
]
BitEnumField
(
"
CauseValue
"
,
None
,
6
,
CauseValues
)
]
def
extract_padding
(
self
,
pkt
):
return
""
,
pkt
...
...
@@ -172,17 +171,18 @@ class IE_Cause(Packet):
class
IE_IMSI
(
Packet
):
name
=
"
IMSI - Subscriber identity of the MS
"
fields_desc
=
[
ByteEnumField
(
"
ietype
"
,
2
,
IEType
),
TBCDField
(
"
imsi
"
,
""
,
8
)
]
TBCD
Byte
Field
(
"
imsi
"
,
""
,
8
)
]
def
extract_padding
(
self
,
pkt
):
return
""
,
pkt
class
IE_Routing
(
Packet
):
name
=
"
Routing Area Identity
"
fields_desc
=
[
ByteEnumField
(
"
ietype
"
,
3
,
IEType
),
Bit
Field
(
"
MCC
"
,
None
,
1
2
),
# MNC:
I
f
only have 2 digits, then third digit (1byte) is 0xf
Bit
Field
(
"
MNC
"
,
None
,
1
2
),
Bi
tField
(
"
LAC
"
,
None
,
16
),
TBCDByte
Field
(
"
MCC
"
,
""
,
2
),
# MNC:
i
f
the third digit of MCC is 0xf, then the length of MNC is 1 byte
TBCDByte
Field
(
"
MNC
"
,
""
,
1
),
Shor
tField
(
"
LAC
"
,
None
),
ByteField
(
"
RAC
"
,
None
)
]
def
extract_padding
(
self
,
pkt
):
return
""
,
pkt
...
...
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