Commit c62e8552 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Refactor for UE NAS/NGAP context

parent b78197fc
...@@ -235,7 +235,6 @@ void amf_app::set_ran_amf_id_2_ue_context( ...@@ -235,7 +235,6 @@ void amf_app::set_ran_amf_id_2_ue_context(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_app::is_supi_2_ue_context(const string& supi) const { bool amf_app::is_supi_2_ue_context(const string& supi) const {
std::shared_lock lock(m_supi2ue_ctx); std::shared_lock lock(m_supi2ue_ctx);
// return bool{supi2ue_ctx.count(supi) > 0};
if (supi2ue_ctx.count(supi) > 0) { if (supi2ue_ctx.count(supi) > 0) {
if (supi2ue_ctx.at(supi) != nullptr) { if (supi2ue_ctx.at(supi) != nullptr) {
return true; return true;
...@@ -244,13 +243,6 @@ bool amf_app::is_supi_2_ue_context(const string& supi) const { ...@@ -244,13 +243,6 @@ bool amf_app::is_supi_2_ue_context(const string& supi) const {
return false; return false;
} }
//------------------------------------------------------------------------------
std::shared_ptr<ue_context> amf_app::supi_2_ue_context(
const string& supi) const {
std::shared_lock lock(m_supi2ue_ctx);
return supi2ue_ctx.at(supi);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_app::supi_2_ue_context( bool amf_app::supi_2_ue_context(
const std::string& supi, std::shared_ptr<ue_context>& uc) const { const std::string& supi, std::shared_ptr<ue_context>& uc) const {
...@@ -520,7 +512,8 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) { ...@@ -520,7 +512,8 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
if (ue_ctx.supiIsSet()) { if (ue_ctx.supiIsSet()) {
supi = ue_ctx.getSupi(); supi = ue_ctx.getSupi();
if (!is_supi_2_ue_context(supi)) { // Update UE Context
if (!supi_2_ue_context(supi, uc)) {
// Create a new UE Context // Create a new UE Context
Logger::amf_app().debug( Logger::amf_app().debug(
"No existing UE Context, Create a new one with SUPI %s", "No existing UE Context, Create a new one with SUPI %s",
...@@ -529,8 +522,6 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) { ...@@ -529,8 +522,6 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
uc->amf_ue_ngap_id = -1; uc->amf_ue_ngap_id = -1;
uc->supi = supi; uc->supi = supi;
set_supi_2_ue_context(supi, uc); set_supi_2_ue_context(supi, uc);
} else { // Update UE Context
uc = supi_2_ue_context(supi);
} }
} }
......
...@@ -224,13 +224,6 @@ class amf_app { ...@@ -224,13 +224,6 @@ class amf_app {
*/ */
bool is_supi_2_ue_context(const string& supi) const; bool is_supi_2_ue_context(const string& supi) const;
/*
* Get UE context associated with a SUPI
* @param [const std::string&] supi: UE SUPI
* @return shared pointer to the context
*/
std::shared_ptr<ue_context> supi_2_ue_context(const string& supi) const;
/* /*
* Get UE context associated with a SUPI * Get UE context associated with a SUPI
* @param [const std::string&] supi: SUPI * @param [const std::string&] supi: SUPI
......
...@@ -124,6 +124,7 @@ typedef struct auth_conf_s { ...@@ -124,6 +124,7 @@ typedef struct auth_conf_s {
std::string mysql_pass; std::string mysql_pass;
std::string mysql_db; std::string mysql_db;
std::string random; std::string random;
nlohmann::json to_json() const { nlohmann::json to_json() const {
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["mysql_server"] = this->mysql_server; json_data["mysql_server"] = this->mysql_server;
...@@ -231,6 +232,7 @@ typedef struct guami_s { ...@@ -231,6 +232,7 @@ typedef struct guami_s {
typedef struct slice_s { typedef struct slice_s {
uint8_t sst; uint8_t sst;
uint32_t sd; uint32_t sd;
bool operator==(const struct slice_s& s) const { bool operator==(const struct slice_s& s) const {
if ((s.sst == this->sst) && (s.sd == this->sd)) { if ((s.sst == this->sst) && (s.sd == this->sd)) {
return true; return true;
...@@ -238,13 +240,16 @@ typedef struct slice_s { ...@@ -238,13 +240,16 @@ typedef struct slice_s {
return false; return false;
} }
} }
bool operator>(const struct slice_s& s) const { bool operator>(const struct slice_s& s) const {
if (this->sst > s.sst) return true; if (this->sst > s.sst) return true;
if (this->sst == s.sst) { if (this->sst == s.sst) {
if (this->sd > s.sd) return true; if (this->sd > s.sd) return true;
if (this->sd <= s.sd) return false; if (this->sd <= s.sd) return false;
} }
return true;
} }
nlohmann::json to_json() const { nlohmann::json to_json() const {
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["sst"] = this->sst; json_data["sst"] = this->sst;
......
...@@ -212,7 +212,7 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) { ...@@ -212,7 +212,7 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) {
long amf_ue_ngap_id = itti_msg.amf_ue_ngap_id; long amf_ue_ngap_id = itti_msg.amf_ue_ngap_id;
uint32_t ran_ue_ngap_id = itti_msg.ran_ue_ngap_id; uint32_t ran_ue_ngap_id = itti_msg.ran_ue_ngap_id;
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -263,7 +263,7 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) { ...@@ -263,7 +263,7 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) {
// Get NSSAI // Get NSSAI
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed NAS context for UE with amf_ue_ngap_id " "No existed NAS context for UE with amf_ue_ngap_id "
"(" AMF_UE_NGAP_ID_FMT ")", "(" AMF_UE_NGAP_ID_FMT ")",
...@@ -657,7 +657,7 @@ void amf_n1::uplink_nas_msg_handle( ...@@ -657,7 +657,7 @@ void amf_n1::uplink_nas_msg_handle(
case SERVICE_REQUEST: { case SERVICE_REQUEST: {
Logger::amf_n1().debug("Received Service Request message, handling..."); Logger::amf_n1().debug("Received Service Request message, handling...");
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
service_request_handle(nc, ran_ue_ngap_id, amf_ue_ngap_id, plain_msg); service_request_handle(nc, ran_ue_ngap_id, amf_ue_ngap_id, plain_msg);
} else { } else {
Logger::amf_n1().debug("No NAS context available"); Logger::amf_n1().debug("No NAS context available");
...@@ -732,9 +732,8 @@ void amf_n1::identity_response_handle( ...@@ -732,9 +732,8 @@ void amf_n1::identity_response_handle(
uc->supi = "imsi-" + supi; uc->supi = "imsi-" + supi;
// associate SUPI with UC // associate SUPI with UC
// Verify if there's PDU session info in the old context // Verify if there's PDU session info in the old context
if (amf_app_inst->is_supi_2_ue_context(uc->supi)) { std::shared_ptr<ue_context> old_uc = {};
std::shared_ptr<ue_context> old_uc = {}; if (amf_app_inst->is_supi_2_ue_context(uc->supi, old_uc)) {
old_uc = amf_app_inst->supi_2_ue_context(uc->supi);
uc->copy_pdu_sessions(old_uc); uc->copy_pdu_sessions(old_uc);
} }
amf_app_inst->set_supi_2_ue_context(uc->supi, uc); amf_app_inst->set_supi_2_ue_context(uc->supi, uc);
...@@ -902,9 +901,8 @@ void amf_n1::service_request_handle( ...@@ -902,9 +901,8 @@ void amf_n1::service_request_handle(
// Get the status of PDU Session context // Get the status of PDU Session context
std::shared_ptr<pdu_session_context> old_psc = {}; std::shared_ptr<pdu_session_context> old_psc = {};
if (amf_app_inst->is_supi_2_ue_context(supi)) { std::shared_ptr<ue_context> old_uc = {};
std::shared_ptr<ue_context> old_uc = {}; if (amf_app_inst->supi_2_ue_context(supi, old_uc)) {
old_uc = amf_app_inst->supi_2_ue_context(supi);
uc->copy_pdu_sessions(old_uc); uc->copy_pdu_sessions(old_uc);
amf_app_inst->set_supi_2_ue_context(supi, uc); amf_app_inst->set_supi_2_ue_context(supi, uc);
} }
...@@ -1140,11 +1138,10 @@ void amf_n1::registration_request_handle( ...@@ -1140,11 +1138,10 @@ void amf_n1::registration_request_handle(
// Try to find old nas_context and release // Try to find old nas_context and release
std::shared_ptr<nas_context> old_nc = {}; std::shared_ptr<nas_context> old_nc = {};
old_nc = imsi_2_nas_context("imsi-" + nc->imsi); if (imsi_2_nas_context("imsi-" + nc->imsi, old_nc)) {
// release
if (old_nc) {
old_nc.reset(); old_nc.reset();
} }
set_imsi_2_nas_context("imsi-" + nc->imsi, nc); set_imsi_2_nas_context("imsi-" + nc->imsi, nc);
Logger::amf_n1().info( Logger::amf_n1().info(
"Associating IMSI (%s) with nas_context (%p)", "Associating IMSI (%s) with nas_context (%p)",
...@@ -1453,25 +1450,18 @@ bool amf_n1::is_amf_ue_id_2_nas_context(const long& amf_ue_ngap_id) const { ...@@ -1453,25 +1450,18 @@ bool amf_n1::is_amf_ue_id_2_nas_context(const long& amf_ue_ngap_id) const {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_n1::is_amf_ue_id_2_nas_context( bool amf_n1::amf_ue_id_2_nas_context(
const long& amf_ue_ngap_id, std::shared_ptr<nas_context>& nc) const { const long& amf_ue_ngap_id, std::shared_ptr<nas_context>& nc) const {
std::shared_lock lock(m_amfueid2nas_context); std::shared_lock lock(m_amfueid2nas_context);
if (amfueid2nas_context.count(amf_ue_ngap_id) > 0) { if (amfueid2nas_context.count(amf_ue_ngap_id) > 0) {
nc = amfueid2nas_context.at(amf_ue_ngap_id); if (amfueid2nas_context.at(amf_ue_ngap_id) != nullptr) {
if (nc != nullptr) { nc = amfueid2nas_context.at(amf_ue_ngap_id);
return true; return true;
} }
} }
return false; return false;
} }
//------------------------------------------------------------------------------
std::shared_ptr<nas_context> amf_n1::amf_ue_id_2_nas_context(
const long& amf_ue_ngap_id) const {
std::shared_lock lock(m_amfueid2nas_context);
return amfueid2nas_context.at(amf_ue_ngap_id);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void amf_n1::set_amf_ue_ngap_id_2_nas_context( void amf_n1::set_amf_ue_ngap_id_2_nas_context(
const long& amf_ue_ngap_id, std::shared_ptr<nas_context> nc) { const long& amf_ue_ngap_id, std::shared_ptr<nas_context> nc) {
...@@ -1589,13 +1579,15 @@ bool amf_n1::remove_guti_2_nas_context(const std::string& guti) { ...@@ -1589,13 +1579,15 @@ bool amf_n1::remove_guti_2_nas_context(const std::string& guti) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::shared_ptr<nas_context> amf_n1::imsi_2_nas_context( bool amf_n1::imsi_2_nas_context(
const std::string& imsi) const { const std::string& imsi, std::shared_ptr<nas_context>& nc) const {
std::shared_lock lock(m_nas_context); std::shared_lock lock(m_nas_context);
if (imsi2nas_context.count(imsi) > 0) { if (imsi2nas_context.count(imsi) > 0) {
return imsi2nas_context.at(imsi); if (!imsi2nas_context.at(imsi)) return false;
nc = imsi2nas_context.at(imsi);
return true;
} else { } else {
return nullptr; return false;
} }
} }
...@@ -2217,7 +2209,7 @@ void amf_n1::authentication_response_handle( ...@@ -2217,7 +2209,7 @@ void amf_n1::authentication_response_handle(
bstring plain_msg) { bstring plain_msg) {
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().error( Logger::amf_n1().error(
"No existed NAS context for UE with amf_ue_ngap_id " AMF_UE_NGAP_ID_FMT, "No existed NAS context for UE with amf_ue_ngap_id " AMF_UE_NGAP_ID_FMT,
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -2310,7 +2302,7 @@ void amf_n1::authentication_failure_handle( ...@@ -2310,7 +2302,7 @@ void amf_n1::authentication_failure_handle(
const uint32_t ran_ue_ngap_id, const long amf_ue_ngap_id, const uint32_t ran_ue_ngap_id, const long amf_ue_ngap_id,
bstring plain_msg) { bstring plain_msg) {
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().error( Logger::amf_n1().error(
"No existed NAS context for UE with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT "No existed NAS context for UE with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT
")", ")",
...@@ -2514,7 +2506,7 @@ void amf_n1::security_mode_complete_handle( ...@@ -2514,7 +2506,7 @@ void amf_n1::security_mode_complete_handle(
} }
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -2775,7 +2767,7 @@ void amf_n1::registration_complete_handle( ...@@ -2775,7 +2767,7 @@ void amf_n1::registration_complete_handle(
} }
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -3049,7 +3041,7 @@ void amf_n1::ue_initiate_de_registration_handle( ...@@ -3049,7 +3041,7 @@ void amf_n1::ue_initiate_de_registration_handle(
Logger::amf_n1().debug("Handling UE-initiated De-registration Request"); Logger::amf_n1().debug("Handling UE-initiated De-registration Request");
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -3290,7 +3282,7 @@ void amf_n1::ul_nas_transport_handle( ...@@ -3290,7 +3282,7 @@ void amf_n1::ul_nas_transport_handle(
"Requested/Configured NSSAI!"); "Requested/Configured NSSAI!");
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed nas_context with amf_ue_ngap_id(0x%x)", amf_ue_ngap_id); "No existed nas_context with amf_ue_ngap_id(0x%x)", amf_ue_ngap_id);
return; return;
...@@ -4271,7 +4263,7 @@ bool amf_n1::find_ue_context( ...@@ -4271,7 +4263,7 @@ bool amf_n1::find_ue_context(
void amf_n1::mobile_reachable_timer_timeout( void amf_n1::mobile_reachable_timer_timeout(
timer_id_t& timer_id, const uint64_t amf_ue_ngap_id) { timer_id_t& timer_id, const uint64_t amf_ue_ngap_id) {
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -4301,7 +4293,7 @@ void amf_n1::mobile_reachable_timer_timeout( ...@@ -4301,7 +4293,7 @@ void amf_n1::mobile_reachable_timer_timeout(
void amf_n1::implicit_deregistration_timer_timeout( void amf_n1::implicit_deregistration_timer_timeout(
timer_id_t timer_id, uint64_t amf_ue_ngap_id) { timer_id_t timer_id, uint64_t amf_ue_ngap_id) {
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n1().warn( Logger::amf_n1().warn(
"No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
......
...@@ -147,22 +147,15 @@ class amf_n1 { ...@@ -147,22 +147,15 @@ class amf_n1 {
bool is_amf_ue_id_2_nas_context(const long& amf_ue_ngap_id) const; bool is_amf_ue_id_2_nas_context(const long& amf_ue_ngap_id) const;
/* /*
* Verify if a UE NAS context associated with an AMF UE NGAP ID exist * Verify if a UE NAS context associated with an AMF UE NGAP ID exist and not
* null
* @param [const long& ] amf_ue_ngap_id: AMF UE NGAP ID * @param [const long& ] amf_ue_ngap_id: AMF UE NGAP ID
* @param [std::shared_ptr<nas_context>&] nc: pointer to UE NAS context * @param [std::shared_ptr<nas_context>&] nc: pointer to UE NAS context
* @return true if UE NAS context exist, otherwise false * @return true if UE NAS context exist, otherwise false
*/ */
bool is_amf_ue_id_2_nas_context( bool amf_ue_id_2_nas_context(
const long& amf_ue_ngap_id, std::shared_ptr<nas_context>& nc) const; const long& amf_ue_ngap_id, std::shared_ptr<nas_context>& nc) const;
/*
* Get UE NAS context associated with an AMF UE NGAP ID
* @param [const long& ] amf_ue_ngap_id: AMF UE NGAP ID
* @return shared pointer to the UE NAS context
*/
std::shared_ptr<nas_context> amf_ue_id_2_nas_context(
const long& amf_ue_ngap_id) const;
/* /*
* Store an UE NAS context associated with an AMF UE NGAP ID * Store an UE NAS context associated with an AMF UE NGAP ID
* @param [const long& ] amf_ue_ngap_id: AMF UE NGAP ID * @param [const long& ] amf_ue_ngap_id: AMF UE NGAP ID
......
...@@ -268,7 +268,7 @@ void amf_n2::handle_itti_message(itti_paging& itti_msg) { ...@@ -268,7 +268,7 @@ void amf_n2::handle_itti_message(itti_paging& itti_msg) {
// get NAS context // get NAS context
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(itti_msg.amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(itti_msg.amf_ue_ngap_id, nc)) {
Logger::amf_n2().warn( Logger::amf_n2().warn(
"No existed nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT ")",
itti_msg.amf_ue_ngap_id); itti_msg.amf_ue_ngap_id);
...@@ -606,65 +606,59 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) { ...@@ -606,65 +606,59 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
Logger::amf_n2().debug( Logger::amf_n2().debug(
"Create a new UE NGAP context with ran_ue_ngap_id " GNB_UE_NGAP_ID_FMT, "Create a new UE NGAP context with ran_ue_ngap_id " GNB_UE_NGAP_ID_FMT,
ran_ue_ngap_id); ran_ue_ngap_id);
unc = std::shared_ptr<ue_ngap_context>(new ue_ngap_context()); unc = std::make_shared<ue_ngap_context>();
set_ran_ue_ngap_id_2_ue_ngap_context(ran_ue_ngap_id, unc); set_ran_ue_ngap_id_2_ue_ngap_context(ran_ue_ngap_id, unc);
} }
if (unc == nullptr) { // Store related information into UE NGAP context
Logger::amf_n2().error( unc->ran_ue_ngap_id = ran_ue_ngap_id;
"Failed to get UE NGAP context for ran_ue_ngap_id " GNB_UE_NGAP_ID_FMT, unc->sctp_stream_recv = init_ue_msg.stream;
ran_ue_ngap_id); unc->sctp_stream_send == gc->next_sctp_stream;
gc->next_sctp_stream += 1;
if (gc->next_sctp_stream >= gc->instreams) gc->next_sctp_stream = 1;
unc->gnb_assoc_id = init_ue_msg.assoc_id;
NrCgi_t cgi = {};
Tai_t tai = {};
if (init_ue_msg.initUeMsg->getUserLocationInfoNR(cgi, tai)) {
itti_msg->cgi = cgi;
itti_msg->tai = tai;
unc->tai = tai;
} else { } else {
// Store related information into UE NGAP context Logger::amf_n2().error("Missing Mandatory IE UserLocationInfoNR");
unc->ran_ue_ngap_id = ran_ue_ngap_id; return;
unc->sctp_stream_recv = init_ue_msg.stream; }
unc->sctp_stream_send == gc->next_sctp_stream;
gc->next_sctp_stream += 1;
if (gc->next_sctp_stream >= gc->instreams) gc->next_sctp_stream = 1;
unc->gnb_assoc_id = init_ue_msg.assoc_id;
NrCgi_t cgi = {};
Tai_t tai = {};
if (init_ue_msg.initUeMsg->getUserLocationInfoNR(cgi, tai)) {
itti_msg->cgi = cgi;
itti_msg->tai = tai;
unc->tai = tai;
} else {
Logger::amf_n2().error("Missing Mandatory IE UserLocationInfoNR");
return;
}
if (init_ue_msg.initUeMsg->getRRCEstablishmentCause() == -1) { if (init_ue_msg.initUeMsg->getRRCEstablishmentCause() == -1) {
Logger::amf_n2().warn("IE RRCEstablishmentCause not present"); Logger::amf_n2().warn("IE RRCEstablishmentCause not present");
itti_msg->rrc_cause = -1; // not present, TODO with optional itti_msg->rrc_cause = -1; // not present, TODO with optional
} else { } else {
itti_msg->rrc_cause = init_ue_msg.initUeMsg->getRRCEstablishmentCause(); itti_msg->rrc_cause = init_ue_msg.initUeMsg->getRRCEstablishmentCause();
} }
if (init_ue_msg.initUeMsg->getUeContextRequest() == -1) { if (init_ue_msg.initUeMsg->getUeContextRequest() == -1) {
Logger::amf_n2().warn("IE UeContextRequest not present"); Logger::amf_n2().warn("IE UeContextRequest not present");
itti_msg->ueCtxReq = -1; // not present, TODO with optional itti_msg->ueCtxReq = -1; // not present, TODO with optional
} else { } else {
itti_msg->ueCtxReq = init_ue_msg.initUeMsg->getUeContextRequest(); itti_msg->ueCtxReq = init_ue_msg.initUeMsg->getUeContextRequest();
} }
std::string _5g_s_tmsi = {}; std::string _5g_s_tmsi = {};
if (!init_ue_msg.initUeMsg->get5GS_TMSI(_5g_s_tmsi)) { if (!init_ue_msg.initUeMsg->get5GS_TMSI(_5g_s_tmsi)) {
itti_msg->is_5g_s_tmsi_present = false; itti_msg->is_5g_s_tmsi_present = false;
Logger::amf_n2().debug("5g_s_tmsi not present"); Logger::amf_n2().debug("5g_s_tmsi not present");
} else { } else {
itti_msg->is_5g_s_tmsi_present = true; itti_msg->is_5g_s_tmsi_present = true;
itti_msg->_5g_s_tmsi = _5g_s_tmsi; itti_msg->_5g_s_tmsi = _5g_s_tmsi;
Logger::amf_n2().debug("5g_s_tmsi present"); Logger::amf_n2().debug("5g_s_tmsi present");
init_ue_msg.initUeMsg->get5GS_TMSI( init_ue_msg.initUeMsg->get5GS_TMSI(
unc->s_setid, unc->s_pointer, unc->s_tmsi); unc->s_setid, unc->s_pointer, unc->s_tmsi);
} }
if (!init_ue_msg.initUeMsg->getNasPdu(itti_msg->nas_buf)) { if (!init_ue_msg.initUeMsg->getNasPdu(itti_msg->nas_buf)) {
Logger::amf_n2().error("Missing IE NAS-PDU"); Logger::amf_n2().error("Missing IE NAS-PDU");
return; return;
}
} }
// Store InitialUEMessage for Rereoute NAS later // Store InitialUEMessage for Rereoute NAS later
...@@ -886,8 +880,7 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) { ...@@ -886,8 +880,7 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
// Get NSSAI from PDU Session Context // Get NSSAI from PDU Session Context
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context( if (!amf_n1_inst->amf_ue_id_2_nas_context(itti_msg.amf_ue_ngap_id, nc)) {
itti_msg.amf_ue_ngap_id, nc)) {
Logger::amf_n2().warn( Logger::amf_n2().warn(
"No existed nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT "No existed nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT
")", ")",
...@@ -974,7 +967,7 @@ void amf_n2::handle_itti_message( ...@@ -974,7 +967,7 @@ void amf_n2::handle_itti_message(
// Get NSSAI from PDU Session Context // Get NSSAI from PDU Session Context
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(itti_msg.amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(itti_msg.amf_ue_ngap_id, nc)) {
Logger::amf_n2().warn( Logger::amf_n2().warn(
"No existed nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT ")",
itti_msg.amf_ue_ngap_id); itti_msg.amf_ue_ngap_id);
...@@ -1195,7 +1188,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) { ...@@ -1195,7 +1188,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
// Send ITTI to N11 SBI, notify CommunicationFailure Report, RAN Cause // Send ITTI to N11 SBI, notify CommunicationFailure Report, RAN Cause
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(itti_msg.amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(itti_msg.amf_ue_ngap_id, nc)) {
Logger::amf_n2().warn( Logger::amf_n2().warn(
"Could not notify RAN caused CommunicationFailure." "Could not notify RAN caused CommunicationFailure."
"No existing nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT ")", "No existing nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT ")",
...@@ -1275,7 +1268,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_complete& itti_msg) { ...@@ -1275,7 +1268,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_complete& itti_msg) {
// Change UE status from CM-CONNECTED to CM-IDLE // Change UE status from CM-CONNECTED to CM-IDLE
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n2().warn( Logger::amf_n2().warn(
"No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No existed nas_context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -1535,7 +1528,7 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) { ...@@ -1535,7 +1528,7 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
// Security context // Security context
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n2().error( Logger::amf_n2().error(
"No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -1709,7 +1702,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) { ...@@ -1709,7 +1702,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
gc->gnb_name.c_str(), gc->globalRanNodeId); gc->gnb_name.c_str(), gc->globalRanNodeId);
std::shared_ptr<ue_ngap_context> unc = {}; std::shared_ptr<ue_ngap_context> unc = {};
if (!is_amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) { if (!amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) {
Logger::amf_n2().error( Logger::amf_n2().error(
"No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -1729,7 +1722,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) { ...@@ -1729,7 +1722,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
itti_msg.handoverrequestAck->getTargetToSource_TransparentContainer(); itti_msg.handoverrequestAck->getTargetToSource_TransparentContainer();
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n2().error( Logger::amf_n2().error(
"No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -1866,7 +1859,7 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) { ...@@ -1866,7 +1859,7 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
gc->gnb_name.c_str(), gc->globalRanNodeId); gc->gnb_name.c_str(), gc->globalRanNodeId);
std::shared_ptr<ue_ngap_context> unc = {}; std::shared_ptr<ue_ngap_context> unc = {};
if (!is_amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) { if (!amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) {
Logger::amf_n2().error( Logger::amf_n2().error(
"No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -1881,7 +1874,7 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) { ...@@ -1881,7 +1874,7 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
} }
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
Logger::amf_n2().error( Logger::amf_n2().error(
"No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -1981,7 +1974,7 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) { ...@@ -1981,7 +1974,7 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
sctp_s_38412.sctp_send_msg(unc->gnb_assoc_id, 0, &b); sctp_s_38412.sctp_send_msg(unc->gnb_assoc_id, 0, &b);
bdestroy_wrapper(&b); bdestroy_wrapper(&b);
if (!is_amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) { if (!amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) {
Logger::amf_n2().error( Logger::amf_n2().error(
"No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -2009,7 +2002,7 @@ void amf_n2::handle_itti_message(itti_uplink_ran_status_transfer& itti_msg) { ...@@ -2009,7 +2002,7 @@ void amf_n2::handle_itti_message(itti_uplink_ran_status_transfer& itti_msg) {
} }
std::shared_ptr<ue_ngap_context> unc = {}; std::shared_ptr<ue_ngap_context> unc = {};
if (!is_amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) { if (!amf_ue_id_2_ue_ngap_context(amf_ue_ngap_id, unc)) {
Logger::amf_n2().error( Logger::amf_n2().error(
"No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NGAP context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
amf_ue_ngap_id); amf_ue_ngap_id);
...@@ -2139,21 +2132,14 @@ bool amf_n2::ran_ue_id_2_ue_ngap_context( ...@@ -2139,21 +2132,14 @@ bool amf_n2::ran_ue_id_2_ue_ngap_context(
std::shared_ptr<ue_ngap_context>& unc) const { std::shared_ptr<ue_ngap_context>& unc) const {
std::shared_lock lock(m_ranid2uecontext); std::shared_lock lock(m_ranid2uecontext);
if (ranid2uecontext.count(ran_ue_ngap_id) > 0) { if (ranid2uecontext.count(ran_ue_ngap_id) > 0) {
unc = ranid2uecontext.at(ran_ue_ngap_id); if (ranid2uecontext.at(ran_ue_ngap_id) != nullptr) {
if (unc != nullptr) { unc = ranid2uecontext.at(ran_ue_ngap_id);
return true; return true;
} }
} }
return false; return false;
} }
/*
//------------------------------------------------------------------------------
std::shared_ptr<ue_ngap_context> amf_n2::ran_ue_id_2_ue_ngap_context(
const uint32_t& ran_ue_ngap_id) const {
std::shared_lock lock(m_ranid2uecontext);
return ranid2uecontext.at(ran_ue_ngap_id);
}
*/
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void amf_n2::set_ran_ue_ngap_id_2_ue_ngap_context( void amf_n2::set_ran_ue_ngap_id_2_ue_ngap_context(
const uint32_t& ran_ue_ngap_id, const uint32_t& ran_ue_ngap_id,
...@@ -2186,7 +2172,7 @@ void amf_n2::remove_ue_context_with_ran_ue_ngap_id( ...@@ -2186,7 +2172,7 @@ void amf_n2::remove_ue_context_with_ran_ue_ngap_id(
// Remove all NAS context if still exist // Remove all NAS context if still exist
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (amf_n1_inst->is_amf_ue_id_2_nas_context(unc->amf_ue_ngap_id, nc)) { if (amf_n1_inst->amf_ue_id_2_nas_context(unc->amf_ue_ngap_id, nc)) {
// Remove all NAS context // Remove all NAS context
string supi = "imsi-" + nc->imsi; string supi = "imsi-" + nc->imsi;
if (nc->is_stacs_available) { if (nc->is_stacs_available) {
...@@ -2226,13 +2212,6 @@ void amf_n2::get_ue_ngap_contexts( ...@@ -2226,13 +2212,6 @@ void amf_n2::get_ue_ngap_contexts(
} }
} }
//------------------------------------------------------------------------------
std::shared_ptr<ue_ngap_context> amf_n2::amf_ue_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id) const {
std::shared_lock lock(m_amfueid2uecontext);
return amfueid2uecontext.at(amf_ue_ngap_id);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_n2::is_amf_ue_id_2_ue_ngap_context( bool amf_n2::is_amf_ue_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id) const { const unsigned long& amf_ue_ngap_id) const {
...@@ -2246,7 +2225,7 @@ bool amf_n2::is_amf_ue_id_2_ue_ngap_context( ...@@ -2246,7 +2225,7 @@ bool amf_n2::is_amf_ue_id_2_ue_ngap_context(
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_n2::is_amf_ue_id_2_ue_ngap_context( bool amf_n2::amf_ue_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id, const unsigned long& amf_ue_ngap_id,
std::shared_ptr<ue_ngap_context>& unc) const { std::shared_ptr<ue_ngap_context>& unc) const {
std::shared_lock lock(m_amfueid2uecontext); std::shared_lock lock(m_amfueid2uecontext);
...@@ -2280,7 +2259,7 @@ void amf_n2::remove_ue_context_with_amf_ue_ngap_id( ...@@ -2280,7 +2259,7 @@ void amf_n2::remove_ue_context_with_amf_ue_ngap_id(
const unsigned long& amf_ue_ngap_id) { const unsigned long& amf_ue_ngap_id) {
// Remove all NAS context if still exist // Remove all NAS context if still exist
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) { if (amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nc)) {
// Remove all NAS context // Remove all NAS context
string supi = "imsi-" + nc->imsi; string supi = "imsi-" + nc->imsi;
// Update UE status // Update UE status
...@@ -2382,8 +2361,6 @@ bool amf_n2::get_common_NSSAI( ...@@ -2382,8 +2361,6 @@ bool amf_n2::get_common_NSSAI(
return false; return false;
} }
if (!unc) return false;
// Get gNB Context // Get gNB Context
std::shared_ptr<gnb_context> gc = {}; std::shared_ptr<gnb_context> gc = {};
if (!amf_n2_inst->is_assoc_id_2_gnb_context(unc->gnb_assoc_id, gc)) { if (!amf_n2_inst->is_assoc_id_2_gnb_context(unc->gnb_assoc_id, gc)) {
......
...@@ -224,14 +224,6 @@ class amf_n2 : public ngap::ngap_app { ...@@ -224,14 +224,6 @@ class amf_n2 : public ngap::ngap_app {
bool get_common_NSSAI( bool get_common_NSSAI(
const uint32_t& ran_ue_ngap_id, std::vector<nas::SNSSAI_t>& common_nssai); const uint32_t& ran_ue_ngap_id, std::vector<nas::SNSSAI_t>& common_nssai);
/*
* Get UE NGAP context associated with a RAN UE NGAP ID
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return shared pointer to the UE NGAP context
*/
// std::shared_ptr<ue_ngap_context> ran_ue_id_2_ue_ngap_context(
// const uint32_t& ran_ue_ngap_id) const;
/* /*
* Verify whether a UE NGAP context associated with a RAN UE NGAP ID exist * Verify whether a UE NGAP context associated with a RAN UE NGAP ID exist
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID * @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
...@@ -292,13 +284,13 @@ class amf_n2 : public ngap::ngap_app { ...@@ -292,13 +284,13 @@ class amf_n2 : public ngap::ngap_app {
const unsigned long& amf_ue_ngap_id) const; const unsigned long& amf_ue_ngap_id) const;
/* /*
* Verify whether a UE NGAP context associated with a AMF UE NGAP ID exist * Get UE NGAP context associated with a AMF UE NGAP ID
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID * @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @param [std::shared_ptr<ue_ngap_context>&] unc: store the pointer to UE * @param [std::shared_ptr<ue_ngap_context>&] unc: store the pointer to UE
* NGAP context * NGAP context
* @return true if exist, otherwise return false * @return true if context exist and not null, otherwise return false
*/ */
bool is_amf_ue_id_2_ue_ngap_context( bool amf_ue_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id, const unsigned long& amf_ue_ngap_id,
std::shared_ptr<ue_ngap_context>& unc) const; std::shared_ptr<ue_ngap_context>& unc) const;
......
...@@ -278,7 +278,7 @@ void amf_sbi::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) { ...@@ -278,7 +278,7 @@ void amf_sbi::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
Logger::amf_sbi().debug("Handle ITTI SMF_PDU_SESSION_CREATE_SM_CTX"); Logger::amf_sbi().debug("Handle ITTI SMF_PDU_SESSION_CREATE_SM_CTX");
std::shared_ptr<nas_context> nc = {}; std::shared_ptr<nas_context> nc = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(smf.amf_ue_ngap_id, nc)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(smf.amf_ue_ngap_id, nc)) {
Logger::amf_sbi().error( Logger::amf_sbi().error(
"No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")", "No UE NAS context with amf_ue_ngap_id (" AMF_UE_NGAP_ID_FMT ")",
smf.amf_ue_ngap_id); smf.amf_ue_ngap_id);
......
...@@ -422,7 +422,7 @@ int ngap_amf_handle_pdu_session_resource_setup_response( ...@@ -422,7 +422,7 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
new itti_nsmf_pdusession_update_sm_context(TASK_NGAP, TASK_AMF_SBI); new itti_nsmf_pdusession_update_sm_context(TASK_NGAP, TASK_AMF_SBI);
long amf_ue_ngap_id = pdu_session_resource_setup_resp->getAmfUeNgapId(); long amf_ue_ngap_id = pdu_session_resource_setup_resp->getAmfUeNgapId();
std::shared_ptr<nas_context> nct = {}; std::shared_ptr<nas_context> nct = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nct)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nct)) {
Logger::ngap().error( Logger::ngap().error(
"No UE NAS context with amf_ue_ngap_id (0x%x)", amf_ue_ngap_id); "No UE NAS context with amf_ue_ngap_id (0x%x)", amf_ue_ngap_id);
return RETURNerror; return RETURNerror;
...@@ -491,7 +491,7 @@ int ngap_amf_handle_pdu_session_resource_setup_response( ...@@ -491,7 +491,7 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
long amf_ue_ngap_id = pdu_session_resource_setup_resp->getAmfUeNgapId(); long amf_ue_ngap_id = pdu_session_resource_setup_resp->getAmfUeNgapId();
std::shared_ptr<nas_context> nct = {}; std::shared_ptr<nas_context> nct = {};
if (!amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id, nct)) { if (!amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id, nct)) {
Logger::ngap().error( Logger::ngap().error(
"No UE NAS context with amf_ue_ngap_id (0x%x)", amf_ue_ngap_id); "No UE NAS context with amf_ue_ngap_id (0x%x)", amf_ue_ngap_id);
return RETURNerror; return RETURNerror;
......
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