rollback ogs_expect() [#551]

This commit is contained in:
Sukchan Lee 2020-09-08 22:16:46 -04:00
parent c3d66085fc
commit 7f9f6fc3f2
12 changed files with 34 additions and 21 deletions

View File

@ -122,7 +122,6 @@ void ogs_log_hexdump_func(ogs_log_level_e level, int domain_id,
if (ogs_likely(expr)) ; \
else { \
ogs_error("%s: Expectation `%s' failed.", OGS_FUNC, #expr); \
ogs_abort(); \
} \
} while (0)
@ -131,7 +130,6 @@ void ogs_log_hexdump_func(ogs_log_level_e level, int domain_id,
if (ogs_likely(expr)) ; \
else { \
ogs_error("%s: Expectation `%s' failed.", OGS_FUNC, #expr); \
ogs_abort(); \
return; \
} \
} while (0)

View File

@ -129,7 +129,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
}
if (!MME_UE_HAVE_IMSI(mme_ue)) {
ogs_warn("[EMM] Service request : Unknown UE");
ogs_info("[EMM] Service request : Unknown UE");
nas_eps_send_service_reject(mme_ue,
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
OGS_FSM_TRAN(s, &emm_state_exception);
@ -234,7 +234,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
}
if (!MME_UE_HAVE_IMSI(mme_ue)) {
ogs_warn("[EMM] TAU request : Unknown UE");
ogs_info("[EMM] TAU request : Unknown UE");
nas_eps_send_tau_reject(mme_ue,
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
OGS_FSM_TRAN(s, &emm_state_exception);
@ -565,7 +565,7 @@ void emm_state_authentication(ogs_fsm_t *s, mme_event_t *e)
"(Non-EPS authentication unacceptable)");
break;
case EMM_CAUSE_SYNCH_FAILURE:
ogs_warn("Authentication failure(Synch failure)");
ogs_info("Authentication failure(Synch failure)");
mme_s6a_send_air(mme_ue,
authentication_failure_parameter);
return;
@ -885,6 +885,10 @@ void emm_state_initial_context_setup(ogs_fsm_t *s, mme_event_t *e)
mme_send_delete_session_or_detach(mme_ue);
OGS_FSM_TRAN(s, &emm_state_de_registered);
break;
case OGS_NAS_EPS_SECURITY_MODE_COMPLETE:
ogs_warn("[%s] Duplicated : Security mode complete",
mme_ue->imsi_bcd);
break;
default:
ogs_warn("Unknown message[%d]",
message->emm.h.message_type);

View File

@ -2447,7 +2447,7 @@ mme_ue_t *mme_ue_find_by_message(ogs_nas_eps_message_t *message)
ogs_nas_guti.mme_code,
ogs_nas_guti.m_tmsi);
} else {
ogs_warn("Unknown UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]",
ogs_info("Unknown UE by GUTI[G:%d,C:%d,M_TMSI:0x%x]",
ogs_nas_guti.mme_gid,
ogs_nas_guti.mme_code,
ogs_nas_guti.m_tmsi);

View File

@ -297,9 +297,9 @@ static void mme_s6a_aia_cb(void *data, struct msg **msg)
if (s6a_message->result_code != ER_DIAMETER_SUCCESS) {
if (s6a_message->err)
ogs_warn(" Result Code: %d", s6a_message->result_code);
ogs_info(" Result Code: %d", s6a_message->result_code);
else if (s6a_message->exp_err)
ogs_warn(" Experimental Result Code: %d",
ogs_info(" Experimental Result Code: %d",
s6a_message->result_code);
else {
ogs_fatal("ERROR DIAMETER Result Code(%d)",

View File

@ -74,10 +74,10 @@ void mme_send_release_access_bearer_or_ue_context_release(enb_ue_t *enb_ue)
mme_ue = enb_ue->mme_ue;
if (mme_ue) {
if (BEARER_CONTEXT_IS_ACTIVE(mme_ue)) {
ogs_debug(" EMM-Registered");
ogs_debug("[%s] EMM-Registered", mme_ue->imsi_bcd);
mme_gtp_send_release_access_bearers_request(mme_ue);
} else {
ogs_warn("No EMM-Registered");
ogs_warn("[%s] No EMM-Registered", mme_ue->imsi_bcd);
mme_send_delete_session_or_mme_ue_context_release(mme_ue);
}
} else {

View File

@ -44,7 +44,7 @@ static uint8_t emm_cause_from_diameter(
if (dia_exp_err) {
switch (*dia_exp_err) {
case OGS_DIAM_S6A_ERROR_USER_UNKNOWN: /* 5001 */
ogs_warn("[%s] User Unknown in HSS DB", mme_ue->imsi_bcd);
ogs_info("[%s] User Unknown in HSS DB", mme_ue->imsi_bcd);
return EMM_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED;
case OGS_DIAM_S6A_ERROR_UNKNOWN_EPS_SUBSCRIPTION: /* 5420 */
/* FIXME: Error diagnostic? */
@ -448,7 +448,7 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
uint8_t emm_cause = emm_cause_from_diameter(
mme_ue, s6a_message->err, s6a_message->exp_err);
ogs_warn("[%s] Attach reject [EMM_CAUSE:%d]",
ogs_info("[%s] Attach reject [EMM_CAUSE:%d]",
mme_ue->imsi_bcd, emm_cause);
nas_eps_send_attach_reject(mme_ue,
emm_cause, ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED);

View File

@ -111,10 +111,7 @@ void nas_eps_send_attach_accept(mme_ue_t *mme_ue)
ogs_assert(mme_bearer_next(bearer) == NULL);
esmbuf = esm_build_activate_default_bearer_context_request(sess);
if (!esmbuf) {
ogs_error("esm_build_activate_default_bearer_context_request() failed");
return;
}
ogs_expect_or_return(esmbuf);
emmbuf = emm_build_attach_accept(mme_ue, esmbuf);
ogs_expect_or_return(emmbuf);

View File

@ -275,7 +275,7 @@ void s1ap_handle_initial_ue_message(mme_enb_t *enb, ogs_s1ap_message_t *message)
mme_ue = mme_ue_find_by_guti(&nas_guti);
if (!mme_ue) {
ogs_warn("Unknown UE by S_TMSI[G:%d,C:%d,M_TMSI:0x%x]",
ogs_info("Unknown UE by S_TMSI[G:%d,C:%d,M_TMSI:0x%x]",
nas_guti.mme_gid, nas_guti.mme_code, nas_guti.m_tmsi);
} else {
ogs_debug(" S_TMSI[G:%d,C:%d,M_TMSI:0x%x] IMSI:[%s]",

View File

@ -116,6 +116,12 @@ void s1ap_state_operational(ogs_fsm_t *s, mme_event_t *e)
case S1AP_ProcedureCode_id_Reset:
s1ap_handle_s1_reset(enb, pdu);
break;
case S1AP_ProcedureCode_id_ErrorIndication:
/* TODO */
break;
case S1AP_ProcedureCode_id_NASNonDeliveryIndication:
/* TODO */
break;
default:
ogs_error("Not implemented(choice:%d, proc:%d)",
pdu->present, (int)initiatingMessage->procedureCode);

View File

@ -147,8 +147,10 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data)
pdr = ogs_pfcp_pdr_find_by_teid_and_qfi(teid, qfi);
if (!pdr) {
#if 0 /* It's redundant log message */
ogs_warn("[DROP] Cannot find PDR : TEID[0x%x] QFI[%d]",
teid, qfi);
#endif
goto cleanup;
}

View File

@ -1707,9 +1707,6 @@ int smf_pco_build(uint8_t *pco_buf, uint8_t *buffer, int length)
smf_self()->p_cscf6_index %= smf_self()->num_of_p_cscf6;
}
break;
case OGS_PCO_ID_IP_ADDRESS_ALLOCATION_VIA_NAS_SIGNALLING:
/* TODO */
break;
case OGS_PCO_ID_IPV4_LINK_MTU_REQUEST:
if (smf_self()->mtu) {
mtu = htons(smf_self()->mtu);
@ -1719,6 +1716,15 @@ int smf_pco_build(uint8_t *pco_buf, uint8_t *buffer, int length)
smf.num_of_id++;
}
break;
case OGS_PCO_ID_IP_ADDRESS_ALLOCATION_VIA_NAS_SIGNALLING:
/* TODO */
break;
case OGS_PCO_ID_MS_SUPPORTS_BCM:
/* TODO */
break;
case OGS_PCO_ID_MS_SUPPORT_LOCAL_ADDR_TFT_INDICATOR:
/* TODO */
break;
default:
ogs_warn("Unknown PCO ID:(0x%x)", ue.ids[i].id);
}

View File

@ -71,7 +71,7 @@ int app_initialize(const char *const argv[])
*
* If freeDiameter is not used, it uses a delay of less than 1 second.
*/
ogs_msleep(500);
ogs_msleep(1500);
return OGS_OK;;
}