Commit c1220b37 authored by matzakos's avatar matzakos

Avoid hardcoding SRB2 id in F1 UE context setup request message and extract...

Avoid hardcoding SRB2 id in F1 UE context setup request message and extract from RRC itti message instead
parent f20125f7
...@@ -243,7 +243,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -243,7 +243,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ie11->criticality = F1AP_Criticality_reject; // ? ie11->criticality = F1AP_Criticality_reject; // ?
ie11->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List; ie11->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List;
for (int i=0; i<1; i++) { for (int i=0; i<f1ap_ue_context_setup_req->srbs_to_be_setup_length; i++) {
// //
asn1cSequenceAdd(ie11->value.choice.SRBs_ToBeSetup_List.list, F1AP_SRBs_ToBeSetup_ItemIEs_t, srbs_toBeSetup_item_ies); asn1cSequenceAdd(ie11->value.choice.SRBs_ToBeSetup_List.list, F1AP_SRBs_ToBeSetup_ItemIEs_t, srbs_toBeSetup_item_ies);
srbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item; // 73 srbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item; // 73
...@@ -252,7 +252,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -252,7 +252,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* 11.1 SRBs_ToBeSetup_Item */ /* 11.1 SRBs_ToBeSetup_Item */
F1AP_SRBs_ToBeSetup_Item_t *srbs_toBeSetup_item=&srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item; F1AP_SRBs_ToBeSetup_Item_t *srbs_toBeSetup_item=&srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item;
/* 11.1.1 sRBID */ /* 11.1.1 sRBID */
srbs_toBeSetup_item->sRBID = 2L; srbs_toBeSetup_item->sRBID = f1ap_ue_context_setup_req->srbs_to_be_setup[i].srb_id;
/* OPTIONAL */ /* OPTIONAL */
/* 11.1.2 duplicationIndication */ /* 11.1.2 duplicationIndication */
//if (0) { //if (0) {
......
...@@ -1367,12 +1367,30 @@ rrc_gNB_process_RRCReconfigurationComplete( ...@@ -1367,12 +1367,30 @@ rrc_gNB_process_RRCReconfigurationComplete(
NULL, NULL,
get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL); get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL);
} }
else { else if(SRB_configList!=NULL || DRB_configList!=NULL){
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_DU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rnti = ue_context_pP->ue_context.rnti;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).mcc = RC.nrrrc[0]->configuration.mcc[0];
F1AP_UE_CONTEXT_SETUP_REQ (message_p).mnc = RC.nrrrc[0]->configuration.mnc[0];
F1AP_UE_CONTEXT_SETUP_REQ (message_p).mnc_digit_length = RC.nrrrc[0]->configuration.mnc_digit_length[0];
F1AP_UE_CONTEXT_SETUP_REQ (message_p).nr_cellid = RC.nrrrc[0]->nr_cellid;
if(SRB_configList!=NULL){
F1AP_UE_CONTEXT_SETUP_REQ (message_p).srbs_to_be_setup = malloc(SRB_configList->list.count*sizeof(f1ap_srb_to_be_setup_t));
F1AP_UE_CONTEXT_SETUP_REQ (message_p).srbs_to_be_setup_length = SRB_configList->list.count;
f1ap_srb_to_be_setup_t *SRBs=F1AP_UE_CONTEXT_SETUP_REQ (message_p).srbs_to_be_setup;
for (int i = 0; i < SRB_configList->list.count; i++){
if(SRB_configList->list.array[i]->srb_Identity > 1){
SRBs[i].srb_id = SRB_configList->list.array[i]->srb_Identity;
SRBs[i].lcid = SRB_configList->list.array[i]->srb_Identity;
}
}
}
if(DRB_configList!=NULL){ if(DRB_configList!=NULL){
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req; gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t)); memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup = malloc(DRB_configList->list.count*sizeof(f1ap_drb_to_be_setup_t)); F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup = malloc(DRB_configList->list.count*sizeof(f1ap_drb_to_be_setup_t));
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup_length = DRB_configList->list.count; F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup_length = DRB_configList->list.count;
f1ap_drb_to_be_setup_t *DRBs=F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup; f1ap_drb_to_be_setup_t *DRBs=F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup;
...@@ -1387,16 +1405,9 @@ rrc_gNB_process_RRCReconfigurationComplete( ...@@ -1387,16 +1405,9 @@ rrc_gNB_process_RRCReconfigurationComplete(
DRBs[i].up_dl_tnl[0].port=rrc->eth_params_s.remote_portd; DRBs[i].up_dl_tnl[0].port=rrc->eth_params_s.remote_portd;
DRBs[i].up_dl_tnl_length = 1; DRBs[i].up_dl_tnl_length = 1;
} }
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_DU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rnti = ue_context_pP->ue_context.rnti;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).mcc = RC.nrrrc[0]->configuration.mcc[0];
F1AP_UE_CONTEXT_SETUP_REQ (message_p).mnc = RC.nrrrc[0]->configuration.mnc[0];
F1AP_UE_CONTEXT_SETUP_REQ (message_p).mnc_digit_length = RC.nrrrc[0]->configuration.mnc_digit_length[0];
F1AP_UE_CONTEXT_SETUP_REQ (message_p).nr_cellid = RC.nrrrc[0]->nr_cellid;
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
LOG_I(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n"); LOG_I(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
} }
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
} }
#endif #endif
......
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