Skip to content

Commit

Permalink
Addressed review comments (R3)
Browse files Browse the repository at this point in the history
Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
  • Loading branch information
priya-wavelabs committed May 24, 2022
1 parent 84fd7b2 commit e7b85d7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions lte/gateway/c/core/oai/tasks/amf/Registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,26 @@ int amf_proc_registration_request(amf_ue_ngap_id_t ue_id,
ue_m5gmm_context_s* ue_m5gmm_context = NULL;
if (ies->imsi) {
imsi64 = amf_imsi_to_imsi64(ies->imsi);
OAILOG_DEBUG(LOG_AMF_APP,
OAILOG_DEBUG(LOG_NAS_AMF,
"During initial registration request "
"SUPI as IMSI converted to imsi64 " IMSI_64_FMT " = ",
imsi64);
} else if (ies->imei) {
char imei_str[MAX_IMEISV_SIZE];
IMEI_TO_STRING(ies->imei, imei_str, MAX_IMEISV_SIZE);
OAILOG_DEBUG(LOG_AMF_APP,
OAILOG_DEBUG(LOG_NAS_AMF,
"REGISTRATION REQ (ue_id = " AMF_UE_NGAP_ID_FMT
") (IMEI = %s ) \n",
ue_id, imei_str);
}

ue_m5gmm_context = amf_ue_context_exists_amf_ue_ngap_id(ue_id);
if (ue_m5gmm_context == NULL) {
OAILOG_ERROR(LOG_AMF_APP,
OAILOG_ERROR(LOG_NAS_AMF,
"ue context not found for the"
"ue_id=" AMF_UE_NGAP_ID_FMT "\n",
ue_id);
OAILOG_FUNC_RETURN(LOG_AMF_APP, rc);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, rc);
}

ue_m5gmm_context->amf_context.amf_procedures = NULL;
Expand Down Expand Up @@ -305,7 +305,7 @@ static int amf_registration_reject(amf_context_t* amf_context,
amf_sap_t amf_sap = {};
nas_amf_registration_proc_t* registration_proc =
(nas_amf_registration_proc_t*)nas_base_proc;
OAILOG_WARNING(LOG_AMF_APP,
OAILOG_WARNING(LOG_NAS_AMF,
"AMF-PROC - AMF Registration procedure not accepted ");
/*
* Notify AMF-AS SAP that Registration Reject message has to be sent
Expand Down Expand Up @@ -355,7 +355,7 @@ int amf_registration_run_procedure(amf_context_t* amf_context) {
nas_amf_registration_proc_t* registration_proc =
get_nas_specific_procedure_registration(amf_context);
if (registration_proc == NULL) {
OAILOG_WARNING(LOG_AMF_APP, " Registration_proc null, from %s\n",
OAILOG_WARNING(LOG_NAS_AMF, " Registration_proc null, from %s\n",
__FUNCTION__);
}
OAILOG_DEBUG(
Expand Down Expand Up @@ -705,7 +705,7 @@ static int registration_accept_t3550_handler(zloop_t* loop, int timer_id,
ue_amf_context = amf_ue_context_exists_amf_ue_ngap_id(ue_id);

if (ue_amf_context == NULL) {
OAILOG_DEBUG(LOG_AMF_APP,
OAILOG_DEBUG(LOG_NAS_AMF,
"ue context not found for the ue_id=" AMF_UE_NGAP_ID_FMT "\n",
ue_id);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, RETURNok);
Expand All @@ -728,13 +728,13 @@ static int registration_accept_t3550_handler(zloop_t* loop, int timer_id,
/* Send entity Registration accept message to the UE */

OAILOG_WARNING(
LOG_AMF_APP,
LOG_NAS_AMF,
"T3550: timer has expired retransmitting registration accept\n");
amf_send_registration_accept(amf_ctx);
} else {
/* Abort the registration procedure */
OAILOG_ERROR(
LOG_AMF_APP,
LOG_NAS_AMF,
"T3550: Maximum retires:%d, for registration accept done hence Abort "
"the registration "
"procedure\n",
Expand Down Expand Up @@ -774,7 +774,7 @@ int amf_proc_registration_complete(amf_context_t* amf_ctx) {
amf_ctx->amf_procedures->amf_specific_proc;

amf_app_stop_timer(registration_proc->T3550.id);
OAILOG_DEBUG(LOG_AMF_APP,
OAILOG_DEBUG(LOG_NAS_AMF,
"Timer: after stop registration timer T3550 with id = %lu\n",
registration_proc->T3550.id);
registration_proc->T3550.id = NAS5G_TIMER_INACTIVE_ID;
Expand All @@ -791,7 +791,7 @@ int amf_proc_registration_complete(amf_context_t* amf_ctx) {
"UE Context not found for "
"(ue_id=" AMF_UE_NGAP_ID_FMT ")\n",
ue_id);
OAILOG_FUNC_RETURN(LOG_AMF_APP, rc);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, rc);
}

/*
Expand Down Expand Up @@ -1048,15 +1048,15 @@ void amf_delete_registration_ies(amf_registration_request_ies_t** ies) {
***************************************************************************/
int amf_proc_registration_abort(amf_context_t* amf_ctx,
struct ue_m5gmm_context_s* ue_context_p) {
OAILOG_FUNC_IN(LOG_AMF_APP);
OAILOG_FUNC_IN(LOG_NAS_AMF);
int rc = RETURNerror;
if (ue_context_p) {
amf_app_itti_ue_context_release(ue_context_p, NGAP_NAS_DEREGISTER);
amf_delete_registration_proc(&ue_context_p->amf_context);
amf_free_ue_context(ue_context_p);
rc = RETURNok;
}
OAILOG_FUNC_RETURN(LOG_AMF_APP, rc);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, rc);
}
/***************************************************************************
** **
Expand All @@ -1079,7 +1079,7 @@ int get_decrypt_imsi_suci_extension(amf_context_t* amf_context,
->amf_ue_ngap_id;

OAILOG_INFO(
LOG_AMF_APP,
LOG_NAS_AMF,
"Sending msg(grpc) to :[subscriberdb] for ue: [" AMF_UE_NGAP_ID_FMT
"] decrypt-imsi\n",
ue_id);
Expand All @@ -1102,12 +1102,12 @@ void create_new_registration_info(amf_context_t* amf_context_p,
amf_ue_ngap_id_t amf_ue_ngap_id,
struct amf_registration_request_ies_s* ies,
bool is_mm_ctx_new) {
OAILOG_FUNC_IN(LOG_AMF_APP);
OAILOG_FUNC_IN(LOG_NAS_AMF);
amf_context_p->new_registration_info = new (new_registration_info_t)();
amf_context_p->new_registration_info->amf_ue_ngap_id = amf_ue_ngap_id;
amf_context_p->new_registration_info->ies = ies;
amf_context_p->new_registration_info->is_mm_ctx_new = is_mm_ctx_new;
OAILOG_FUNC_OUT(LOG_AMF_APP);
OAILOG_FUNC_OUT(LOG_NAS_AMF);
}

} // namespace magma5g
32 changes: 16 additions & 16 deletions lte/gateway/c/core/oai/tasks/amf/amf_app_ue_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ amf_context_t* amf_context_get(const amf_ue_ngap_id_t ue_id) {
if (ue_mm_context) {
amf_context_p = &ue_mm_context->amf_context;
}
OAILOG_DEBUG(LOG_NAS_AMF, "Stored UE id " AMF_UE_NGAP_ID_FMT " \n", ue_id);
OAILOG_DEBUG(LOG_AMF_APP, "Stored UE id " AMF_UE_NGAP_ID_FMT " \n", ue_id);
}
OAILOG_FUNC_RETURN(LOG_AMF_APP, amf_context_p);
}
Expand Down Expand Up @@ -559,7 +559,7 @@ void amf_free_ue_context(ue_m5gmm_context_s* ue_context_p) {
magma::map_rc_t m_rc = magma::MAP_OK;
amf_app_desc_t* amf_app_desc_p = get_amf_nas_state(false);
amf_ue_context_t* amf_ue_context_p = &amf_app_desc_p->amf_ue_contexts;
OAILOG_DEBUG(LOG_NAS_AMF, "amf_free_ue_context \n");
OAILOG_DEBUG(LOG_AMF_APP, "amf_free_ue_context \n");
map_uint64_ue_context_t* amf_state_ue_id_ht = get_amf_ue_state();
if (!ue_context_p || !amf_ue_context_p) {
return;
Expand All @@ -580,9 +580,9 @@ void amf_free_ue_context(ue_m5gmm_context_s* ue_context_p) {
***************************************************************************/
void proc_new_registration_req(amf_ue_context_t* const amf_ue_context_p,
struct ue_m5gmm_context_s* ue_context_p) {
OAILOG_FUNC_IN(LOG_NAS_AMF);
OAILOG_FUNC_IN(LOG_AMF_APP);

OAILOG_INFO(LOG_NAS_AMF,
OAILOG_INFO(LOG_AMF_APP,
"Process new Registration Request for ue_id " AMF_UE_NGAP_ID_FMT
"\n",
ue_context_p->amf_ue_ngap_id);
Expand Down Expand Up @@ -628,10 +628,10 @@ void proc_new_registration_req(amf_ue_context_t* const amf_ue_context_p,
amf_ue_context_exists_amf_ue_ngap_id(registration_info.amf_ue_ngap_id);

if (ue_m5gmm_context == NULL) {
OAILOG_ERROR(LOG_NAS_AMF, "Failed to re-register " AMF_UE_NGAP_ID_FMT "\n",
OAILOG_ERROR(LOG_AMF_APP, "Failed to re-register " AMF_UE_NGAP_ID_FMT "\n",
registration_info.amf_ue_ngap_id);

OAILOG_FUNC_OUT(LOG_NAS_AMF);
OAILOG_FUNC_OUT(LOG_AMF_APP);
}

amf_context_t* new_amf_ctx = &ue_m5gmm_context->amf_context;
Expand All @@ -645,14 +645,14 @@ void proc_new_registration_req(amf_ue_context_t* const amf_ue_context_p,
}
amf_registration_run_procedure(&ue_m5gmm_context->amf_context);

OAILOG_FUNC_OUT(LOG_NAS_AMF);
OAILOG_FUNC_OUT(LOG_AMF_APP);
}

//------------------------------------------------------------------------------
int amf_app_handle_implicit_deregistration_timer_expiry(zloop_t* loop,
int timer_id,
void* args) {
OAILOG_FUNC_IN(LOG_NAS_AMF);
OAILOG_FUNC_IN(LOG_AMF_APP);

amf_context_t* amf_ctx = NULL;
amf_ue_ngap_id_t ue_id = 0;
Expand All @@ -662,18 +662,18 @@ int amf_app_handle_implicit_deregistration_timer_expiry(zloop_t* loop,
LOG_AMF_APP,
"Implicit Deregistration: Invalid Timer Id expiration, Timer Id: %u\n",
timer_id);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, RETURNok);
OAILOG_FUNC_RETURN(LOG_AMF_APP, RETURNok);
}

ue_m5gmm_context_s* ue_context_p =
amf_ue_context_exists_amf_ue_ngap_id(ue_id);

if (ue_context_p == NULL) {
OAILOG_DEBUG(LOG_NAS_AMF,
OAILOG_DEBUG(LOG_AMF_APP,
"Implicit Deregistration: ue_amf_context is NULL for "
"ue id: " AMF_UE_NGAP_ID_FMT "\n",
ue_id);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, RETURNok);
OAILOG_FUNC_RETURN(LOG_AMF_APP, RETURNok);
}

amf_ctx = &ue_context_p->amf_context;
Expand All @@ -683,7 +683,7 @@ int amf_app_handle_implicit_deregistration_timer_expiry(zloop_t* loop,
"Implicit Deregistration: Timer expired no amf context for "
"ue id: " AMF_UE_NGAP_ID_FMT "\n",
ue_id);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, RETURNok);
OAILOG_FUNC_RETURN(LOG_AMF_APP, RETURNok);
}

ue_context_p->m5_implicit_deregistration_timer.id = AMF_APP_TIMER_INACTIVE_ID;
Expand All @@ -707,18 +707,18 @@ static int amf_app_handle_mobile_reachability_timer_expiry(zloop_t* loop,
LOG_AMF_APP,
"Mobile Rechability timer: Invalid Timer Id expiration, Timer Id: %u\n",
timer_id);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, RETURNok);
OAILOG_FUNC_RETURN(LOG_AMF_APP, RETURNok);
}

ue_m5gmm_context_s* ue_context_p =
amf_ue_context_exists_amf_ue_ngap_id(ue_id);

if (ue_context_p == NULL) {
OAILOG_DEBUG(LOG_NAS_AMF,
OAILOG_DEBUG(LOG_AMF_APP,
"Mobile Reachability Timer: ue_amf_context is NULL for "
"ue id: " AMF_UE_NGAP_ID_FMT "\n",
ue_id);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, RETURNok);
OAILOG_FUNC_RETURN(LOG_AMF_APP, RETURNok);
}

amf_ctx = &ue_context_p->amf_context;
Expand All @@ -728,7 +728,7 @@ static int amf_app_handle_mobile_reachability_timer_expiry(zloop_t* loop,
"Mobile Reachability Timer: Timer expired no amf context for "
"ue id: " AMF_UE_NGAP_ID_FMT "\n",
ue_id);
OAILOG_FUNC_RETURN(LOG_NAS_AMF, RETURNok);
OAILOG_FUNC_RETURN(LOG_AMF_APP, RETURNok);
}

ue_context_p->m5_mobile_reachability_timer.id = AMF_APP_TIMER_INACTIVE_ID;
Expand Down

0 comments on commit e7b85d7

Please sign in to comment.