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
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
OpenXG
OpenXG-AMF
Commits
23a7f1bd
Commit
23a7f1bd
authored
Mar 11, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get PDU Session Status from NAS Message Container if necessary
parent
dac9170e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
5 deletions
+41
-5
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+38
-3
src/nas/ies/5GSMobilityIdentity.cpp
src/nas/ies/5GSMobilityIdentity.cpp
+2
-1
src/nas/msgs/ServiceRequest.cpp
src/nas/msgs/ServiceRequest.cpp
+1
-1
No files found.
src/amf-app/amf_n1.cpp
View file @
23a7f1bd
...
...
@@ -601,10 +601,45 @@ void amf_n1::service_request_handle(
// associate SUPI with UC
amf_app_inst
->
set_supi_2_ue_context
(
supi
,
uc
);
// get PDU session status
// Get PDU session status from Service Request
uint16_t
pdu_session_status
=
(
uint16_t
)
serReq
->
getPduSessionStatus
();
if
(
pdu_session_status
<
0
)
{
// Get PDU Session Status from NAS Message Container
bstring
plain_msg
;
if
(
serReq
->
getNasMessageContainer
(
plain_msg
))
{
uint8_t
*
buf_nas
=
(
uint8_t
*
)
bdata
(
plain_msg
);
uint8_t
message_type
=
*
(
buf_nas
+
2
);
Logger
::
amf_n1
().
debug
(
"NAS message type 0x%x"
,
message_type
);
switch
(
message_type
)
{
case
REGISTRATION_REQUEST
:
{
Logger
::
nas_mm
().
debug
(
"NAS Message Container contains a Registration Request, handling "
"..."
);
}
break
;
case
SERVICE_REQUEST
:
{
Logger
::
nas_mm
().
debug
(
"NAS Message Container contains a Service Request, handling ..."
);
std
::
unique_ptr
<
ServiceRequest
>
serReqNas
=
std
::
make_unique
<
ServiceRequest
>
();
serReqNas
->
decodefrombuffer
(
nullptr
,
(
uint8_t
*
)
bdata
(
plain_msg
),
blength
(
plain_msg
));
bdestroy
(
plain_msg
);
if
(
serReqNas
->
getPduSessionStatus
()
>
0
)
{
pdu_session_status
=
serReqNas
->
getPduSessionStatus
();
}
}
break
;
default:
Logger
::
nas_mm
().
error
(
"NAS Message Container, unknown NAS message 0x%x"
,
message_type
);
}
}
}
std
::
vector
<
uint8_t
>
pdu_session_to_be_activated
=
{};
std
::
bitset
<
16
>
pdu_session_status_bits
(
(
uint16_t
)
serReq
->
getPduSessionStatus
());
std
::
bitset
<
16
>
pdu_session_status_bits
(
pdu_session_status
);
for
(
int
i
=
0
;
i
<
15
;
i
++
)
{
if
(
pdu_session_status_bits
.
test
(
i
))
{
...
...
src/nas/ies/5GSMobilityIdentity.cpp
View file @
23a7f1bd
...
...
@@ -132,7 +132,8 @@ int _5GSMobilityIdentity::_5g_s_tmsi_encode2buffer(uint8_t* buf, int len) {
int
_5GSMobilityIdentity
::
_5g_s_tmsi_decodefrombuffer
(
uint8_t
*
buf
,
int
len
)
{
int
decoded_size
=
0
;
_5g_s_tmsi
=
(
_5G_S_TMSI_t
*
)
calloc
(
1
,
sizeof
(
_5G_S_TMSI_t
));
uint8_t
octet
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
// type of identity
uint8_t
octet
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
_5g_s_tmsi
->
amf_set_id
=
0x0000
|
((
uint16_t
)
octet
)
<<
2
;
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/ServiceRequest.cpp
View file @
23a7f1bd
...
...
@@ -202,7 +202,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
!=
0x0
)
)
{
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