Commit 418455bc authored by Robert Schmidt's avatar Robert Schmidt

NAS First REQ/NAS Uplink: Use selected PLMN ID

parent 81e70dfc
...@@ -124,6 +124,7 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -124,6 +124,7 @@ int s1ap_eNB_handle_nas_first_req(
ue_desc_p->mme_ref = mme_desc_p; ue_desc_p->mme_ref = mme_desc_p;
ue_desc_p->ue_initial_id = s1ap_nas_first_req_p->ue_initial_id; ue_desc_p->ue_initial_id = s1ap_nas_first_req_p->ue_initial_id;
ue_desc_p->eNB_instance = instance_p; ue_desc_p->eNB_instance = instance_p;
ue_desc_p->selected_plmn_identity = s1ap_nas_first_req_p->selected_plmn_identity;
do { do {
struct s1ap_eNB_ue_context_s *collision_p; struct s1ap_eNB_ue_context_s *collision_p;
...@@ -172,9 +173,9 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -172,9 +173,9 @@ int s1ap_eNB_handle_nas_first_req(
ie->value.present = S1AP_InitialUEMessage_IEs__value_PR_TAI; ie->value.present = S1AP_InitialUEMessage_IEs__value_PR_TAI;
/* Assuming TAI is the TAI from the cell */ /* Assuming TAI is the TAI from the cell */
INT16_TO_OCTET_STRING(instance_p->tac, &ie->value.choice.TAI.tAC); INT16_TO_OCTET_STRING(instance_p->tac, &ie->value.choice.TAI.tAC);
MCC_MNC_TO_PLMNID(instance_p->mcc, MCC_MNC_TO_PLMNID(instance_p->mcc[ue_desc_p->selected_plmn_identity],
instance_p->mnc, instance_p->mnc[ue_desc_p->selected_plmn_identity],
instance_p->mnc_digit_length, instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity],
&ie->value.choice.TAI.pLMNidentity); &ie->value.choice.TAI.pLMNidentity);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
...@@ -191,9 +192,9 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -191,9 +192,9 @@ int s1ap_eNB_handle_nas_first_req(
MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id, MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id,
0, // Cell ID 0, // Cell ID
&ie->value.choice.EUTRAN_CGI.cell_ID); &ie->value.choice.EUTRAN_CGI.cell_ID);
MCC_MNC_TO_TBCD(instance_p->mcc, MCC_MNC_TO_TBCD(instance_p->mcc[ue_desc_p->selected_plmn_identity],
instance_p->mnc, instance_p->mnc[ue_desc_p->selected_plmn_identity],
instance_p->mnc_digit_length, instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity],
&ie->value.choice.EUTRAN_CGI.pLMNidentity); &ie->value.choice.EUTRAN_CGI.pLMNidentity);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
...@@ -608,9 +609,9 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ ...@@ -608,9 +609,9 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
ie->criticality = S1AP_Criticality_ignore; ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_EUTRAN_CGI; ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_EUTRAN_CGI;
MCC_MNC_TO_PLMNID( MCC_MNC_TO_PLMNID(
s1ap_eNB_instance_p->mcc, s1ap_eNB_instance_p->mcc[ue_context_p->selected_plmn_identity],
s1ap_eNB_instance_p->mnc, s1ap_eNB_instance_p->mnc[ue_context_p->selected_plmn_identity],
s1ap_eNB_instance_p->mnc_digit_length, s1ap_eNB_instance_p->mnc_digit_length[ue_context_p->selected_plmn_identity],
&ie->value.choice.EUTRAN_CGI.pLMNidentity); &ie->value.choice.EUTRAN_CGI.pLMNidentity);
//#warning "TODO get cell id from RRC" //#warning "TODO get cell id from RRC"
MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id, MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id,
...@@ -624,9 +625,9 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ ...@@ -624,9 +625,9 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
ie->criticality = S1AP_Criticality_ignore; ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_TAI; ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_TAI;
MCC_MNC_TO_PLMNID( MCC_MNC_TO_PLMNID(
s1ap_eNB_instance_p->mcc, s1ap_eNB_instance_p->mcc[ue_context_p->selected_plmn_identity],
s1ap_eNB_instance_p->mnc, s1ap_eNB_instance_p->mnc[ue_context_p->selected_plmn_identity],
s1ap_eNB_instance_p->mnc_digit_length, s1ap_eNB_instance_p->mnc_digit_length[ue_context_p->selected_plmn_identity],
&ie->value.choice.TAI.pLMNidentity); &ie->value.choice.TAI.pLMNidentity);
TAC_TO_ASN1(s1ap_eNB_instance_p->tac, &ie->value.choice.TAI.tAC); TAC_TO_ASN1(s1ap_eNB_instance_p->tac, &ie->value.choice.TAI.tAC);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......
...@@ -67,6 +67,11 @@ typedef struct s1ap_eNB_ue_context_s { ...@@ -67,6 +67,11 @@ typedef struct s1ap_eNB_ue_context_s {
/* Reference to MME data this UE is attached to */ /* Reference to MME data this UE is attached to */
struct s1ap_eNB_mme_data_s *mme_ref; struct s1ap_eNB_mme_data_s *mme_ref;
/* Signaled by the UE in RRC Connection Setup Complete and used in NAS Uplink
* to route NAS messages correctly. 0-based, not 1-based as in TS 36.331
* 6.2.2 RRC Connection Setup Complete! */
int selected_plmn_identity;
/* Reference to eNB data this UE is attached to */ /* Reference to eNB data this UE is attached to */
s1ap_eNB_instance_t *eNB_instance; s1ap_eNB_instance_t *eNB_instance;
} s1ap_eNB_ue_context_t; } s1ap_eNB_ue_context_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment