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
badb84e3
Commit
badb84e3
authored
Mar 08, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for Service Request with an active PDU Sessino
parent
e9ef5c60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+23
-17
No files found.
src/amf-app/amf_n1.cpp
View file @
badb84e3
...
@@ -583,19 +583,25 @@ void amf_n1::service_request_handle(
...
@@ -583,19 +583,25 @@ void amf_n1::service_request_handle(
uint16_t
pdu_session_status
=
(
uint16_t
)
serReq
->
getPduSessionStatus
();
uint16_t
pdu_session_status
=
(
uint16_t
)
serReq
->
getPduSessionStatus
();
uint8_t
pdu_sessino_status_byte_1
=
uint8_t
(
pdu_session_status
&
0x00ff
);
uint8_t
pdu_sessino_status_byte_1
=
uint8_t
(
pdu_session_status
&
0x00ff
);
uint8_t
pdu_sessino_status_byte_2
=
uint8_t
(
pdu_session_status
>>
8
);
uint8_t
pdu_sessino_status_byte_2
=
uint8_t
(
pdu_session_status
>>
8
);
for
(
int
i
=
1
;
i
<
7
;
i
++
)
{
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
if
(
pdu_sessino_status_byte_1
%
(
uint
16
_t
)(
pow
(
2
,
i
))
==
1
)
{
if
(
pdu_sessino_status_byte_1
%
(
uint
8
_t
)(
pow
(
2
,
i
))
==
1
)
{
pdu_session_to_be_activated
.
push_back
(
i
);
pdu_session_to_be_activated
.
push_back
(
i
+
8
);
}
}
}
}
for
(
int
i
=
0
;
i
<
7
;
i
++
)
{
for
(
int
i
=
1
;
i
<
8
;
i
++
)
{
if
(
pdu_sessino_status_byte_2
%
(
uint
16
_t
)(
pow
(
2
,
i
))
==
1
)
{
if
(
pdu_sessino_status_byte_2
%
(
uint
8
_t
)(
pow
(
2
,
i
))
==
1
)
{
pdu_session_to_be_activated
.
push_back
(
i
+
8
);
pdu_session_to_be_activated
.
push_back
(
i
);
}
}
}
}
if
(
pdu_session_to_be_activated
.
size
()
>
0
)
{
for
(
auto
i
:
pdu_session_to_be_activated
)
Logger
::
amf_n1
().
debug
(
"PDU session to be activated %d"
,
i
);
}
// No PDU Sessions To Be Activated
// No PDU Sessions To Be Activated
if
(
pdu_session_to_be_activated
.
size
()
==
0
)
{
if
(
pdu_session_to_be_activated
.
size
()
==
0
)
{
Logger
::
amf_n1
().
debug
(
"There is no PDU session to be activated"
);
serApt
->
setPDU_session_status
(
0x0000
);
serApt
->
setPDU_session_status
(
0x0000
);
uint8_t
buffer
[
BUFFER_SIZE_256
];
uint8_t
buffer
[
BUFFER_SIZE_256
];
int
encoded_size
=
serApt
->
encode2buffer
(
buffer
,
BUFFER_SIZE_256
);
int
encoded_size
=
serApt
->
encode2buffer
(
buffer
,
BUFFER_SIZE_256
);
...
@@ -631,9 +637,9 @@ void amf_n1::service_request_handle(
...
@@ -631,9 +637,9 @@ void amf_n1::service_request_handle(
}
else
{
}
else
{
// TODO: Contact SMF to activate UP for these sessions
// TODO: Contact SMF to activate UP for these sessions
// DO for 1 PDU session ID for now
// DO for 1 PDU session ID for now
serApt
->
setPDU_session_status
(
0x2000
);
// PSI 1 (0x0200), should be updated
serApt
->
setPDU_session_status
(
serReq
->
getPduSessionStatus
());
// PSI 1 (0x0200), should be updated
serApt
->
setPDU_session_reactivation_result
(
0x0000
);
serApt
->
setPDU_session_reactivation_result
(
0x0000
);
uint8_t
buffer
[
BUFFER_SIZE_256
];
uint8_t
buffer
[
BUFFER_SIZE_256
];
int
encoded_size
=
serApt
->
encode2buffer
(
buffer
,
BUFFER_SIZE_256
);
int
encoded_size
=
serApt
->
encode2buffer
(
buffer
,
BUFFER_SIZE_256
);
...
@@ -657,13 +663,13 @@ void amf_n1::service_request_handle(
...
@@ -657,13 +663,13 @@ void amf_n1::service_request_handle(
itti_msg
->
is_sr
=
true
;
// service request indicator
itti_msg
->
is_sr
=
true
;
// service request indicator
itti_msg
->
pdu_session_id
=
1
;
// PSI 1, should be updated
itti_msg
->
pdu_session_id
=
1
;
// PSI 1, should be updated
itti_msg
->
is_pdu_exist
=
true
;
itti_msg
->
is_pdu_exist
=
true
;
//
if (psc.get()->isn2sm_avaliable) {
if
(
psc
.
get
()
->
isn2sm_avaliable
)
{
//
itti_msg->n2sm = psc.get()->n2sm;
itti_msg
->
n2sm
=
psc
.
get
()
->
n2sm
;
//
itti_msg->isn2sm_avaliable = true;
itti_msg
->
isn2sm_avaliable
=
true
;
//
} else {
}
else
{
itti_msg
->
isn2sm_avaliable
=
false
;
itti_msg
->
isn2sm_avaliable
=
false
;
//
Logger::amf_n1().error("Cannot get pdu session information");
Logger
::
amf_n1
().
error
(
"Cannot get pdu session information"
);
//
}
}
std
::
shared_ptr
<
itti_initial_context_setup_request
>
i
=
std
::
shared_ptr
<
itti_initial_context_setup_request
>
i
=
std
::
shared_ptr
<
itti_initial_context_setup_request
>
(
itti_msg
);
std
::
shared_ptr
<
itti_initial_context_setup_request
>
(
itti_msg
);
int
ret
=
itti_inst
->
send_msg
(
i
);
int
ret
=
itti_inst
->
send_msg
(
i
);
...
@@ -1941,12 +1947,12 @@ void amf_n1::encode_nas_message_protected(
...
@@ -1941,12 +1947,12 @@ void amf_n1::encode_nas_message_protected(
case
INTEGRITY_PROTECTED_AND_CIPHERED
:
{
case
INTEGRITY_PROTECTED_AND_CIPHERED
:
{
bstring
input
=
blk2bstr
(
input_nas_buf
,
input_nas_len
);
bstring
input
=
blk2bstr
(
input_nas_buf
,
input_nas_len
);
bstring
ciphered
;
bstring
ciphered
;
//balloc(ciphered, blength(input));
//
balloc(ciphered, blength(input));
nas_message_cipher_protected
(
nsc
,
NAS_MESSAGE_DOWNLINK
,
input
,
ciphered
);
nas_message_cipher_protected
(
nsc
,
NAS_MESSAGE_DOWNLINK
,
input
,
ciphered
);
protected_nas_buf
[
0
]
=
EPD_5GS_MM_MSG
;
protected_nas_buf
[
0
]
=
EPD_5GS_MM_MSG
;
protected_nas_buf
[
1
]
=
INTEGRITY_PROTECTED_AND_CIPHERED
;
protected_nas_buf
[
1
]
=
INTEGRITY_PROTECTED_AND_CIPHERED
;
protected_nas_buf
[
6
]
=
(
uint8_t
)
nsc
->
dl_count
.
seq_num
;
protected_nas_buf
[
6
]
=
(
uint8_t
)
nsc
->
dl_count
.
seq_num
;
//if (bdata(ciphered) != nullptr)
//
if (bdata(ciphered) != nullptr)
memcpy
(
memcpy
(
&
protected_nas_buf
[
7
],
(
uint8_t
*
)
bdata
(
ciphered
),
blength
(
ciphered
));
&
protected_nas_buf
[
7
],
(
uint8_t
*
)
bdata
(
ciphered
),
blength
(
ciphered
));
...
...
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