Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF-Simple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CommunityXG
OpenXG-AMF-Simple
Commits
a91ae6c8
Commit
a91ae6c8
authored
Mar 04, 2021
by
dukl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs: decoding NASMessageConteainer in service request
parent
d62a7388
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+1
-1
src/nas/ies/5GSMobilityIdentity.cpp
src/nas/ies/5GSMobilityIdentity.cpp
+7
-0
src/nas/msgs/ServiceRequest.cpp
src/nas/msgs/ServiceRequest.cpp
+1
-1
No files found.
src/amf-app/amf_n1.cpp
View file @
a91ae6c8
...
...
@@ -604,7 +604,7 @@ void amf_n1::service_request_handle(
if
(
serReq
->
getNasMessageContainer
(
nas_container
)){
Logger
::
amf_n1
().
debug
(
"try to get pdu-session-status value from nas message container(length: %d)"
,
blength
(
nas_container
));
uint8_t
*
buf
=
(
uint8_t
*
)
bdata
(
nas_container
);
pdu_session_status
=
buf
[
1
8
]
<<
8
|
buf
[
19
];
pdu_session_status
=
buf
[
1
9
]
<<
8
|
buf
[
20
];
Logger
::
amf_n1
().
debug
(
"Get pdu-session-status value: 0x%x"
,
pdu_session_status
);
}
ServiceAccept
*
serApt
=
new
ServiceAccept
();
...
...
src/nas/ies/5GSMobilityIdentity.cpp
View file @
a91ae6c8
...
...
@@ -86,30 +86,36 @@ int _5GSMobilityIdentity::_5g_s_tmsi_decodefrombuffer(uint8_t* buf, int len) {
int
decoded_size
=
1
;
_5g_s_tmsi
=
(
_5G_S_TMSI_t
*
)
calloc
(
1
,
sizeof
(
_5G_S_TMSI_t
));
uint8_t
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"first octet 0x%x"
,
octet
);
decoded_size
++
;
_5g_s_tmsi
->
amf_set_id
=
0x0000
|
((
uint16_t
)
octet
)
<<
2
;
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"second octet 0x%x"
,
octet
);
decoded_size
++
;
_5g_s_tmsi
->
amf_set_id
|=
(
octet
&
0xc0
)
>>
6
;
_5g_s_tmsi
->
amf_pointer
=
octet
&
0x3f
;
uint32_t
tmsi
=
0
;
uint8_t
digit
[
4
];
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"third octet 0x%x"
,
octet
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
0
]
=
octet
;
tmsi
|=
octet
;
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"fourth octet 0x%x"
,
octet
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
1
]
=
octet
;
tmsi
|=
octet
<<
8
;
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"fifth octet 0x%x"
,
octet
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
2
]
=
octet
;
tmsi
|=
octet
<<
16
;
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"sixth octet 0x%x"
,
octet
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
3
]
=
octet
;
...
...
@@ -497,6 +503,7 @@ int _5GSMobilityIdentity::decodefrombuffer(
typeOfIdentity
=
_5G_S_TMSI
;
decoded_size
+=
_5g_s_tmsi_decodefrombuffer
(
buf
+
decoded_size
,
len
-
decoded_size
);
Logger
::
amf_n1
().
debug
(
"Decoded 5GSMobilityIdentity %d octets"
,
decoded_size
);
return
decoded_size
;
}
break
;
}
...
...
src/nas/msgs/ServiceRequest.cpp
View file @
a91ae6c8
...
...
@@ -195,7 +195,7 @@ int ServiceRequest::decodefrombuffer(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
uint8_t
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"First optional IE (0x%x)"
,
octet
);
while
(
!
octet
)
{
while
(
octet
)
{
switch
(
octet
)
{
case
0x40
:
{
Logger
::
nas_mm
().
debug
(
"Decoding ie_uplink_data_status (IEI: 0x40)"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment