Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
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
OpenXG
OpenXG-SMF
Commits
eb3c40bf
Commit
eb3c40bf
authored
Sep 13, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add N1 class for N1-related procedures
parent
3ddb67ed
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
801 additions
and
587 deletions
+801
-587
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+35
-14
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+45
-12
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+597
-539
src/smf_app/smf_n1.hpp
src/smf_app/smf_n1.hpp
+105
-14
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+19
-8
No files found.
src/smf_app/smf_app.cpp
View file @
eb3c40bf
...
...
@@ -567,9 +567,12 @@ void smf_app::handle_pdu_session_create_sm_context_request(
smContextCreateError
.
setError
(
problem_details
);
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
if
(
smf_n1_inst
.
create_n1_sm_container
(
smreq
->
req
,
PDU_SESSION_ESTABLISHMENT_REJECT
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE
))
{
//if (smf_n1_inst.create_n1_sm_container(
// smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message,
// cause_value_5gsm_e::CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE)) {
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_message_hex
);
//trigger to send reply to AMF
trigger_http_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
...
...
@@ -625,9 +628,11 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject
if
(
smf_n1_inst
.
create_n1_sm_container
(
smreq
->
req
,
PDU_SESSION_ESTABLISHMENT_REJECT
,
n1_sm_message
,
cause_n1
))
{
//if (smf_n1_inst.create_n1_sm_container(smreq->req,
//PDU_SESSION_ESTABLISHMENT_REJECT,
// n1_sm_message, cause_n1)) {
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_n1
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_message_hex
);
//trigger to send reply to AMF
trigger_http_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
...
...
@@ -677,9 +682,12 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject including cause "#81 Invalid PTI value" (section 7.3.1 @3GPP TS 24.501)
if
(
smf_n1_inst
.
create_n1_sm_container
(
smreq
->
req
,
PDU_SESSION_ESTABLISHMENT_REJECT
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_81_INVALID_PTI_VALUE
))
{
//if (smf_n1_inst.create_n1_sm_container(
// smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message,
// cause_value_5gsm_e::CAUSE_81_INVALID_PTI_VALUE)) {
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_81_INVALID_PTI_VALUE
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_message_hex
);
//trigger to send reply to AMF
trigger_http_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
...
...
@@ -717,12 +725,16 @@ void smf_app::handle_pdu_session_create_sm_context_request(
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject
//(24.501 (section 7.4)) implementation dependent->do similar to UE: response with a 5GSM STATUS message including cause "#98 message type not compatible with protocol state."
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
smreq->req,
PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message,
cause_value_5gsm_e::CAUSE_98_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_98_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_message_hex
);
//trigger to send reply to AMF
trigger_http_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
...
...
@@ -759,9 +771,13 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject, 24.501 cause "#27 Missing or unknown DNN"
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message,
cause_value_5gsm_e::CAUSE_27_MISSING_OR_UNKNOWN_DNN)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_27_MISSING_OR_UNKNOWN_DNN
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_message_hex
);
//trigger to send reply to AMF
trigger_http_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
...
...
@@ -851,12 +867,17 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject, with cause "29 User authentication or authorization failed"
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
smreq->req,
PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message,
cause_value_5gsm_e::CAUSE_29_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED)) {
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_message_hex
);
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_29_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_message_hex
);
//trigger to send reply to AMF
trigger_http_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
...
...
src/smf_app/smf_context.cpp
View file @
eb3c40bf
...
...
@@ -1157,12 +1157,16 @@ void smf_context::handle_pdu_session_create_sm_context_request(
smContextCreateError
.
setError
(
problem_details
);
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
smreq->req,
PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message,
cause_value_5gsm_e::CAUSE_29_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_29_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_msg_hex
);
//trigger to send reply to AMF
smf_app_inst
->
trigger_http_response
(
...
...
@@ -1334,9 +1338,13 @@ void smf_context::handle_pdu_session_create_sm_context_request(
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextCreateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message,
cause_value_5gsm_e::CAUSE_28_UNKNOWN_PDU_SESSION_TYPE)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_value_5gsm_e
::
CAUSE_28_UNKNOWN_PDU_SESSION_TYPE
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_msg_hex
);
//trigger to send reply to AMF
smf_app_inst
->
trigger_http_response
(
...
...
@@ -1455,9 +1463,12 @@ void smf_context::handle_pdu_session_create_sm_context_request(
if
(
sm_context_resp
->
res
.
get_cause
()
==
NO_RESOURCES_AVAILABLE
)
{
cause_n1
=
cause_value_5gsm_e
::
CAUSE_26_INSUFFICIENT_RESOURCES
;
}
smf_n1_inst
.
create_n1_sm_container
(
sm_context_resp_pending
->
res
,
/*
smf_n1_inst.create_n1_sm_container(sm_context_resp_pending->res,
PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message, cause_n1);
*/
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
sm_context_resp_pending
->
res
,
n1_sm_message
,
cause_n1
);
smf_app_inst
->
convert_string_2_hex
(
n1_sm_message
,
n1_sm_msg_hex
);
sm_context_resp_pending
->
res
.
set_n1_sm_message
(
n1_sm_msg_hex
);
...
...
@@ -1795,9 +1806,12 @@ void smf_context::handle_pdu_session_update_sm_context_request(
std
::
string
n1_sm_msg_to_be_created
,
n1_sm_msg_hex_to_be_created
;
std
::
string
n2_sm_info_to_be_created
,
n2_sm_info_hex_to_be_created
;
//N1 SM (PDU Session Modification Command)
if
(
not
smf_n1_inst
.
create_n1_sm_container
(
/*
if (not smf_n1_inst.create_n1_sm_container(
n11_sm_context_resp->res, PDU_SESSION_MODIFICATION_COMMAND,
n1_sm_msg_to_be_created, cause_value_5gsm_e::CAUSE_0_UNKNOWN) or //TODO: need cause?
*/
if
(
not
smf_n1_inst
.
create_n1_pdu_session_modification_command
(
n11_sm_context_resp
->
res
,
n1_sm_msg_to_be_created
,
cause_value_5gsm_e
::
CAUSE_0_UNKNOWN
)
or
//TODO: need cause?
//N2 SM (PDU Session Resource Modify Request Transfer IE)
// not smf_n2_inst.create_n2_sm_information(
// n11_sm_context_resp->res, 1, n2_sm_info_type_e::PDU_RES_MOD_REQ,
...
...
@@ -1964,10 +1978,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
smContextUpdateError
.
setError
(
problem_details
);
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextUpdateError
.
setN1SmMsg
(
refToBinaryData
);
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
sm_context_req_msg, PDU_SESSION_RELEASE_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_43_INVALID_PDU_SESSION_IDENTITY)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_release_reject
(
sm_context_req_msg
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_43_INVALID_PDU_SESSION_IDENTITY
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
//trigger to send reply to AMF
smf_app_inst
->
trigger_http_response
(
...
...
@@ -2129,10 +2146,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
smContextUpdateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject
//24.501: response with a 5GSM STATUS message including cause "#95 Semantically incorrect message"
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
sm_context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
sm_context_req_msg
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
//TODO: need N1SM?
//trigger to send reply to AMF
smf_app_inst
->
trigger_http_response
(
...
...
@@ -2221,9 +2241,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextUpdateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject, 24.501 cause "#26 Insufficient resources"
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_26_INSUFFICIENT_RESOURCES
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
//trigger to send reply to AMF
smf_app_inst
->
trigger_http_response
(
...
...
@@ -2458,9 +2482,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
refToBinaryData
.
setContentId
(
N1_SM_CONTENT_ID
);
smContextUpdateError
.
setN1SmMsg
(
refToBinaryData
);
//PDU Session Establishment Reject
if
(
smf_n1_inst
.
create_n1_sm_container
(
/*
if (smf_n1_inst.create_n1_sm_container(
sm_context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_38_NETWORK_FAILURE)) {
*/
if
(
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
sm_context_req_msg
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_38_NETWORK_FAILURE
))
{
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
//trigger to send reply to AMF
smf_app_inst
->
trigger_http_response
(
...
...
@@ -2646,10 +2674,15 @@ void smf_context::handle_pdu_session_modification_network_requested(
//TODO: handle encode N1, N2 failure
//N1: PDU_SESSION_MODIFICATION_COMMAND
smf_n1_inst
.
create_n1_sm_container
(
itti_msg
->
msg
,
/*
smf_n1_inst.create_n1_sm_container(itti_msg->msg,
PDU_SESSION_MODIFICATION_COMMAND,
n1_sm_msg,
cause_value_5gsm_e::CAUSE_0_UNKNOWN);
*/
smf_n1_inst
.
create_n1_pdu_session_modification_command
(
itti_msg
->
msg
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_0_UNKNOWN
);
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
itti_msg
->
msg
.
set_n1_sm_message
(
n1_sm_msg_hex
);
...
...
src/smf_app/smf_n1.cpp
View file @
eb3c40bf
This diff is collapsed.
Click to expand it.
src/smf_app/smf_n1.hpp
View file @
eb3c40bf
...
...
@@ -54,14 +54,113 @@ class smf_n1 {
void
operator
=
(
smf_n1
const
&
)
=
delete
;
/*
* Create N1 SM Container to send to AMF (using NAS lib)
* @param [pdu_session_msg&] msg
* @param [uint8_t] msg_type Type of N1 message
* @param [std::string&] nas_msg_str store NAS message in form of string
* Create N1 SM Container: PDU Session Establishment Accept
* @param [pdu_session_create_sm_context_response] sm_context_res: include necessary information for encoding NGAP msg
* @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [uint8_t] sm_cause store NAS Cause
* @return boolean: True if the NAS message has been created successfully, otherwise return false
* @return boolean: True if the NGAP message has been created successfully, otherwise return false
*
*/
bool
create_n1_sm_container
(
pdu_session_msg
&
msg
,
uint8_t
msg_type
,
bool
create_n1_pdu_session_establishment_accept
(
pdu_session_create_sm_context_response
&
sm_context_res
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
/*
* Create N1 SM Container: PDU Session Establishment Reject
* @param [pdu_session_msg] msg: include necessary information for encoding NGAP msg
* @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [uint8_t] sm_cause store NAS Cause
* @return boolean: True if the NGAP message has been created successfully, otherwise return false
*
*/
bool
create_n1_pdu_session_establishment_reject
(
pdu_session_msg
&
msg
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
//TODO: separate into 4 functions (verify if necessary)
/*
bool create_n1_pdu_session_establishment_accept(pdu_session_create_sm_context_response &sm_context_res,
std::string &nas_msg_str,
cause_value_5gsm_e sm_cause);
bool create_n1_pdu_session_establishment_reject(pdu_session_create_sm_context_request &msg, uint8_t msg_type,
std::string &nas_msg_str,
cause_value_5gsm_e sm_cause);
bool create_n1_pdu_session_establishment_reject(pdu_session_create_sm_context_response &msg, uint8_t msg_type,
std::string &nas_msg_str,
cause_value_5gsm_e sm_cause);
bool create_n1_pdu_session_establishment_reject(pdu_session_update_sm_context_request &msg, uint8_t msg_type,
std::string &nas_msg_str,
cause_value_5gsm_e sm_cause);
*/
//For testing purpose
bool
create_n1_pdu_session_modification_request
(
pdu_session_update_sm_context_response
&
msg
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
/*
* Create N1 SM Container: PDU Session Modification Command
* Included in PDU Session Update SM Context Response (PDU Session Modification UE-Initiated procedure - step 1)
* @param [pdu_session_msg] msg: include necessary information for encoding NGAP msg
* @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [uint8_t] sm_cause store NAS Cause
* @return boolean: True if the NGAP message has been created successfully, otherwise return false
*
*/
bool
create_n1_pdu_session_modification_command
(
pdu_session_update_sm_context_response
&
msg
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
/*
* Create N1 SM Container: PDU Session Modification Command
* Included in N1N2MessageTransfer Request (PDU Session Modification SMF-Requested, step 1 (from SMF to AMF))
* @param [pdu_session_msg] msg: include necessary information for encoding NGAP msg
* @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [uint8_t] sm_cause store NAS Cause
* @return boolean: True if the NGAP message has been created successfully, otherwise return false
*
*/
bool
create_n1_pdu_session_modification_command
(
pdu_session_modification_network_requested
&
msg
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
/*
* Create N1 SM Container: PDU Session Release Reject
* Included in PDU Session Update SM Context Response (PDU Session Release UE-Initiated, step 1)
* @param [pdu_session_msg] msg: include necessary information for encoding NGAP msg
* @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [uint8_t] sm_cause store NAS Cause
* @return boolean: True if the NGAP message has been created successfully, otherwise return false
*
*/
bool
create_n1_pdu_session_release_reject
(
pdu_session_update_sm_context_request
&
sm_context_res
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
/*
* Create N1 SM Container: PDU Session Release Command
* Included in PDU Session Update SM Context Response (PDU Session Release UE-Initiated, step 1)
* @param [pdu_session_msg] msg: include necessary information for encoding NGAP msg
* @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [uint8_t] sm_cause store NAS Cause
* @return boolean: True if the NGAP message has been created successfully, otherwise return false
*
*/
bool
create_n1_pdu_session_release_command
(
pdu_session_update_sm_context_response
&
msg
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
/*
* Create N1 SM Container: PDU Session Release Command
* Included in N1N2MessageTransfer Request (PDU Session Release SMF-Requested, step 1)
* @param [pdu_session_msg] msg: include necessary information for encoding NGAP msg
* @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [uint8_t] sm_cause store NAS Cause
* @return boolean: True if the NGAP message has been created successfully, otherwise return false
*
*/
bool
create_n1_pdu_session_release_command
(
pdu_session_modification_network_requested
&
msg
,
std
::
string
&
nas_msg_str
,
cause_value_5gsm_e
sm_cause
);
...
...
@@ -73,14 +172,6 @@ class smf_n1 {
*/
int
decode_n1_sm_container
(
nas_message_t
&
nas_msg
,
const
std
::
string
&
n1_sm_msg
);
/*
* Decode N2 SM Information Ngap_PDUSessionResourceSetupResponseTransfer
* @param [std::shared_ptr<Ngap_PDUSessionResourceSetupResponseTransfer_t>&] ngap_IE Store decoded NGAP message
* @param [const std::string&] n2_sm_info N2 SM Information
* @return status of the decode process
*/
};
}
// namespace smf
...
...
src/smf_app/smf_procedure.cpp
View file @
eb3c40bf
...
...
@@ -388,9 +388,12 @@ void session_create_sm_context_procedure::handle_itti_msg(
cause_value_5gsm_e
::
CAUSE_50_PDU_SESSION_TYPE_IPV4_ONLY_ALLOWED
;
}
smf_n1_inst
.
create_n1_sm_container
(
n11_triggered_pending
->
res
,
/*
smf_n1_inst.create_n1_sm_container(n11_triggered_pending->res,
PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_msg, cause_n1);
*/
smf_n1_inst
.
create_n1_pdu_session_establishment_reject
(
n11_triggered_pending
->
res
,
n1_sm_msg
,
cause_n1
);
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
n11_triggered_pending
->
res
.
set_n1_sm_message
(
n1_sm_msg_hex
);
...
...
@@ -406,9 +409,14 @@ void session_create_sm_context_procedure::handle_itti_msg(
cause_value_5gsm_e
::
CAUSE_50_PDU_SESSION_TYPE_IPV4_ONLY_ALLOWED
;
}
smf_n1_inst
.
create_n1_sm_container
(
n11_triggered_pending
->
res
,
PDU_SESSION_ESTABLISHMENT_ACCEPT
,
n1_sm_msg
,
cause_n1
);
//smf_n1_inst.create_n1_sm_container(n11_triggered_pending->res,
//PDU_SESSION_ESTABLISHMENT_ACCEPT,
// n1_sm_msg, cause_n1);
smf_n1_inst
.
create_n1_pdu_session_establishment_accept
(
n11_triggered_pending
->
res
,
n1_sm_msg
,
cause_n1
);
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
n11_triggered_pending
->
res
.
set_n1_sm_message
(
n1_sm_msg_hex
);
//N2 SM Information (Step 11, section 4.3.2.2.1 @ 3GPP TS 23.502): PDUSessionRessourceSetupRequestTransfer IE
...
...
@@ -1062,9 +1070,8 @@ void session_update_sm_context_procedure::handle_itti_msg(
//FOR TESTING PURPOSE
case
session_management_procedures_type_e
:
:
PDU_SESSION_TEST
:
{
//N1 SM
smf_n1_inst
.
create_n1_sm_container
(
n11_triggered_pending
->
res
,
PDU_SESSION_MODIFICATION_REQUEST
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_0_UNKNOWN
);
smf_n1_inst
.
create_n1_pdu_session_modification_request
(
n11_triggered_pending
->
res
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_0_UNKNOWN
);
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
n11_triggered_pending
->
res
.
set_n1_sm_message
(
n1_sm_msg_hex
);
//N2 SM Information
...
...
@@ -1170,9 +1177,13 @@ void session_update_sm_context_procedure::handle_itti_msg(
Logger
::
smf_app
().
info
(
"PDU Session Release UE-initiated (Step 1))"
);
//N1 SM
smf_n1_inst
.
create_n1_sm_container
(
/*
smf_n1_inst.create_n1_sm_container(
n11_triggered_pending->res, PDU_SESSION_RELEASE_COMMAND, n1_sm_msg,
cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES); //TODO: check Cause
*/
smf_n1_inst
.
create_n1_pdu_session_release_command
(
n11_triggered_pending
->
res
,
n1_sm_msg
,
cause_value_5gsm_e
::
CAUSE_26_INSUFFICIENT_RESOURCES
);
//TODO: check Cause
smf_app_inst
->
convert_string_2_hex
(
n1_sm_msg
,
n1_sm_msg_hex
);
n11_triggered_pending
->
res
.
set_n1_sm_message
(
n1_sm_msg_hex
);
...
...
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