introduce ECM_IDLE and ECM_CONNECTED

This commit is contained in:
Sukchan Lee 2018-02-03 23:23:50 +09:00
parent 95551de5f9
commit de04e1de45
5 changed files with 13 additions and 29 deletions

View File

@ -25,7 +25,6 @@ status_t emm_build_attach_accept(
&attach_accept->eps_network_feature_support;
d_assert(mme_ue, return CORE_ERROR, "Null param");
d_assert(mme_ue->enb_ue, return CORE_ERROR, "Null param");
d_assert(esmbuf, return CORE_ERROR, "Null param");
d_trace(3, "[EMM] Attach accept\n");

View File

@ -304,10 +304,10 @@ struct _mme_ue_t {
c_uint8_t ebi; /* EPS Bearer ID generator */
list_t sess_list;
#define ECM_IDLE(__mME) \
((__mME) && ((__mME)->enb_ue == NULL))
#define ECM_CONNECTED(__mME) \
((__mME) && ((__mME)->enb_ue != NULL))
((__mME) && ((__mME)->enb_ue != NULL) && \
enb_ue_find((__mME)->enb_ue->index))
#define ECM_IDLE(__mME) (!ECM_CONNECTED(__mME))
/* S1 UE context */
enb_ue_t *enb_ue;

View File

@ -275,19 +275,9 @@ void mme_state_operational(fsm_t *s, event_t *e)
/* If NAS(mme_ue_t) has already been associated with
* older S1(enb_ue_t) context */
if (mme_ue->enb_ue)
if (ECM_CONNECTED(mme_ue))
{
#if SEND_UE_CTX_REL_CMD_IMMEDIATELY
/* Send UE context release command to
* older S1 context immediately. */
d_trace(5, "OLD ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
mme_ue->enb_ue->enb_ue_s1ap_id,
mme_ue->enb_ue->mme_ue_s1ap_id);
rv = s1ap_send_ue_context_release_command(mme_ue->enb_ue,
S1ap_Cause_PR_nas, S1ap_CauseNas_normal_release,
S1AP_UE_CTX_REL_NO_ACTION, 0);
d_assert(rv == CORE_OK, return, "s1ap send error");
#elif IMPLICIT_S1_RELEASE
#if IMPLICIT_S1_RELEASE
/* Implcit S1 release */
d_warn("Implicit S1 release");
d_warn(" ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]",

View File

@ -161,19 +161,9 @@ void s1ap_handle_initial_ue_message(mme_enb_t *enb, s1ap_message_t *message)
/* If NAS(mme_ue_t) has already been associated with
* older S1(enb_ue_t) context */
if (mme_ue->enb_ue)
if (ECM_CONNECTED(mme_ue))
{
#if SEND_UE_CTX_REL_CMD_IMMEDIATELY
/* Send UE context release command to
* older S1 context immediately. */
d_trace(5, "OLD ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]\n",
mme_ue->enb_ue->enb_ue_s1ap_id,
mme_ue->enb_ue->mme_ue_s1ap_id);
rv = s1ap_send_ue_context_release_command(mme_ue->enb_ue,
S1ap_Cause_PR_nas, S1ap_CauseNas_normal_release,
S1AP_UE_CTX_REL_NO_ACTION, 0);
d_assert(rv == CORE_OK, return, "s1ap send error");
#elif IMPLICIT_S1_RELEASE
#if IMPLICIT_S1_RELEASE
/* Implcit S1 release */
d_warn("Implicit S1 release");
d_warn(" ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]",
@ -563,7 +553,6 @@ void s1ap_handle_ue_context_release_request(
enb_ue = enb_ue_find_by_mme_ue_s1ap_id(ies->mme_ue_s1ap_id);
if (!enb_ue)
{
d_assert(0,,);
d_warn("No ENB UE Context : MME_UE_S1AP_ID[%d]", ies->mme_ue_s1ap_id);
rv = s1ap_send_error_indication(enb,
S1AP_ERRORINDICATIONIES_MME_UE_S1AP_ID_PRESENT |

View File

@ -322,6 +322,12 @@ static void attach_test1(abts_case *tc, void *data)
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
/* Receive Error Indicaation */
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
rv = tests1ap_enb_read(sock, recvbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
#else /* S1_HOLDING_TIMER */
/* Send UE Context Release Request */
rv = tests1ap_build_ue_context_release_request(&sendbuf, msgindex);