forked from acouzens/open5gs
ogs_assert to ogs_expects (#314)
* HACK: Don't retransmit InitialContextSetupReq Related: #256 * HACK: Don't use buggy sa1p_copy() in eNBConfigTransfer Related: #257 * mme: don't reject with 'IMSI is unknown in HLR' (permanent reject) * MME: Implement S6a result -> EMM cause code mapping Closes: #263 * Spencer: modification to Haralds fix because macros are now renamed * MME: don't assert on MAC failures of uplink NAS frames Closes: #267 * MME: Avoid ogs_assert() in many situations We don't want to crash the entire program just because a message received from an external entity didn't match some of our expectations. * compiles fine, checked DIFFs and only difference is the ogs_assert -> ogs_expect
This commit is contained in:
parent
552045aa28
commit
5b59f09d9f
|
@ -221,7 +221,7 @@ int emm_handle_attach_complete(
|
|||
(int)local.tm_gmtoff);
|
||||
|
||||
rv = nas_send_emm_to_esm(mme_ue, &attach_complete->esm_message_container);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.security_header_type =
|
||||
|
@ -273,8 +273,10 @@ int emm_handle_attach_complete(
|
|||
}
|
||||
|
||||
rv = nas_security_encode(&emmbuf, mme_ue, &message);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_assert(nas_send_to_downlink_nas_transport(mme_ue, emmbuf) == OGS_OK);
|
||||
if (rv == OGS_OK) {
|
||||
ogs_assert(emmbuf);
|
||||
ogs_expect(nas_send_to_downlink_nas_transport(mme_ue, emmbuf) == OGS_OK);
|
||||
}
|
||||
|
||||
ogs_debug("[EMM] EMM information");
|
||||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
@ -307,7 +309,7 @@ int emm_handle_identity_response(
|
|||
&mobile_identity->imsi, mobile_identity->length, imsi_bcd);
|
||||
mme_ue_set_imsi(mme_ue, imsi_bcd);
|
||||
|
||||
ogs_assert(mme_ue->imsi_len);
|
||||
ogs_expect(mme_ue->imsi_len);
|
||||
} else {
|
||||
ogs_warn("Not supported Identity type[%d]", mobile_identity->imsi.type);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
}
|
||||
|
||||
rv = s1ap_send_initial_context_setup_request(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_warn("[EMM] TAU request : Unknown UE");
|
||||
rv = nas_send_tau_reject(mme_ue,
|
||||
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
OGS_FSM_TRAN(s, &emm_state_exception);
|
||||
return;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
&MME_UE_S1AP_ID, &ENB_UE_S1AP_ID,
|
||||
S1AP_Cause_PR_transport,
|
||||
S1AP_CauseTransport_transport_resource_unavailable);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -339,7 +339,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
if (SECURITY_CONTEXT_IS_VALID(mme_ue)) {
|
||||
rv = nas_send_emm_to_esm(mme_ue,
|
||||
&mme_ue->pdn_connectivity_request);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
OGS_FSM_TRAN(s, &emm_state_initial_context_setup);
|
||||
} else {
|
||||
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
|
||||
|
@ -357,7 +357,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_warn("No PDN Connection : UE[%s]", mme_ue->imsi_bcd);
|
||||
rv = nas_send_tau_reject(mme_ue,
|
||||
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
OGS_FSM_TRAN(s, emm_state_exception);
|
||||
break;
|
||||
}
|
||||
|
@ -373,11 +373,11 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
if (mme_ue->nas_eps.update.active_flag) {
|
||||
rv = nas_send_tau_accept(mme_ue,
|
||||
S1AP_ProcedureCode_id_InitialContextSetup);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
rv = nas_send_tau_accept(mme_ue,
|
||||
S1AP_ProcedureCode_id_downlinkNASTransport);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
mme_send_release_access_bearer_or_ue_context_release(enb_ue);
|
||||
}
|
||||
|
@ -385,10 +385,9 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_debug(" Uplink NAS Transport");
|
||||
rv = nas_send_tau_accept(mme_ue,
|
||||
S1AP_ProcedureCode_id_downlinkNASTransport);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_fatal("Invalid Procedure Code[%d]", (int)procedureCode);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
break;
|
||||
case MME_EPS_TYPE_EXTENDED_SERVICE_REQUEST:
|
||||
|
@ -442,7 +441,7 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
}
|
||||
|
||||
rv = s1ap_send_initial_context_setup_request(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
} else if (procedureCode == S1AP_ProcedureCode_id_uplinkNASTransport) {
|
||||
ogs_debug(" Uplink NAS Transport");
|
||||
|
@ -468,16 +467,14 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
|||
}
|
||||
|
||||
rv = s1ap_send_ue_context_modification_request(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_fatal("Invalid Procedure Code[%d]", (int)procedureCode);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
ogs_fatal("Invalid NAS-EPS[%d]", mme_ue->nas_eps.type);
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -529,7 +526,7 @@ void emm_state_authentication(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_log_hexdump(OGS_LOG_WARN,
|
||||
mme_ue->xres, OGS_MAX_RES_LEN);
|
||||
rv = nas_send_authentication_reject(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
OGS_FSM_TRAN(&mme_ue->sm, &emm_state_exception);
|
||||
} else {
|
||||
OGS_FSM_TRAN(&mme_ue->sm, &emm_state_security_mode);
|
||||
|
@ -573,7 +570,7 @@ void emm_state_authentication(ogs_fsm_t *s, mme_event_t *e)
|
|||
}
|
||||
|
||||
rv = nas_send_authentication_reject(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
OGS_FSM_TRAN(&mme_ue->sm, &emm_state_exception);
|
||||
|
||||
break;
|
||||
|
@ -730,7 +727,6 @@ void emm_state_security_mode(ogs_fsm_t *s, mme_event_t *e)
|
|||
OGS_FSM_TRAN(s, &emm_state_registered);
|
||||
} else {
|
||||
ogs_fatal("Invalid OGS_NAS_EPS[%d]", mme_ue->nas_eps.type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
break;
|
||||
case OGS_NAS_SECURITY_MODE_REJECT:
|
||||
|
@ -757,7 +753,7 @@ void emm_state_security_mode(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_debug("[EMM] Tracking area update request");
|
||||
rv = nas_send_tau_reject(mme_ue,
|
||||
EMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
OGS_FSM_TRAN(s, &emm_state_exception);
|
||||
break;
|
||||
case OGS_NAS_EMM_STATUS:
|
||||
|
|
|
@ -54,10 +54,10 @@ int esm_build_pdn_connectivity_reject(
|
|||
pdn_connectivity_reject->esm_cause = esm_cause;
|
||||
|
||||
if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_registered)) {
|
||||
ogs_assert(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
ogs_expect(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
*pkbuf);
|
||||
} else {
|
||||
ogs_assert(ogs_nas_plain_encode(pkbuf, &message) == OGS_OK && *pkbuf);
|
||||
ogs_expect(ogs_nas_plain_encode(pkbuf, &message) == OGS_OK && *pkbuf);
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
|
@ -88,7 +88,7 @@ int esm_build_information_request(ogs_pkbuf_t **pkbuf, mme_bearer_t *bearer)
|
|||
message.esm.h.procedure_transaction_identity = sess->pti;
|
||||
message.esm.h.message_type = OGS_NAS_ESM_INFORMATION_REQUEST;
|
||||
|
||||
ogs_assert(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
ogs_expect(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
*pkbuf);
|
||||
|
||||
return OGS_OK;
|
||||
|
@ -169,8 +169,10 @@ int esm_build_activate_default_bearer_context_request(
|
|||
pdn->paa.both.addr6+(OGS_IPV6_LEN>>1), OGS_IPV6_LEN>>1);
|
||||
pdn_address->length = OGS_NAS_PDN_ADDRESS_IPV4V6_LEN;
|
||||
ogs_debug(" IPv4v6");
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
} else {
|
||||
ogs_error("Unexpected PDN Type %u", pdn_address->pdn_type);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
if (pdn->ambr.downlink || pdn->ambr.uplink) {
|
||||
activate_default_eps_bearer_context_request->presencemask |=
|
||||
|
@ -187,10 +189,10 @@ int esm_build_activate_default_bearer_context_request(
|
|||
}
|
||||
|
||||
if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_registered)) {
|
||||
ogs_assert(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
ogs_expect(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
*pkbuf);
|
||||
} else {
|
||||
ogs_assert(ogs_nas_plain_encode(pkbuf, &message) == OGS_OK && *pkbuf);
|
||||
ogs_expect(ogs_nas_plain_encode(pkbuf, &message) == OGS_OK && *pkbuf);
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
|
@ -244,7 +246,7 @@ int esm_build_activate_dedicated_bearer_context_request(
|
|||
ogs_assert(bearer->tft.data);
|
||||
memcpy(tft->buffer, bearer->tft.data, tft->length);
|
||||
|
||||
ogs_assert(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
ogs_expect(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
*pkbuf);
|
||||
|
||||
return OGS_OK;
|
||||
|
@ -301,7 +303,7 @@ int esm_build_modify_bearer_context_request(
|
|||
memcpy(tft->buffer, bearer->tft.data, tft->length);
|
||||
}
|
||||
|
||||
ogs_assert(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
ogs_expect(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
*pkbuf);
|
||||
|
||||
return OGS_OK;
|
||||
|
@ -340,7 +342,7 @@ int esm_build_deactivate_bearer_context_request(
|
|||
|
||||
deactivate_eps_bearer_context_request->esm_cause = esm_cause;
|
||||
|
||||
ogs_assert(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
ogs_expect(nas_security_encode(pkbuf, mme_ue, &message) == OGS_OK &&
|
||||
*pkbuf);
|
||||
|
||||
return OGS_OK;
|
||||
|
|
|
@ -69,7 +69,7 @@ int esm_handle_pdn_connectivity_request(mme_bearer_t *bearer,
|
|||
/* Invalid APN */
|
||||
rv = nas_send_pdn_connectivity_reject(
|
||||
sess, ESM_CAUSE_MISSING_OR_UNKNOWN_APN);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
@ -99,11 +99,11 @@ int esm_handle_pdn_connectivity_request(mme_bearer_t *bearer,
|
|||
if (sess->pdn) {
|
||||
ogs_debug(" APN[%s]", sess->pdn->apn);
|
||||
rv = mme_gtp_send_create_session_request(sess);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
rv = nas_send_pdn_connectivity_reject(
|
||||
sess, ESM_CAUSE_MISSING_OR_UNKNOWN_APN);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
@ -148,12 +148,12 @@ int esm_handle_information_response(mme_sess_t *sess,
|
|||
}
|
||||
} else {
|
||||
rv = mme_gtp_send_create_session_request(sess);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
} else {
|
||||
rv = nas_send_pdn_connectivity_reject(
|
||||
sess, ESM_CAUSE_MISSING_OR_UNKNOWN_APN);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
|
|
@ -111,11 +111,11 @@ void esm_state_inactive(ogs_fsm_t *s, mme_event_t *e)
|
|||
* E-RAB Setup Response is received */
|
||||
if (MME_HAVE_ENB_S1U_PATH(bearer)) {
|
||||
rv = mme_gtp_send_modify_bearer_request(bearer, 0);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
rv = nas_send_activate_all_dedicated_bearers(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
OGS_FSM_TRAN(s, esm_state_active);
|
||||
break;
|
||||
|
@ -128,7 +128,7 @@ void esm_state_inactive(ogs_fsm_t *s, mme_event_t *e)
|
|||
* E-RAB Setup Response is received */
|
||||
if (MME_HAVE_ENB_S1U_PATH(bearer)) {
|
||||
rv = mme_gtp_send_create_bearer_response(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
OGS_FSM_TRAN(s, esm_state_active);
|
||||
|
@ -217,10 +217,10 @@ void esm_state_active(ogs_fsm_t *s, mme_event_t *e)
|
|||
mme_ue->imsi_bcd, sess->pti, bearer->ebi);
|
||||
if (MME_HAVE_SGW_S1U_PATH(sess)) {
|
||||
rv = mme_gtp_send_delete_session_request(sess);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
rv = nas_send_deactivate_bearer_context_request(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
OGS_FSM_TRAN(s, esm_state_pdn_will_disconnect);
|
||||
break;
|
||||
|
@ -230,7 +230,7 @@ void esm_state_active(ogs_fsm_t *s, mme_event_t *e)
|
|||
mme_ue->imsi_bcd, sess->pti, bearer->ebi);
|
||||
|
||||
rv = mme_gtp_send_update_bearer_response(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
break;
|
||||
case OGS_NAS_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT:
|
||||
ogs_debug("[ESM] [A] Deactivate EPS bearer "
|
||||
|
@ -238,7 +238,7 @@ void esm_state_active(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_debug(" IMSI[%s] PTI[%d] EBI[%d]",
|
||||
mme_ue->imsi_bcd, sess->pti, bearer->ebi);
|
||||
rv = mme_gtp_send_delete_bearer_response(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
OGS_FSM_TRAN(s, esm_state_bearer_deactivated);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -212,13 +212,13 @@ static void mme_s6a_aia_cb(void *data, struct msg **msg)
|
|||
|
||||
/* Search the session, retrieve its data */
|
||||
ret = fd_msg_sess_get(fd_g_config->cnf_dict, *msg, &session, &new);
|
||||
ogs_assert(ret == 0);
|
||||
ogs_assert(new == 0);
|
||||
ogs_expect_or_return(ret == 0);
|
||||
ogs_expect_or_return(new == 0);
|
||||
|
||||
ret = fd_sess_state_retrieve(mme_s6a_reg, session, &sess_data);
|
||||
ogs_assert(ret == 0);
|
||||
ogs_assert(sess_data);
|
||||
ogs_assert((void *)sess_data == data);
|
||||
ogs_expect_or_return(ret == 0);
|
||||
ogs_expect_or_return(sess_data);
|
||||
ogs_expect_or_return((void *)sess_data == data);
|
||||
|
||||
mme_ue = sess_data->mme_ue;
|
||||
ogs_assert(mme_ue);
|
||||
|
@ -614,13 +614,13 @@ static void mme_s6a_ula_cb(void *data, struct msg **msg)
|
|||
|
||||
/* Search the session, retrieve its data */
|
||||
ret = fd_msg_sess_get(fd_g_config->cnf_dict, *msg, &session, &new);
|
||||
ogs_assert(ret == 0);
|
||||
ogs_assert(new == 0);
|
||||
ogs_expect_or_return(ret == 0);
|
||||
ogs_expect_or_return(new == 0);
|
||||
|
||||
ret = fd_sess_state_retrieve(mme_s6a_reg, session, &sess_data);
|
||||
ogs_assert(ret == 0);
|
||||
ogs_assert(sess_data);
|
||||
ogs_assert((void *)sess_data == data);
|
||||
ogs_expect_or_return(ret == 0);
|
||||
ogs_expect_or_return(sess_data);
|
||||
ogs_expect_or_return((void *)sess_data == data);
|
||||
|
||||
mme_ue = sess_data->mme_ue;
|
||||
ogs_assert(mme_ue);
|
||||
|
|
|
@ -176,13 +176,17 @@ int mme_gtp_send_create_session_request(mme_sess_t *sess)
|
|||
h.teid = mme_ue->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_create_session_request(&pkbuf, h.type, sess);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return rv;
|
||||
|
||||
xact = ogs_gtp_xact_local_create(mme_ue->gnode, &h, pkbuf, timeout, mme_ue);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -209,13 +213,17 @@ int mme_gtp_send_modify_bearer_request(
|
|||
|
||||
rv = mme_s11_build_modify_bearer_request(
|
||||
&pkbuf, h.type, bearer, uli_presence);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return rv;
|
||||
|
||||
xact = ogs_gtp_xact_local_create(mme_ue->gnode, &h, pkbuf, timeout, mme_ue);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -237,13 +245,17 @@ int mme_gtp_send_delete_session_request(mme_sess_t *sess)
|
|||
h.teid = mme_ue->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_delete_session_request(&s11buf, h.type, sess);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return rv;
|
||||
|
||||
xact = ogs_gtp_xact_local_create(mme_ue->gnode, &h, s11buf, timeout, sess);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(s11buf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -276,7 +288,7 @@ void mme_gtp_send_delete_all_sessions(mme_ue_t *mme_ue)
|
|||
ogs_warn("PDN will disconnect[EBI:%d]", bearer->ebi);
|
||||
} else {
|
||||
rv = mme_gtp_send_delete_session_request(sess);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
} else {
|
||||
mme_sess_remove(sess);
|
||||
|
@ -307,13 +319,17 @@ int mme_gtp_send_create_bearer_response(mme_bearer_t *bearer)
|
|||
h.teid = mme_ue->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_create_bearer_response(&pkbuf, h.type, bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return rv;
|
||||
|
||||
rv = ogs_gtp_xact_update_tx(xact, &h, pkbuf);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -339,13 +355,17 @@ int mme_gtp_send_update_bearer_response(mme_bearer_t *bearer)
|
|||
h.teid = mme_ue->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_update_bearer_response(&pkbuf, h.type, bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return rv;
|
||||
|
||||
rv = ogs_gtp_xact_update_tx(xact, &h, pkbuf);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -371,13 +391,18 @@ int mme_gtp_send_delete_bearer_response(mme_bearer_t *bearer)
|
|||
h.teid = mme_ue->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_delete_bearer_response(&pkbuf, h.type, bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return rv;
|
||||
|
||||
|
||||
rv = ogs_gtp_xact_update_tx(xact, &h, pkbuf);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -396,13 +421,17 @@ void mme_gtp_send_release_access_bearers_request(mme_ue_t *mme_ue)
|
|||
h.teid = mme_ue->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_release_access_bearers_request(&pkbuf, h.type);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return;
|
||||
|
||||
xact = ogs_gtp_xact_local_create(mme_ue->gnode, &h, pkbuf, timeout, mme_ue);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
int mme_gtp_send_create_indirect_data_forwarding_tunnel_request(
|
||||
|
@ -421,13 +450,17 @@ int mme_gtp_send_create_indirect_data_forwarding_tunnel_request(
|
|||
|
||||
rv = mme_s11_build_create_indirect_data_forwarding_tunnel_request(
|
||||
&pkbuf, h.type, mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
if (rv != OGS_OK)
|
||||
return rv;
|
||||
|
||||
xact = ogs_gtp_xact_local_create(mme_ue->gnode, &h, pkbuf, timeout, mme_ue);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -450,10 +483,13 @@ int mme_gtp_send_delete_indirect_data_forwarding_tunnel_request(
|
|||
ogs_pkbuf_reserve(pkbuf, OGS_TLV_MAX_HEADROOM);
|
||||
|
||||
xact = ogs_gtp_xact_local_create(mme_ue->gnode, &h, pkbuf, timeout, mme_ue);
|
||||
ogs_assert(xact);
|
||||
if (!xact) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
|
|
@ -253,7 +253,7 @@ int mme_s11_build_create_session_request(
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ int mme_s11_build_modify_bearer_request(ogs_pkbuf_t **pkbuf,
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ int mme_s11_build_delete_session_request(
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -471,7 +471,7 @@ int mme_s11_build_create_bearer_response(
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -629,7 +629,7 @@ int mme_s11_build_delete_bearer_response(
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -650,7 +650,7 @@ int mme_s11_build_release_access_bearers_request(
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ int mme_s11_build_downlink_data_notification_ack(
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ int mme_s11_build_create_indirect_data_forwarding_tunnel_request(
|
|||
|
||||
gtp_message.h.type = type;
|
||||
rv = ogs_gtp_build_msg(pkbuf, >p_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ void mme_s11_handle_create_session_response(
|
|||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
if (rsp->cause.presence) {
|
||||
ogs_gtp_cause_t *cause = rsp->cause.data;
|
||||
|
@ -110,7 +110,7 @@ void mme_s11_handle_create_session_response(
|
|||
|
||||
bearer = mme_bearer_find_by_ue_ebi(mme_ue,
|
||||
rsp->bearer_contexts_created.eps_bearer_id.u8);
|
||||
ogs_assert(bearer);
|
||||
ogs_expect_or_return(bearer);
|
||||
sess = bearer->sess;
|
||||
ogs_assert(sess);
|
||||
pdn = sess->pdn;
|
||||
|
@ -177,7 +177,7 @@ void mme_s11_handle_modify_bearer_response(
|
|||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
if (rsp->cause.presence) {
|
||||
ogs_gtp_cause_t *cause = rsp->cause.data;
|
||||
|
@ -198,7 +198,7 @@ void mme_s11_handle_modify_bearer_response(
|
|||
|
||||
GTP_COUNTER_CHECK(mme_ue, GTP_COUNTER_MODIFY_BEARER_BY_PATH_SWITCH,
|
||||
rv = s1ap_send_path_switch_ack(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
);
|
||||
|
||||
GTP_COUNTER_CHECK(mme_ue, GTP_COUNTER_MODIFY_BEARER_BY_HANDOVER_NOTIFY,
|
||||
|
@ -234,7 +234,7 @@ void mme_s11_handle_delete_session_response(
|
|||
ogs_assert(mme_ue);
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
if (rsp->cause.presence) {
|
||||
ogs_gtp_cause_t *cause = rsp->cause.data;
|
||||
|
@ -258,11 +258,11 @@ void mme_s11_handle_delete_session_response(
|
|||
}
|
||||
} else if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_registered)) {
|
||||
mme_bearer_t *bearer = mme_default_bearer_in_sess(sess);
|
||||
ogs_assert(bearer);
|
||||
ogs_expect(bearer);
|
||||
|
||||
if (OGS_FSM_CHECK(&bearer->sm, esm_state_pdn_will_disconnect)) {
|
||||
rv = nas_send_deactivate_bearer_context_request(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
/*
|
||||
* mme_sess_remove() should not be called here.
|
||||
|
@ -393,7 +393,7 @@ void mme_s11_handle_create_bearer_request(
|
|||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
/* Bearer QoS */
|
||||
ogs_assert(ogs_gtp_parse_bearer_qos(&bearer_qos,
|
||||
ogs_expect(ogs_gtp_parse_bearer_qos(&bearer_qos,
|
||||
&req->bearer_contexts.bearer_level_qos) ==
|
||||
req->bearer_contexts.bearer_level_qos.len);
|
||||
bearer->qos.qci = bearer_qos.qci;
|
||||
|
@ -415,7 +415,7 @@ void mme_s11_handle_create_bearer_request(
|
|||
|
||||
/* Before Activate DEDICATED bearer, we'll check DEFAULT bearer status */
|
||||
default_bearer = mme_default_bearer_in_sess(sess);
|
||||
ogs_assert(default_bearer);
|
||||
ogs_expect_or_return(default_bearer);
|
||||
|
||||
if (/* Check if Activate Default Bearer Accept is received */
|
||||
OGS_FSM_CHECK(&default_bearer->sm, esm_state_active) &&
|
||||
|
@ -423,7 +423,7 @@ void mme_s11_handle_create_bearer_request(
|
|||
* E-RAB Setup Response is received */
|
||||
MME_HAVE_ENB_S1U_PATH(default_bearer)) {
|
||||
rv = nas_send_activate_dedicated_bearer_context_request(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ void mme_s11_handle_update_bearer_request(
|
|||
if (mme_ue && cause_value == OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
|
||||
bearer = mme_bearer_find_by_ue_ebi(mme_ue,
|
||||
req->bearer_contexts.eps_bearer_id.u8);
|
||||
ogs_assert(bearer);
|
||||
ogs_expect_or_return(bearer);
|
||||
}
|
||||
|
||||
if (!bearer) {
|
||||
|
@ -482,7 +482,7 @@ void mme_s11_handle_update_bearer_request(
|
|||
MME_HAVE_ENB_S1U_PATH(bearer)) {
|
||||
if (req->bearer_contexts.bearer_level_qos.presence == 1) {
|
||||
/* Bearer QoS */
|
||||
ogs_assert(ogs_gtp_parse_bearer_qos(&bearer_qos,
|
||||
ogs_expect(ogs_gtp_parse_bearer_qos(&bearer_qos,
|
||||
&req->bearer_contexts.bearer_level_qos) ==
|
||||
req->bearer_contexts.bearer_level_qos.len);
|
||||
bearer->qos.qci = bearer_qos.qci;
|
||||
|
@ -508,12 +508,12 @@ void mme_s11_handle_update_bearer_request(
|
|||
bearer,
|
||||
req->bearer_contexts.bearer_level_qos.presence,
|
||||
req->bearer_contexts.tft.presence);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_warn("[IGNORE] Update Bearer Request : "
|
||||
"Both QoS and TFT is NULL");
|
||||
rv = mme_gtp_send_update_bearer_response(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
} else {
|
||||
if (!OGS_FSM_CHECK(&bearer->sm, esm_state_active)) {
|
||||
|
@ -541,11 +541,11 @@ void mme_s11_handle_delete_bearer_request(
|
|||
if (mme_ue && req->linked_eps_bearer_id.presence == 1) {
|
||||
bearer = mme_bearer_find_by_ue_ebi(
|
||||
mme_ue, req->linked_eps_bearer_id.u8);
|
||||
ogs_assert(bearer);
|
||||
ogs_expect(bearer);
|
||||
} else if (mme_ue && req->eps_bearer_ids.presence == 1) {
|
||||
bearer = mme_bearer_find_by_ue_ebi(
|
||||
mme_ue, req->eps_bearer_ids.u8);
|
||||
ogs_assert(bearer);
|
||||
ogs_expect(bearer);
|
||||
} else {
|
||||
ogs_error("No Linked EBI or EPS Bearer ID");
|
||||
ogs_gtp_send_error_message(xact, mme_ue ? mme_ue->sgw_s11_teid : 0,
|
||||
|
@ -560,6 +560,8 @@ void mme_s11_handle_delete_bearer_request(
|
|||
ogs_debug(" MME_S11_TEID[%d] SGW_S11_TEID[%d]",
|
||||
mme_ue->mme_s11_teid, mme_ue->sgw_s11_teid);
|
||||
|
||||
ogs_expect_or_return(bearer);
|
||||
|
||||
/* Save Transaction. will be handled after EMM-attached */
|
||||
bearer->xact = xact;
|
||||
|
||||
|
@ -569,7 +571,7 @@ void mme_s11_handle_delete_bearer_request(
|
|||
* E-RAB Setup Response is received */
|
||||
MME_HAVE_ENB_S1U_PATH(bearer)) {
|
||||
rv = nas_send_deactivate_bearer_context_request(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
if (!OGS_FSM_CHECK(&bearer->sm, esm_state_active)) {
|
||||
ogs_assert_if_reached();
|
||||
|
@ -601,7 +603,7 @@ void mme_s11_handle_release_access_bearers_response(
|
|||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
if (rsp->cause.presence) {
|
||||
ogs_gtp_cause_t *cause = rsp->cause.data;
|
||||
|
@ -621,7 +623,7 @@ void mme_s11_handle_release_access_bearers_response(
|
|||
}
|
||||
|
||||
rv = CLEAR_BEARER_CONTEXT(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
enb_ue = mme_ue->enb_ue;
|
||||
if (enb_ue) {
|
||||
|
@ -671,13 +673,13 @@ void mme_s11_handle_downlink_data_notification(
|
|||
h.teid = mme_ue->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_downlink_data_notification_ack(&s11buf, h.type);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
rv = ogs_gtp_xact_update_tx(xact, &h, s11buf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
|
||||
|
@ -705,7 +707,7 @@ void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
|
|||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
if (rsp->cause.presence) {
|
||||
ogs_gtp_cause_t *cause = rsp->cause.data;
|
||||
|
@ -734,7 +736,9 @@ void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
|
|||
|
||||
bearer = mme_bearer_find_by_ue_ebi(mme_ue,
|
||||
bearers[i]->eps_bearer_id.u8);
|
||||
ogs_assert(bearer);
|
||||
ogs_expect(bearer);
|
||||
if (!bearer)
|
||||
continue;
|
||||
|
||||
if (bearers[i]->s4_u_sgsn_f_teid.presence) {
|
||||
teid = bearers[i]->s4_u_sgsn_f_teid.data;
|
||||
|
@ -742,7 +746,7 @@ void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
|
|||
|
||||
bearer->sgw_dl_teid = ntohl(teid->teid);
|
||||
rv = ogs_gtp_f_teid_to_ip(teid, &bearer->sgw_dl_ip);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
if (bearers[i]->s2b_u_epdg_f_teid_5.presence) {
|
||||
teid = bearers[i]->s2b_u_epdg_f_teid_5.data;
|
||||
|
@ -750,7 +754,7 @@ void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
|
|||
|
||||
bearer->sgw_ul_teid = ntohl(teid->teid);
|
||||
rv = ogs_gtp_f_teid_to_ip(teid, &bearer->sgw_ul_ip);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -758,7 +762,7 @@ void mme_s11_handle_create_indirect_data_forwarding_tunnel_response(
|
|||
ogs_assert(source_ue);
|
||||
|
||||
rv = s1ap_send_handover_command(source_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
void mme_s11_handle_delete_indirect_data_forwarding_tunnel_response(
|
||||
|
@ -780,7 +784,7 @@ void mme_s11_handle_delete_indirect_data_forwarding_tunnel_response(
|
|||
}
|
||||
|
||||
rv = ogs_gtp_xact_commit(xact);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
if (rsp->cause.presence) {
|
||||
ogs_gtp_cause_t *cause = rsp->cause.data;
|
||||
|
@ -800,5 +804,5 @@ void mme_s11_handle_delete_indirect_data_forwarding_tunnel_response(
|
|||
mme_ue->mme_s11_teid, mme_ue->sgw_s11_teid);
|
||||
|
||||
rv = mme_ue_clear_indirect_tunnel(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ void mme_s6a_handle_aia(mme_ue_t *mme_ue,
|
|||
CLEAR_MME_UE_TIMER(mme_ue->t3460);
|
||||
|
||||
rv = nas_send_authentication_request(mme_ue, e_utran_vector);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
void mme_s6a_handle_ula(mme_ue_t *mme_ue,
|
||||
|
|
|
@ -246,7 +246,7 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
rv = s1ap_send_error_indication(
|
||||
enb, NULL, NULL, S1AP_Cause_PR_protocol,
|
||||
S1AP_CauseProtocol_abstract_syntax_error_falsely_constructed_message);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
ogs_s1ap_free(&s1ap_message);
|
||||
|
@ -268,7 +268,11 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_assert(enb_ue);
|
||||
pkbuf = e->pkbuf;
|
||||
ogs_assert(pkbuf);
|
||||
ogs_assert(ogs_nas_emm_decode(&nas_message, pkbuf) == OGS_OK);
|
||||
if (ogs_nas_emm_decode(&nas_message, pkbuf) != OGS_OK) {
|
||||
ogs_expect(0);
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
mme_ue = enb_ue->mme_ue;
|
||||
if (!mme_ue) {
|
||||
|
@ -290,7 +294,11 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
* So, we disabled 'ciphered'
|
||||
* not to decrypt NAS message */
|
||||
h.ciphered = 0;
|
||||
ogs_assert(nas_security_decode(mme_ue, h, pkbuf) == OGS_OK);
|
||||
if (nas_security_decode(mme_ue, h, pkbuf) != OGS_OK) {
|
||||
ogs_expect(0);
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -334,7 +342,11 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
|
||||
pkbuf = e->pkbuf;
|
||||
ogs_assert(pkbuf);
|
||||
ogs_assert(ogs_nas_esm_decode(&nas_message, pkbuf) == OGS_OK);
|
||||
if (ogs_nas_esm_decode(&nas_message, pkbuf) != OGS_OK) {
|
||||
ogs_expect(0);
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
break;
|
||||
}
|
||||
|
||||
bearer = mme_bearer_find_or_add_by_message(mme_ue, &nas_message);
|
||||
if (!bearer) {
|
||||
|
@ -346,7 +358,11 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
sess = bearer->sess;
|
||||
ogs_assert(sess);
|
||||
default_bearer = mme_default_bearer_in_sess(sess);
|
||||
ogs_assert(default_bearer);
|
||||
ogs_expect(default_bearer);
|
||||
if (!default_bearer) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
break;
|
||||
}
|
||||
|
||||
e->bearer = bearer;
|
||||
e->nas_message = &nas_message;
|
||||
|
@ -431,7 +447,7 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
if (mme_ue->nas_eps.type == MME_EPS_TYPE_ATTACH_REQUEST) {
|
||||
rv = nas_send_emm_to_esm(mme_ue,
|
||||
&mme_ue->pdn_connectivity_request);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_fatal("Invalid Type[%d]", mme_ue->nas_eps.type);
|
||||
ogs_assert_if_reached();
|
||||
|
@ -441,12 +457,12 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
if (mme_ue->nas_eps.type == MME_EPS_TYPE_TAU_REQUEST) {
|
||||
rv = nas_send_tau_accept(mme_ue,
|
||||
S1AP_ProcedureCode_id_InitialContextSetup);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else if (mme_ue->nas_eps.type ==
|
||||
MME_EPS_TYPE_SERVICE_REQUEST) {
|
||||
rv = s1ap_send_initial_context_setup_request(
|
||||
mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_fatal("Invalid Type[%d]", mme_ue->nas_eps.type);
|
||||
ogs_assert_if_reached();
|
||||
|
|
|
@ -54,7 +54,7 @@ int nas_send_emm_to_esm(mme_ue_t *mme_ue,
|
|||
ogs_pkbuf_put_data(esmbuf,
|
||||
esm_message_container->buffer, esm_message_container->length);
|
||||
|
||||
ogs_assert(s1ap_send_to_esm(mme_ue, esmbuf) == OGS_OK);
|
||||
ogs_expect(s1ap_send_to_esm(mme_ue, esmbuf) == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -74,10 +74,10 @@ int nas_send_to_downlink_nas_transport(mme_ue_t *mme_ue, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
} else {
|
||||
rv = s1ap_build_downlink_nas_transport(&s1apbuf, enb_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
|
@ -100,16 +100,16 @@ int nas_send_attach_accept(mme_ue_t *mme_ue)
|
|||
ogs_assert(mme_bearer_next(bearer) == NULL);
|
||||
|
||||
rv = esm_build_activate_default_bearer_context_request(&esmbuf, sess);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
|
||||
rv = emm_build_attach_accept(&emmbuf, mme_ue, esmbuf);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
|
||||
rv = s1ap_build_initial_context_setup_request(&s1apbuf, mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -129,13 +129,13 @@ void nas_send_attach_reject(mme_ue_t *mme_ue,
|
|||
sess = mme_sess_first(mme_ue);
|
||||
if (sess) {
|
||||
rv = esm_build_pdn_connectivity_reject(&esmbuf, sess, esm_cause);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
}
|
||||
|
||||
rv = emm_build_attach_reject(&emmbuf, emm_cause, esmbuf);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
int nas_send_identity_request(mme_ue_t *mme_ue)
|
||||
|
@ -152,7 +152,7 @@ int nas_send_identity_request(mme_ue_t *mme_ue)
|
|||
|
||||
} else {
|
||||
rv = emm_build_identity_request(&emmbuf, mme_ue);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
}
|
||||
|
||||
mme_ue->t3470.pkbuf = ogs_pkbuf_copy(emmbuf);
|
||||
|
@ -160,7 +160,7 @@ int nas_send_identity_request(mme_ue_t *mme_ue)
|
|||
mme_timer_cfg(MME_TIMER_T3470)->duration);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ int nas_send_authentication_request(
|
|||
} else {
|
||||
ogs_assert(e_utran_vector);
|
||||
rv = emm_build_authentication_request(&emmbuf, e_utran_vector);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
}
|
||||
|
||||
mme_ue->t3460.pkbuf = ogs_pkbuf_copy(emmbuf);
|
||||
|
@ -190,7 +190,7 @@ int nas_send_authentication_request(
|
|||
mme_timer_cfg(MME_TIMER_T3460)->duration);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ int nas_send_security_mode_command(mme_ue_t *mme_ue)
|
|||
|
||||
} else {
|
||||
rv = emm_build_security_mode_command(&emmbuf, mme_ue);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
}
|
||||
|
||||
mme_ue->t3460.pkbuf = ogs_pkbuf_copy(emmbuf);
|
||||
|
@ -218,7 +218,7 @@ int nas_send_security_mode_command(mme_ue_t *mme_ue)
|
|||
mme_timer_cfg(MME_TIMER_T3460)->duration);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -234,10 +234,10 @@ int nas_send_authentication_reject(mme_ue_t *mme_ue)
|
|||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
||||
rv = emm_build_authentication_reject(&emmbuf);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -255,10 +255,10 @@ void nas_send_detach_accept(mme_ue_t *mme_ue)
|
|||
if (mme_ue->nas_eps.detach.switch_off == 0) {
|
||||
int rv;
|
||||
rv = emm_build_detach_accept(&emmbuf, mme_ue);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
s1ap_send_ue_context_release_command(enb_ue,
|
||||
|
@ -280,10 +280,10 @@ int nas_send_pdn_connectivity_reject(
|
|||
|
||||
if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_registered)) {
|
||||
rv = esm_build_pdn_connectivity_reject(&esmbuf, sess, esm_cause);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, esmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
/* During the UE-attach process, we'll send Attach-Reject
|
||||
* with pyggybacking PDN-connectivity-Reject */
|
||||
|
@ -308,7 +308,7 @@ int nas_send_esm_information_request(mme_bearer_t *bearer)
|
|||
esmbuf = bearer->t3489.pkbuf;
|
||||
} else {
|
||||
rv = esm_build_information_request(&esmbuf, bearer);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
}
|
||||
|
||||
bearer->t3489.pkbuf = ogs_pkbuf_copy(esmbuf);
|
||||
|
@ -316,7 +316,7 @@ int nas_send_esm_information_request(mme_bearer_t *bearer)
|
|||
mme_timer_cfg(MME_TIMER_T3489)->duration);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, esmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -336,13 +336,13 @@ int nas_send_activate_default_bearer_context_request(mme_bearer_t *bearer)
|
|||
ogs_assert(mme_ue);
|
||||
|
||||
rv = esm_build_activate_default_bearer_context_request(&esmbuf, sess);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
|
||||
rv = s1ap_build_e_rab_setup_request(&s1apbuf, bearer, esmbuf);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -360,13 +360,13 @@ int nas_send_activate_dedicated_bearer_context_request(
|
|||
ogs_assert(mme_ue);
|
||||
|
||||
rv = esm_build_activate_dedicated_bearer_context_request(&esmbuf, bearer);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
|
||||
rv = s1ap_build_e_rab_setup_request(&s1apbuf, bearer, esmbuf);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ int nas_send_activate_all_dedicated_bearers(mme_bearer_t *default_bearer)
|
|||
while (dedicated_bearer) {
|
||||
rv = nas_send_activate_dedicated_bearer_context_request(
|
||||
dedicated_bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
dedicated_bearer = mme_bearer_next(dedicated_bearer);
|
||||
}
|
||||
|
@ -403,17 +403,17 @@ int nas_send_modify_bearer_context_request(
|
|||
|
||||
rv = esm_build_modify_bearer_context_request(
|
||||
&esmbuf, bearer, qos_presence, tft_presence);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
|
||||
if (qos_presence == 1) {
|
||||
rv = s1ap_build_e_rab_modify_request(&s1apbuf, bearer, esmbuf);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, esmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
|
@ -432,14 +432,14 @@ int nas_send_deactivate_bearer_context_request(mme_bearer_t *bearer)
|
|||
|
||||
rv = esm_build_deactivate_bearer_context_request(
|
||||
&esmbuf, bearer, ESM_CAUSE_REGULAR_DEACTIVATION);
|
||||
ogs_assert(rv == OGS_OK && esmbuf);
|
||||
ogs_expect(rv == OGS_OK && esmbuf);
|
||||
|
||||
rv = s1ap_build_e_rab_release_command(&s1apbuf, bearer, esmbuf,
|
||||
S1AP_Cause_PR_nas, S1AP_CauseNas_normal_release);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -456,18 +456,18 @@ int nas_send_tau_accept(
|
|||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
||||
rv = emm_build_tau_accept(&emmbuf, mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
if (procedureCode == S1AP_ProcedureCode_id_InitialContextSetup) {
|
||||
ogs_pkbuf_t *s1apbuf = NULL;
|
||||
rv = s1ap_build_initial_context_setup_request(&s1apbuf, mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else if (procedureCode == S1AP_ProcedureCode_id_downlinkNASTransport) {
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
|
@ -483,10 +483,10 @@ int nas_send_tau_reject(mme_ue_t *mme_ue, ogs_nas_emm_cause_t emm_cause)
|
|||
|
||||
/* Build TAU reject */
|
||||
rv = emm_build_tau_reject(&emmbuf, emm_cause, mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -501,10 +501,10 @@ void nas_send_service_reject(mme_ue_t *mme_ue,
|
|||
|
||||
/* Build Service Reject */
|
||||
rv = emm_build_service_reject(&emmbuf, emm_cause, mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
int nas_send_cs_service_notification(mme_ue_t *mme_ue)
|
||||
|
@ -518,10 +518,10 @@ int nas_send_cs_service_notification(mme_ue_t *mme_ue)
|
|||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
||||
rv = emm_build_cs_service_notification(&emmbuf, mme_ue);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -540,10 +540,10 @@ int nas_send_downlink_nas_transport(
|
|||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
||||
rv = emm_build_downlink_nas_transport(&emmbuf, mme_ue, buffer, length);
|
||||
ogs_assert(rv == OGS_OK && emmbuf);
|
||||
ogs_expect(rv == OGS_OK && emmbuf);
|
||||
|
||||
rv = nas_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,10 @@ int nas_security_encode(
|
|||
h.protocol_discriminator = message->h.protocol_discriminator;
|
||||
h.sequence_number = (mme_ue->dl_count & 0xff);
|
||||
|
||||
ogs_assert(ogs_nas_plain_encode(&new, message) == OGS_OK);
|
||||
if (ogs_nas_plain_encode(&new, message) != OGS_OK) {
|
||||
ogs_error("Error encoding plaintext NAS");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
if (ciphered) {
|
||||
/* encrypt NAS message */
|
||||
|
|
|
@ -1396,9 +1396,13 @@ int s1ap_build_mme_configuration_transfer(
|
|||
|
||||
SONConfigurationTransfer = &ie->value.choice.SONConfigurationTransfer;
|
||||
|
||||
#if 0
|
||||
rv = ogs_s1ap_copy_ie(&asn_DEF_S1AP_SONConfigurationTransfer,
|
||||
son_configuration_transfer, SONConfigurationTransfer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
#else
|
||||
memcpy(SONConfigurationTransfer, son_configuration_transfer, sizeof(*SONConfigurationTransfer));
|
||||
#endif
|
||||
|
||||
rv = ogs_s1ap_encode(s1apbuf, &pdu);
|
||||
ogs_s1ap_free(&pdu);
|
||||
|
|
|
@ -160,7 +160,7 @@ void s1ap_handle_s1_setup_request(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
|||
&s1apbuf, group, cause, S1AP_TimeToWait_v10s) == OGS_OK);
|
||||
}
|
||||
|
||||
ogs_assert(
|
||||
ogs_expect(
|
||||
s1ap_send_to_enb(enb, s1apbuf, S1AP_NON_UE_SIGNALLING) == OGS_OK);
|
||||
}
|
||||
|
||||
|
@ -300,8 +300,7 @@ void s1ap_handle_initial_ue_message(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
|||
ogs_debug(" ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d] TAC[%d]",
|
||||
enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id, enb_ue->saved.tai.tac);
|
||||
|
||||
ogs_assert(s1ap_send_to_nas(enb_ue,
|
||||
S1AP_ProcedureCode_id_initialUEMessage, NAS_PDU) == OGS_OK);
|
||||
s1ap_send_to_nas(enb_ue, S1AP_ProcedureCode_id_initialUEMessage, NAS_PDU);
|
||||
}
|
||||
|
||||
void s1ap_handle_uplink_nas_transport(
|
||||
|
@ -354,8 +353,7 @@ void s1ap_handle_uplink_nas_transport(
|
|||
ogs_debug(" ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]",
|
||||
enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
|
||||
|
||||
ogs_assert(s1ap_send_to_nas(enb_ue,
|
||||
S1AP_ProcedureCode_id_uplinkNASTransport, NAS_PDU) == OGS_OK);
|
||||
s1ap_send_to_nas(enb_ue, S1AP_ProcedureCode_id_uplinkNASTransport, NAS_PDU);
|
||||
}
|
||||
|
||||
void s1ap_handle_ue_capability_info_indication(
|
||||
|
@ -506,7 +504,7 @@ void s1ap_handle_initial_context_setup_response(
|
|||
uli_presence = 1;
|
||||
}
|
||||
rv = mme_gtp_send_modify_bearer_request(bearer, uli_presence);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -803,10 +801,10 @@ void s1ap_handle_e_rab_setup_response(
|
|||
|
||||
if (bearer->ebi == linked_bearer->ebi) {
|
||||
rv = mme_gtp_send_modify_bearer_request(bearer, 0);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
rv = mme_gtp_send_create_bearer_response(bearer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -870,7 +868,7 @@ void s1ap_handle_ue_context_release_request(
|
|||
MME_UE_S1AP_ID, ENB_UE_S1AP_ID,
|
||||
S1AP_Cause_PR_radioNetwork,
|
||||
S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -949,7 +947,7 @@ void s1ap_handle_ue_context_release_complete(
|
|||
MME_UE_S1AP_ID, NULL,
|
||||
S1AP_Cause_PR_radioNetwork,
|
||||
S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -983,13 +981,13 @@ void s1ap_handle_ue_context_release_complete(
|
|||
if (mme_ue_have_indirect_tunnel(mme_ue)) {
|
||||
rv = mme_gtp_send_delete_indirect_data_forwarding_tunnel_request(
|
||||
mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_warn("Check your eNodeB");
|
||||
ogs_warn(" There is no INDIRECT TUNNEL");
|
||||
ogs_warn(" Packet could be dropped during S1-Handover");
|
||||
rv = mme_ue_clear_indirect_tunnel(mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1098,10 +1096,10 @@ void s1ap_handle_path_switch_request(
|
|||
*ENB_UE_S1AP_ID, *MME_UE_S1AP_ID,
|
||||
S1AP_Cause_PR_radioNetwork,
|
||||
S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb(enb, s1apbuf, S1AP_NON_UE_SIGNALLING);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1118,10 +1116,10 @@ void s1ap_handle_path_switch_request(
|
|||
rv = s1ap_build_path_switch_failure(&s1apbuf,
|
||||
*ENB_UE_S1AP_ID, *MME_UE_S1AP_ID,
|
||||
S1AP_Cause_PR_nas, S1AP_CauseNas_authentication_failure);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb_ue(enb_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1187,13 +1185,13 @@ void s1ap_handle_path_switch_request(
|
|||
bearer->enb_s1u_teid = ntohl(bearer->enb_s1u_teid);
|
||||
rv = ogs_s1ap_BIT_STRING_to_ip(
|
||||
&e_rab->transportLayerAddress, &bearer->enb_s1u_ip);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
GTP_COUNTER_INCREMENT(
|
||||
mme_ue, GTP_COUNTER_MODIFY_BEARER_BY_PATH_SWITCH);
|
||||
|
||||
rv = mme_gtp_send_modify_bearer_request(bearer, 1);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
/* Switch to enb */
|
||||
|
@ -1283,7 +1281,7 @@ void s1ap_handle_enb_configuration_transfer(
|
|||
|
||||
rv = s1ap_send_mme_configuration_transfer(
|
||||
target_enb, SONConfigurationTransfer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1388,7 +1386,7 @@ void s1ap_handle_handover_required(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
|||
ogs_assert(Cause);
|
||||
|
||||
rv = s1ap_send_handover_preparation_failure(source_ue, Cause);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1400,7 +1398,7 @@ void s1ap_handle_handover_required(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
|||
ENB_UE_S1AP_ID, MME_UE_S1AP_ID,
|
||||
HandoverType, Cause,
|
||||
Source_ToTarget_TransparentContainer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
void s1ap_handle_handover_request_ack(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
||||
|
@ -1528,10 +1526,10 @@ void s1ap_handle_handover_request_ack(mme_enb_t *enb, ogs_s1ap_message_t *messag
|
|||
if (mme_ue_have_indirect_tunnel(mme_ue) == 1) {
|
||||
rv = mme_gtp_send_create_indirect_data_forwarding_tunnel_request(
|
||||
mme_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
rv = s1ap_send_handover_command(source_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1593,7 +1591,7 @@ void s1ap_handle_handover_failure(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
|||
target_ue->enb_ue_s1ap_id, target_ue->mme_ue_s1ap_id);
|
||||
|
||||
rv = s1ap_send_handover_preparation_failure(source_ue, Cause);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
s1ap_send_ue_context_release_command(
|
||||
target_ue, S1AP_Cause_PR_radioNetwork,
|
||||
|
@ -1664,7 +1662,7 @@ void s1ap_handle_handover_cancel(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
|||
target_ue->enb_ue_s1ap_id, target_ue->mme_ue_s1ap_id);
|
||||
|
||||
rv = s1ap_send_handover_cancel_ack(source_ue);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
s1ap_send_ue_context_release_command(
|
||||
target_ue, S1AP_Cause_PR_radioNetwork,
|
||||
|
@ -1743,7 +1741,7 @@ void s1ap_handle_enb_status_transfer(mme_enb_t *enb, ogs_s1ap_message_t *message
|
|||
|
||||
rv = s1ap_send_mme_status_transfer(target_ue,
|
||||
ENB_StatusTransfer_TransparentContainer);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
void s1ap_handle_handover_notification(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
||||
|
@ -1875,7 +1873,7 @@ void s1ap_handle_handover_notification(mme_enb_t *enb, ogs_s1ap_message_t *messa
|
|||
mme_ue, GTP_COUNTER_MODIFY_BEARER_BY_HANDOVER_NOTIFY);
|
||||
|
||||
rv = mme_gtp_send_modify_bearer_request(bearer, 1);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
bearer = mme_bearer_next(bearer);
|
||||
}
|
||||
|
@ -1997,7 +1995,7 @@ void s1ap_handle_s1_reset(
|
|||
}
|
||||
|
||||
rv = s1ap_send_s1_reset_ack(enb, partOfS1_Interface);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
void s1ap_handle_write_replace_warning_response(
|
||||
|
|
|
@ -185,23 +185,27 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
|
|||
break;
|
||||
case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED:
|
||||
security_header_type.integrity_protected = 1;
|
||||
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
|
||||
if (!ogs_pkbuf_pull(nasbuf, 6))
|
||||
return OGS_ERROR;
|
||||
break;
|
||||
case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHERED:
|
||||
security_header_type.integrity_protected = 1;
|
||||
security_header_type.ciphered = 1;
|
||||
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
|
||||
if (!ogs_pkbuf_pull(nasbuf, 6))
|
||||
return OGS_ERROR;
|
||||
break;
|
||||
case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_NEW_SECURITY_CONTEXT:
|
||||
security_header_type.integrity_protected = 1;
|
||||
security_header_type.new_security_context = 1;
|
||||
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
|
||||
if (!ogs_pkbuf_pull(nasbuf, 6))
|
||||
return OGS_ERROR;
|
||||
break;
|
||||
case OGS_NAS_SECURITY_HEADER_INTEGRITY_PROTECTED_AND_CIPHTERD_WITH_NEW_INTEGRITY_CONTEXT:
|
||||
security_header_type.integrity_protected = 1;
|
||||
security_header_type.ciphered = 1;
|
||||
security_header_type.new_security_context = 1;
|
||||
ogs_assert(ogs_pkbuf_pull(nasbuf, 6));
|
||||
if (!ogs_pkbuf_pull(nasbuf, 6))
|
||||
return OGS_ERROR;
|
||||
break;
|
||||
default:
|
||||
ogs_error("Not implemented(securiry header type:0x%x)",
|
||||
|
@ -210,8 +214,9 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
|
|||
}
|
||||
|
||||
if (enb_ue->mme_ue) {
|
||||
ogs_assert(nas_security_decode(
|
||||
enb_ue->mme_ue, security_header_type, nasbuf) == OGS_OK);
|
||||
if (nas_security_decode(enb_ue->mme_ue, security_header_type, nasbuf) != OGS_OK) {
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
h = (ogs_nas_emm_header_t *)nasbuf->data;
|
||||
|
@ -234,8 +239,11 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
|
|||
mme_ue_t *mme_ue = enb_ue->mme_ue;
|
||||
ogs_assert(mme_ue);
|
||||
s1ap_send_to_esm(mme_ue, nasbuf);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
} else {
|
||||
ogs_error("Unknown/Unimplemented NAS Protocol discriminator 0x%02x",
|
||||
h->protocol_discriminator);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -248,10 +256,10 @@ int s1ap_send_initial_context_setup_request(mme_ue_t *mme_ue)
|
|||
ogs_assert(mme_ue);
|
||||
|
||||
rv = s1ap_build_initial_context_setup_request(&s1apbuf, mme_ue, NULL);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -264,10 +272,10 @@ int s1ap_send_ue_context_modification_request(mme_ue_t *mme_ue)
|
|||
ogs_assert(mme_ue);
|
||||
|
||||
rv = s1ap_build_ue_context_modification_request(&s1apbuf, mme_ue);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -294,10 +302,10 @@ void s1ap_send_ue_context_release_command(
|
|||
|
||||
rv = s1ap_build_ue_context_release_command(
|
||||
&s1apbuf, enb_ue, group, cause);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_delayed_send_to_enb_ue(enb_ue, s1apbuf, delay);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
} else {
|
||||
ogs_assert(action != S1AP_UE_CTX_REL_INVALID_ACTION);
|
||||
enb_ue->ue_ctx_rel_action = action;
|
||||
|
@ -310,7 +318,7 @@ void s1ap_send_ue_context_release_command(
|
|||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_delayed_send_to_enb_ue(enb_ue, s1apbuf, 0);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -332,13 +340,13 @@ void s1ap_send_paging(mme_ue_t *mme_ue, S1AP_CNDomain_t cn_domain)
|
|||
s1apbuf = mme_ue->t3413.pkbuf;
|
||||
} else {
|
||||
rv = s1ap_build_paging(&s1apbuf, mme_ue, cn_domain);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
}
|
||||
|
||||
mme_ue->t3413.pkbuf = ogs_pkbuf_copy(s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb(enb, s1apbuf, S1AP_NON_UE_SIGNALLING);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -360,10 +368,10 @@ int s1ap_send_mme_configuration_transfer(
|
|||
|
||||
rv = s1ap_build_mme_configuration_transfer(
|
||||
&s1apbuf, SONConfigurationTransfer);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb(target_enb, s1apbuf, S1AP_NON_UE_SIGNALLING);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -376,10 +384,10 @@ int s1ap_send_path_switch_ack(mme_ue_t *mme_ue)
|
|||
ogs_assert(mme_ue);
|
||||
|
||||
rv = s1ap_build_path_switch_ack(&s1apbuf, mme_ue);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = nas_send_to_enb(mme_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -392,10 +400,10 @@ int s1ap_send_handover_command(enb_ue_t *source_ue)
|
|||
ogs_assert(source_ue);
|
||||
|
||||
rv = s1ap_build_handover_command(&s1apbuf, source_ue);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb_ue(source_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -410,10 +418,10 @@ int s1ap_send_handover_preparation_failure(
|
|||
ogs_assert(cause);
|
||||
|
||||
rv = s1ap_build_handover_preparation_failure(&s1apbuf, source_ue, cause);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb_ue(source_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -426,10 +434,10 @@ int s1ap_send_handover_cancel_ack(enb_ue_t *source_ue)
|
|||
ogs_assert(source_ue);
|
||||
|
||||
rv = s1ap_build_handover_cancel_ack(&s1apbuf, source_ue);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb_ue(source_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -473,10 +481,10 @@ int s1ap_send_handover_request(
|
|||
enb_ue_s1ap_id, mme_ue_s1ap_id,
|
||||
handovertype, cause,
|
||||
source_totarget_transparentContainer);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb_ue(target_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -493,10 +501,10 @@ int s1ap_send_mme_status_transfer(
|
|||
|
||||
rv = s1ap_build_mme_status_transfer(&s1apbuf, target_ue,
|
||||
enb_statustransfer_transparentContainer);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb_ue(target_ue, s1apbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -514,10 +522,10 @@ int s1ap_send_error_indication(
|
|||
|
||||
rv = s1ap_build_error_indication(&s1apbuf,
|
||||
mme_ue_s1ap_id, enb_ue_s1ap_id, group, cause);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb(enb, s1apbuf, S1AP_NON_UE_SIGNALLING);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -532,10 +540,10 @@ int s1ap_send_s1_reset_ack(
|
|||
ogs_assert(enb);
|
||||
|
||||
rv = s1ap_build_s1_reset_ack(&s1apbuf, partOfS1_Interface);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
rv = s1ap_send_to_enb(enb, s1apbuf, S1AP_NON_UE_SIGNALLING);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ void s1ap_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
|||
ogs_assert(e->enb_ue);
|
||||
ogs_assert(e->pkbuf);
|
||||
|
||||
ogs_assert(OGS_OK == s1ap_send_to_enb_ue(e->enb_ue, e->pkbuf));
|
||||
ogs_expect(OGS_OK == s1ap_send_to_enb_ue(e->enb_ue, e->pkbuf));
|
||||
ogs_timer_delete(e->timer);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -51,10 +51,10 @@ void sbc_handle_write_replace_warning_request(sbc_pws_data_t *sbc_pws)
|
|||
|
||||
/* Buidl S1AP Write Replace Warning Request message */
|
||||
rv = s1ap_build_write_replace_warning_request(&s1apbuf, sbc_pws);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
/* Send to enb */
|
||||
ogs_assert(s1ap_send_to_enb(
|
||||
ogs_expect(s1ap_send_to_enb(
|
||||
enb, s1apbuf, S1AP_NON_UE_SIGNALLING) == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
@ -89,10 +89,10 @@ void sbc_handle_stop_warning_request(sbc_pws_data_t *sbc_pws)
|
|||
|
||||
/* Buidl S1AP Kill request message */
|
||||
rv = s1ap_build_kill_request(&s1apbuf, sbc_pws);
|
||||
ogs_assert(rv == OGS_OK && s1apbuf);
|
||||
ogs_expect(rv == OGS_OK && s1apbuf);
|
||||
|
||||
/* Send to enb */
|
||||
ogs_assert(s1ap_send_to_enb(
|
||||
ogs_expect(s1ap_send_to_enb(
|
||||
enb, s1apbuf, S1AP_NON_UE_SIGNALLING) == OGS_OK);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,8 @@ void sgsap_handle_location_update_accept(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
ogs_pkbuf_pull(pkbuf, 1);
|
||||
|
||||
root = ogs_tlv_parse_block(pkbuf->len, pkbuf->data, OGS_TLV_MODE_T1_L1);
|
||||
ogs_assert(root);
|
||||
if (!root)
|
||||
goto error;
|
||||
|
||||
iter = root;
|
||||
while (iter) {
|
||||
|
@ -72,17 +73,20 @@ void sgsap_handle_location_update_accept(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
ogs_tlv_free_all(root);
|
||||
|
||||
ogs_assert(nas_mobile_identity_imsi && lai);
|
||||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
if (!nas_mobile_identity_imsi || !lai)
|
||||
goto error;
|
||||
if (nas_mobile_identity_imsi_len != SGSAP_IE_IMSI_LEN)
|
||||
goto error;
|
||||
|
||||
if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) {
|
||||
ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi,
|
||||
nas_mobile_identity_imsi_len, imsi_bcd);
|
||||
mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
goto error;
|
||||
|
||||
ogs_assert(mme_ue);
|
||||
if (!mme_ue)
|
||||
goto error;
|
||||
|
||||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
if (lai) {
|
||||
|
@ -132,7 +136,8 @@ void sgsap_handle_location_update_reject(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
ogs_pkbuf_pull(pkbuf, 1);
|
||||
|
||||
root = ogs_tlv_parse_block(pkbuf->len, pkbuf->data, OGS_TLV_MODE_T1_L1);
|
||||
ogs_assert(root);
|
||||
if (!root)
|
||||
goto error;
|
||||
|
||||
iter = root;
|
||||
while (iter) {
|
||||
|
@ -156,17 +161,19 @@ void sgsap_handle_location_update_reject(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
ogs_tlv_free_all(root);
|
||||
|
||||
ogs_assert(nas_mobile_identity_imsi && emm_cause);
|
||||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
if (!nas_mobile_identity_imsi || !emm_cause)
|
||||
goto error;
|
||||
if (nas_mobile_identity_imsi_len != SGSAP_IE_IMSI_LEN)
|
||||
goto error;
|
||||
|
||||
if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) {
|
||||
ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi,
|
||||
nas_mobile_identity_imsi_len, imsi_bcd);
|
||||
mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
} else
|
||||
goto error;
|
||||
|
||||
ogs_assert(mme_ue);
|
||||
ogs_expect_or_return(mme_ue);
|
||||
|
||||
ogs_debug(" IMSI[%s] CAUSE[%d]", mme_ue->imsi_bcd, emm_cause);
|
||||
if (lai) {
|
||||
|
@ -177,6 +184,12 @@ void sgsap_handle_location_update_reject(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
nas_send_attach_reject(mme_ue,
|
||||
emm_cause, ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED);
|
||||
mme_send_delete_session_or_mme_ue_context_release(mme_ue);
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
ogs_error("Error processing SGsAP LU REJECT");
|
||||
return;
|
||||
}
|
||||
|
||||
void sgsap_handle_detach_ack(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
||||
|
@ -199,12 +212,12 @@ void sgsap_handle_detach_ack(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
else if (type == SGSAP_IMSI_DETACH_ACK)
|
||||
ogs_debug("[SGSAP] IMSI-DETACH-ACK");
|
||||
else
|
||||
ogs_assert_if_reached();
|
||||
ogs_expect_or_return(0);
|
||||
|
||||
ogs_pkbuf_pull(pkbuf, 1);
|
||||
|
||||
root = ogs_tlv_parse_block(pkbuf->len, pkbuf->data, OGS_TLV_MODE_T1_L1);
|
||||
ogs_assert(root);
|
||||
ogs_expect_or_return(root);
|
||||
|
||||
iter = root;
|
||||
while (iter) {
|
||||
|
@ -222,17 +235,17 @@ void sgsap_handle_detach_ack(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
ogs_tlv_free_all(root);
|
||||
|
||||
ogs_assert(nas_mobile_identity_imsi);
|
||||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
|
||||
if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) {
|
||||
ogs_nas_imsi_to_bcd(nas_mobile_identity_imsi,
|
||||
nas_mobile_identity_imsi_len, imsi_bcd);
|
||||
mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
} else
|
||||
ogs_expect_or_return(0);
|
||||
|
||||
ogs_assert(mme_ue);
|
||||
ogs_expect_or_return(mme_ue);
|
||||
|
||||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
||||
|
@ -260,7 +273,7 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
ogs_pkbuf_pull(pkbuf, 1);
|
||||
|
||||
root = ogs_tlv_parse_block(pkbuf->len, pkbuf->data, OGS_TLV_MODE_T1_L1);
|
||||
ogs_assert(root);
|
||||
ogs_expect_or_return(root);
|
||||
|
||||
iter = root;
|
||||
while (iter) {
|
||||
|
@ -287,8 +300,8 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
ogs_tlv_free_all(root);
|
||||
|
||||
ogs_assert(nas_mobile_identity_imsi);
|
||||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
|
||||
if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) {
|
||||
|
||||
|
@ -296,7 +309,7 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
nas_mobile_identity_imsi_len, imsi_bcd);
|
||||
mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
ogs_expect_or_return(0);
|
||||
|
||||
if (mme_ue) {
|
||||
ogs_assert(service_indicator);
|
||||
|
@ -401,7 +414,7 @@ void sgsap_handle_downlink_unitdata(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
} else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
ogs_assert(mme_ue);
|
||||
ogs_expect_or_return(mme_ue);
|
||||
|
||||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
ogs_log_hexdump(OGS_LOG_DEBUG,
|
||||
|
@ -440,7 +453,7 @@ void sgsap_handle_release_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
ogs_pkbuf_pull(pkbuf, 1);
|
||||
|
||||
root = ogs_tlv_parse_block(pkbuf->len, pkbuf->data, OGS_TLV_MODE_T1_L1);
|
||||
ogs_assert(root);
|
||||
ogs_expect_or_return(root);
|
||||
|
||||
iter = root;
|
||||
while (iter) {
|
||||
|
@ -458,8 +471,8 @@ void sgsap_handle_release_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
ogs_tlv_free_all(root);
|
||||
|
||||
ogs_assert(nas_mobile_identity_imsi);
|
||||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
|
||||
if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) {
|
||||
|
||||
|
@ -467,7 +480,7 @@ void sgsap_handle_release_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
nas_mobile_identity_imsi_len, imsi_bcd);
|
||||
mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
ogs_expect_or_return(0);
|
||||
|
||||
if (mme_ue)
|
||||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
@ -494,7 +507,7 @@ void sgsap_handle_mm_information_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
ogs_pkbuf_pull(pkbuf, 1);
|
||||
|
||||
root = ogs_tlv_parse_block(pkbuf->len, pkbuf->data, OGS_TLV_MODE_T1_L1);
|
||||
ogs_assert(root);
|
||||
ogs_expect_or_return(root);
|
||||
|
||||
iter = root;
|
||||
while (iter) {
|
||||
|
@ -515,8 +528,8 @@ void sgsap_handle_mm_information_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
ogs_tlv_free_all(root);
|
||||
|
||||
ogs_assert(nas_mobile_identity_imsi);
|
||||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi);
|
||||
ogs_expect_or_return(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
|
||||
if (nas_mobile_identity_imsi->type == OGS_NAS_MOBILE_IDENTITY_IMSI) {
|
||||
|
||||
|
@ -524,7 +537,7 @@ void sgsap_handle_mm_information_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
nas_mobile_identity_imsi_len, imsi_bcd);
|
||||
mme_ue = mme_ue_find_by_imsi_bcd(imsi_bcd);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
ogs_expect_or_return(0);
|
||||
|
||||
if (mme_ue)
|
||||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
|
|
@ -133,7 +133,7 @@ int sgsap_send_location_update_request(mme_ue_t *mme_ue)
|
|||
|
||||
pkbuf = sgsap_build_location_update_request(mme_ue);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ int sgsap_send_tmsi_reallocation_complete(mme_ue_t *mme_ue)
|
|||
|
||||
pkbuf = sgsap_build_tmsi_reallocation_complete(mme_ue);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ int sgsap_send_detach_indication(mme_ue_t *mme_ue)
|
|||
|
||||
pkbuf = sgsap_build_detach_indication(mme_ue);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ int sgsap_send_mo_csfb_indication(mme_ue_t *mme_ue)
|
|||
|
||||
pkbuf = sgsap_build_mo_csfb_indication(mme_ue);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ int sgsap_send_service_request(mme_ue_t *mme_ue, uint8_t emm_mode)
|
|||
|
||||
pkbuf = sgsap_build_service_request(mme_ue, emm_mode);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ int sgsap_send_reset_ack(mme_vlr_t *vlr)
|
|||
|
||||
pkbuf = sgsap_build_reset_ack(vlr);
|
||||
rv = sgsap_send_to_vlr_with_sid(vlr, pkbuf, 0);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ int sgsap_send_uplink_unitdata(
|
|||
|
||||
pkbuf = sgsap_build_uplink_unidata(mme_ue, nas_message_container);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ int sgsap_send_ue_unreachable(mme_ue_t *mme_ue, uint8_t sgs_cause)
|
|||
|
||||
pkbuf = sgsap_build_ue_unreachable(mme_ue, sgs_cause);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ void sgsap_state_initial(ogs_fsm_t *s, mme_event_t *e)
|
|||
|
||||
vlr->t_conn = ogs_timer_add(mme_self()->timer_mgr,
|
||||
mme_timer_sgs_cli_conn_to_srv, vlr);
|
||||
ogs_assert(vlr->t_conn);
|
||||
ogs_expect_or_return(vlr->t_conn);
|
||||
|
||||
OGS_FSM_TRAN(s, &sgsap_state_will_connect);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue