Commit eb3c40bf authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

add N1 class for N1-related procedures

parent 3ddb67ed
...@@ -567,8 +567,11 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -567,8 +567,11 @@ void smf_app::handle_pdu_session_create_sm_context_request(
smContextCreateError.setError(problem_details); smContextCreateError.setError(problem_details);
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextCreateError.setN1SmMsg(refToBinaryData); 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, // 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)) { cause_value_5gsm_e::CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE)) {
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
...@@ -625,8 +628,10 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -625,8 +628,10 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextCreateError.setN1SmMsg(refToBinaryData); smContextCreateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject //PDU Session Establishment Reject
if (smf_n1_inst.create_n1_sm_container(smreq->req, //if (smf_n1_inst.create_n1_sm_container(smreq->req,
PDU_SESSION_ESTABLISHMENT_REJECT, //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)) { n1_sm_message, cause_n1)) {
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
...@@ -677,8 +682,11 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -677,8 +682,11 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextCreateError.setN1SmMsg(refToBinaryData); smContextCreateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject including cause "#81 Invalid PTI value" (section 7.3.1 @3GPP TS 24.501) //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( //if (smf_n1_inst.create_n1_sm_container(
smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, // 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)) { cause_value_5gsm_e::CAUSE_81_INVALID_PTI_VALUE)) {
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
...@@ -717,12 +725,16 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -717,12 +725,16 @@ void smf_app::handle_pdu_session_create_sm_context_request(
smContextCreateError.setN1SmMsg(refToBinaryData); smContextCreateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject //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." //(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, smreq->req,
PDU_SESSION_ESTABLISHMENT_REJECT, PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message, n1_sm_message,
cause_value_5gsm_e::CAUSE_98_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE)) { 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); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
trigger_http_response(http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN, 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( ...@@ -759,9 +771,13 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextCreateError.setN1SmMsg(refToBinaryData); smContextCreateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject, 24.501 cause "#27 Missing or unknown DNN" //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, smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message,
cause_value_5gsm_e::CAUSE_27_MISSING_OR_UNKNOWN_DNN)) { 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); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
trigger_http_response(http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN, trigger_http_response(http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
...@@ -851,11 +867,16 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -851,11 +867,16 @@ void smf_app::handle_pdu_session_create_sm_context_request(
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextCreateError.setN1SmMsg(refToBinaryData); smContextCreateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject, with cause "29 User authentication or authorization failed" //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, smreq->req,
PDU_SESSION_ESTABLISHMENT_REJECT, PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message, n1_sm_message,
cause_value_5gsm_e::CAUSE_29_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED)) { 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_message_hex); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
trigger_http_response( trigger_http_response(
......
...@@ -1157,12 +1157,16 @@ void smf_context::handle_pdu_session_create_sm_context_request( ...@@ -1157,12 +1157,16 @@ void smf_context::handle_pdu_session_create_sm_context_request(
smContextCreateError.setError(problem_details); smContextCreateError.setError(problem_details);
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextCreateError.setN1SmMsg(refToBinaryData); smContextCreateError.setN1SmMsg(refToBinaryData);
if (smf_n1_inst.create_n1_sm_container( /* if (smf_n1_inst.create_n1_sm_container(
smreq->req, smreq->req,
PDU_SESSION_ESTABLISHMENT_REJECT, PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message, n1_sm_message,
cause_value_5gsm_e::CAUSE_29_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED)) { 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); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_msg_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
...@@ -1334,9 +1338,13 @@ void smf_context::handle_pdu_session_create_sm_context_request( ...@@ -1334,9 +1338,13 @@ void smf_context::handle_pdu_session_create_sm_context_request(
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextCreateError.setN1SmMsg(refToBinaryData); smContextCreateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject //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, smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message,
cause_value_5gsm_e::CAUSE_28_UNKNOWN_PDU_SESSION_TYPE)) { 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); smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_msg_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
...@@ -1455,9 +1463,12 @@ void smf_context::handle_pdu_session_create_sm_context_request( ...@@ -1455,9 +1463,12 @@ void smf_context::handle_pdu_session_create_sm_context_request(
if (sm_context_resp->res.get_cause() == NO_RESOURCES_AVAILABLE) { if (sm_context_resp->res.get_cause() == NO_RESOURCES_AVAILABLE) {
cause_n1 = cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES; 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, PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_message, cause_n1); 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); 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); 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( ...@@ -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 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; std::string n2_sm_info_to_be_created, n2_sm_info_hex_to_be_created;
//N1 SM (PDU Session Modification Command) //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, 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? 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) //N2 SM (PDU Session Resource Modify Request Transfer IE)
// not smf_n2_inst.create_n2_sm_information( // not smf_n2_inst.create_n2_sm_information(
// n11_sm_context_resp->res, 1, n2_sm_info_type_e::PDU_RES_MOD_REQ, // 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( ...@@ -1964,10 +1978,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
smContextUpdateError.setError(problem_details); smContextUpdateError.setError(problem_details);
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextUpdateError.setN1SmMsg(refToBinaryData); 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, sm_context_req_msg, PDU_SESSION_RELEASE_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_43_INVALID_PDU_SESSION_IDENTITY)) { 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); smf_app_inst->convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
...@@ -2129,10 +2146,13 @@ void smf_context::handle_pdu_session_update_sm_context_request( ...@@ -2129,10 +2146,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
smContextUpdateError.setN1SmMsg(refToBinaryData); smContextUpdateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject //PDU Session Establishment Reject
//24.501: response with a 5GSM STATUS message including cause "#95 Semantically incorrect message" //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, sm_context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE)) { 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? smf_app_inst->convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex); //TODO: need N1SM?
//trigger to send reply to AMF //trigger to send reply to AMF
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
...@@ -2221,9 +2241,13 @@ void smf_context::handle_pdu_session_update_sm_context_request( ...@@ -2221,9 +2241,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextUpdateError.setN1SmMsg(refToBinaryData); smContextUpdateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject, 24.501 cause "#26 Insufficient resources" //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, smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES)) { 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); smf_app_inst->convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
...@@ -2458,9 +2482,13 @@ void smf_context::handle_pdu_session_update_sm_context_request( ...@@ -2458,9 +2482,13 @@ void smf_context::handle_pdu_session_update_sm_context_request(
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
smContextUpdateError.setN1SmMsg(refToBinaryData); smContextUpdateError.setN1SmMsg(refToBinaryData);
//PDU Session Establishment Reject //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, sm_context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_msg,
cause_value_5gsm_e::CAUSE_38_NETWORK_FAILURE)) { 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); smf_app_inst->convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
//trigger to send reply to AMF //trigger to send reply to AMF
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
...@@ -2646,10 +2674,15 @@ void smf_context::handle_pdu_session_modification_network_requested( ...@@ -2646,10 +2674,15 @@ void smf_context::handle_pdu_session_modification_network_requested(
//TODO: handle encode N1, N2 failure //TODO: handle encode N1, N2 failure
//N1: PDU_SESSION_MODIFICATION_COMMAND //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, PDU_SESSION_MODIFICATION_COMMAND,
n1_sm_msg, n1_sm_msg,
cause_value_5gsm_e::CAUSE_0_UNKNOWN); 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); 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); itti_msg->msg.set_n1_sm_message(n1_sm_msg_hex);
......
This diff is collapsed.
...@@ -54,14 +54,113 @@ class smf_n1 { ...@@ -54,14 +54,113 @@ class smf_n1 {
void operator=(smf_n1 const&) = delete; void operator=(smf_n1 const&) = delete;
/* /*
* Create N1 SM Container to send to AMF (using NAS lib) * Create N1 SM Container: PDU Session Establishment Accept
* @param [pdu_session_msg&] msg * @param [pdu_session_create_sm_context_response] sm_context_res: include necessary information for encoding NGAP msg
* @param [uint8_t] msg_type Type of N1 message * @param [std::string&] ngap_msg_str store the created NGAP message in form of string
* @param [std::string&] nas_msg_str store NAS message in form of string
* @param [uint8_t] sm_cause store NAS Cause * @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_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_sm_container(pdu_session_msg &msg, uint8_t msg_type, 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, std::string &nas_msg_str,
cause_value_5gsm_e sm_cause); cause_value_5gsm_e sm_cause);
...@@ -73,14 +172,6 @@ class smf_n1 { ...@@ -73,14 +172,6 @@ class smf_n1 {
*/ */
int decode_n1_sm_container(nas_message_t &nas_msg, const std::string &n1_sm_msg); 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 } // namespace smf
......
...@@ -388,9 +388,12 @@ void session_create_sm_context_procedure::handle_itti_msg( ...@@ -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; 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, PDU_SESSION_ESTABLISHMENT_REJECT,
n1_sm_msg, cause_n1); 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); 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); 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( ...@@ -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; 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_ACCEPT, //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); n1_sm_msg, cause_n1);
smf_app_inst->convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex); 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); 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 //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( ...@@ -1062,9 +1070,8 @@ void session_update_sm_context_procedure::handle_itti_msg(
//FOR TESTING PURPOSE //FOR TESTING PURPOSE
case session_management_procedures_type_e::PDU_SESSION_TEST: { case session_management_procedures_type_e::PDU_SESSION_TEST: {
//N1 SM //N1 SM
smf_n1_inst.create_n1_sm_container( smf_n1_inst.create_n1_pdu_session_modification_request(
n11_triggered_pending->res, PDU_SESSION_MODIFICATION_REQUEST, n11_triggered_pending->res, n1_sm_msg, cause_value_5gsm_e::CAUSE_0_UNKNOWN);
n1_sm_msg, cause_value_5gsm_e::CAUSE_0_UNKNOWN);
smf_app_inst->convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex); 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); n11_triggered_pending->res.set_n1_sm_message(n1_sm_msg_hex);
//N2 SM Information //N2 SM Information
...@@ -1170,9 +1177,13 @@ void session_update_sm_context_procedure::handle_itti_msg( ...@@ -1170,9 +1177,13 @@ void session_update_sm_context_procedure::handle_itti_msg(
Logger::smf_app().info("PDU Session Release UE-initiated (Step 1))"); Logger::smf_app().info("PDU Session Release UE-initiated (Step 1))");
//N1 SM //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, n11_triggered_pending->res, PDU_SESSION_RELEASE_COMMAND, n1_sm_msg,
cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES); //TODO: check Cause 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); 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); n11_triggered_pending->res.set_n1_sm_message(n1_sm_msg_hex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment