Commit 0162e7a8 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

Merge branch 'fix_itti' into 'develop'

Fix itti

See merge request !67
parents 2a0dd9c8 2114e592
......@@ -516,7 +516,7 @@ void xgpp_conv::sm_context_request_from_nas(
}
//------------------------------------------------------------------------------
void xgpp_conv::create_sm_context_response_from_ct_request(
void xgpp_conv::create_sm_context_response_from_ctx_request(
const std::shared_ptr<itti_n11_create_sm_context_request>& ctx_request,
std::shared_ptr<itti_n11_create_sm_context_response>& ctx_response) {
ctx_response->http_version = ctx_request->http_version;
......@@ -535,7 +535,7 @@ void xgpp_conv::create_sm_context_response_from_ct_request(
}
//------------------------------------------------------------------------------
void xgpp_conv::update_sm_context_response_from_ct_request(
void xgpp_conv::update_sm_context_response_from_ctx_request(
const std::shared_ptr<itti_n11_update_sm_context_request>& ct_request,
std::shared_ptr<itti_n11_update_sm_context_response>& ct_response) {
ct_response->res.set_http_code(
......
......@@ -161,11 +161,11 @@ void smf_event_exposure_notification_from_openapi(
void sm_context_request_from_nas(
const nas_message_t& nm, smf::pdu_session_create_sm_context_request& pcr);
void create_sm_context_response_from_ct_request(
void create_sm_context_response_from_ctx_request(
const std::shared_ptr<itti_n11_create_sm_context_request>& ct_request,
std::shared_ptr<itti_n11_create_sm_context_response>& ct_response);
void update_sm_context_response_from_ct_request(
void update_sm_context_response_from_ctx_request(
const std::shared_ptr<itti_n11_update_sm_context_request>& ct_request,
std::shared_ptr<itti_n11_update_sm_context_response>& ct_response);
......
......@@ -32,6 +32,11 @@
#include <ctype.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include "logger.hpp"
extern "C" {
#include "dynamic_memory_check.h"
}
static const char hex_to_ascii_table[16] = {
'0', '1', '2', '3', '4', '5', '6', '7',
......@@ -185,3 +190,32 @@ std::string conv::toString(const struct in6_addr& in6addr) {
}
return s;
}
//---------------------------------------------------------------------------------------------
void conv::convert_string_2_hex(
const std::string& input_str, std::string& output_str) {
Logger::smf_app().debug("Convert string to Hex");
unsigned char* data = (unsigned char*) malloc(input_str.length() + 1);
memset(data, 0, input_str.length() + 1);
memcpy((void*) data, (void*) input_str.c_str(), input_str.length());
#if DEBUG_IS_ON
Logger::smf_app().debug("Input: ");
for (int i = 0; i < input_str.length(); i++) {
printf("%02x ", data[i]);
}
printf("\n");
#endif
char* datahex = (char*) malloc(input_str.length() * 2 + 1);
memset(datahex, 0, input_str.length() * 2 + 1);
for (int i = 0; i < input_str.length(); i++)
sprintf(datahex + i * 2, "%02x", data[i]);
output_str = reinterpret_cast<char*>(datahex);
Logger::smf_app().debug("Output: \n %s ", output_str.c_str());
// free memory
free_wrapper((void**) &data);
free_wrapper((void**) &datahex);
}
......@@ -63,5 +63,14 @@ class conv {
const uint8_t digit1, const uint8_t digit2, const uint8_t digit3);
static std::string mncToString(
const uint8_t digit1, const uint8_t digit2, const uint8_t digit3);
/*
* Convert a string to hex representing this string
* @param [const std::string&] input_str Input string
* @param [std::string&] output_str String represents string in hex format
* @return void
*/
static void convert_string_2_hex(
const std::string& input_str, std::string& output_str);
};
#endif /* FILE_CONVERSIONS_HPP_SEEN */
This diff is collapsed.
......@@ -43,9 +43,6 @@
#include "itti_msg_n11.hpp"
#include "itti_msg_n4.hpp"
#include "itti_msg_sbi.hpp"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#include "smf.h"
#include "smf_context.hpp"
#include "smf_msg.hpp"
......@@ -432,13 +429,6 @@ class smf_app {
*/
scid_t generate_smf_context_ref();
/*
* Generate an Event Exposure Subscription ID in a form of string
* @param [std::string &] sub_id: Store the generated reference
* @return void
*/
void generate_ev_subscription_id(std::string& sub_id);
/*
* Generate an Event Exposure Subscription ID
* @param [void]
......@@ -493,6 +483,30 @@ class smf_app {
bool scid_2_smf_context(
const scid_t& scid, std::shared_ptr<smf_context_ref>& scf) const;
/*
* Verify if SM Context is existed for this Supi
* @param [supi_t] supi
* @return True if existed, otherwise false
*/
bool is_supi_2_smf_context(const supi64_t& supi) const;
/*
* Create/Update SMF context with the corresponding supi
* @param [const supi_t&] supi
* @param [std::shared_ptr<smf_context>] sc Shared_ptr Pointer to an SMF
* context
* @return True if existed, otherwise false
*/
void set_supi_2_smf_context(
const supi64_t& supi, std::shared_ptr<smf_context> sc);
/*
* Get SM Context
* @param [supi_t] Supi
* @return Shared pointer to SM context
*/
std::shared_ptr<smf_context> supi_2_smf_context(const supi64_t& supi) const;
/*
* Handle PDUSession_CreateSMContextRequest from AMF
* @param [std::shared_ptr<itti_n11_create_sm_context_request>&] Request
......@@ -527,6 +541,13 @@ class smf_app {
evsub_id_t handle_event_exposure_subscription(
std::shared_ptr<itti_sbi_event_exposure_request> msg);
/*
* Handle NF status notification (e.g., when an UPF becomes available)
* @param [std::shared_ptr<itti_sbi_notification_data>& ] msg: message
* @param [oai::smf_server::model::ProblemDetails& ] problem_details
* @param [uint8_t&] http_code
* @return true if handle sucessfully, otherwise return false
*/
bool handle_nf_status_notification(
std::shared_ptr<itti_sbi_notification_data>& msg,
oai::smf_server::model::ProblemDetails& problem_details,
......@@ -546,30 +567,6 @@ class smf_app {
const pdu_session_id_t pdu_session_id, const snssai_t& snssai,
const pfcp::qfi_t& qfi, const uint8_t& http_version);
/*
* Verify if SM Context is existed for this Supi
* @param [supi_t] supi
* @return True if existed, otherwise false
*/
bool is_supi_2_smf_context(const supi64_t& supi) const;
/*
* Create/Update SMF context with the corresponding supi
* @param [const supi_t&] supi
* @param [std::shared_ptr<smf_context>] sc Shared_ptr Pointer to an SMF
* context
* @return True if existed, otherwise false
*/
void set_supi_2_smf_context(
const supi64_t& supi, std::shared_ptr<smf_context> sc);
/*
* Get SM Context
* @param [supi_t] Supi
* @return Shared pointer to SM context
*/
std::shared_ptr<smf_context> supi_2_smf_context(const supi64_t& supi) const;
/*
* Check whether SMF uses local configuration instead of retrieving Session
* Management Data from UDM
......@@ -613,15 +610,6 @@ class smf_app {
*/
bool is_create_sm_context_request_valid() const;
/*
* Convert a string to hex representing this string
* @param [const std::string&] input_str Input string
* @param [std::string&] output_str String represents string in hex format
* @return void
*/
void convert_string_2_hex(
const std::string& input_str, std::string& output_str);
/*
* Update PDU session status
* @param [const scid_t &] id SM Context ID
......@@ -741,7 +729,6 @@ class smf_app {
* @param [const uint32_t &] http_code: Status code of HTTP response
* @param [const uint8_t &] cause: Error cause
* @param [uint32_t &] promise_id: Promise Id
* @param [uint8_t] msg_type: Type of HTTP message (Update/Release)
* @return void
*/
void trigger_update_context_error_response(
......@@ -754,7 +741,6 @@ class smf_app {
* @param [const uint8_t &] cause: cause
* @param [const std::string &] n1_sm_msg: N1 SM message
* @param [uint32_t &] promise_id: Promise Id
* @param [uint8_t] msg_type: Type of HTTP message (Update/Release)
* @return void
*/
void trigger_update_context_error_response(
......@@ -772,6 +758,42 @@ class smf_app {
void trigger_http_response(
const uint32_t& http_code, uint32_t& promise_id, uint8_t msg_type);
/*
* To trigger the session create sm context response by set the value of the
* corresponding promise to ready
* @param [pdu_session_create_sm_context_response&] sm_context_response:
* response message
* @param [uint32_t &] promise_id: Promise Id
* @return void
*/
void trigger_session_create_sm_context_response(
pdu_session_create_sm_context_response& sm_context_response,
uint32_t& pid);
/*
* To trigger the session update sm context response by set the value of the
* corresponding promise to ready
* @param [pdu_session_update_sm_context_response&] sm_context_response:
* response message
* @param [uint32_t &] promise_id: Promise Id
* @return void
*/
void trigger_session_update_sm_context_response(
pdu_session_update_sm_context_response& sm_context_response,
uint32_t& pid);
/*
* To trigger the session release sm context response by set the value of the
* corresponding promise to ready
* @param [pdu_session_release_sm_context_response&] sm_context_response:
* response message
* @param [uint32_t &] promise_id: Promise Id
* @return void
*/
void trigger_session_release_sm_context_response(
pdu_session_release_sm_context_response& sm_context_response,
uint32_t& pid);
/*
* Add an Event Subscription to the list
* @param [const evsub_id_t&] sub_id: Subscription ID
......
......@@ -734,27 +734,11 @@ void smf_context::handle_itti_msg(
pfcp::qfi_t qfi = {};
if (find_pdu_session(pdr_id, qfi, sd, sp)) {
// Step 1. send N4 Data Report Ack to UPF
pfcp::node_id_t up_node_id = {};
scid_t scid = get_scid();
// Get UPF node
std::shared_ptr<smf_context_ref> scf = {};
if (smf_app_inst->is_scid_2_smf_context(scid)) {
scf = smf_app_inst->scid_2_smf_context(scid);
up_node_id = scf.get()->upf_node_id;
} else {
Logger::smf_app().warn(
"SM Context associated with this id " SCID_FMT
" does not exit!",
scid);
return;
}
itti_n4_session_report_response* n4_ser =
new itti_n4_session_report_response(TASK_SMF_APP, TASK_SMF_N4);
n4_ser->seid = req->seid;
n4_ser->trxn_id = req->trxn_id;
n4_ser->r_endpoint =
endpoint(up_node_id.u1.ipv4_address, pfcp::default_port);
n4_ser->seid = req->seid;
n4_ser->trxn_id = req->trxn_id;
n4_ser->r_endpoint = req->r_endpoint;
std::shared_ptr<itti_n4_session_report_response> n4_report_ack =
std::shared_ptr<itti_n4_session_report_response>(n4_ser);
......@@ -814,7 +798,7 @@ void smf_context::handle_itti_msg(
session_report_msg, 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);
conv::convert_string_2_hex(n2_sm_info, n2_sm_info_hex);
session_report_msg.set_n2_sm_information(n2_sm_info_hex);
// Fill the json part
......@@ -1223,13 +1207,13 @@ void smf_context::handle_pdu_session_create_sm_context_request(
std::string n1_sm_message, n1_sm_msg_hex;
bool request_accepted = true;
// Step 1. get necessary information
// Step 1. Get necessary information
std::string dnn = smreq->req.get_dnn();
snssai_t snssai = smreq->req.get_snssai();
supi64_t supi64 = smf_supi_to_u64(smreq->req.get_supi());
uint32_t pdu_session_id = smreq->req.get_pdu_session_id();
// Step 2. check the validity of the UE request, if valid send PDU Session
// Step 2. Check the validity of the UE request, if valid send PDU Session
// Accept, otherwise send PDU Session Reject to AMF
if (!verify_sm_context_request(smreq)) {
Logger::smf_app().warn(
......@@ -1239,7 +1223,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
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);
conv::convert_string_2_hex(n1_sm_message, n1_sm_msg_hex);
// trigger to send reply to AMF
smf_app_inst->trigger_create_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_401_UNAUTHORIZED,
......@@ -1256,7 +1240,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
return;
}
// store HttpResponse and session-related information to be used when
// Store HttpResponse and session-related information to be used when
// receiving the response from UPF
itti_n11_create_sm_context_response* sm_context_resp =
new itti_n11_create_sm_context_response(
......@@ -1265,14 +1249,14 @@ void smf_context::handle_pdu_session_create_sm_context_request(
std::shared_ptr<itti_n11_create_sm_context_response>(sm_context_resp);
// Assign necessary information for the response
xgpp_conv::create_sm_context_response_from_ct_request(
xgpp_conv::create_sm_context_response_from_ctx_request(
smreq, sm_context_resp_pending);
// Step 3. find pdu_session
// Step 3. Find pdu_session
std::shared_ptr<dnn_context> sd = {};
bool find_dnn = find_dnn_context(snssai, dnn, sd);
// step 3.1. create dnn context if not exist
// Step 3.1. Create dnn context if not exist
// At this step, this context should be existed
if (nullptr == sd.get()) {
Logger::smf_app().debug(
......@@ -1288,7 +1272,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
"DNN context (dnn_in_use %s) is already existed", dnn.c_str());
}
// step 3.2. create pdu session if not exist
// Step 3.2. Create pdu session if not exist
std::shared_ptr<smf_pdu_session> sp = {};
bool find_pdu = sd.get()->find_pdu_session(pdu_session_id, sp);
......@@ -1345,7 +1329,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
Logger::smf_app().debug(
"PDU Session Type IPv4v6, select PDU Session Type IPv4");
bool paa_res = false;
// TODO: Verified if use default session type or requested session type
// TODO: Verify if use default session type or requested session type
std::shared_ptr<session_management_subscription> ss = {};
std::shared_ptr<dnn_configuration_t> sdc = {};
find_dnn_subscription(snssai, ss);
......@@ -1436,6 +1420,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
Logger::smf_app().info(
"UE requests to use DHCPv4 for IPv4 address assignment, this "
"feature has not been supported yet!");
request_accepted = false;
// TODO
}
......@@ -1444,6 +1429,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
case PDU_SESSION_TYPE_E_IPV6: {
// TODO:
Logger::smf_app().debug("IPv6 has not been supported yet!");
request_accepted = false;
} break;
default: {
......@@ -1453,7 +1439,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
if (smf_n1::get_instance().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);
conv::convert_string_2_hex(n1_sm_message, n1_sm_msg_hex);
// trigger to send reply to AMF
smf_app_inst->trigger_create_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
......@@ -1520,9 +1506,6 @@ void smf_context::handle_pdu_session_create_sm_context_request(
// 5, 4.3.2.2.1 TS 23.502)
Logger::smf_app().debug(
"Send ITTI msg to SMF APP to trigger the response of Server");
std::shared_ptr<itti_n11_create_sm_context_response> itti_msg =
std::make_shared<itti_n11_create_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, smreq->pid);
pdu_session_create_sm_context_response sm_context_response = {};
std::string smContextRef = std::to_string(smreq->scid);
......@@ -1540,14 +1523,9 @@ void smf_context::handle_pdu_session_create_sm_context_request(
sm_context_response.set_json_data(json_data);
sm_context_response.set_http_code(
http_status_code_e::HTTP_STATUS_CODE_201_CREATED);
itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
}
smf_app_inst->trigger_session_create_sm_context_response(
sm_context_response, smreq->pid);
// TODO: PDU Session authentication/authorization (Optional)
// see section 4.3.2.3@3GPP TS 23.502 and section 6.3.1@3GPP TS 24.501
......@@ -1612,19 +1590,15 @@ void smf_context::handle_pdu_session_create_sm_context_request(
smf_n1::get_instance().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);
conv::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
// Get supi and put into URL
std::string supi_str;
supi_t supi = sm_context_resp_pending->res.get_supi();
supi_str = sm_context_resp_pending->res.get_supi_prefix() + "-" +
smf_supi_to_string(supi);
std::string url =
// std::string(
// inet_ntoa(*((struct in_addr*) &smf_cfg.amf_addr.ipv4_addr))) +
// ":" + std::to_string(smf_cfg.amf_addr.port) + NAMF_COMMUNICATION_BASE
// +
sp.get()->get_amf_addr() + NAMF_COMMUNICATION_BASE +
smf_cfg.amf_addr.api_version +
fmt::format(
......@@ -1640,7 +1614,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
sm_context_resp_pending->res.get_pdu_session_id();
sm_context_resp_pending->res.set_json_data(json_data);
// send ITTI message to N11 to trigger N1N2MessageTransfer towards AMFs
// Send ITTI message to N11 to trigger N1N2MessageTransfer towards AMFs
Logger::smf_app().info(
"Sending ITTI message %s to task TASK_SMF_SBI",
sm_context_resp_pending->get_msg_name());
......@@ -1745,9 +1719,9 @@ bool smf_context::handle_pdu_session_modification_request(
return false;
}
smf_app_inst->convert_string_2_hex(
conv::convert_string_2_hex(
n1_sm_msg_to_be_created, n1_sm_msg_hex_to_be_created);
smf_app_inst->convert_string_2_hex(
conv::convert_string_2_hex(
n2_sm_info_to_be_created, n2_sm_info_hex_to_be_created);
sm_context_resp.get()->res.set_n1_sm_message(n1_sm_msg_hex_to_be_created);
......@@ -1888,7 +1862,7 @@ bool smf_context::handle_pdu_session_release_request(
if (smf_n1::get_instance().create_n1_pdu_session_release_reject(
sm_context_request.get()->req, 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);
conv::convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
// trigger to send reply to AMF
smf_app_inst->trigger_update_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
......@@ -2040,7 +2014,7 @@ bool smf_context::handle_pdu_session_resource_setup_response_transfer(
if (smf_n1::get_instance().create_n1_pdu_session_establishment_reject(
sm_context_request.get()->req, 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);
conv::convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
// trigger to send reply to AMF
smf_app_inst->trigger_update_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
......@@ -2126,7 +2100,7 @@ bool smf_context::handle_pdu_session_resource_setup_unsuccessful_transfer(
if (smf_n1::get_instance().create_n1_pdu_session_establishment_reject(
sm_context_request.get()->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);
conv::convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
// trigger to send reply to AMF
smf_app_inst->trigger_update_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
......@@ -2272,7 +2246,7 @@ bool smf_context::handle_service_request(
sm_context_resp.get()->res, 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);
conv::convert_string_2_hex(n2_sm_info, n2_sm_info_hex);
sm_context_resp.get()->res.set_n2_sm_information(n2_sm_info_hex);
// fill the content of SmContextUpdatedData
......@@ -2352,7 +2326,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
sp.get()->get_pdu_session_type().pdu_session_type);
// Assign necessary information for the response
xgpp_conv::update_sm_context_response_from_ct_request(
xgpp_conv::update_sm_context_response_from_ctx_request(
smreq, sm_context_resp_pending);
// Step 2.1. Decode N1 (if content is available)
......@@ -2378,7 +2352,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
switch (message_type) {
case PDU_SESSION_MODIFICATION_REQUEST: {
// PDU Session Modification procedure (UE-initiated, step 1.a,
// Section 4.3.3.2@3GPP TS 23.502) UE initiated PDU session
// Section 4.3.3.2@3GPP TS 23.502). UE initiated PDU session
// modification request (Step 1)
procedure_type = session_management_procedures_type_e::
......@@ -2390,9 +2364,8 @@ void smf_context::handle_pdu_session_update_sm_context_request(
} break;
case PDU_SESSION_MODIFICATION_COMPLETE: {
// PDU Session Modification
// procedure (UE-initiated/Network-requested) (step 3) PDU Session
// Modification Command Complete
// PDU Session Modification procedure (UE-initiated/Network-requested)
// (step 3) PDU Session Modification Command Complete
Logger::smf_app().debug("PDU_SESSION_MODIFICATION_COMPLETE");
procedure_type = session_management_procedures_type_e::
......@@ -2404,7 +2377,6 @@ void smf_context::handle_pdu_session_update_sm_context_request(
} break;
case PDU_SESSION_MODIFICATION_COMMAND_REJECT: {
// PDU_SESSION_MODIFICATION_COMMAND_REJECT
// PDU Session Modification procedure (Section 4.3.3.2@3GPP TS 23.502)
Logger::smf_app().debug("PDU_SESSION_MODIFICATION_COMMAND_REJECT");
......@@ -2607,7 +2579,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
insert_procedure(sproc);
if (proc->run(smreq, sm_context_resp_pending, shared_from_this())) {
// error !
// error
Logger::smf_app().info(
"PDU Update SM Context Request procedure failed (session procedure "
"type %s)",
......@@ -2624,7 +2596,7 @@ void smf_context::handle_pdu_session_update_sm_context_request(
if (smf_n1::get_instance().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);
conv::convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
// trigger to send reply to AMF
smf_app_inst->trigger_update_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
......@@ -2648,14 +2620,14 @@ void smf_context::handle_pdu_session_update_sm_context_request(
PDU_SESSION_RELEASE_AMF_INITIATED:
case session_management_procedures_type_e::
PDU_SESSION_RELEASE_UE_REQUESTED_STEP1: {
// trigger to send reply to AMF
// trigger the reply to AMF
smf_app_inst->trigger_update_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING, smreq->pid);
} break;
default: {
// trigger to send reply to AMF
// trigger the reply to AMF
smf_app_inst->trigger_update_context_error_response(
http_status_code_e::HTTP_STATUS_CODE_403_FORBIDDEN,
PDU_SESSION_APPLICATION_ERROR_PEER_NOT_RESPONDING, smreq->pid);
......@@ -2804,14 +2776,14 @@ void smf_context::handle_pdu_session_modification_network_requested(
// N1: PDU_SESSION_MODIFICATION_COMMAND
smf_n1::get_instance().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);
conv::convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
itti_msg->msg.set_n1_sm_message(n1_sm_msg_hex);
// N2: PDU Session Resource Modify Response Transfer
smf_n2::get_instance().create_n2_pdu_session_resource_modify_request_transfer(
itti_msg->msg, 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);
conv::convert_string_2_hex(n2_sm_info, n2_sm_info_hex);
itti_msg->msg.set_n2_sm_information(n2_sm_info_hex);
// Fill N1N2MesasgeTransferRequestData
......@@ -2980,16 +2952,6 @@ std::size_t smf_context::get_number_dnn_contexts() const {
return dnns.size();
}
//-----------------------------------------------------------------------------
void smf_context::set_scid(const scid_t& id) {
scid = id;
}
//-----------------------------------------------------------------------------
scid_t smf_context::get_scid() const {
return scid;
}
//-----------------------------------------------------------------------------
void smf_context::get_supi_prefix(std::string& prefix) const {
prefix = supi_prefix;
......
......@@ -43,9 +43,6 @@
#include "common_root_types.h"
#include "itti.hpp"
#include "msg_pfcp.hpp"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#include "smf_event.hpp"
#include "smf_procedure.hpp"
#include "uint_generator.hpp"
......@@ -561,7 +558,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
: m_context(),
pending_procedures(),
dnn_subscriptions(),
scid(0),
event_sub(),
plmn() {
supi_prefix = {};
......@@ -925,20 +921,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
*/
std::size_t get_number_dnn_contexts() const;
/*
* Set SM Context ID
* @param [const scid_t &] id: SM Context Id
* @return void