GUTI is added
This commit is contained in:
parent
c96d19ffce
commit
094a5c051d
|
@ -16,9 +16,7 @@ status_t emm_build_attach_accept(
|
|||
&attach_accept->eps_attach_result;
|
||||
nas_gprs_timer_t *t3412_value = &attach_accept->t3412_value;
|
||||
nas_tracking_area_identity_list_t *tai_list = &attach_accept->tai_list;
|
||||
#if 1 /* TODO */
|
||||
nas_eps_mobile_identity_t *guti = &attach_accept->guti;
|
||||
#endif
|
||||
nas_gprs_timer_t *t3402_value = &attach_accept->t3402_value;
|
||||
nas_gprs_timer_t *t3423_value = &attach_accept->t3423_value;
|
||||
nas_eps_network_feature_support_t *eps_network_feature_support =
|
||||
|
@ -47,16 +45,16 @@ status_t emm_build_attach_accept(
|
|||
attach_accept->esm_message_container.data = esmbuf->payload;
|
||||
attach_accept->esm_message_container.len = esmbuf->len;
|
||||
|
||||
#if 1 /* TODO */
|
||||
d_assert(mme_ue_new_guti(mme_ue) == CORE_OK,
|
||||
return CORE_ERROR, "GUTI error");
|
||||
attach_accept->presencemask |= NAS_ATTACH_ACCEPT_GUTI_PRESENT;
|
||||
guti->length = 11;
|
||||
guti->length = sizeof(nas_eps_mobile_identity_guti_t);
|
||||
guti->guti.odd_even = NAS_EPS_MOBILE_IDENTITY_EVEN;
|
||||
guti->guti.type = NAS_EPS_MOBILE_IDENTITY_GUTI;
|
||||
memcpy(&guti->guti.plmn_id, &mme_ue->visited_plmn_id, PLMN_ID_LEN);
|
||||
guti->guti.mme_gid = 2;
|
||||
guti->guti.mme_code = 1;
|
||||
guti->guti.m_tmsi = 0x040001fb;
|
||||
#endif
|
||||
memcpy(&guti->guti.plmn_id, &mme_ue->guti.plmn_id, PLMN_ID_LEN);
|
||||
guti->guti.mme_gid = mme_ue->guti.mme_gid;
|
||||
guti->guti.mme_code = mme_ue->guti.mme_code;
|
||||
guti->guti.m_tmsi = mme_ue->guti.m_tmsi;
|
||||
|
||||
attach_accept->presencemask |= NAS_ATTACH_ACCEPT_EMM_CAUSE_PRESENT;
|
||||
attach_accept->emm_cause = EMM_CAUSE_CS_DOMAIN_NOT_AVAILABLE;
|
||||
|
|
|
@ -1055,7 +1055,7 @@ mme_ue_t *mme_ue_this(hash_index_t *hi)
|
|||
return hash_this_val(hi);
|
||||
}
|
||||
|
||||
status_t mme_ue_set_imsi(mme_ue_t *mme_ue, c_uint8_t *imsi, int imsi_len)
|
||||
status_t mme_ue_set_imsi(mme_ue_t *mme_ue, c_uint8_t *imsi, int imsi_len)
|
||||
{
|
||||
d_assert(mme_ue && imsi, return CORE_ERROR, "Invalid Param");
|
||||
|
||||
|
@ -1067,6 +1067,38 @@ status_t mme_ue_set_imsi(mme_ue_t *mme_ue, c_uint8_t *imsi, int imsi_len)
|
|||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t mme_ue_new_guti(mme_ue_t *mme_ue)
|
||||
{
|
||||
served_gummei_t *served_gummei = NULL;
|
||||
|
||||
d_assert(mme_ue, return CORE_ERROR, "Invalid param");
|
||||
d_assert(mme_self()->max_num_of_served_gummei > 0,
|
||||
return CORE_ERROR, "Invalid param");
|
||||
|
||||
served_gummei = &mme_self()->served_gummei[0];
|
||||
|
||||
d_assert(served_gummei->num_of_plmn_id > 0,
|
||||
return CORE_ERROR, "Invalid param");
|
||||
d_assert(served_gummei->num_of_mme_gid > 0,
|
||||
return CORE_ERROR, "Invalid param");
|
||||
d_assert(served_gummei->num_of_mme_code > 0,
|
||||
return CORE_ERROR, "Invalid param");
|
||||
|
||||
memset(&mme_ue->guti, 0, sizeof(guti_t));
|
||||
|
||||
/* FIXME : How to generate GUTI?
|
||||
* At this point, I'll use first(0-index) Served GUMMEI in MME_CONTEXT */
|
||||
memcpy(&mme_ue->guti.plmn_id, &served_gummei->plmn_id[0], PLMN_ID_LEN);
|
||||
mme_ue->guti.mme_gid = served_gummei->mme_gid[0];
|
||||
mme_ue->guti.mme_code = served_gummei->mme_code[0];
|
||||
|
||||
mme_ue->guti.m_tmsi = NEXT_ID(self.m_tmsi, 1, 0xffffffff);
|
||||
|
||||
hash_set(self.guti_ue_hash, &mme_ue->guti, sizeof(guti_t), mme_ue);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
#if 0
|
||||
unsigned int mme_ue_count()
|
||||
{
|
||||
|
|
|
@ -52,7 +52,9 @@ typedef struct _mme_context_t {
|
|||
tm_service_t tm_service; /* Timer Service */
|
||||
gtp_xact_ctx_t gtp_xact_ctx; /* GTP Transaction Context for MME */
|
||||
|
||||
/* Generator for unique identification */
|
||||
c_uint32_t mme_ue_s1ap_id; /** mme_ue_s1ap_id generator */
|
||||
c_uint32_t m_tmsi; /** m_tmsi generator */
|
||||
|
||||
/* defined in 'nas_ies.h'
|
||||
* #define NAS_SECURITY_ALGORITHMS_EIA0 0
|
||||
|
@ -284,22 +286,18 @@ CORE_DECLARE(mme_enb_t*) mme_enb_next(mme_enb_t *enb);
|
|||
CORE_DECLARE(mme_ue_t*) mme_ue_add(enb_ue_t *enb_ue);
|
||||
CORE_DECLARE(status_t) mme_ue_remove(mme_ue_t *mme_ue);
|
||||
CORE_DECLARE(status_t) mme_ue_remove_all();
|
||||
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find(index_t index);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_mme_ue_s1ap_id(
|
||||
c_uint32_t mme_ue_s1ap_id);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_imsi(c_uint8_t *imsi, int imsi_len);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_guti(guti_t *guti);
|
||||
|
||||
CORE_DECLARE(hash_index_t *) mme_ue_first();
|
||||
CORE_DECLARE(hash_index_t *) mme_ue_next(hash_index_t *hi);
|
||||
CORE_DECLARE(mme_ue_t *) mme_ue_this(hash_index_t *hi);
|
||||
CORE_DECLARE(unsigned int) mme_ue_count();
|
||||
CORE_DECLARE(status_t) mme_ue_remove_in_enb(mme_enb_t *enb);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_enb_ue_s1ap_id(
|
||||
mme_enb_t *enb, c_uint32_t enb_ue_s1ap_id);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_first_in_enb(mme_enb_t *enb);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_next_in_enb(mme_ue_t *mme_ue);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_imsi(c_uint8_t *imsi, int imsi_len);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_guti(guti_t *guti);
|
||||
CORE_DECLARE(status_t) mme_ue_set_imsi(mme_ue_t *mme_ue, c_uint8_t *imsi,
|
||||
int imsi_len);
|
||||
|
||||
CORE_DECLARE(status_t) mme_ue_set_imsi(mme_ue_t *mme_ue,
|
||||
c_uint8_t *imsi, int imsi_len);
|
||||
CORE_DECLARE(status_t) mme_ue_new_guti(mme_ue_t *mme_ue);
|
||||
|
||||
CORE_DECLARE(mme_bearer_t*) mme_sess_add(mme_ue_t *mme_ue, c_uint8_t pti);
|
||||
CORE_DECLARE(status_t ) mme_sess_remove(mme_sess_t *sess);
|
||||
|
|
|
@ -39,10 +39,10 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
char *_initial_context_setup_request =
|
||||
"00090080e4000006 00000005c0010000 9d00080002000100 42000a183e800000"
|
||||
"603e800000001800 809200003400808c 4540092000000000 000000000f800a01"
|
||||
"23d8000000017527 f5a0c49902074202 49064000f1105ba0 004c5221c10509ff"
|
||||
"23d8000000017527 e07f582902074202 49064000f1105ba0 004c5221c10509ff"
|
||||
"ffffff0908696e74 65726e657405012d 2d2d015e06000000 000404272980c223"
|
||||
"0403000004802110 0200001081060808 0808830604040404 000d040808080800"
|
||||
"0d0404040404500b f600f11000020104 0001fb5312172c59 49640125006b0005"
|
||||
"0d0404040404500b f600f11000020100 0000015312172c59 49640125006b0005"
|
||||
"1c000c0000004900 203311c603c6a6d6 7f695e5ac02bb75b 381b693c3893a6d9"
|
||||
"32fd91823544e3e7 9b";
|
||||
char *_emm_information =
|
||||
|
|
Loading…
Reference in New Issue