Commit f9bb4150 authored by Laurent Thomas's avatar Laurent Thomas

astyle only

parent b7a91d56
...@@ -100,6 +100,7 @@ int f1ap_add_ue(F1_t isCu, ...@@ -100,6 +100,7 @@ int f1ap_add_ue(F1_t isCu,
return i; return i;
} }
} }
// We didn't find the rnti // We didn't find the rnti
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == 0 ) { if (f1_inst->f1ap_ue[i].rnti == 0 ) {
...@@ -188,12 +189,12 @@ int f1ap_du_add_cu_ue_id(instance_t instanceP, ...@@ -188,12 +189,12 @@ int f1ap_du_add_cu_ue_id(instance_t instanceP,
instance_t du_ue_f1ap_id, instance_t du_ue_f1ap_id,
instance_t cu_ue_f1ap_id) { instance_t cu_ue_f1ap_id) {
f1ap_cudu_inst_t *f1_inst=getCxt(DUtype, instanceP); f1ap_cudu_inst_t *f1_inst=getCxt(DUtype, instanceP);
instance_t f1ap_uid=-1; instance_t f1ap_uid=-1;
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) { if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
f1ap_uid=i; f1ap_uid=i;
break; break;
} }
} }
......
...@@ -97,8 +97,6 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -97,8 +97,6 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
/* assoc_id */ /* assoc_id */
f1ap_setup_req_t *req=&getCxt(true, instance)->setupReq; f1ap_setup_req_t *req=&getCxt(true, instance)->setupReq;
req->assoc_id = assoc_id; req->assoc_id = assoc_id;
/* gNB_DU_id */ /* gNB_DU_id */
// this function exits if the ie is mandatory // this function exits if the ie is mandatory
...@@ -124,8 +122,8 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -124,8 +122,8 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
for (i=0; i<num_cells_available; i++) { for (i=0; i<num_cells_available; i++) {
F1AP_GNB_DU_Served_Cells_Item_t *served_cells_item_p; F1AP_GNB_DU_Served_Cells_Item_t *served_cells_item_p;
served_cells_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *) served_cells_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)
ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])-> ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->
value.choice.GNB_DU_Served_Cells_Item); value.choice.GNB_DU_Served_Cells_Item);
/* tac */ /* tac */
if (served_cells_item_p->served_Cell_Information.fiveGS_TAC) { if (served_cells_item_p->served_Cell_Information.fiveGS_TAC) {
...@@ -153,6 +151,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -153,6 +151,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
f1ap_req(true, instance)->cell_type=CELL_MACRO_GNB; f1ap_req(true, instance)->cell_type=CELL_MACRO_GNB;
else else
f1ap_req(true, instance)->cell_type=CELL_MACRO_ENB; f1ap_req(true, instance)->cell_type=CELL_MACRO_ENB;
LOG_I(F1AP, "Received Cell in %d context\n", f1ap_req(true, instance)->cell_type==CELL_MACRO_GNB); LOG_I(F1AP, "Received Cell in %d context\n", f1ap_req(true, instance)->cell_type==CELL_MACRO_GNB);
// System Information // System Information
/* mib */ /* mib */
...@@ -209,10 +208,10 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -209,10 +208,10 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
// uint16_t nr_sul_band[32]; // uint16_t nr_sul_band[32];
// } tdd; // } tdd;
// } nr_mode_info[F1AP_MAX_NB_CELLS]; // } nr_mode_info[F1AP_MAX_NB_CELLS];
// We copy and store in F1 task data, RRC will free "req" as it frees all itti received messages // We copy and store in F1 task data, RRC will free "req" as it frees all itti received messages
message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ); message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
memcpy(&F1AP_SETUP_REQ(message_p), req, sizeof(f1ap_setup_req_t) ); memcpy(&F1AP_SETUP_REQ(message_p), req, sizeof(f1ap_setup_req_t) );
if (num_cells_available > 0) { if (num_cells_available > 0) {
if (f1ap_req(true, instance)->cell_type == CELL_MACRO_GNB) { if (f1ap_req(true, instance)->cell_type == CELL_MACRO_GNB) {
itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p); itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p);
...@@ -521,14 +520,14 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -521,14 +520,14 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
ieC3->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List; ieC3->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
for (int i=0; i<1; i++) { for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Deactivated_List.list, asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Deactivated_List.list,
F1AP_Cells_to_be_Deactivated_List_ItemIEs_t, cells_to_be_deactivated); F1AP_Cells_to_be_Deactivated_List_ItemIEs_t, cells_to_be_deactivated);
cells_to_be_deactivated->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item; cells_to_be_deactivated->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_deactivated->criticality = F1AP_Criticality_reject; cells_to_be_deactivated->criticality = F1AP_Criticality_reject;
cells_to_be_deactivated->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item; cells_to_be_deactivated->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
// 3.1 cells to be Deactivated list item // 3.1 cells to be Deactivated list item
F1AP_Cells_to_be_Deactivated_List_Item_t *cells_to_be_deactivated_list= F1AP_Cells_to_be_Deactivated_List_Item_t *cells_to_be_deactivated_list=
cells_to_be_deactivated->value.choice.Cells_to_be_Deactivated_List_Item; cells_to_be_deactivated->value.choice.Cells_to_be_Deactivated_List_Item;
addnRCGI(cells_to_be_deactivated_item->nRCGI, f1ap_setup_resp->cells_to_deactivate+i); addnRCGI(cells_to_be_deactivated_item->nRCGI, f1ap_setup_resp->cells_to_deactivate+i);
} }
} }
...@@ -543,19 +542,19 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -543,19 +542,19 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
for (int i=0; i<1; i++) { for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC4->value.choice.GNB_CU_TNL_Association_To_Add_List.list, asn1cSequenceAdd(ieC4->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t, gnb_cu_tnl_association_to_add; F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t, gnb_cu_tnl_association_to_add;
gnb_cu_tnl_association_to_add->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item; gnb_cu_tnl_association_to_add->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
gnb_cu_tnl_association_to_add->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_add->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_add->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item; gnb_cu_tnl_association_to_add->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
// 4.1 GNB_CU_TNL_Association_To_Add_Item // 4.1 GNB_CU_TNL_Association_To_Add_Item
F1AP_GNB_CU_TNL_Association_To_Add_Item_t *gnb_cu_tnl_association_to_add_item= F1AP_GNB_CU_TNL_Association_To_Add_Item_t *gnb_cu_tnl_association_to_add_item=
&gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item; &gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item;
// 4.1.1 tNLAssociationTransportLayerAddress // 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t *transportLayerAddress=; F1AP_CP_TransportLayerAddress_t *transportLayerAddress=;
gnb_cu_tnl_association_to_add->value.choice.GNB_CU_TNL_Association_To_Add_Item; gnb_cu_tnl_association_to_add->value.choice.GNB_CU_TNL_Association_To_Add_Item;
transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address; transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address); TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
...@@ -577,18 +576,18 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -577,18 +576,18 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
ieC5->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List; ieC5->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
for (int i=0; i<1; i++) { for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC5->value.choice.GNB_CU_TNL_Association_To_Remove_List.list, asn1cSequenceAdd(ieC5->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t, gnb_cu_tnl_association_to_remove); F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t, gnb_cu_tnl_association_to_remove);
gnb_cu_tnl_association_to_remove->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item; gnb_cu_tnl_association_to_remove->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
gnb_cu_tnl_association_to_remove->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_remove->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_remove->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item; gnb_cu_tnl_association_to_remove->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
// 4.1 GNB_CU_TNL_Association_To_Remove_Item // 4.1 GNB_CU_TNL_Association_To_Remove_Item
F1AP_GNB_CU_TNL_Association_To_Remove_Item_t *gnb_cu_tnl_association_to_remove_item= F1AP_GNB_CU_TNL_Association_To_Remove_Item_t *gnb_cu_tnl_association_to_remove_item=
&gnb_cu_tnl_association_to_remove->value.choice.GNB_CU_TNL_Association_To_Remove_Item; &gnb_cu_tnl_association_to_remove->value.choice.GNB_CU_TNL_Association_To_Remove_Item;
// 4.1.1 tNLAssociationTransportLayerAddress // 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t *transportLayerAddress= F1AP_CP_TransportLayerAddress_t *transportLayerAddress=
&gnb_cu_tnl_association_to_remove_item->tNLAssociationTransportLayerAddress; &gnb_cu_tnl_association_to_remove_item->tNLAssociationTransportLayerAddress;
transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address; transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address); TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
...@@ -609,7 +608,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -609,7 +608,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
for (int i=0; i<1; i++) { for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC3->value.choice.GNB_CU_TNL_Association_To_Update_List.list, asn1cSequenceAdd(ieC3->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t, gnb_cu_tnl_association_to_update); F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t, gnb_cu_tnl_association_to_update);
gnb_cu_tnl_association_to_update->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item; gnb_cu_tnl_association_to_update->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
gnb_cu_tnl_association_to_update->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_update->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_update->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item; gnb_cu_tnl_association_to_update->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
...@@ -642,7 +641,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -642,7 +641,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
for (int i=0; i<1; i++) { for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC7->value.choice.Cells_to_be_Barred_List.list, asn1cSequenceAdd(ieC7->value.choice.Cells_to_be_Barred_List.list,
F1AP_Cells_to_be_Barred_ItemIEs_t,cells_to_be_barred); F1AP_Cells_to_be_Barred_ItemIEs_t,cells_to_be_barred);
cells_to_be_barred->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item; cells_to_be_barred->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_barred->criticality = F1AP_Criticality_reject; cells_to_be_barred->criticality = F1AP_Criticality_reject;
cells_to_be_barred->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item; cells_to_be_barred->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
...@@ -665,7 +664,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -665,7 +664,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
for (int i=0; i<1; i++) { for (int i=0; i<1; i++) {
asn1cSequenceAdd(ieC8->value.choice.Protected_EUTRA_Resources_List.list, asn1cSequenceAdd(ieC8->value.choice.Protected_EUTRA_Resources_List.list,
F1AP_Protected_EUTRA_Resources_ItemIEs_t, protected_eutra_resources); F1AP_Protected_EUTRA_Resources_ItemIEs_t, protected_eutra_resources);
// 8.1 SpectrumSharingGroupID // 8.1 SpectrumSharingGroupID
protected_eutra_resources->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List; protected_eutra_resources->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
protected_eutra_resources->criticality = F1AP_Criticality_reject; protected_eutra_resources->criticality = F1AP_Criticality_reject;
...@@ -675,11 +674,11 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -675,11 +674,11 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
sizeof(F1AP_Protected_EUTRA_Resources_Item_t)); sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
asn1cSequenceAdd(protected_eutra_resources->value.choice.ListofEUTRACellsinGNBDUCoordination.list, asn1cSequenceAdd(protected_eutra_resources->value.choice.ListofEUTRACellsinGNBDUCoordination.list,
F1AP_Served_EUTRA_Cells_Information_t, served_eutra_cells_information); F1AP_Served_EUTRA_Cells_Information_t, served_eutra_cells_information);
memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t)); memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
F1AP_EUTRA_Mode_Info_t *eUTRA_Mode_Info= F1AP_EUTRA_Mode_Info_t *eUTRA_Mode_Info=
&served_eutra_cells_information.eUTRA_Mode_Info; &served_eutra_cells_information.eUTRA_Mode_Info;
// eUTRAFDD // eUTRAFDD
eUTRA_Mode_Info->present = F1AP_EUTRA_Mode_Info_PR_eUTRAFDD; eUTRA_Mode_Info->present = F1AP_EUTRA_Mode_Info_PR_eUTRAFDD;
......
...@@ -100,7 +100,6 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -100,7 +100,6 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
} }
LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, ie->value.choice.RRCContainer.size); LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, ie->value.choice.RRCContainer.size);
/* DUtoCURRCContainer */ /* DUtoCURRCContainer */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, false); F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, false);
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
instance_t CUuniqInstance=0; instance_t CUuniqInstance=0;
static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) { static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) {
openAddr_t tmp={0}; openAddr_t tmp= {0};
strncpy(tmp.originHost, IPaddrs->my_addr, sizeof(tmp.originHost)-1); strncpy(tmp.originHost, IPaddrs->my_addr, sizeof(tmp.originHost)-1);
strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1); strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1);
sprintf(tmp.originService, "%d", IPaddrs->my_portd); sprintf(tmp.originService, "%d", IPaddrs->my_portd);
...@@ -51,7 +51,7 @@ static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) { ...@@ -51,7 +51,7 @@ static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) {
} }
static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind, static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind,
eth_params_t *IPaddrs) { eth_params_t *IPaddrs) {
createF1inst(true, instance, NULL); createF1inst(true, instance, NULL);
// save the assoc id // save the assoc id
f1ap_setup_req_t *f1ap_cu_data=f1ap_req(true, instance); f1ap_setup_req_t *f1ap_cu_data=f1ap_req(true, instance);
...@@ -90,7 +90,7 @@ static void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *s ...@@ -90,7 +90,7 @@ static void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *s
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} }
static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) { static void cu_task_send_sctp_init_req(instance_t instance, char *my_addr) {
// 1. get the itti msg, and retrive the enb_id from the message // 1. get the itti msg, and retrive the enb_id from the message
// 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port // 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port
// 3. creat an itti message to init // 3. creat an itti message to init
...@@ -103,7 +103,6 @@ static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) { ...@@ -103,7 +103,6 @@ static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) {
message_p->ittiMsg.sctp_init.ipv6 = 0; message_p->ittiMsg.sctp_init.ipv6 = 0;
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1; message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(my_addr); message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(my_addr);
/* /*
* SR WARNING: ipv6 multi-homing fails sometimes for localhost. * SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* * * * Disable it for now. * * * * Disable it for now.
...@@ -113,7 +112,7 @@ static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) { ...@@ -113,7 +112,7 @@ static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) {
itti_send_msg_to_task(TASK_SCTP, instance, message_p); itti_send_msg_to_task(TASK_SCTP, instance, message_p);
} }
void * F1AP_CU_task(void *arg) { void *F1AP_CU_task(void *arg) {
MessageDef *received_msg = NULL; MessageDef *received_msg = NULL;
int result; int result;
LOG_I(F1AP, "Starting F1AP at CU\n"); LOG_I(F1AP, "Starting F1AP at CU\n");
...@@ -121,13 +120,15 @@ void * F1AP_CU_task(void *arg) { ...@@ -121,13 +120,15 @@ void * F1AP_CU_task(void *arg) {
pool_buffer_init(); pool_buffer_init();
itti_mark_task_ready(TASK_CU_F1); itti_mark_task_ready(TASK_CU_F1);
eth_params_t *IPaddrs; eth_params_t *IPaddrs;
// Hardcoded instance id! // Hardcoded instance id!
if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU)
IPaddrs=&RC.nrrrc[0]->eth_params_s; IPaddrs=&RC.nrrrc[0]->eth_params_s;
else else
IPaddrs=&RC.rrc[0]->eth_params_s; IPaddrs=&RC.rrc[0]->eth_params_s;
cu_task_send_sctp_init_req(0, IPaddrs->my_addr); cu_task_send_sctp_init_req(0, IPaddrs->my_addr);
while (1) { while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg); itti_receive_msg(TASK_CU_F1, &received_msg);
...@@ -137,7 +138,7 @@ void * F1AP_CU_task(void *arg) { ...@@ -137,7 +138,7 @@ void * F1AP_CU_task(void *arg) {
ITTI_MSG_DESTINATION_INSTANCE(received_msg)); ITTI_MSG_DESTINATION_INSTANCE(received_msg));
cu_task_handle_sctp_association_ind(ITTI_MSG_ORIGIN_INSTANCE(received_msg), cu_task_handle_sctp_association_ind(ITTI_MSG_ORIGIN_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_ind, &received_msg->ittiMsg.sctp_new_association_ind,
IPaddrs); IPaddrs);
break; break;
case SCTP_NEW_ASSOCIATION_RESP: case SCTP_NEW_ASSOCIATION_RESP:
......
...@@ -44,8 +44,10 @@ int to_NRNRB(int nrb) { ...@@ -44,8 +44,10 @@ int to_NRNRB(int nrb) {
for (int i=0; i<sizeofArray(nrb_lut); i++) for (int i=0; i<sizeofArray(nrb_lut); i++)
if (nrb_lut[i] == nrb) if (nrb_lut[i] == nrb)
return i; return i;
if(!RC.nrrrc) if(!RC.nrrrc)
return 0; return 0;
AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n",nrb); AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n",nrb);
} }
...@@ -435,7 +437,7 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -435,7 +437,7 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
memcpy((void *)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si], memcpy((void *)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si],
(void *)sib_item->sIBmessage.buf, (void *)sib_item->sIBmessage.buf,
size); size);
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_type[si]=sib_item->sIBtype; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_type[si]=sib_item->sIBtype;
} }
break; break;
...@@ -869,7 +871,7 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -869,7 +871,7 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
memcpy((void *)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si], memcpy((void *)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si],
(void *)sib_item->sIBmessage.buf, (void *)sib_item->sIBmessage.buf,
size); size);
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_type[si]=sib_item->sIBtype; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_type[si]=sib_item->sIBtype;
} }
break; break;
......
...@@ -137,7 +137,6 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -137,7 +137,6 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* RRC Container */ /* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true); F1AP_ProtocolIE_ID_id_RRCContainer, true);
rrc_dl_sdu_len = ie->value.choice.RRCContainer.size; rrc_dl_sdu_len = ie->value.choice.RRCContainer.size;
/* optional */ /* optional */
...@@ -763,7 +762,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP, ...@@ -763,7 +762,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP,
LOG_E(F1AP, "Failed to add UE \n"); LOG_E(F1AP, "Failed to add UE \n");
return -1; return -1;
} }
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
...@@ -920,7 +919,7 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -920,7 +919,7 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
LOG_E(F1AP, "Failed to find the F1AP UID \n"); LOG_E(F1AP, "Failed to find the F1AP UID \n");
//return -1; //return -1;
} }
/* optional */ /* optional */
/* oldgNB_DU_UE_F1AP_ID */ /* oldgNB_DU_UE_F1AP_ID */
if (0) { if (0) {
...@@ -932,7 +931,6 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -932,7 +931,6 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
/* SRBID */ /* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true); F1AP_ProtocolIE_ID_id_SRBID, true);
uint64_t srb_id = ie->value.choice.SRBID; uint64_t srb_id = ie->value.choice.SRBID;
LOG_D(F1AP, "srb_id %lu \n", srb_id); LOG_D(F1AP, "srb_id %lu \n", srb_id);
...@@ -985,13 +983,12 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -985,13 +983,12 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
// decode RRC Container and act on the message type // decode RRC Container and act on the message type
AssertFatal(srb_id<3,"illegal srb_id\n"); AssertFatal(srb_id<3,"illegal srb_id\n");
MessageDef * msg = itti_alloc_new_message(TASK_DU_F1, 0, NR_DU_RRC_DL_INDICATION); MessageDef *msg = itti_alloc_new_message(TASK_DU_F1, 0, NR_DU_RRC_DL_INDICATION);
NRDuDlReq_t * req=&NRDuDlReq(msg); NRDuDlReq_t *req=&NRDuDlReq(msg);
req->rnti=f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id); req->rnti=f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
req->srb_id=srb_id; req->srb_id=srb_id;
req->buf= get_free_mem_block( ie->value.choice.RRCContainer.size, __func__); req->buf= get_free_mem_block( ie->value.choice.RRCContainer.size, __func__);
memcpy(req->buf->data, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size); memcpy(req->buf->data, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg); itti_send_msg_to_task(TASK_RRC_GNB, instance, msg);
return 0; return 0;
} }
...@@ -85,7 +85,6 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat ...@@ -85,7 +85,6 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams; f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
f1ap_du_data->default_sctp_stream_id = 0; f1ap_du_data->default_sctp_stream_id = 0;
/* setup parameters for F1U and start the server */ /* setup parameters for F1U and start the server */
DU_send_F1_SETUP_REQUEST(instance); DU_send_F1_SETUP_REQUEST(instance);
} }
...@@ -98,8 +97,8 @@ void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_dat ...@@ -98,8 +97,8 @@ void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_dat
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} }
static instance_t du_create_gtpu_instance_to_cu(char* CUaddr, uint16_t CUport, char * DUaddr, uint16_t DUport) { static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, char *DUaddr, uint16_t DUport) {
openAddr_t tmp={0}; openAddr_t tmp= {0};
strncpy(tmp.originHost, DUaddr, sizeof(tmp.originHost)-1); strncpy(tmp.originHost, DUaddr, sizeof(tmp.originHost)-1);
strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1); strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1);
sprintf(tmp.originService, "%d", DUport); sprintf(tmp.originService, "%d", DUport);
...@@ -121,22 +120,22 @@ void *F1AP_DU_task(void *arg) { ...@@ -121,22 +120,22 @@ void *F1AP_DU_task(void *arg) {
switch (ITTI_MSG_ID(msg)) { switch (ITTI_MSG_ID(msg)) {
case F1AP_SETUP_REQ: case F1AP_SETUP_REQ:
// this is not a true F1 message, but rather an ITTI message sent by enb_app // this is not a true F1 message, but rather an ITTI message sent by enb_app
// 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message, // 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message,
// 2. store the message in f1ap context, that is also stored in RC // 2. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req // 2. send a sctp_association req
LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n"); LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n");
f1ap_setup_req_t * msgSetup=&F1AP_SETUP_REQ(msg); f1ap_setup_req_t *msgSetup=&F1AP_SETUP_REQ(msg);
createF1inst(false, myInstance, msgSetup); createF1inst(false, myInstance, msgSetup);
getCxt(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address, getCxt(DUtype, myInstance)->gtpInst=du_create_gtpu_instance_to_cu(msgSetup->CU_f1_ip_address.ipv4_address,
msgSetup->CUport, msgSetup->CUport,
msgSetup->DU_f1_ip_address.ipv4_address, msgSetup->DU_f1_ip_address.ipv4_address,
msgSetup->DUport); msgSetup->DUport);
AssertFatal(getCxt(DUtype, myInstance)->gtpInst>0,"Failed to create CU F1-U UDP listener"); AssertFatal(getCxt(DUtype, myInstance)->gtpInst>0,"Failed to create CU F1-U UDP listener");
// Fixme: fully inconsistent instances management // Fixme: fully inconsistent instances management
// dirty global var is a bad fix // dirty global var is a bad fix
extern instance_t legacyInstanceMapping; extern instance_t legacyInstanceMapping;
legacyInstanceMapping = DUuniqInstance = getCxt(DUtype, myInstance)->gtpInst; legacyInstanceMapping = DUuniqInstance = getCxt(DUtype, myInstance)->gtpInst;
du_task_send_sctp_association_req(myInstance,msgSetup); du_task_send_sctp_association_req(myInstance,msgSetup);
break; break;
......
...@@ -50,10 +50,12 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) { ...@@ -50,10 +50,12 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
char errbuf[128]; /* Buffer for error message */ char errbuf[128]; /* Buffer for error message */
size_t errlen = sizeof(errbuf); /* Size of the buffer */ size_t errlen = sizeof(errbuf); /* Size of the buffer */
int ret = asn_check_constraints(&asn_DEF_F1AP_F1AP_PDU, pdu, errbuf, &errlen); int ret = asn_check_constraints(&asn_DEF_F1AP_F1AP_PDU, pdu, errbuf, &errlen);
/* assert(errlen < sizeof(errbuf)); // Guaranteed: you may rely on that */ /* assert(errlen < sizeof(errbuf)); // Guaranteed: you may rely on that */
if(ret) { if(ret) {
fprintf(stderr, "Constraint validation failed: %s\n", errbuf); fprintf(stderr, "Constraint validation failed: %s\n", errbuf);
} }
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer); encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) { if (encoded < 0) {
......
...@@ -472,7 +472,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer ...@@ -472,7 +472,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer
char ip4[INET_ADDRSTRLEN]; char ip4[INET_ADDRSTRLEN];
char ip6[INET6_ADDRSTRLEN]; char ip6[INET6_ADDRSTRLEN];
LOG_I(GTPU, "[%ld] Created tunnel for RNTI %x, teid for DL: %x, teid for UL %x to remote IPv4: %s, IPv6 %s\n", LOG_I(GTPU, "[%ld] Created tunnel for RNTI %x, teid for DL: %x, teid for UL %x to remote IPv4: %s, IPv6 %s\n",
instance, instance,
rnti, rnti,
tmp->teid_incoming, tmp->teid_incoming,
tmp->teid_outgoing, tmp->teid_outgoing,
...@@ -485,7 +485,7 @@ int ocp_gtpv1u_create_s1u_tunnel(instance_t instance, ...@@ -485,7 +485,7 @@ int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n", LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n",
instance, instance,
create_tunnel_req->rnti, create_tunnel_req->rnti,
create_tunnel_req->num_tunnels, create_tunnel_req->num_tunnels,
create_tunnel_req->sgw_S1u_teid[0]); create_tunnel_req->sgw_S1u_teid[0]);
...@@ -520,7 +520,7 @@ int ocp_gtpv1u_update_s1u_tunnel( ...@@ -520,7 +520,7 @@ int ocp_gtpv1u_update_s1u_tunnel(
const rnti_t prior_rnti const rnti_t prior_rnti
) { ) {
LOG_D(GTPU, "[%ld] Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %x, eps_bearer_id %x\n", LOG_D(GTPU, "[%ld] Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %x, eps_bearer_id %x\n",
instance, instance,
prior_rnti, prior_rnti,
create_tunnel_req->rnti, create_tunnel_req->rnti,
create_tunnel_req->num_tunnels, create_tunnel_req->num_tunnels,
...@@ -553,7 +553,7 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance, ...@@ -553,7 +553,7 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance,
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req, const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req,
gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp) { gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp) {
LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n", LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n",
instance, instance,
create_tunnel_req->rnti, create_tunnel_req->rnti,
create_tunnel_req->num_tunnels, create_tunnel_req->num_tunnels,
create_tunnel_req->outgoing_teid[0]); create_tunnel_req->outgoing_teid[0]);
......
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