Commit 3a21a218 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

update N11 interface/polish the code

parent a02cd778
......@@ -174,7 +174,7 @@ int encode_pdu_session_establishment_accept( pdu_session_establishment_accept_ms
uint32_t encoded = 0;
int encoded_result = 0;
printf ("Encode PDU Session Establishment Accept\n");
printf ("\nEncode PDU Session Establishment Accept\n");
// Check if we got a NULL pointer and if buffer length is >= minimum length expected for the message.
CHECK_PDU_POINTER_AND_LENGTH_ENCODER (buffer, PDU_SESSION_ESTABLISHMENT_ACCEPT_MINIMUM_LENGTH, len);
/*
......
......@@ -10,7 +10,7 @@ int decode_pdu_session_establishment_request( pdu_session_establishment_request_
{
uint32_t decoded = 0;
int decoded_result = 0;
printf("decode_pdu_session_establishment_request\n");
//printf("decode_pdu_session_establishment_request\n");
// Check if we got a NULL pointer and if buffer length is >= minimum length expected for the message.
CHECK_PDU_POINTER_AND_LENGTH_DECODER (buffer, PDU_SESSION_ESTABLISHMENT_REQUEST_MINIMUM_LENGTH, len);
......
......@@ -93,7 +93,7 @@ sm_msg_decode (
buffer += header_result;
len -= header_result;
printf("\ndukl esm message type %d\n",msg->header.message_type);
// printf("\n esm message type %d\n",msg->header.message_type);
switch (msg->header.message_type) {
case PDU_SESSION_ESTABLISHMENT_REQUEST:
......@@ -210,7 +210,7 @@ fivegsm_msg_encode (
buffer += header_result;
len -= header_result;
printf("Msg type %d",msg->header.message_type );
printf(", Msg type %d",msg->header.message_type );
switch (msg->header.message_type) {
case PDU_SESSION_ESTABLISHMENT_REQUEST:
encode_result = encode_pdu_session_establishment_request(&msg->pdu_session_establishment_request, buffer, len);
......@@ -403,7 +403,7 @@ _fivegsm_msg_encode_header (
* Encode the procedure transaction identity
*/
ENCODE_U8 (buffer + size, header->procedure_transaction_identity, size);
printf("fivegsm_msg_encode_header, procedure transaction identity %d", header->procedure_transaction_identity);
printf("fivegsm_msg_encode_header, procedure transaction identity %d ", header->procedure_transaction_identity);
/*
* Encode the message type
*/
......
......@@ -439,7 +439,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
//handle PDU Session Create SM Context Request as specified in section 4.3.2 3GPP TS 23.502
oai::smf_server::model::SmContextCreateError smContextCreateError;
oai::smf_server::model::ProblemDetails problem_details;
std::string n1_sm_message; //N1 SM container
std::string n1_sm_message, n1_sm_message_hex; //N1 SM container
smf_n1_n2 smf_n1_n2_inst;
nas_message_t decoded_nas_msg;
......@@ -459,10 +459,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
//PDU Session Establishment Reject
//24.501: response with a 5GSM STATUS message including cause "#95 Semantically incorrect message"
smf_n1_n2_inst.create_n1_sm_container(context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE); //TODO: should define 5GSM cause in 24.501
//Send response to AMF
//httpResponse.headers().add<Pistache::Http::Header::Location>(url);
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//Send response to AMF
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
}
Logger::smf_app().debug("NAS header information: extended protocol discriminator %d, security headertype %d",
......@@ -512,8 +511,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
//PDU Session Establishment Reject
//(24.501 (section 7.3.1)) NAS N1 SM message: response with a 5GSM STATUS message including cause "#81 Invalid PTI value"
smf_n1_n2_inst.create_n1_sm_container(context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_81_INVALID_PTI_VALUE); //TODO: should define 5GSM cause in 24.501
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//Send response to AMF
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
}
//check pdu session id
......@@ -531,8 +531,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
//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."
smf_n1_n2_inst.create_n1_sm_container(context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_98_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE); //TODO: should define 5GSM cause in 24.501
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
//Send response to AMF
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
}
//check request type
......@@ -554,8 +555,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
smContextCreateError.setError(problem_details);
//PDU Session Establishment Reject, 24.501 cause "#27 Missing or unknown DNN"
smf_n1_n2_inst.create_n1_sm_container(context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, 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);
//Send response to AMF
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
return;
}
......@@ -588,6 +590,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
}
//Step 6. retrieve Session Management Subscription data from UDM if not available (step 4, section 4.3.2 3GPP TS 23.502)
//TODO: Test with UDM (TESTER)
std::string dnn_selection_mode = smreq->req.get_dnn_selection_mode();
if (not use_local_configuration_subscription_data(dnn_selection_mode) && not is_supi_dnn_snssai_subscription_data(supi, dnn, snssai))
{
......@@ -607,8 +610,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
smContextCreateError.setError(problem_details);
//PDU Session Establishment Reject, with cause "29 User authentication or authorization failed"?
smf_n1_n2_inst.create_n1_sm_container(context_req_msg, 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);
//Send response (PDU Session Establishment Reject) to AMF
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
return;
}
}
......@@ -641,7 +645,7 @@ void smf_app::handle_pdu_session_update_sm_context_request (std::shared_ptr<itti
Logger::smf_app().info("Handle a PDU Session Update SM Context Request from an AMF");
oai::smf_server::model::SmContextUpdateError smContextUpdateError;
oai::smf_server::model::ProblemDetails problem_details;
std::string n1_sm_message; //N1 SM container
std::string n1_sm_message, n1_sm_message_hex; //N1 SM container
smf_n1_n2 smf_n1_n2_inst; //to encode Ngap IE
//Step 1. get supi, dnn, nssai, pdu_session id from sm_context
......@@ -663,8 +667,8 @@ void smf_app::handle_pdu_session_update_sm_context_request (std::shared_ptr<itti
smContextUpdateError.setError(problem_details);
//PDU Session Update Reject
smf_n1_n2_inst.create_n1_sm_container(smreq->req, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_54_PDU_SESSION_DOES_NOT_EXIST);
//Send response to AMF
smf_n11_inst->send_pdu_session_update_sm_context_response(smreq->http_response, smContextUpdateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
smf_n11_inst->send_pdu_session_update_sm_context_response(smreq->http_response, smContextUpdateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
return;
}
......@@ -675,6 +679,7 @@ void smf_app::handle_pdu_session_update_sm_context_request (std::shared_ptr<itti
} else {
Logger::smf_app().warn("Context associated with this id " SCID_FMT " does not exit!", scid);
//TODO: send reject to AMF
return;
}
supi_t supi = scf.get()->supi;
......@@ -703,9 +708,8 @@ void smf_app::handle_pdu_session_update_sm_context_request (std::shared_ptr<itti
smContextUpdateError.setError(problem_details);
//Create N1 container
smf_n1_n2_inst.create_n1_sm_container(context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_29_USER_AUTHENTICATION_OR_AUTHORIZATION_FAILED);
//Send response to AMF
smf_n11_inst->send_pdu_session_update_sm_context_response(smreq->http_response, smContextUpdateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
smf_n11_inst->send_pdu_session_update_sm_context_response(smreq->http_response, smContextUpdateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
return;
}
......@@ -721,8 +725,8 @@ void smf_app::handle_pdu_session_update_sm_context_request (std::shared_ptr<itti
smContextUpdateError.setError(problem_details);
//Create N1 container
smf_n1_n2_inst.create_n1_sm_container(context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_27_MISSING_OR_UNKNOWN_DNN);
//Send response to AMF
smf_n11_inst->send_pdu_session_update_sm_context_response(smreq->http_response, smContextUpdateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_message_hex);
smf_n11_inst->send_pdu_session_update_sm_context_response(smreq->http_response, smContextUpdateError, Pistache::Http::Code::Forbidden, n1_sm_message_hex);
return;
}
}
......
......@@ -441,8 +441,7 @@ void smf_context::handle_pdu_session_create_sm_context_request (std::shared_ptr<
pdu_session_create_sm_context_request sm_context_req_msg = smreq->req;
oai::smf_server::model::SmContextCreateError smContextCreateError;
oai::smf_server::model::ProblemDetails problem_details;
std::string n1_sm_message; //N1 SM container
std::string n1_sm_msg_hex;
std::string n1_sm_message, n1_sm_msg_hex; //N1 SM container
smf_n1_n2 smf_n1_n2_inst;
bool request_accepted = true;
......@@ -464,7 +463,8 @@ void smf_context::handle_pdu_session_create_sm_context_request (std::shared_ptr<
//PDU Session Establishment Reject
//TODO: check cause
smf_n1_n2_inst.create_n1_sm_container(sm_context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_82_MAXIMUM_DATA_RATE_PER_UE_FOR_USER_PLANE_INTEGRITY_PROTECTION_IS_TOO_LOW);
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_msg_hex);
smf_n11_inst->send_pdu_session_create_sm_context_response(smreq->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_msg_hex);
//TODO:
//SMF unsubscribes to the modifications of Session Management Subscription data for (SUPI, DNN, S-NSSAI)
//using Nudm_SDM_Unsubscribe()
......@@ -608,7 +608,8 @@ void smf_context::handle_pdu_session_create_sm_context_request (std::shared_ptr<
smContextCreateError.setError(problem_details);
//PDU Session Establishment Reject
smf_n1_n2_inst.create_n1_sm_container(sm_context_req_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_28_UNKNOWN_PDU_SESSION_TYPE);
smf_n11_inst->send_pdu_session_create_sm_context_response(sm_context_resp->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_message);
smf_app_inst->convert_string_2_hex(n1_sm_message, n1_sm_msg_hex);
smf_n11_inst->send_pdu_session_create_sm_context_response(sm_context_resp->http_response, smContextCreateError, Pistache::Http::Code::Forbidden, n1_sm_msg_hex);
request_accepted = false;
break;
}
......@@ -632,6 +633,8 @@ void smf_context::handle_pdu_session_create_sm_context_request (std::shared_ptr<
//(step 5 (4.3.2.2.1 TS 23.502)) Send reply to AMF (PDUSession_CreateSMContextResponse including Cause, SMContextId)
//location header contains the URI of the created resource
oai::smf_server::model::SmContextCreatedData smContextCreatedData;
//TODO: assign values for smContextCreatedData
//include only SmfServiceInstanceId (See section 6.1.6.2.3, 3GPP TS 29.502 v16.0.0)
//Enable to test with tester
// std::string smContextRef = sm_context_req_msg.get_supi_prefix() + "-" + smf_supi_to_string(sm_context_req_msg.get_supi());
......@@ -697,11 +700,9 @@ void smf_context::handle_pdu_session_create_sm_context_request (std::shared_ptr<
*/
//Create PDU Session Establishment Reject
smf_n1_n2 smf_n1_n2_inst;
std::string n1_sm_msg,n1_sm_msg_hex;
Logger::smf_app().debug("Create PDU Session Establishment Reject");
smf_n1_n2_inst.create_n1_sm_container(sm_context_resp_pending->res, PDU_SESSION_ESTABLISHMENT_REJECT, 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_n1_n2_inst.create_n1_sm_container(sm_context_resp_pending->res, PDU_SESSION_ESTABLISHMENT_REJECT, n1_sm_message, cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES);
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);
//get supi and put into URL
......@@ -734,7 +735,6 @@ void smf_context::handle_pdu_session_create_sm_context_request (std::shared_ptr<
//-------------------------------------------------------------------------------------
void smf_context::handle_pdu_session_update_sm_context_request (std::shared_ptr<itti_n11_update_sm_context_request> smreq)
{
Logger::smf_app().info("Handle a PDU Session Update SM Context Request message from AMF");
pdu_session_update_sm_context_request sm_context_req_msg = smreq->req;
smf_n1_n2 smf_n1_n2_inst;
......@@ -1053,7 +1053,8 @@ typedef struct{
*/
//PDU_SESSION_ESTABLISHMENT_UE_REQUESTED & SERVICE_REQUEST_UE_TRIGGERED
procedure_type = session_management_procedures_type_e::SERVICE_REQUEST_UE_TRIGGERED;
procedure_type = session_management_procedures_type_e::PDU_SESSION_ESTABLISHMENT_UE_REQUESTED;
//procedure_type = session_management_procedures_type_e::SERVICE_REQUEST_UE_TRIGGERED_STEP2;
//Ngap_PDUSessionResourceSetupResponseTransfer
std::shared_ptr<Ngap_PDUSessionResourceSetupResponseTransfer_t> decoded_msg = std::make_shared<Ngap_PDUSessionResourceSetupResponseTransfer_t>();
......@@ -1069,11 +1070,11 @@ typedef struct{
//TODO: to be verified which one is teid_gre_key, ipv4_address
memcpy (&dl_teid.teid_gre_key, decoded_msg->qosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID.buf, sizeof (struct in_addr));
memcpy (&dl_teid.ipv4_address, decoded_msg->qosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf, 4);
printf("\ngTP_TEID:");
printf("gTP_TEID:");
printf("%02x ", decoded_msg->qosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID.buf[0]);
printf("%02x ", decoded_msg->qosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID.buf[1]);
printf("%02x ", decoded_msg->qosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID.buf[2]);
printf("%02x ", decoded_msg->qosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID.buf[3]);
printf("%02x \n", decoded_msg->qosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID.buf[3]);
Logger::smf_app().debug("gTP_TEID " "0x%" PRIx32 " ", htonl(dl_teid.teid_gre_key));
Logger::smf_app().debug("uPTransportLayerInformation IP Addr %s", conv::toString(dl_teid.ipv4_address).c_str());
......@@ -1082,7 +1083,7 @@ typedef struct{
for (int i =0; i< decoded_msg->qosFlowPerTNLInformation.associatedQosFlowList.list.count; i++ ){
pfcp::qfi_t qfi((uint8_t)(decoded_msg->qosFlowPerTNLInformation.associatedQosFlowList.list.array[i])->qosFlowIdentifier);
sm_context_req_msg.add_qfi(qfi);
Logger::smf_app().debug("associatedQosFlowList %d",(decoded_msg->qosFlowPerTNLInformation.associatedQosFlowList.list.array[i])->qosFlowIdentifier );
Logger::smf_app().debug("QoSFlowPerTNLInformation, AssociatedQosFlowList, QFI %d",(decoded_msg->qosFlowPerTNLInformation.associatedQosFlowList.list.array[i])->qosFlowIdentifier );
}
//need to update UPF accordingly
update_upf = true;
......@@ -1148,7 +1149,7 @@ typedef struct{
//Step 3. For Service Request
if (!sm_context_req_msg.n1_sm_msg_is_set() and !sm_context_req_msg.n2_sm_info_is_set() and sm_context_req_msg.upCnx_state_is_set()){
procedure_type = session_management_procedures_type_e::SERVICE_REQUEST_UE_TRIGGERED;
procedure_type = session_management_procedures_type_e::SERVICE_REQUEST_UE_TRIGGERED_STEP1;
//if request accepted-> set unCnxState to ACTIVATING
//Update upCnxState
sp.get()->set_upCnx_state(upCnx_state_e::UPCNX_STATE_ACTIVATING);
......
This diff is collapsed.
......@@ -36,6 +36,7 @@
#include <pistache/http.h>
#include <pistache/mime.h>
#include <arpa/inet.h>
extern "C" {
#include "nas_message.h"
......
......@@ -149,11 +149,9 @@ int session_create_sm_context_procedure::run(std::shared_ptr<itti_n11_create_sm_
{
//wys-test-add
destination_interface.interface_value = pfcp::INTERFACE_VALUE_ACCESS; // ACCESS is for downlink, CORE for uplink
outer_header_creation.teid = 1;
outer_header_creation.teid = 1;
//inet_aton("192.168.20.136", &outer_header_creation.ipv4_address);
outer_header_creation.ipv4_address = smf_cfg.test_upf_cfg.gnb_addr4 ;
//uint16_t port = 4;
//outer_header_creation.port_number = port;
outer_header_creation.outer_header_creation_description = pfcp::OUTER_HEADER_CREATION_GTPU_UDP_IPV4;
forwarding_parameters.set(outer_header_creation);
......@@ -165,7 +163,6 @@ int session_create_sm_context_procedure::run(std::shared_ptr<itti_n11_create_sm_
forwarding_parameters.set(destination_interface);
}
//destination_interface.interface_value = pfcp::INTERFACE_VALUE_CORE; // ACCESS is for downlink, CORE for uplink
//forwarding_parameters.set(destination_interface);
//TODO
......@@ -352,7 +349,6 @@ void session_create_sm_context_procedure::handle_itti_msg (itti_n4_session_estab
std::string n1_sm_msg,n1_sm_msg_hex;
std::string n2_sm_info, n2_sm_info_hex;
//TODO: should uncomment this line when including UPF in the test
n11_triggered_pending->res.set_cause(REQUEST_ACCEPTED);//for testing purpose
......@@ -790,24 +786,77 @@ void session_update_sm_context_procedure::handle_itti_msg (itti_n4_session_modif
int ret = itti_inst->send_msg(itti_msg);
*/
// Create N2 SM Information
smf_n1_n2 smf_n1_n2_inst;
std::string n2_sm_info, n2_sm_info_hex;
switch (session_procedure_type){
//TODO: N2 SM Information
smf_n1_n2_inst.create_n2_sm_information(n11_triggered_pending->res, 1, n2_sm_info_type_e::PDU_RES_SETUP_REQ, n2_sm_info);
smf_app_inst->convert_string_2_hex(n2_sm_info, n2_sm_info_hex);
n11_triggered_pending->res.set_n2_sm_information(n2_sm_info_hex);
//TODO: to be verified
case session_management_procedures_type_e::PDU_SESSION_MODIFICATION_UE_INITIATED:{
// Create N2 SM Information
smf_n1_n2 smf_n1_n2_inst;
std::string n2_sm_info, n2_sm_info_hex;
//Fill the json part
//N2SM
//TODO: fill the content of N1N2MessageTransferReqData
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["n2InformationClass"] = "SM";
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = n11_triggered_pending->res.get_pdu_session_id();
//N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] = "PDU_RES_SETUP_REQ"; //NGAP message
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2SmMsg";
//TODO: N2 SM Information
smf_n1_n2_inst.create_n2_sm_information(n11_triggered_pending->res, 1, n2_sm_info_type_e::PDU_RES_MOD_REQ, n2_sm_info);
smf_app_inst->convert_string_2_hex(n2_sm_info, n2_sm_info_hex);
n11_triggered_pending->res.set_n2_sm_information(n2_sm_info_hex);
//TODO: fill the content of SmContextUpdatedData
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["n2InformationClass"] = "SM";
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = n11_triggered_pending->res.get_pdu_session_id();
//N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] = "PDU_RES_MOD_REQ"; //NGAP message
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2SmMsg";
}
break;
//UE-Triggered Service Request Procedure (Step 1)
case session_management_procedures_type_e::SERVICE_REQUEST_UE_TRIGGERED_STEP1:{
// Create N2 SM Information: PDU Session Resource Setup Request Transfer IE
smf_n1_n2 smf_n1_n2_inst;
std::string n2_sm_info, n2_sm_info_hex;
//TODO: N2 SM Information
smf_n1_n2_inst.create_n2_sm_information(n11_triggered_pending->res, 1, n2_sm_info_type_e::PDU_RES_SETUP_REQ, n2_sm_info);
smf_app_inst->convert_string_2_hex(n2_sm_info, n2_sm_info_hex);
n11_triggered_pending->res.set_n2_sm_information(n2_sm_info_hex);
//TODO: fill the content of SmContextUpdatedData
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["n2InformationClass"] = "SM";
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = n11_triggered_pending->res.get_pdu_session_id();
//N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] = "PDU_RES_SETUP_REQ"; //NGAP message
n11_triggered_pending->res.sm_context_updated_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2SmMsg";
}
break;
case session_management_procedures_type_e::PDU_SESSION_ESTABLISHMENT_UE_REQUESTED:{
//PDU Session Establishment UE-Requested
//No need to create N1/N2 Container, just Cause
Logger::smf_app().info( "PDU Session Establishment Request (UE-Initiated)");
}
break;
case session_management_procedures_type_e::SERVICE_REQUEST_UE_TRIGGERED_STEP2:{
//PDU Session Establishment UE-Requested
//No need to create N1/N2 Container, just Cause
Logger::smf_app().info( "UE Triggered Service Request (Step 2)");
}
break;
//SERVICE_REQUEST_NETWORK_TRIGGERED
//PDU_SESSION_MODIFICATION_UE_INITIATED,
//PDU_SESSION_MODIFICATION_SMF_REQUESTED
// PDU_SESSION_MODIFICATION_AN_REQUESTED
// PDU_SESSION_RELEASE_UE_REQUESTED
//PDU_SESSION_RELEASE_NETWORK_REQUESTED
default: {
}
}
//send ITTI message to N11 interface to trigger SessionUpdateSMContextResponse towards AMFs
......
......@@ -97,13 +97,13 @@ int udp_server::create_socket (const struct in_addr &address, const uint16_t por
addr.sin_addr.s_addr = address.s_addr;
std::string ipv4 = conv::toString(address);
Logger::udp().debug("Creating new listen socket on address %s and port %" PRIu16 "\n", ipv4.c_str(), port);
Logger::udp().debug("Creating new listen socket on address %s and port %" PRIu16 " ", ipv4.c_str(), port);
if (bind (sd, (struct sockaddr *)&addr, sizeof (struct sockaddr_in)) < 0) {
/*
* Bind failed
*/
Logger::udp().error("Socket bind failed (%s) for address %s and port %" PRIu16 "\n", strerror (errno), ipv4.c_str(), port);
Logger::udp().error("Socket bind failed (%s) for address %s and port %" PRIu16 " ", strerror (errno), ipv4.c_str(), port);
close (sd);
return errno;
}
......@@ -170,4 +170,4 @@ void udp_server::start_receive(udp_application * app, const util::thread_sched_p
Logger::udp().trace( "udp_server::start_receive");
thread_ = std::thread(&udp_server::udp_read_loop,this, sched_params);
thread_.detach();
}
\ No newline at end of file
}
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