forked from acouzens/open5gs
tai update
This commit is contained in:
parent
ce801ee218
commit
178678c216
|
@ -65,6 +65,10 @@ void emm_handle_attach_request(
|
|||
sizeof(nas_eps_attach_type_t));
|
||||
mme_ue->nas_eps.type = MME_EPS_TYPE_ATTACH_REQUEST;
|
||||
|
||||
/* Copy TAI and ECGI from enb_ue */
|
||||
memcpy(&mme_ue->tai, &enb_ue->nas.tai, sizeof(tai_t));
|
||||
memcpy(&mme_ue->e_cgi, &enb_ue->nas.e_cgi, sizeof(e_cgi_t));
|
||||
|
||||
/* Store UE specific information */
|
||||
if (attach_request->presencemask &
|
||||
NAS_ATTACH_REQUEST_LAST_VISITED_REGISTERED_TAI_PRESENT)
|
||||
|
@ -73,14 +77,11 @@ void emm_handle_attach_request(
|
|||
&attach_request->last_visited_registered_tai;
|
||||
|
||||
memcpy(&mme_ue->visited_plmn_id,
|
||||
&last_visited_registered_tai->plmn_id,
|
||||
PLMN_ID_LEN);
|
||||
&last_visited_registered_tai->plmn_id, PLMN_ID_LEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME : what will do if we don't know last visited plmn_id */
|
||||
memcpy(&mme_ue->visited_plmn_id,
|
||||
&mme_self()->served_tai[0].plmn_id, PLMN_ID_LEN);
|
||||
memcpy(&mme_ue->visited_plmn_id, &mme_ue->tai.plmn_id, PLMN_ID_LEN);
|
||||
}
|
||||
|
||||
memcpy(&mme_ue->ue_network_capability,
|
||||
|
@ -90,10 +91,6 @@ void emm_handle_attach_request(
|
|||
&attach_request->ms_network_capability,
|
||||
sizeof(attach_request->ms_network_capability));
|
||||
|
||||
/* Copy TAI and ECGI from enb_ue */
|
||||
memcpy(&mme_ue->tai, &enb_ue->nas.tai, sizeof(tai_t));
|
||||
memcpy(&mme_ue->e_cgi, &enb_ue->nas.e_cgi, sizeof(e_cgi_t));
|
||||
|
||||
switch(eps_mobile_identity->imsi.type)
|
||||
{
|
||||
case NAS_EPS_MOBILE_IDENTITY_IMSI:
|
||||
|
@ -467,6 +464,10 @@ void emm_handle_tau_request(
|
|||
sizeof(nas_eps_update_type_t));
|
||||
mme_ue->nas_eps.type = MME_EPS_TYPE_TAU_REQUEST;
|
||||
|
||||
/* Copy TAI and ECGI from enb_ue */
|
||||
memcpy(&mme_ue->tai, &enb_ue->nas.tai, sizeof(tai_t));
|
||||
memcpy(&mme_ue->e_cgi, &enb_ue->nas.e_cgi, sizeof(e_cgi_t));
|
||||
|
||||
/* Store UE specific information */
|
||||
if (tau_request->presencemask &
|
||||
NAS_TRACKING_AREA_UPDATE_REQUEST_LAST_VISITED_REGISTERED_TAI_PRESENT)
|
||||
|
@ -475,14 +476,11 @@ void emm_handle_tau_request(
|
|||
&tau_request->last_visited_registered_tai;
|
||||
|
||||
memcpy(&mme_ue->visited_plmn_id,
|
||||
&last_visited_registered_tai->plmn_id,
|
||||
PLMN_ID_LEN);
|
||||
&last_visited_registered_tai->plmn_id, PLMN_ID_LEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME : what will do if we don't know last visited plmn_id */
|
||||
memcpy(&mme_ue->visited_plmn_id,
|
||||
&mme_self()->served_tai[0].plmn_id, PLMN_ID_LEN);
|
||||
memcpy(&mme_ue->visited_plmn_id, &mme_ue->tai.plmn_id, PLMN_ID_LEN);
|
||||
}
|
||||
|
||||
if (tau_request->presencemask &
|
||||
|
@ -501,10 +499,6 @@ void emm_handle_tau_request(
|
|||
sizeof(tau_request->ms_network_capability));
|
||||
}
|
||||
|
||||
/* Copy TAI and ECGI from enb_ue */
|
||||
memcpy(&mme_ue->tai, &enb_ue->nas.tai, sizeof(tai_t));
|
||||
memcpy(&mme_ue->e_cgi, &enb_ue->nas.e_cgi, sizeof(e_cgi_t));
|
||||
|
||||
/* TODO:
|
||||
* 1) Consider if MME is changed or not.
|
||||
* 2) Consider if SGW is changed or not.
|
||||
|
|
|
@ -757,7 +757,6 @@ status_t mme_context_parse_config()
|
|||
tai_t *tai = NULL;
|
||||
plmn_id_t *plmn_id = NULL;
|
||||
const char *mcc = NULL, *mnc = NULL;
|
||||
c_uint16_t tac = 0;
|
||||
|
||||
d_assert(self.max_num_of_served_tai <=
|
||||
MAX_NUM_OF_SERVED_TAI, return CORE_ERROR,);
|
||||
|
@ -822,20 +821,20 @@ status_t mme_context_parse_config()
|
|||
else if (!strcmp(tai_key, "tac"))
|
||||
{
|
||||
const char *v = yaml_iter_value(&tai_iter);
|
||||
if (v) tac = atoi(v);
|
||||
if (v) tai->tac = atoi(v);
|
||||
}
|
||||
else
|
||||
d_warn("unknown key `%s`", tai_key);
|
||||
}
|
||||
|
||||
if (mcc && mnc && tac)
|
||||
if (mcc && mnc && tai->tac)
|
||||
{
|
||||
self.max_num_of_served_tai++;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_warn("Ignore tai : mcc(%p), mnc(%p), tac(%d)",
|
||||
mcc, mnc, tac);
|
||||
mcc, mnc, tai->tac);
|
||||
}
|
||||
} while(yaml_iter_type(&tai_array) ==
|
||||
YAML_SEQUENCE_NODE);
|
||||
|
|
|
@ -276,16 +276,20 @@ status_t tests1ap_build_setup_req(
|
|||
ies = &message.s1ap_S1SetupRequestIEs;
|
||||
|
||||
s1ap_uint32_to_ENB_ID(present, enb_id, &ies->global_ENB_ID.eNB_ID);
|
||||
s1ap_buffer_to_OCTET_STRING(&mme_self()->served_tai[0].plmn_id,
|
||||
s1ap_buffer_to_OCTET_STRING(&mme_self()->served_gummei[0].plmn_id[0],
|
||||
PLMN_ID_LEN, &ies->global_ENB_ID.pLMNidentity);
|
||||
|
||||
supportedTA = (S1ap_SupportedTAs_Item_t *)
|
||||
core_calloc(1, sizeof(S1ap_SupportedTAs_Item_t));
|
||||
#if 0 /* FIXTAI */
|
||||
s1ap_uint16_to_OCTET_STRING(
|
||||
mme_self()->served_tai[0].tac, &supportedTA->tAC);
|
||||
#else
|
||||
s1ap_uint16_to_OCTET_STRING(12345, &supportedTA->tAC);
|
||||
#endif
|
||||
plmnIdentity = (S1ap_PLMNidentity_t *)
|
||||
core_calloc(1, sizeof(S1ap_PLMNidentity_t));
|
||||
s1ap_buffer_to_OCTET_STRING(&mme_self()->served_tai[0].plmn_id,
|
||||
s1ap_buffer_to_OCTET_STRING(&mme_self()->served_gummei[0].plmn_id[0],
|
||||
PLMN_ID_LEN, plmnIdentity);
|
||||
ASN_SEQUENCE_ADD(&supportedTA->broadcastPLMNs, plmnIdentity);
|
||||
|
||||
|
|
Loading…
Reference in New Issue