Commit 42ea1f82 authored by Laurent THOMAS's avatar Laurent THOMAS

fix F1 setup messages memory error

parent 66e31967
...@@ -39,21 +39,24 @@ ...@@ -39,21 +39,24 @@
extern f1ap_setup_req_t *f1ap_du_data_from_du; extern f1ap_setup_req_t *f1ap_du_data_from_du;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
#define asn1cCalloc(VaR, TyPe, lOcPtr) TyPe *lOcPtr=VaR=(TyPe*) calloc(1,sizeof(TyPe));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) TyPe *lOcPtr=(TyPe*) calloc(1,sizeof(TyPe)); ASN_SEQUENCE_ADD(&VaR,lOcPtr);
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) { int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance, int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_handle_RESET(instance_t instance, int CU_handle_RESET(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -66,9 +69,9 @@ int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *Rese ...@@ -66,9 +69,9 @@ int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *Rese
Error Indication Error Indication
*/ */
int CU_handle_ERROR_INDICATION(instance_t instance, int CU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -83,77 +86,65 @@ int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorI ...@@ -83,77 +86,65 @@ int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorI
int CU_handle_F1_SETUP_REQUEST(instance_t instance, int CU_handle_F1_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) F1AP_F1AP_PDU_t *pdu) {
{
LOG_D(F1AP, "CU_handle_F1_SETUP_REQUEST\n"); LOG_D(F1AP, "CU_handle_F1_SETUP_REQUEST\n");
MessageDef *message_p; MessageDef *message_p;
F1AP_F1SetupRequest_t *container; F1AP_F1SetupRequest_t *container;
F1AP_F1SetupRequestIEs_t *ie; F1AP_F1SetupRequestIEs_t *ie;
int i = 0; int i = 0;
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage->value.choice.F1SetupRequest; container = &pdu->choice.initiatingMessage->value.choice.F1SetupRequest;
/* F1 Setup Request == Non UE-related procedure -> stream 0 */ /* F1 Setup Request == Non UE-related procedure -> stream 0 */
if (stream != 0) { if (stream != 0) {
LOG_W(F1AP, "[SCTP %d] Received f1 setup request on stream != 0 (%d)\n", LOG_W(F1AP, "[SCTP %d] Received f1 setup request on stream != 0 (%d)\n",
assoc_id, stream); assoc_id, stream);
} }
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);
/* assoc_id */ /* assoc_id */
F1AP_SETUP_REQ(message_p).assoc_id = assoc_id; F1AP_SETUP_REQ(message_p).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
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_ID, true); F1AP_ProtocolIE_ID_id_gNB_DU_ID, true);
asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &F1AP_SETUP_REQ(message_p).gNB_DU_id); asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &F1AP_SETUP_REQ(message_p).gNB_DU_id);
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id); LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id);
/* gNB_DU_name */ /* gNB_DU_name */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Name, true); F1AP_ProtocolIE_ID_id_gNB_DU_Name, true);
F1AP_SETUP_REQ(message_p).gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char)); F1AP_SETUP_REQ(message_p).gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).gNB_DU_name, ie->value.choice.GNB_DU_Name.buf, memcpy(F1AP_SETUP_REQ(message_p).gNB_DU_name, ie->value.choice.GNB_DU_Name.buf,
ie->value.choice.GNB_DU_Name.size); ie->value.choice.GNB_DU_Name.size);
/* Convert the mme name to a printable string */ /* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).gNB_DU_name[ie->value.choice.GNB_DU_Name.size] = '\0'; F1AP_SETUP_REQ(message_p).gNB_DU_name[ie->value.choice.GNB_DU_Name.size] = '\0';
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name); LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name);
/* GNB_DU_Served_Cells_List */ /* GNB_DU_Served_Cells_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List, true); F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List, true);
F1AP_SETUP_REQ(message_p).num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count; F1AP_SETUP_REQ(message_p).num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).num_cells_available %d \n", LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).num_cells_available %d \n",
F1AP_SETUP_REQ(message_p).num_cells_available); F1AP_SETUP_REQ(message_p).num_cells_available);
int num_cells_available = F1AP_SETUP_REQ(message_p).num_cells_available; int num_cells_available = F1AP_SETUP_REQ(message_p).num_cells_available;
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 *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item); served_cells_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->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) {
OCTET_STRING_TO_INT16(served_cells_item_p->served_Cell_Information.fiveGS_TAC, F1AP_SETUP_REQ(message_p).tac[i]); OCTET_STRING_TO_INT16(served_cells_item_p->served_Cell_Information.fiveGS_TAC, F1AP_SETUP_REQ(message_p).tac[i]);
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n", LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n",
i, F1AP_SETUP_REQ(message_p).tac[i]); i, F1AP_SETUP_REQ(message_p).tac[i]);
} }
/* - nRCGI */ /* - nRCGI */
TBCD_TO_MCC_MNC(&(served_cells_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i], TBCD_TO_MCC_MNC(&(served_cells_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i], F1AP_SETUP_REQ(message_p).mnc[i],
F1AP_SETUP_REQ(message_p).mnc_digit_length[i]); F1AP_SETUP_REQ(message_p).mnc_digit_length[i]);
// NR cellID // NR cellID
BIT_STRING_TO_NR_CELL_IDENTITY(&served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity, BIT_STRING_TO_NR_CELL_IDENTITY(&served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity,
F1AP_SETUP_REQ(message_p).nr_cellid[i]); F1AP_SETUP_REQ(message_p).nr_cellid[i]);
LOG_D(F1AP, "[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n", assoc_id, LOG_D(F1AP, "[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n", assoc_id,
F1AP_SETUP_REQ(message_p).mcc[i], F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i], F1AP_SETUP_REQ(message_p).mnc[i],
...@@ -168,7 +159,6 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -168,7 +159,6 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_cells_item_p->served_Cell_Information.nRPCI; F1AP_SETUP_REQ(message_p).nr_pci[i] = served_cells_item_p->served_Cell_Information.nRPCI;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n", LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n",
i, F1AP_SETUP_REQ(message_p).nr_pci[i]); i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
// System Information // System Information
/* mib */ /* mib */
F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_cells_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char)); F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_cells_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
...@@ -179,7 +169,6 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -179,7 +169,6 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
F1AP_SETUP_REQ(message_p).mib_length[i] = served_cells_item_p->gNB_DU_System_Information->mIB_message.size; F1AP_SETUP_REQ(message_p).mib_length[i] = served_cells_item_p->gNB_DU_System_Information->mIB_message.size;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).mib[%d] %s , len = %d \n", LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).mib[%d] %s , len = %d \n",
i, F1AP_SETUP_REQ(message_p).mib[i], F1AP_SETUP_REQ(message_p).mib_length[i]); i, F1AP_SETUP_REQ(message_p).mib[i], F1AP_SETUP_REQ(message_p).mib_length[i]);
/* sib1 */ /* sib1 */
F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_cells_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char)); F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_cells_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_cells_item_p->gNB_DU_System_Information->sIB1_message.buf, memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_cells_item_p->gNB_DU_System_Information->sIB1_message.buf,
...@@ -191,59 +180,48 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -191,59 +180,48 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
i, F1AP_SETUP_REQ(message_p).sib1[i], F1AP_SETUP_REQ(message_p).sib1_length[i]); i, F1AP_SETUP_REQ(message_p).sib1[i], F1AP_SETUP_REQ(message_p).sib1_length[i]);
} }
*f1ap_du_data_from_du = F1AP_SETUP_REQ(message_p); *f1ap_du_data_from_du = F1AP_SETUP_REQ(message_p);
// char *measurement_timing_information[F1AP_MAX_NB_CELLS]; // char *measurement_timing_information[F1AP_MAX_NB_CELLS];
// uint8_t ranac[F1AP_MAX_NB_CELLS]; // uint8_t ranac[F1AP_MAX_NB_CELLS];
// int fdd_flag = f1ap_setup_req->fdd_flag; // int fdd_flag = f1ap_setup_req->fdd_flag;
// union { // union {
// struct { // struct {
// uint32_t ul_nr_arfcn; // uint32_t ul_nr_arfcn;
// uint8_t ul_scs; // uint8_t ul_scs;
// uint8_t ul_nrb; // uint8_t ul_nrb;
// uint32_t dl_nr_arfcn; // uint32_t dl_nr_arfcn;
// uint8_t dl_scs; // uint8_t dl_scs;
// uint8_t dl_nrb; // uint8_t dl_nrb;
// uint32_t sul_active; // uint32_t sul_active;
// uint32_t sul_nr_arfcn; // uint32_t sul_nr_arfcn;
// uint8_t sul_scs; // uint8_t sul_scs;
// uint8_t sul_nrb; // uint8_t sul_nrb;
// uint8_t num_frequency_bands; // uint8_t num_frequency_bands;
// uint16_t nr_band[32]; // uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands; // uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32]; // uint16_t nr_sul_band[32];
// } fdd; // } fdd;
// struct { // struct {
// uint32_t nr_arfcn; // uint32_t nr_arfcn;
// uint8_t scs; // uint8_t scs;
// uint8_t nrb; // uint8_t nrb;
// uint32_t sul_active; // uint32_t sul_active;
// uint32_t sul_nr_arfcn; // uint32_t sul_nr_arfcn;
// uint8_t sul_scs; // uint8_t sul_scs;
// uint8_t sul_nrb; // uint8_t sul_nrb;
// uint8_t num_frequency_bands; // uint8_t num_frequency_bands;
// uint16_t nr_band[32]; // uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands; // uint8_t num_sul_frequency_bands;
// 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];
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_F1AP_CU, MSC_F1AP_CU,
MSC_RRC_ENB, MSC_RRC_ENB,
0, 0,
0, 0,
MSC_AS_TIME_FMT" CU_handle_F1_SETUP_REQUEST", MSC_AS_TIME_FMT" CU_handle_F1_SETUP_REQUEST",
0,0//MSC_AS_TIME_ARGS(ctxt_pP), 0,0//MSC_AS_TIME_ARGS(ctxt_pP),
); );
if (num_cells_available > 0) { if (num_cells_available > 0) {
...@@ -254,34 +232,32 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -254,34 +232,32 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
} }
} else { } else {
CU_send_F1_SETUP_FAILURE(instance); CU_send_F1_SETUP_FAILURE(instance);
if (RC.nrrrc[0]->node_type == ngran_gNB_CU) { if (RC.nrrrc[0]->node_type == ngran_gNB_CU) {
itti_free(TASK_RRC_GNB,message_p); itti_free(TASK_RRC_GNB,message_p);
} else { } else {
itti_free(TASK_RRC_ENB,message_p); itti_free(TASK_RRC_ENB,message_p);
} }
return -1; return -1;
} }
return 0; return 0;
} }
int CU_send_F1_SETUP_RESPONSE(instance_t instance, int CU_send_F1_SETUP_RESPONSE(instance_t instance,
f1ap_setup_resp_t *f1ap_setup_resp) { f1ap_setup_resp_t *f1ap_setup_resp) {
module_id_t enb_mod_idP; module_id_t enb_mod_idP;
module_id_t cu_mod_idP; module_id_t cu_mod_idP;
// This should be fixed // This should be fixed
enb_mod_idP = (module_id_t)0; enb_mod_idP = (module_id_t)0;
cu_mod_idP = (module_id_t)0; cu_mod_idP = (module_id_t)0;
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupResponse_t *out; F1AP_F1SetupResponse_t *out;
F1AP_F1SetupResponseIEs_t *ie; F1AP_F1SetupResponseIEs_t *ie;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int i = 0; int i = 0;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -291,7 +267,6 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -291,7 +267,6 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject; pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse; pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse; out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse;
/* mandatory */ /* mandatory */
/* c1. Transaction ID (integer value)*/ /* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t)); ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
...@@ -300,7 +275,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -300,7 +275,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID; ie->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP); ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */ /* optional */
/* c2. GNB_CU_Name */ /* c2. GNB_CU_Name */
if (f1ap_setup_resp->gNB_CU_name != NULL) { if (f1ap_setup_resp->gNB_CU_name != NULL) {
...@@ -317,91 +292,85 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -317,91 +292,85 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
/* c3. cells to be Activated list */ /* c3. cells to be Activated list */
int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate; int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate;
LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate); LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
if (num_cells_to_activate >0) { if (num_cells_to_activate >0) {
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t)); ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List; ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List; ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
for (i=0; for (i=0;
i<num_cells_to_activate; i<num_cells_to_activate;
i++) { i++) {
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies; F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t)); cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item; cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject; cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item; cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
/* 3.1 cells to be Activated list item */ /* 3.1 cells to be Activated list item */
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item; F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t)); memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_setup_resp->cells_to_activate[i].mcc, f1ap_setup_resp->cells_to_activate[i].mnc, f1ap_setup_resp->cells_to_activate[i].mnc_digit_length, MCC_MNC_TO_PLMNID(f1ap_setup_resp->cells_to_activate[i].mcc, f1ap_setup_resp->cells_to_activate[i].mnc, f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI; cells_to_be_activated_list_item.nRCGI = nRCGI;
/* optional */ /* optional */
/* - nRPCI */ /* - nRPCI */
if (1) { if (1) {
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t)); cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
*cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007 *cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
} }
/* optional */ /* optional */
/* - gNB-CU System Information */ /* - gNB-CU System Information */
if (1) { if (1) {
/* 3.1.2 gNB-CUSystem Information */ /* 3.1.2 gNB-CUSystem Information */
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs; F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t)); cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation; cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject; cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation; cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t)); //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]); //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++) // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]); //printf("\n");
//printf("\n");
// for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
// for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ? for (int sIBtype=2; sIBtype<21; sIBtype++) {
for (int sIBtype=2;sIBtype<21;sIBtype++) { if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) { AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype); F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item)); memset((void *)sib_item,0,sizeof(*sib_item));
memset((void*)sib_item,0,sizeof(*sib_item)); sib_item->sIBtype = sIBtype;
sib_item->sIBtype = sIBtype; OCTET_STRING_fromBuf(&sib_item->sIBmessage,
OCTET_STRING_fromBuf(&sib_item->sIBmessage, (const char *)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
(const char*)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype], f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]); LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]); }
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item); }
}
} cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation; F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
ASN_SEQUENCE_ADD(&p_154P112_t.list,
F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t; cells_to_be_activated_list_itemExtIEs);
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t)); cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)&p_154P112_t;
free(gNB_CUSystemInformation);
ASN_SEQUENCE_ADD(&p_154P112_t.list, gNB_CUSystemInformation = NULL;
cells_to_be_activated_list_itemExtIEs);
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
free(gNB_CUSystemInformation);
gNB_CUSystemInformation = NULL;
} }
/* ADD */ /* ADD */
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item; cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
cells_to_be_activated_list_item_ies); cells_to_be_activated_list_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
} }
...@@ -412,27 +381,21 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -412,27 +381,21 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
} }
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0); cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0; return 0;
} }
int CU_send_F1_SETUP_FAILURE(instance_t instance) { int CU_send_F1_SETUP_FAILURE(instance_t instance) {
LOG_D(F1AP, "CU_send_F1_SETUP_FAILURE\n"); LOG_D(F1AP, "CU_send_F1_SETUP_FAILURE\n");
module_id_t enb_mod_idP; module_id_t enb_mod_idP;
module_id_t cu_mod_idP; module_id_t cu_mod_idP;
// This should be fixed // This should be fixed
enb_mod_idP = (module_id_t)0; enb_mod_idP = (module_id_t)0;
cu_mod_idP = (module_id_t)0; cu_mod_idP = (module_id_t)0;
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupFailure_t *out; F1AP_F1SetupFailure_t *out;
F1AP_F1SetupFailureIEs_t *ie; F1AP_F1SetupFailureIEs_t *ie;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -442,7 +405,6 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) { ...@@ -442,7 +405,6 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
pdu.choice.unsuccessfulOutcome->criticality = F1AP_Criticality_reject; pdu.choice.unsuccessfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.unsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure; pdu.choice.unsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure;
out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure; out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
/* mandatory */ /* mandatory */
/* c1. Transaction ID (integer value)*/ /* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t)); ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
...@@ -451,7 +413,6 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) { ...@@ -451,7 +413,6 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TransactionID; ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP); ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/* c2. Cause */ /* c2. Cause */
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t)); ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
...@@ -498,7 +459,6 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) { ...@@ -498,7 +459,6 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
} }
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0); cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0; return 0;
} }
...@@ -509,19 +469,19 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) { ...@@ -509,19 +469,19 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
*/ */
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) { F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) { F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -533,130 +493,90 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -533,130 +493,90 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) { //void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update) { int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update) {
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu= {0};
F1AP_GNBCUConfigurationUpdate_t *out;
F1AP_GNBCUConfigurationUpdateIEs_t *ie;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int i = 0;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, initMsg);
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate; initMsg->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject; initMsg->criticality = F1AP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate; initMsg->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
out = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate; F1AP_GNBCUConfigurationUpdate_t *cfgUpdate = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
/* mandatory */ /* mandatory */
/* c1. Transaction ID (integer value) */ /* c1. Transaction ID (integer value) */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC1);
ie->id = F1AP_ProtocolIE_ID_id_TransactionID; ieC1->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject; ieC1->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID; ieC1->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, 0); ieC1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, 0);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// mandatory // mandatory
// c2. Cells_to_be_Activated_List // c2. Cells_to_be_Activated_List
if (f1ap_gnb_cu_configuration_update->num_cells_to_activate > 0) { if (f1ap_gnb_cu_configuration_update->num_cells_to_activate > 0) {
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC3);
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List; ieC3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject; ieC3->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List; ieC3->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
for (i=0; for (int i=0; i<f1ap_gnb_cu_configuration_update->num_cells_to_activate; i++) {
i<f1ap_gnb_cu_configuration_update->num_cells_to_activate; asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Activated_List.list,F1AP_Cells_to_be_Activated_List_ItemIEs_t,
i++) { cells_to_be_activated_list_item_ies);
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item; cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject; cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item; cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
// 2.1 cells to be Activated list item // 2.1 cells to be Activated list item
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item; F1AP_Cells_to_be_Activated_List_Item_t *cells_to_be_activated_list_item=&cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t)); // - nRCGI
F1AP_NRCGI_t *nRCGI=&cells_to_be_activated_list_item->nRCGI;
// - nRCGI MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
F1AP_NRCGI_t nRCGI; f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc, &nRCGI->pLMN_Identity);
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc, NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length, &nRCGI->nRCellIdentity);
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
&nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
// optional // optional
// -nRPCI // -nRPCI
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t)); asn1cCalloc(cells_to_be_activated_list_item->nRPCI, F1AP_NRPCI_t, tmp);
*cells_to_be_activated_list_item.nRPCI = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007 *tmp = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
// optional
// optional
// 3.1.2 gNB-CUSystem Information // 3.1.2 gNB-CUSystem Information
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs; F1AP_ProtocolExtensionContainer_154P112_t *p_154P112=(F1AP_ProtocolExtensionContainer_154P112_t *) calloc(1,sizeof(*p_154P112));
cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t)); cells_to_be_activated_list_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p_154P112;
//F1AP_ProtocolExtensionContainer_154P112_t
asn1cSequenceAdd(p_154P112->list,F1AP_Cells_to_be_Activated_List_ItemExtIEs_t, cells_to_be_activated_list_itemExtIEs);
cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation; cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject; cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation; cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) { if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t)); F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = &cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]); //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++) //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]); // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
//printf("\n"); //printf("\n");
// for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ? // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
for (int sIBtype=2;sIBtype<21;sIBtype++) { for (int sIBtype=2; sIBtype<21; sIBtype++) {
if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) { if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype); AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item)); asn1cSequenceAdd(gNB_CUSystemInformation->sibtypetobeupdatedlist.list, F1AP_SibtypetobeupdatedListItem_t, sib_item);
memset((void*)sib_item,0,sizeof(*sib_item)); sib_item->sIBtype = sIBtype;
sib_item->sIBtype = sIBtype; OCTET_STRING_fromBuf(&sib_item->sIBmessage,
OCTET_STRING_fromBuf(&sib_item->sIBmessage, (const char *)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype],
(const char*)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype], f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]); LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,
f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]); }
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item); }
} }
} }
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
ASN_SEQUENCE_ADD(&p_154P112_t.list,
cells_to_be_activated_list_itemExtIEs);
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
free(gNB_CUSystemInformation);
gNB_CUSystemInformation = NULL;
}
// ADD
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
cells_to_be_activated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
} }
/* /*
// c3. Cells_to_be_Deactivated_List // c3. Cells_to_be_Deactivated_List
// //
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List; ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
...@@ -673,7 +593,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -673,7 +593,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject; cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item; cells_to_be_deactivated_list_item_ies->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_item; F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t)); memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
...@@ -688,14 +608,13 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -688,14 +608,13 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item; cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
cells_to_be_deactivated_list_item_ies); cells_to_be_deactivated_list_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/ */
/* /*
// c4. GNB_CU_TNL_Association_To_Add_List // c4. GNB_CU_TNL_Association_To_Add_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List; ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
...@@ -711,7 +630,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -711,7 +630,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_add_item_ies->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_item_ies->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;
memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t)); memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
...@@ -721,7 +640,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -721,7 +640,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
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);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port; // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t)); // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
...@@ -731,19 +650,19 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -731,19 +650,19 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
// 4.1.2 tNLAssociationUsage // 4.1.2 tNLAssociationUsage
gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue; gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = 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;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
gnb_cu_tnl_association_to_add_item_ies); gnb_cu_tnl_association_to_add_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/ */
/* /*
// c5. GNB_CU_TNL_Association_To_Remove_List // c5. GNB_CU_TNL_Association_To_Remove_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List; ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
...@@ -764,29 +683,29 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -764,29 +683,29 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t)); memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
// 4.1.1 tNLAssociationTransportLayerAddress // 4.1.1 tNLAssociationTransportLayerAddress
F1AP_CP_TransportLayerAddress_t transportLayerAddress; F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
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);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port; // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t)); // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address); // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress; gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item; gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
gnb_cu_tnl_association_to_remove_item_ies); gnb_cu_tnl_association_to_remove_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/ */
/* /*
//c6. GNB_CU_TNL_Association_To_Update_List //c6. GNB_CU_TNL_Association_To_Update_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List; ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
...@@ -802,7 +721,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -802,7 +721,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject; gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_update_item_ies->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_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
// 4.1 GNB_CU_TNL_Association_To_Update_Item // 4.1 GNB_CU_TNL_Association_To_Update_Item
F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item; F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t)); memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
...@@ -812,32 +731,32 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -812,32 +731,32 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
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);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t)); // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port; // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t)); // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address); // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress; gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
// 4.1.2 tNLAssociationUsage
// 4.1.2 tNLAssociationUsage
if (1) { if (1) {
gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t)); gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
*gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue; *gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
} }
gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item; gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list, ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
gnb_cu_tnl_association_to_update_item_ies); gnb_cu_tnl_association_to_update_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/ */
/* /*
// c7. Cells_to_be_Barred_List // c7. Cells_to_be_Barred_List
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t)); ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List; ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
...@@ -857,14 +776,14 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -857,14 +776,14 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item; F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t)); memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
// - nRCGI // - nRCGI
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
memset(&nRCGI,0,sizeof(F1AP_NRCGI_t)); memset(&nRCGI,0,sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_barred_item.nRCGI = nRCGI; cells_to_be_barred_item.nRCGI = nRCGI;
// 7.2 cellBarred // 7.2 cellBarred
cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred; cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
...@@ -897,7 +816,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -897,7 +816,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item; protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item;
((F1AP_Protected_EUTRA_Resources_Item_t*)&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L; ((F1AP_Protected_EUTRA_Resources_Item_t*)&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L;
memset(&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item,0, memset(&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item,0,
sizeof(F1AP_Protected_EUTRA_Resources_Item_t)); sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies); ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
...@@ -936,44 +855,48 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -936,44 +855,48 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
*/ */
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 gNB-CU CONFIGURATION UPDATE\n"); LOG_E(F1AP, "Failed to encode F1 gNB-CU CONFIGURATION UPDATE\n");
return -1; return -1;
} }
printf("F1AP gNB-CU CONFIGURATION UPDATE : "); printf("F1AP gNB-CU CONFIGURATION UPDATE : ");
for (int i=0;i<len;i++) printf("%02x ",buffer[i]);
for (int i=0; i<len; i++)
printf("%02x ",buffer[i]);
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
printf("\n"); printf("\n");
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0); cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0; return 0;
} }
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
LOG_I(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id); LOG_I(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id);
return(0); return(0);
} }
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(0, "Not implemented yet\n"); AssertFatal(0, "Not implemented yet\n");
} }
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance, int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) { F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) {
AssertFatal(0, "Not implemented yet\n"); AssertFatal(0, "Not implemented yet\n");
} }
...@@ -43,14 +43,17 @@ extern RAN_CONTEXT_t RC; ...@@ -43,14 +43,17 @@ extern RAN_CONTEXT_t RC;
int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273}; int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273};
int to_NRNRB(int nrb) { int to_NRNRB(int nrb) {
for (int i=0;i<29;i++) if (nrb_lut[i] == nrb) return i; for (int i=0; i<29; i++)
if (nrb_lut[i] == nrb)
return i;
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);
} }
int DU_handle_RESET(instance_t instance, int DU_handle_RESET(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -79,9 +82,9 @@ int DU_send_ERROR_INDICATION(instance_t instance, F1AP_F1AP_PDU_t *pdu_p) { ...@@ -79,9 +82,9 @@ int DU_send_ERROR_INDICATION(instance_t instance, F1AP_F1AP_PDU_t *pdu_p) {
} }
int DU_handle_ERROR_INDICATION(instance_t instance, int DU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -90,329 +93,240 @@ int DU_handle_ERROR_INDICATION(instance_t instance, ...@@ -90,329 +93,240 @@ int DU_handle_ERROR_INDICATION(instance_t instance,
F1 Setup F1 Setup
*/ */
#define asn1cCalloc(VaR, TyPe, lOcPtr) TyPe *lOcPtr=VaR=(TyPe*) calloc(1,sizeof(TyPe));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) TyPe *lOcPtr=(TyPe*) calloc(1,sizeof(TyPe)); ASN_SEQUENCE_ADD(&VaR,lOcPtr);
// SETUP REQUEST // SETUP REQUEST
int DU_send_F1_SETUP_REQUEST(instance_t instance) { int DU_send_F1_SETUP_REQUEST(instance_t instance) {
module_id_t enb_mod_idP=0; module_id_t enb_mod_idP=0;
module_id_t du_mod_idP=0; module_id_t du_mod_idP=0;
F1AP_F1AP_PDU_t pdu= {0};
F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupRequest_t *out;
F1AP_F1SetupRequestIEs_t *ie;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int i = 0;
/* Create */ /* Create */
/* 0. pdu Type */ /* 0. pdu Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); asn1cCalloc(pdu.choice.initiatingMessage, F1AP_InitiatingMessage_t, initMsg);
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_F1Setup; initMsg->procedureCode = F1AP_ProcedureCode_id_F1Setup;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject; initMsg->criticality = F1AP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_F1SetupRequest; initMsg->value.present = F1AP_InitiatingMessage__value_PR_F1SetupRequest;
out = &pdu.choice.initiatingMessage->value.choice.F1SetupRequest; F1AP_F1SetupRequest_t *f1Setup = &initMsg->value.choice.F1SetupRequest;
/* mandatory */ /* mandatory */
/* c1. Transaction ID (integer value) */ /* c1. Transaction ID (integer value) */
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieC1);
ie->id = F1AP_ProtocolIE_ID_id_TransactionID; ieC1->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject; ieC1->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_TransactionID; ieC1->value.present = F1AP_F1SetupRequestIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP); ieC1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/* c2. GNB_DU_ID (integer value) */ /* c2. GNB_DU_ID (integer value) */
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieC2);
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID; ieC2->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID;
ie->criticality = F1AP_Criticality_reject; ieC2->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID; ieC2->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID;
asn_int642INTEGER(&ie->value.choice.GNB_DU_ID, f1ap_du_data->gNB_DU_id); asn_int642INTEGER(&ieC2->value.choice.GNB_DU_ID, f1ap_du_data->gNB_DU_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */ /* optional */
/* c3. GNB_DU_Name */ /* c3. GNB_DU_Name */
if (f1ap_du_data->gNB_DU_name != NULL) { if (f1ap_du_data->gNB_DU_name != NULL) {
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieC3);
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name; ieC3->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name;
ie->criticality = F1AP_Criticality_ignore; ieC3->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name; ieC3->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name;
OCTET_STRING_fromBuf(&ie->value.choice.GNB_DU_Name, f1ap_du_data->gNB_DU_name, OCTET_STRING_fromBuf(&ieC3->value.choice.GNB_DU_Name, f1ap_du_data->gNB_DU_name,
strlen(f1ap_du_data->gNB_DU_name)); strlen(f1ap_du_data->gNB_DU_name));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
} }
/* mandatory */ /* mandatory */
/* c4. served cells list */ /* c4. served cells list */
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieCells);
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List; ieCells->id = F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
ie->criticality = F1AP_Criticality_reject; ieCells->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List; ieCells->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
int num_cells_available = f1ap_du_data->num_cells_available; int num_cells_available = f1ap_du_data->num_cells_available;
LOG_D(F1AP, "num_cells_available = %d \n", num_cells_available); LOG_D(F1AP, "num_cells_available = %d \n", num_cells_available);
for (i=0;
i<num_cells_available;
i++) {
/* mandatory */
/* 4.1 served cells item */
F1AP_GNB_DU_Served_Cells_ItemIEs_t *gnb_du_served_cell_list_item_ies;
gnb_du_served_cell_list_item_ies = (F1AP_GNB_DU_Served_Cells_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_DU_Served_Cells_ItemIEs_t));
gnb_du_served_cell_list_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item;
gnb_du_served_cell_list_item_ies->criticality = F1AP_Criticality_reject;
gnb_du_served_cell_list_item_ies->value.present = F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
F1AP_GNB_DU_Served_Cells_Item_t gnb_du_served_cells_item;
memset((void *)&gnb_du_served_cells_item, 0, sizeof(F1AP_GNB_DU_Served_Cells_Item_t));
/* 4.1.1 served cell Information */
F1AP_Served_Cell_Information_t served_cell_information;
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity);
LOG_D(F1AP, "plmn: (%d,%d)\n",f1ap_du_data->mcc[i],f1ap_du_data->mnc[i]);
//MCC_MNC_TO_PLMNID(208, 95, 2, &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity);
LOG_D(F1AP, "nRCellIdentity (%llx): %x.%x.%x.%x.%x\n",
(long long unsigned int)f1ap_du_data->nr_cellid[i],
nRCGI.nRCellIdentity.buf[0],
nRCGI.nRCellIdentity.buf[1],
nRCGI.nRCellIdentity.buf[2],
nRCGI.nRCellIdentity.buf[3],
nRCGI.nRCellIdentity.buf[4]);
served_cell_information.nRCGI = nRCGI;
/* - nRPCI */
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */
uint8_t fiveGS_TAC[3];
served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
fiveGS_TAC[0] = ((uint8_t*)&f1ap_du_data->tac[i])[2];
fiveGS_TAC[1] = ((uint8_t*)&f1ap_du_data->tac[i])[1];
fiveGS_TAC[2] = ((uint8_t*)&f1ap_du_data->tac[i])[0];
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char *)fiveGS_TAC,
3);
/* - Configured_EPS_TAC */
if(0){
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
"2",
2);
}
/* servedPLMN information */
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info;
//f1ap_du_data->fdd_flag = 1;
if (f1ap_du_data->fdd_flag) { // FDD
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
/* FDD.1 UL NRFreqInfo */
/* FDD.1.1 UL NRFreqInfo ARFCN */
fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_arfcn; // Integer
/* FDD.1.2 F1AP_SUL_Information */
if(0) { // Optional
F1AP_SUL_Information_t *fdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
fdd_sul_info->sUL_NRARFCN = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
fDD_Info->uL_NRFreqInfo.sul_Information = fdd_sul_info;
}
/* FDD.1.3 freqBandListNr */
int fdd_ul_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_frequency_bands;
LOG_D(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
int fdd_ul_j;
for (fdd_ul_j=0;
fdd_ul_j<fdd_ul_num_available_freq_Bands;
fdd_ul_j++) {
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
/* FDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_band[fdd_ul_j]; //
/* FDD.1.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_sul_frequency_bands;
LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
int fdd_ul_k;
for (fdd_ul_k=0;
fdd_ul_k<num_available_supported_SULBands;
fdd_ul_k++) {
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
/* FDD.1.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_sul_band[fdd_ul_k]; //
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
} // for FDD : UL supported_SULBands
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
} // for FDD : UL freq_Bands
/* FDD.2 DL NRFreqInfo */
/* FDD.2.1 DL NRFreqInfo ARFCN */
fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_arfcn; // Integer
/* FDD.2.2 F1AP_SUL_Information */
if(0) { // Optional
F1AP_SUL_Information_t *fdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
fdd_sul_info->sUL_NRARFCN = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
fDD_Info->dL_NRFreqInfo.sul_Information = fdd_sul_info;
}
/* FDD.2.3 freqBandListNr */
int fdd_dl_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_frequency_bands;
LOG_D(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
int fdd_dl_j;
for (fdd_dl_j=0;
fdd_dl_j<fdd_dl_num_available_freq_Bands;
fdd_dl_j++) {
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
/* FDD.2.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_band[fdd_dl_j]; //
/* FDD.2.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_sul_frequency_bands;
LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
int fdd_dl_k;
for (fdd_dl_k=0;
fdd_dl_k<num_available_supported_SULBands;
fdd_dl_k++) {
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
/* FDD.2.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_sul_band[fdd_dl_k]; //
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
} // for FDD : DL supported_SULBands
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
} // for FDD : DL freq_Bands
/* FDD.3 UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.ul_nrb);
/* FDD.4 DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.dl_nrb);
nR_Mode_Info.choice.fDD = fDD_Info;
} else { // TDD
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
/* TDD.1 nRFreqInfo */
/* TDD.1.1 nRFreqInfo ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].tdd.nr_arfcn; // Integer
/* TDD.1.2 F1AP_SUL_Information */
if(0) { // Optional
F1AP_SUL_Information_t *tdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
tdd_sul_info->sUL_NRARFCN = 0;
tdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
tdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
tDD_Info->nRFreqInfo.sul_Information = tdd_sul_info;
}
/* TDD.1.3 freqBandListNr */
int tdd_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].tdd.num_frequency_bands;
LOG_D(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
int j;
for (j=0;
j<tdd_num_available_freq_Bands;
j++) {
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
/* TDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem.freqBandIndicatorNr = *f1ap_du_data->nr_mode_info[i].tdd.nr_band; //
/* TDD.1.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].tdd.num_sul_frequency_bands;
LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
int k;
for (k=0;
k<num_available_supported_SULBands;
k++) {
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
/* TDD.1.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem.freqBandIndicatorNr = *f1ap_du_data->nr_mode_info[i].tdd.nr_sul_band; //
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
} // for TDD : supported_SULBands
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
} // for TDD : freq_Bands
/* TDD.2 transmission_Bandwidth */
tDD_Info->transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].tdd.scs;
tDD_Info->transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].tdd.nrb);
nR_Mode_Info.choice.tDD = tDD_Info;
} // if nR_Mode_Info
served_cell_information.nR_Mode_Info = nR_Mode_Info;
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = f1ap_du_data->measurement_timing_information[i]; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
gnb_du_served_cells_item.served_Cell_Information = served_cell_information; //
/* 4.1.2 gNB-DU System Information */
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
(const char*)f1ap_du_data->mib[i],//f1ap_du_data->mib,
f1ap_du_data->mib_length[i]);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
(const char*)f1ap_du_data->sib1[i],
f1ap_du_data->sib1_length[i]);
gnb_du_served_cells_item.gNB_DU_System_Information = gNB_DU_System_Information; //
/* ADD */
gnb_du_served_cell_list_item_ies->value.choice.GNB_DU_Served_Cells_Item = gnb_du_served_cells_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_DU_Served_Cells_List.list,
gnb_du_served_cell_list_item_ies);
for (int i=0; i<num_cells_available; i++) {
/* mandatory */
/* 4.1 served cells item */
asn1cSequenceAdd(ieCells->value.choice.GNB_DU_Served_Cells_List.list,
F1AP_GNB_DU_Served_Cells_ItemIEs_t, duServedCell);
duServedCell->id = F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item;
duServedCell->criticality = F1AP_Criticality_reject;
duServedCell->value.present = F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
F1AP_GNB_DU_Served_Cells_Item_t *gnb_du_served_cells_item=&duServedCell->value.choice.GNB_DU_Served_Cells_Item;
/* 4.1.1 served cell Information */
F1AP_Served_Cell_Information_t *served_cell_information= &gnb_du_served_cells_item->served_Cell_Information;
F1AP_NRCGI_t *nRCGI= &served_cell_information->nRCGI;
/* - nRCGI */
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI->pLMN_Identity);
LOG_D(F1AP, "plmn: (%d,%d)\n",f1ap_du_data->mcc[i],f1ap_du_data->mnc[i]);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI->nRCellIdentity);
LOG_D(F1AP, "nRCellIdentity (%llx): %x.%x.%x.%x.%x\n",
(long long unsigned int)f1ap_du_data->nr_cellid[i],
nRCGI->nRCellIdentity.buf[0],
nRCGI->nRCellIdentity.buf[1],
nRCGI->nRCellIdentity.buf[2],
nRCGI->nRCellIdentity.buf[3],
nRCGI->nRCellIdentity.buf[4]);
/* - nRPCI */
served_cell_information->nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */
uint32_t tac=htonl(f1ap_du_data->tac[i]);
asn1cCalloc(served_cell_information->fiveGS_TAC, F1AP_FiveGS_TAC_t, netOrder);
OCTET_STRING_fromBuf(netOrder, ((char *)&tac)+1, 3);
/* - Configured_EPS_TAC */
if(0) {
served_cell_information->configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(served_cell_information->configured_EPS_TAC, "2", 2);
}
/* servedPLMN information */
asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t,servedPLMN_item);
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i],
f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
//f1ap_du_data->fdd_flag = 1;
if (f1ap_du_data->fdd_flag) { // FDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
asn1cCalloc(nR_Mode_Info->choice.fDD, F1AP_FDD_Info_t, fDD_Info);
/* FDD.1 UL NRFreqInfo */
/* FDD.1.1 UL NRFreqInfo ARFCN */
fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_arfcn; // Integer
/* FDD.1.2 F1AP_SUL_Information */
if(0) { // Optional
asn1cCalloc(fDD_Info->uL_NRFreqInfo.sul_Information, F1AP_SUL_Information_t, fdd_sul_info);
fdd_sul_info->sUL_NRARFCN = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
}
/* FDD.1.3 freqBandListNr */
int fdd_ul_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_frequency_bands;
LOG_D(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
for (int fdd_ul_j=0; fdd_ul_j<fdd_ul_num_available_freq_Bands; fdd_ul_j++) {
asn1cSequenceAdd(fDD_Info->uL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* FDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_band[fdd_ul_j]; //
/* FDD.1.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_sul_frequency_bands;
LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
for (int fdd_ul_k=0; fdd_ul_k<num_available_supported_SULBands; fdd_ul_k++) {
asn1cSequenceAdd(nr_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
/* FDD.1.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem->freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_sul_band[fdd_ul_k]; //
} // for FDD : UL supported_SULBands
} // for FDD : UL freq_Bands
/* FDD.2 DL NRFreqInfo */
/* FDD.2.1 DL NRFreqInfo ARFCN */
fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_arfcn; // Integer
/* FDD.2.2 F1AP_SUL_Information */
if(0) { // Optional
F1AP_SUL_Information_t *fdd_sul_info=fDD_Info->dL_NRFreqInfo.sul_Information;
fdd_sul_info->sUL_NRARFCN = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
}
/* FDD.2.3 freqBandListNr */
int fdd_dl_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_frequency_bands;
LOG_D(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
for (int fdd_dl_j=0; fdd_dl_j<fdd_dl_num_available_freq_Bands; fdd_dl_j++) {
asn1cSequenceAdd(fDD_Info->dL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* FDD.2.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_band[fdd_dl_j]; //
/* FDD.2.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_sul_frequency_bands;
LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
for (int fdd_dl_k=0; fdd_dl_k<num_available_supported_SULBands; fdd_dl_k++) {
asn1cSequenceAdd(nr_freqBandNrItem->supportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
/* FDD.2.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem->freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_sul_band[fdd_dl_k]; //
} // for FDD : DL supported_SULBands
} // for FDD : DL freq_Bands
/* FDD.3 UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.ul_nrb);
/* FDD.4 DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.dl_nrb);
} else { // TDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
asn1cCalloc(nR_Mode_Info->choice.tDD, F1AP_TDD_Info_t, tDD_Info);
/* TDD.1 nRFreqInfo */
/* TDD.1.1 nRFreqInfo ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].tdd.nr_arfcn; // Integer
/* TDD.1.2 F1AP_SUL_Information */
if(0) { // Optional
F1AP_SUL_Information_t *tdd_sul_info= tDD_Info->nRFreqInfo.sul_Information;
tdd_sul_info->sUL_NRARFCN = 0;
tdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
tdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
}
/* TDD.1.3 freqBandListNr */
int tdd_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].tdd.num_frequency_bands;
LOG_D(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
for (int j=0; j<tdd_num_available_freq_Bands; j++) {
asn1cSequenceAdd(tDD_Info->nRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
/* TDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem->freqBandIndicatorNr = *f1ap_du_data->nr_mode_info[i].tdd.nr_band; //
/* TDD.1.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].tdd.num_sul_frequency_bands;
LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
for (int k=0; k<num_available_supported_SULBands; k++) {
asn1cSequenceAdd(nr_freqBandNrItem->supportedSULBandList.list,F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
/* TDD.1.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem->freqBandIndicatorNr = *f1ap_du_data->nr_mode_info[i].tdd.nr_sul_band; //
} // for TDD : supported_SULBands
} // for TDD : freq_Bands
/* TDD.2 transmission_Bandwidth */
tDD_Info->transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].tdd.scs;
tDD_Info->transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].tdd.nrb);
} // if nR_Mode_Info
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = f1ap_du_data->measurement_timing_information[i]; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information->measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
asn1cCalloc(gnb_du_served_cells_item->gNB_DU_System_Information, F1AP_GNB_DU_System_Information_t, gNB_DU_System_Information);
/* 4.1.2 gNB-DU System Information */
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
(const char *)f1ap_du_data->mib[i], //f1ap_du_data->mib,
f1ap_du_data->mib_length[i]);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
(const char *)f1ap_du_data->sib1[i],
f1ap_du_data->sib1_length[i]);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/* c5. RRC VERSION */ /* c5. RRC VERSION */
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ie2);
ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version; ie2->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
ie->criticality = F1AP_Criticality_reject; ie2->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version; ie2->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
ie->value.choice.RRC_Version.latest_RRC_Version.buf=calloc(1,sizeof(char)); ie2->value.choice.RRC_Version.latest_RRC_Version.buf=calloc(1,sizeof(char));
ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0; ie2->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
ie->value.choice.RRC_Version.latest_RRC_Version.size = 1; ie2->value.choice.RRC_Version.latest_RRC_Version.size = 1;
ie->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5; ie2->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
...@@ -420,98 +334,82 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -420,98 +334,82 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
return -1; return -1;
} }
MSC_LOG_TX_MESSAGE( ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
MSC_F1AP_DU,
MSC_F1AP_CU,
(const char *)buffer,
len,
MSC_AS_TIME_FMT" F1_SETUP_REQUEST initiatingMessage gNB_DU_name %s",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
f1ap_du_data->gNB_DU_name);
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0); du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
return 0; return 0;
} }
int DU_handle_F1_SETUP_RESPONSE(instance_t instance, int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) F1AP_F1AP_PDU_t *pdu) {
{
LOG_D(F1AP, "DU_handle_F1_SETUP_RESPONSE\n"); LOG_D(F1AP, "DU_handle_F1_SETUP_RESPONSE\n");
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_successfulOutcome, AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_successfulOutcome,
"pdu->present != F1AP_F1AP_PDU_PR_successfulOutcome\n"); "pdu->present != F1AP_F1AP_PDU_PR_successfulOutcome\n");
AssertFatal(pdu->choice.successfulOutcome->procedureCode == F1AP_ProcedureCode_id_F1Setup, AssertFatal(pdu->choice.successfulOutcome->procedureCode == F1AP_ProcedureCode_id_F1Setup,
"pdu->choice.successfulOutcome->procedureCode != F1AP_ProcedureCode_id_F1Setup\n"); "pdu->choice.successfulOutcome->procedureCode != F1AP_ProcedureCode_id_F1Setup\n");
AssertFatal(pdu->choice.successfulOutcome->criticality == F1AP_Criticality_reject, AssertFatal(pdu->choice.successfulOutcome->criticality == F1AP_Criticality_reject,
"pdu->choice.successfulOutcome->criticality != F1AP_Criticality_reject\n"); "pdu->choice.successfulOutcome->criticality != F1AP_Criticality_reject\n");
AssertFatal(pdu->choice.successfulOutcome->value.present == F1AP_SuccessfulOutcome__value_PR_F1SetupResponse, AssertFatal(pdu->choice.successfulOutcome->value.present == F1AP_SuccessfulOutcome__value_PR_F1SetupResponse,
"pdu->choice.successfulOutcome->value.present != F1AP_SuccessfulOutcome__value_PR_F1SetupResponse\n"); "pdu->choice.successfulOutcome->value.present != F1AP_SuccessfulOutcome__value_PR_F1SetupResponse\n");
F1AP_F1SetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.F1SetupResponse; F1AP_F1SetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.F1SetupResponse;
F1AP_F1SetupResponseIEs_t *ie; F1AP_F1SetupResponseIEs_t *ie;
int TransactionId = -1; int TransactionId = -1;
int num_cells_to_activate = 0; int num_cells_to_activate = 0;
F1AP_Cells_to_be_Activated_List_Item_t *cell; F1AP_Cells_to_be_Activated_List_Item_t *cell;
MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_SETUP_RESP); MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_SETUP_RESP);
LOG_D(F1AP, "F1AP: F1Setup-Resp: protocolIEs.list.count %d\n", LOG_D(F1AP, "F1AP: F1Setup-Resp: protocolIEs.list.count %d\n",
in->protocolIEs.list.count); in->protocolIEs.list.count);
for (int i=0;i < in->protocolIEs.list.count; i++) {
for (int i=0; i < in->protocolIEs.list.count; i++) {
ie = in->protocolIEs.list.array[i]; ie = in->protocolIEs.list.array[i];
switch (ie->id) { switch (ie->id) {
case F1AP_ProtocolIE_ID_id_TransactionID: case F1AP_ProtocolIE_ID_id_TransactionID:
AssertFatal(ie->criticality == F1AP_Criticality_reject, AssertFatal(ie->criticality == F1AP_Criticality_reject,
"ie->criticality != F1AP_Criticality_reject\n"); "ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_TransactionID, AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_TransactionID,
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n"); "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
TransactionId=ie->value.choice.TransactionID; TransactionId=ie->value.choice.TransactionID;
LOG_D(F1AP, "F1AP: F1Setup-Resp: TransactionId %d\n", LOG_D(F1AP, "F1AP: F1Setup-Resp: TransactionId %d\n",
TransactionId); TransactionId);
break; break;
case F1AP_ProtocolIE_ID_id_gNB_CU_Name: case F1AP_ProtocolIE_ID_id_gNB_CU_Name:
AssertFatal(ie->criticality == F1AP_Criticality_ignore, AssertFatal(ie->criticality == F1AP_Criticality_ignore,
"ie->criticality != F1AP_Criticality_ignore\n"); "ie->criticality != F1AP_Criticality_ignore\n");
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name, AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name,
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n"); "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
F1AP_SETUP_RESP (msg_p).gNB_CU_name = malloc(ie->value.choice.GNB_CU_Name.size+1); F1AP_SETUP_RESP (msg_p).gNB_CU_name = malloc(ie->value.choice.GNB_CU_Name.size+1);
memcpy(F1AP_SETUP_RESP (msg_p).gNB_CU_name,ie->value.choice.GNB_CU_Name.buf,ie->value.choice.GNB_CU_Name.size); memcpy(F1AP_SETUP_RESP (msg_p).gNB_CU_name,ie->value.choice.GNB_CU_Name.buf,ie->value.choice.GNB_CU_Name.size);
F1AP_SETUP_RESP (msg_p).gNB_CU_name[ie->value.choice.GNB_CU_Name.size]='\0'; F1AP_SETUP_RESP (msg_p).gNB_CU_name[ie->value.choice.GNB_CU_Name.size]='\0';
LOG_D(F1AP, "F1AP: F1Setup-Resp: gNB_CU_name %s\n", LOG_D(F1AP, "F1AP: F1Setup-Resp: gNB_CU_name %s\n",
F1AP_SETUP_RESP (msg_p).gNB_CU_name); F1AP_SETUP_RESP (msg_p).gNB_CU_name);
break; break;
case F1AP_ProtocolIE_ID_id_GNB_CU_RRC_Version: case F1AP_ProtocolIE_ID_id_GNB_CU_RRC_Version:
LOG_D(F1AP, "F1AP: Received GNB-CU-RRC-Version, ignoring\n"); LOG_D(F1AP, "F1AP: Received GNB-CU-RRC-Version, ignoring\n");
break; break;
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List:
{ case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List: {
AssertFatal(ie->criticality == F1AP_Criticality_reject, AssertFatal(ie->criticality == F1AP_Criticality_reject,
"ie->criticality != F1AP_Criticality_reject\n"); "ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List, AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List,
"ie->value.present != F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List\n"); "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List\n");
num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count; num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count;
LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate); LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate);
for (int i=0;i<num_cells_to_activate;i++) {
for (int i=0; i<num_cells_to_activate; i++) {
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i]; F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i];
AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item, AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item,
"cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item"); "cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject, AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject,
"cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject"); "cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item, AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item,
"cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item"); "cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item; cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc,
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc_digit_length); F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc_digit_length);
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n", LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
cell->nRCGI.nRCellIdentity.buf[0], cell->nRCGI.nRCellIdentity.buf[0],
cell->nRCGI.nRCellIdentity.buf[1], cell->nRCGI.nRCellIdentity.buf[1],
...@@ -519,60 +417,70 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -519,60 +417,70 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
cell->nRCGI.nRCellIdentity.buf[3], cell->nRCGI.nRCellIdentity.buf[3],
cell->nRCGI.nRCellIdentity.buf[4]); cell->nRCGI.nRCellIdentity.buf[4]);
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity, BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid); F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid);
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions; F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
if (ext==NULL) continue;
if (ext==NULL)
continue;
for (int cnt=0;cnt<ext->list.count;cnt++) { for (int cnt=0; cnt<ext->list.count; cnt++) {
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt]; F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt];
switch (cells_to_be_activated_list_itemExtIEs->id) { switch (cells_to_be_activated_list_itemExtIEs->id) {
/* /*
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_NOTHING: case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_NOTHING:
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailablePLMNList, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailablePLMNList,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_ExtendedAvailablePLMN_List, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_ExtendedAvailablePLMN_List,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_IAB_Info_IAB_donor_CU, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_IAB_Info_IAB_donor_CU,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailableSNPN_ID_List case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailableSNPN_ID_List
*/ */
case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation: case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation: {
{
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nrpci = (cell->nRPCI != NULL) ? *cell->nRPCI : 0; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nrpci = (cell->nRPCI != NULL) ? *cell->nRPCI : 0;
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t*)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation; F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;
AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n"); AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n");
LOG_D(F1AP, "F1AP: Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n", LOG_D(F1AP, "F1AP: Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n",
i, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc, i, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc,
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI); F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI);
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
for (int si = 0; si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count; si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si]; F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size; size_t size = sib_item->sIBmessage.size;
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si] = size; F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si] = size;
LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size); LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si]); F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si]);
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);
} }
break; break;
} }
case F1AP_ProtocolIE_ID_id_AvailablePLMNList: case F1AP_ProtocolIE_ID_id_AvailablePLMNList:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
case F1AP_ProtocolIE_ID_id_ExtendedAvailablePLMN_List: case F1AP_ProtocolIE_ID_id_ExtendedAvailablePLMN_List:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
case F1AP_ProtocolIE_ID_id_IAB_Info_IAB_donor_CU: case F1AP_ProtocolIE_ID_id_IAB_Info_IAB_donor_CU:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
case F1AP_ProtocolIE_ID_id_AvailableSNPN_ID_List: case F1AP_ProtocolIE_ID_id_AvailableSNPN_ID_List:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
default: default:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n",(int)cells_to_be_activated_list_itemExtIEs->id); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n",(int)cells_to_be_activated_list_itemExtIEs->id);
break; break;
} }
} // for (cnt=... } // for (cnt=...
} // for (cells_to_activate... } // for (cells_to_activate...
break; break;
} // case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List } // case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List
...@@ -581,30 +489,32 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, ...@@ -581,30 +489,32 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
break; break;
} // switch ie } // switch ie
} // for IE } // for IE
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n"); AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate); LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = num_cells_to_activate; F1AP_SETUP_RESP (msg_p).num_cells_to_activate = num_cells_to_activate;
// tmp // tmp
// F1AP_SETUP_RESP (msg_p).num_SI[0] = 1; // F1AP_SETUP_RESP (msg_p).num_SI[0] = 1;
for (int i=0;i<num_cells_to_activate;i++) for (int i=0; i<num_cells_to_activate; i++)
AssertFatal(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI > 0, "System Information %d is missing",i); AssertFatal(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI > 0, "System Information %d is missing",i);
MSC_LOG_RX_MESSAGE( MSC_LOG_RX_MESSAGE(
MSC_F1AP_DU, MSC_F1AP_DU,
MSC_F1AP_CU, MSC_F1AP_CU,
0, 0,
0, 0,
MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d", MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP), 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
assoc_id); assoc_id);
if (RC.nrrrc[0]->node_type == ngran_gNB_DU) { if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to GNB_APP with assoc_id (%d->%d)\n", LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to GNB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
} else { } else {
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
} }
...@@ -617,24 +527,20 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, ...@@ -617,24 +527,20 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
LOG_E(F1AP, "DU_handle_F1_SETUP_FAILURE\n"); LOG_E(F1AP, "DU_handle_F1_SETUP_FAILURE\n");
F1AP_F1SetupFailure_t *out; F1AP_F1SetupFailure_t *out;
F1AP_F1SetupFailureIEs_t *ie; F1AP_F1SetupFailureIEs_t *ie;
out = &pdu->choice.unsuccessfulOutcome->value.choice.F1SetupFailure; out = &pdu->choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
/* Transaction ID */ /* Transaction ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out,
F1AP_ProtocolIE_ID_id_TransactionID, true); F1AP_ProtocolIE_ID_id_TransactionID, true);
/* Cause */ /* Cause */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out,
F1AP_ProtocolIE_ID_id_Cause, true); F1AP_ProtocolIE_ID_id_Cause, true);
if(0) { if(0) {
/* TimeToWait */ /* TimeToWait */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupFailureIEs_t, ie, out,
F1AP_ProtocolIE_ID_id_TimeToWait, true); F1AP_ProtocolIE_ID_id_TimeToWait, true);
} }
return 0; return 0;
...@@ -647,17 +553,15 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, ...@@ -647,17 +553,15 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance,
//void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { //void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
instance_t du_mod_idP, instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_setup_req) { f1ap_setup_req_t *f1ap_setup_req) {
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_GNBDUConfigurationUpdate_t *out; F1AP_GNBDUConfigurationUpdate_t *out;
F1AP_GNBDUConfigurationUpdateIEs_t *ie; F1AP_GNBDUConfigurationUpdateIEs_t *ie;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int i = 0; int i = 0;
int j = 0; int j = 0;
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -667,7 +571,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -667,7 +571,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject; pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate; pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
out = &pdu.choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate; out = &pdu.choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
/* mandatory */ /* mandatory */
/* c1. Transaction ID (integer value) */ /* c1. Transaction ID (integer value) */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t)); ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
...@@ -676,8 +579,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -676,8 +579,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID; ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP); ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/* c2. Served_Cells_To_Add */ /* c2. Served_Cells_To_Add */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t)); ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
...@@ -688,158 +589,124 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -688,158 +589,124 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
for (j=0; for (j=0;
j<1; j<1;
j++) { j++) {
// //
F1AP_Served_Cells_To_Add_ItemIEs_t *served_cells_to_add_item_ies; F1AP_Served_Cells_To_Add_ItemIEs_t *served_cells_to_add_item_ies;
served_cells_to_add_item_ies = (F1AP_Served_Cells_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Add_ItemIEs_t)); served_cells_to_add_item_ies = (F1AP_Served_Cells_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Add_ItemIEs_t));
served_cells_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_Item; served_cells_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Add_Item;
served_cells_to_add_item_ies->criticality = F1AP_Criticality_reject; served_cells_to_add_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_add_item_ies->value.present = F1AP_Served_Cells_To_Add_ItemIEs__value_PR_Served_Cells_To_Add_Item; served_cells_to_add_item_ies->value.present = F1AP_Served_Cells_To_Add_ItemIEs__value_PR_Served_Cells_To_Add_Item;
F1AP_Served_Cells_To_Add_Item_t served_cells_to_add_item;
F1AP_Served_Cells_To_Add_Item_t served_cells_to_add_item; memset((void *)&served_cells_to_add_item, 0, sizeof(F1AP_Served_Cells_To_Add_Item_t));
memset((void *)&served_cells_to_add_item, 0, sizeof(F1AP_Served_Cells_To_Add_Item_t)); /* 2.1.1 serverd cell Information */
F1AP_Served_Cell_Information_t served_cell_information;
/* 2.1.1 serverd cell Information */ memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
F1AP_Served_Cell_Information_t served_cell_information; /* - nRCGI */
F1AP_NRCGI_t nRCGI;
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
/* - nRCGI */ MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &nRCGI.pLMN_Identity);
F1AP_NRCGI_t nRCGI; LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); nRCGI.nRCellIdentity.buf[0],
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &nRCGI.pLMN_Identity); nRCGI.nRCellIdentity.buf[1],
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n", nRCGI.nRCellIdentity.buf[2],
nRCGI.nRCellIdentity.buf[0], nRCGI.nRCellIdentity.buf[3],
nRCGI.nRCellIdentity.buf[1], nRCGI.nRCellIdentity.buf[4]);
nRCGI.nRCellIdentity.buf[2], NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
nRCGI.nRCellIdentity.buf[3], served_cell_information.nRCGI = nRCGI;
nRCGI.nRCellIdentity.buf[4]); /* - nRPCI */
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity); served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
served_cell_information.nRCGI = nRCGI; /* - fiveGS_TAC */
uint32_t tac=htonl(f1ap_du_data->tac[i]);
/* - nRPCI */ served_cell_information.fiveGS_TAC=(F1AP_FiveGS_TAC_t *) calloc(1,sizeof(F1AP_FiveGS_TAC_t *));
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007 OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, ((char *)&tac)+1, 3);
/* - fiveGS_TAC */ /* - Configured_EPS_TAC */
uint8_t fiveGS_TAC[3]; if(1) {
fiveGS_TAC[0] = ((uint8_t*)&f1ap_setup_req->tac[i])[2]; served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
fiveGS_TAC[1] = ((uint8_t*)&f1ap_setup_req->tac[i])[1]; OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
fiveGS_TAC[2] = ((uint8_t*)&f1ap_setup_req->tac[i])[0]; "2",
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, 2);
(const char *)fiveGS_TAC, }
3);
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
/* - Configured_EPS_TAC */ memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
if(1){ MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t)); ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC, // // /* - CHOICE NR-MODE-Info */
"2", F1AP_NR_Mode_Info_t nR_Mode_Info;
2);
} if (f1ap_setup_req->fdd_flag) {
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item)); /* > FDD >> FDD Info */
memset(servedPLMN_item,0,sizeof(*servedPLMN_item)); F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity); /* >>> UL NRFreqInfo */
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item); fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
// // /* - CHOICE NR-MODE-Info */ ul_freqBandNrItem.freqBandIndicatorNr = 888L;
F1AP_NR_Mode_Info_t nR_Mode_Info; F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
if (f1ap_setup_req->fdd_flag) { ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD; ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
/* > FDD >> FDD Info */ ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t)); /* >>> DL NRFreqInfo */
/* >>> UL NRFreqInfo */ fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L; F1AP_FreqBandNrItem_t dl_freqBandNrItem;
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
F1AP_FreqBandNrItem_t ul_freqBandNrItem; dl_freqBandNrItem.freqBandIndicatorNr = 555L;
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
ul_freqBandNrItem.freqBandIndicatorNr = 888L; memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem; ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L; /* >>> UL Transmission Bandwidth */
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem); fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem); /* >>> DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
/* >>> DL NRFreqInfo */ fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L; nR_Mode_Info.choice.fDD = fDD_Info;
} else { // TDD
F1AP_FreqBandNrItem_t dl_freqBandNrItem; nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); /* > TDD >> TDD Info */
dl_freqBandNrItem.freqBandIndicatorNr = 555L; F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
/* >>> ARFCN */
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem; tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); F1AP_FreqBandNrItem_t nr_freqBandNrItem;
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L; memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem); nr_freqBandNrItem.freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem); memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
/* >>> UL Transmission Bandwidth */ ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
/* >>> DL Transmission Bandwidth */ tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; nR_Mode_Info.choice.tDD = tDD_Info;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; }
nR_Mode_Info.choice.fDD = fDD_Info; served_cell_information.nR_Mode_Info = nR_Mode_Info;
} else { // TDD /* - measurementTimingConfiguration */
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD; char *measurementTimingConfiguration = "0"; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
/* > TDD >> TDD Info */ measurementTimingConfiguration,
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t)); strlen(measurementTimingConfiguration));
/* >>> ARFCN */ served_cells_to_add_item.served_Cell_Information = served_cell_information; //
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer /* 2.1.2 gNB-DU System Information */
F1AP_FreqBandNrItem_t nr_freqBandNrItem; F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
nr_freqBandNrItem.freqBandIndicatorNr = 555L; "1",
sizeof("1"));
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem; OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); "1",
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L; sizeof("1"));
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem); served_cells_to_add_item.gNB_DU_System_Information = gNB_DU_System_Information; //
/* ADD */
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem); served_cells_to_add_item_ies->value.choice.Served_Cells_To_Add_Item = served_cells_to_add_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Add_List.list,
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15; served_cells_to_add_item_ies);
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
nR_Mode_Info.choice.tDD = tDD_Info;
}
served_cell_information.nR_Mode_Info = nR_Mode_Info;
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
served_cells_to_add_item.served_Cell_Information = served_cell_information; //
/* 2.1.2 gNB-DU System Information */
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
"1",
sizeof("1"));
served_cells_to_add_item.gNB_DU_System_Information = gNB_DU_System_Information; //
/* ADD */
served_cells_to_add_item_ies->value.choice.Served_Cells_To_Add_Item = served_cells_to_add_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Add_List.list,
served_cells_to_add_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/* c3. Served_Cells_To_Modify */ /* c3. Served_Cells_To_Modify */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t)); ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
...@@ -850,160 +717,127 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -850,160 +717,127 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
for (i=0; for (i=0;
i<1; i<1;
i++) { i++) {
// //
F1AP_Served_Cells_To_Modify_ItemIEs_t *served_cells_to_modify_item_ies; F1AP_Served_Cells_To_Modify_ItemIEs_t *served_cells_to_modify_item_ies;
served_cells_to_modify_item_ies = (F1AP_Served_Cells_To_Modify_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Modify_ItemIEs_t)); served_cells_to_modify_item_ies = (F1AP_Served_Cells_To_Modify_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Modify_ItemIEs_t));
served_cells_to_modify_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_Item; served_cells_to_modify_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Modify_Item;
served_cells_to_modify_item_ies->criticality = F1AP_Criticality_reject; served_cells_to_modify_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_modify_item_ies->value.present = F1AP_Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item; served_cells_to_modify_item_ies->value.present = F1AP_Served_Cells_To_Modify_ItemIEs__value_PR_Served_Cells_To_Modify_Item;
F1AP_Served_Cells_To_Modify_Item_t served_cells_to_modify_item;
F1AP_Served_Cells_To_Modify_Item_t served_cells_to_modify_item; memset((void *)&served_cells_to_modify_item, 0, sizeof(F1AP_Served_Cells_To_Modify_Item_t));
memset((void *)&served_cells_to_modify_item, 0, sizeof(F1AP_Served_Cells_To_Modify_Item_t)); /* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI;
/* 3.1 oldNRCGI */ memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t));
F1AP_NRCGI_t oldNRCGI; MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t)); &oldNRCGI.pLMN_Identity);
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity);
&oldNRCGI.pLMN_Identity); served_cells_to_modify_item.oldNRCGI = oldNRCGI;
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity); /* 3.2.1 serverd cell Information */
served_cells_to_modify_item.oldNRCGI = oldNRCGI; F1AP_Served_Cell_Information_t served_cell_information;
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
/* - nRCGI */
/* 3.2.1 serverd cell Information */ F1AP_NRCGI_t nRCGI;
F1AP_Served_Cell_Information_t served_cell_information; memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
&nRCGI.pLMN_Identity);
/* - nRCGI */ NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity);
F1AP_NRCGI_t nRCGI; served_cell_information.nRCGI = nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); /* - nRPCI */
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
&nRCGI.pLMN_Identity); /* - fiveGS_TAC */
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity); served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
served_cell_information.nRCGI = nRCGI; OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char *) &f1ap_setup_req->tac[i],
/* - nRPCI */ 3);
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - Configured_EPS_TAC */
/* - fiveGS_TAC */ if(1) {
served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC)); served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
(const char *) &f1ap_setup_req->tac[i], "2",
3); 2);
}
/* - Configured_EPS_TAC */
if(1){ F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t)); memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC, MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
"2", ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
2); // // /* - CHOICE NR-MODE-Info */
} F1AP_NR_Mode_Info_t nR_Mode_Info;
F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item)); if (f1ap_setup_req->fdd_flag) {
memset(servedPLMN_item,0,sizeof(*servedPLMN_item)); nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity); /* > FDD >> FDD Info */
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item); F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L;
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
// // /* - CHOICE NR-MODE-Info */ memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
F1AP_NR_Mode_Info_t nR_Mode_Info; ul_freqBandNrItem.freqBandIndicatorNr = 888L;
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
if (f1ap_setup_req->fdd_flag) { memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD; ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
/* > FDD >> FDD Info */ ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t)); ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
/* >>> UL NRFreqInfo */ /* >>> DL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = 999L; fDD_Info->dL_NRFreqInfo.nRARFCN = 666L;
F1AP_FreqBandNrItem_t dl_freqBandNrItem;
F1AP_FreqBandNrItem_t ul_freqBandNrItem; memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); dl_freqBandNrItem.freqBandIndicatorNr = 555L;
ul_freqBandNrItem.freqBandIndicatorNr = 888L; F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem;
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem; dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem);
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L; ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem); /* >>> UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem); fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
/* >>> DL Transmission Bandwidth */
/* >>> DL NRFreqInfo */ fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15;
fDD_Info->dL_NRFreqInfo.nRARFCN = 666L; fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11;
nR_Mode_Info.choice.fDD = fDD_Info;
F1AP_FreqBandNrItem_t dl_freqBandNrItem; } else { // TDD
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
dl_freqBandNrItem.freqBandIndicatorNr = 555L; /* > TDD >> TDD Info */
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem; /* >>> ARFCN */
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L; F1AP_FreqBandNrItem_t nr_freqBandNrItem;
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem); memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
nr_freqBandNrItem.freqBandIndicatorNr = 555L;
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem); F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
/* >>> UL Transmission Bandwidth */ nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
/* >>> DL Transmission Bandwidth */ tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15;
fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; nR_Mode_Info.choice.tDD = tDD_Info;
}
nR_Mode_Info.choice.fDD = fDD_Info;
} else { // TDD served_cell_information.nR_Mode_Info = nR_Mode_Info;
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD; /* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; // sept. 2018
/* > TDD >> TDD Info */ OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t)); measurementTimingConfiguration,
/* >>> ARFCN */ strlen(measurementTimingConfiguration));
tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer served_cells_to_modify_item.served_Cell_Information = served_cell_information; //
F1AP_FreqBandNrItem_t nr_freqBandNrItem; /* 3.2.2 gNB-DU System Information */
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
nr_freqBandNrItem.freqBandIndicatorNr = 555L; OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem; sizeof("1"));
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L; "1",
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem); sizeof("1"));
served_cells_to_modify_item.gNB_DU_System_Information = gNB_DU_System_Information; //
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem); /* ADD */
served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item = served_cells_to_modify_item;
tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15; ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Modify_List.list,
tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11; served_cells_to_modify_item_ies);
nR_Mode_Info.choice.tDD = tDD_Info;
}
served_cell_information.nR_Mode_Info = nR_Mode_Info;
/* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
measurementTimingConfiguration,
strlen(measurementTimingConfiguration));
served_cells_to_modify_item.served_Cell_Information = served_cell_information; //
/* 3.2.2 gNB-DU System Information */
F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
"1",
sizeof("1"));
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
"1",
sizeof("1"));
served_cells_to_modify_item.gNB_DU_System_Information = gNB_DU_System_Information; //
/* ADD */
served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item = served_cells_to_modify_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Modify_List.list,
served_cells_to_modify_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/* c4. Served_Cells_To_Delete */ /* c4. Served_Cells_To_Delete */
ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t)); ie = (F1AP_GNBDUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBDUConfigurationUpdateIEs_t));
...@@ -1014,33 +848,28 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -1014,33 +848,28 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
for (i=0; for (i=0;
i<1; i<1;
i++) { i++) {
// //
F1AP_Served_Cells_To_Delete_ItemIEs_t *served_cells_to_delete_item_ies; F1AP_Served_Cells_To_Delete_ItemIEs_t *served_cells_to_delete_item_ies;
served_cells_to_delete_item_ies = (F1AP_Served_Cells_To_Delete_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Delete_ItemIEs_t)); served_cells_to_delete_item_ies = (F1AP_Served_Cells_To_Delete_ItemIEs_t *)calloc(1, sizeof(F1AP_Served_Cells_To_Delete_ItemIEs_t));
served_cells_to_delete_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_Item; served_cells_to_delete_item_ies->id = F1AP_ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
served_cells_to_delete_item_ies->criticality = F1AP_Criticality_reject; served_cells_to_delete_item_ies->criticality = F1AP_Criticality_reject;
served_cells_to_delete_item_ies->value.present = F1AP_Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item; served_cells_to_delete_item_ies->value.present = F1AP_Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item;
F1AP_Served_Cells_To_Delete_Item_t served_cells_to_delete_item;
F1AP_Served_Cells_To_Delete_Item_t served_cells_to_delete_item; memset((void *)&served_cells_to_delete_item, 0, sizeof(F1AP_Served_Cells_To_Delete_Item_t));
memset((void *)&served_cells_to_delete_item, 0, sizeof(F1AP_Served_Cells_To_Delete_Item_t)); /* 3.1 oldNRCGI */
F1AP_NRCGI_t oldNRCGI;
/* 3.1 oldNRCGI */ memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t));
F1AP_NRCGI_t oldNRCGI; MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i],
memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t)); &oldNRCGI.pLMN_Identity);
MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity);
&oldNRCGI.pLMN_Identity); served_cells_to_delete_item.oldNRCGI = oldNRCGI;
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity); /* ADD */
served_cells_to_delete_item.oldNRCGI = oldNRCGI; served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item = served_cells_to_delete_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Delete_List.list,
/* ADD */ served_cells_to_delete_item_ies);
served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item = served_cells_to_delete_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Served_Cells_To_Delete_List.list,
served_cells_to_delete_item_ies);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 gNB-DU CONFIGURATION UPDATE\n"); LOG_E(F1AP, "Failed to encode F1 gNB-DU CONFIGURATION UPDATE\n");
...@@ -1050,86 +879,76 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -1050,86 +879,76 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
return 0; return 0;
} }
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "DU_handle_gNB_CU_CONFIGURATION_UPDATE\n"); LOG_D(F1AP, "DU_handle_gNB_CU_CONFIGURATION_UPDATE\n");
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_initiatingMessage, AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_initiatingMessage,
"pdu->present != F1AP_F1AP_PDU_PR_initiatingMessage\n"); "pdu->present != F1AP_F1AP_PDU_PR_initiatingMessage\n");
AssertFatal(pdu->choice.initiatingMessage->procedureCode == F1AP_ProcedureCode_id_gNBCUConfigurationUpdate, AssertFatal(pdu->choice.initiatingMessage->procedureCode == F1AP_ProcedureCode_id_gNBCUConfigurationUpdate,
"pdu->choice.initiatingMessage->procedureCode != F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n"); "pdu->choice.initiatingMessage->procedureCode != F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n");
AssertFatal(pdu->choice.initiatingMessage->criticality == F1AP_Criticality_reject, AssertFatal(pdu->choice.initiatingMessage->criticality == F1AP_Criticality_reject,
"pdu->choice.initiatingMessage->criticality != F1AP_Criticality_reject\n"); "pdu->choice.initiatingMessage->criticality != F1AP_Criticality_reject\n");
AssertFatal(pdu->choice.initiatingMessage->value.present == F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate, AssertFatal(pdu->choice.initiatingMessage->value.present == F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate,
"pdu->choice.initiatingMessage->value.present != F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate\n"); "pdu->choice.initiatingMessage->value.present != F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate\n");
F1AP_GNBCUConfigurationUpdate_t *in = &pdu->choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate; F1AP_GNBCUConfigurationUpdate_t *in = &pdu->choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
F1AP_GNBCUConfigurationUpdateIEs_t *ie; F1AP_GNBCUConfigurationUpdateIEs_t *ie;
int TransactionId = -1; int TransactionId = -1;
int num_cells_to_activate = 0; int num_cells_to_activate = 0;
F1AP_Cells_to_be_Activated_List_Item_t *cell; F1AP_Cells_to_be_Activated_List_Item_t *cell;
MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE); MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE);
LOG_D(F1AP, "F1AP: gNB_CU_Configuration_Update: protocolIEs.list.count %d\n", LOG_D(F1AP, "F1AP: gNB_CU_Configuration_Update: protocolIEs.list.count %d\n",
in->protocolIEs.list.count); in->protocolIEs.list.count);
for (int i=0;i < in->protocolIEs.list.count; i++) {
for (int i=0; i < in->protocolIEs.list.count; i++) {
ie = in->protocolIEs.list.array[i]; ie = in->protocolIEs.list.array[i];
switch (ie->id) { switch (ie->id) {
case F1AP_ProtocolIE_ID_id_TransactionID: case F1AP_ProtocolIE_ID_id_TransactionID:
AssertFatal(ie->criticality == F1AP_Criticality_reject, AssertFatal(ie->criticality == F1AP_Criticality_reject,
"ie->criticality != F1AP_Criticality_reject\n"); "ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID, AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID,
"ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID\n"); "ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID\n");
TransactionId=ie->value.choice.TransactionID; TransactionId=ie->value.choice.TransactionID;
LOG_D(F1AP, "F1AP: GNB-CU-ConfigurationUpdate: TransactionId %d\n", LOG_D(F1AP, "F1AP: GNB-CU-ConfigurationUpdate: TransactionId %d\n",
TransactionId); TransactionId);
break; break;
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List:
{ case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List: {
AssertFatal(ie->criticality == F1AP_Criticality_reject, AssertFatal(ie->criticality == F1AP_Criticality_reject,
"ie->criticality != F1AP_Criticality_reject\n"); "ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List, AssertFatal(ie->value.present == F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List,
"ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List\n"); "ie->value.present != F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List\n");
num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count; num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count;
LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate); LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate);
for (int i=0;i<num_cells_to_activate;i++) {
for (int i=0; i<num_cells_to_activate; i++) {
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i]; F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *) ie->value.choice.Cells_to_be_Activated_List.list.array[i];
AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item, AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item,
"cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item"); "cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject, AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject,
"cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject"); "cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item, AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item,
"cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item"); "cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item; cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc,
TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc_digit_length); F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc_digit_length);
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n", LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
cell->nRCGI.nRCellIdentity.buf[0], cell->nRCGI.nRCellIdentity.buf[0],
cell->nRCGI.nRCellIdentity.buf[1], cell->nRCGI.nRCellIdentity.buf[1],
...@@ -1137,61 +956,70 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -1137,61 +956,70 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
cell->nRCGI.nRCellIdentity.buf[3], cell->nRCGI.nRCellIdentity.buf[3],
cell->nRCGI.nRCellIdentity.buf[4]); cell->nRCGI.nRCellIdentity.buf[4]);
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity, BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid); F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid);
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions; F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
if (ext==NULL) continue; if (ext==NULL)
continue;
for (int cnt=0;cnt<ext->list.count;cnt++) {
for (int cnt=0; cnt<ext->list.count; cnt++) {
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt]; F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt];
switch (cells_to_be_activated_list_itemExtIEs->id) { switch (cells_to_be_activated_list_itemExtIEs->id) {
/* /*
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_NOTHING: case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_NOTHING:
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailablePLMNList, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailablePLMNList,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_ExtendedAvailablePLMN_List, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_ExtendedAvailablePLMN_List,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_IAB_Info_IAB_donor_CU, case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_IAB_Info_IAB_donor_CU,
case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailableSNPN_ID_List case F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_AvailableSNPN_ID_List
*/ */
case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation: case F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation: {
{
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nrpci = (cell->nRPCI != NULL) ? *cell->nRPCI : 0; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nrpci = (cell->nRPCI != NULL) ? *cell->nRPCI : 0;
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t*)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation; F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)&cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;
AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n"); AssertFatal(ext->list.count==1,"At least one SI message should be there, and only 1 for now!\n");
LOG_D(F1AP, "F1AP: Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n", LOG_D(F1AP, "F1AP: Cell %d MCC %d MNC %d NRCellid %lx num_si %d\n",
i, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc, i, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mcc, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].mnc,
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI); F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].nr_cellid, F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].num_SI);
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
for (int si = 0; si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count; si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si]; F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size; size_t size = sib_item->sIBmessage.size;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si] = size; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si] = size;
LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size); LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si]); F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si]);
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);
} }
break; break;
} }
case F1AP_ProtocolIE_ID_id_AvailablePLMNList: case F1AP_ProtocolIE_ID_id_AvailablePLMNList:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
case F1AP_ProtocolIE_ID_id_ExtendedAvailablePLMN_List: case F1AP_ProtocolIE_ID_id_ExtendedAvailablePLMN_List:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
case F1AP_ProtocolIE_ID_id_IAB_Info_IAB_donor_CU: case F1AP_ProtocolIE_ID_id_IAB_Info_IAB_donor_CU:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
case F1AP_ProtocolIE_ID_id_AvailableSNPN_ID_List: case F1AP_ProtocolIE_ID_id_AvailableSNPN_ID_List:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n"); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id_AvailablePLMNList not supported yet\n");
break; break;
default: default:
AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n",(int)cells_to_be_activated_list_itemExtIEs->id); AssertFatal(1==0,"F1AP_ProtocolIE_ID_id %d unknown\n",(int)cells_to_be_activated_list_itemExtIEs->id);
break; break;
} }
} // for (cnt=... } // for (cnt=...
} // for (cells_to_activate... } // for (cells_to_activate...
break; break;
} // case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List } // case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List
...@@ -1200,26 +1028,26 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -1200,26 +1028,26 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
break; break;
} // switch ie } // switch ie
} // for IE } // for IE
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n"); AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate); LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate; F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate;
MSC_LOG_RX_MESSAGE( MSC_LOG_RX_MESSAGE(
MSC_F1AP_DU, MSC_F1AP_DU,
MSC_F1AP_CU, MSC_F1AP_CU,
0, 0,
0, 0,
MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d", MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP), 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
assoc_id); assoc_id);
if (RC.nrrrc[0]->node_type == ngran_gNB_DU) { if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to GNB_APP with assoc_id (%d->%d)\n", LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to GNB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
} else { } else {
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to ENB_APP with assoc_id (%d->%d)\n", LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to ENB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
} }
...@@ -1227,35 +1055,28 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -1227,35 +1055,28 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
} }
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) { f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) {
AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n", AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n",
GNBCUConfigurationUpdateFailure->cause); GNBCUConfigurationUpdateFailure->cause);
} }
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge) { f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0, AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0,
"%d cells failed to activate\n", "%d cells failed to activate\n",
GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated); GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated);
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup == 0, AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup == 0,
"%d TNLAssociations to setup, handle this ...\n", "%d TNLAssociations to setup, handle this ...\n",
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup); GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup);
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed == 0, AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed == 0,
"%d TNLAssociations failed\n", "%d TNLAssociations failed\n",
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed); GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed);
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs == 0, AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs == 0,
"%d DedicatedSIDeliveryNeededUEs\n", "%d DedicatedSIDeliveryNeededUEs\n",
GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs); GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs);
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
/* Create */ /* Create */
/* 0. pdu Type */ /* 0. pdu Type */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -1265,7 +1086,6 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -1265,7 +1086,6 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject; pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge; pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge;
F1AP_GNBCUConfigurationUpdateAcknowledge_t *out = &pdu.choice.successfulOutcome->value.choice.GNBCUConfigurationUpdateAcknowledge; F1AP_GNBCUConfigurationUpdateAcknowledge_t *out = &pdu.choice.successfulOutcome->value.choice.GNBCUConfigurationUpdateAcknowledge;
/* mandatory */ /* mandatory */
/* c1. Transaction ID (integer value)*/ /* c1. Transaction ID (integer value)*/
F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *ie = (F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t)); F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *ie = (F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
...@@ -1282,21 +1102,18 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -1282,21 +1102,18 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
} }
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0); du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
return 0; return 0;
} }
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest) { F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest) {
AssertFatal(0, "Not implemented yet\n"); AssertFatal(0, "Not implemented yet\n");
} }
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance, int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
AssertFatal(0, "Not implemented yet\n"); AssertFatal(0, "Not implemented yet\n");
} }
...@@ -925,21 +925,14 @@ void ...@@ -925,21 +925,14 @@ void
sctp_eNB_read_from_socket( sctp_eNB_read_from_socket(
struct sctp_cnx_list_elm_s *sctp_cnx) struct sctp_cnx_list_elm_s *sctp_cnx)
{ {
int flags = 0, n;
socklen_t from_len;
struct sctp_sndrcvinfo sinfo;
struct sockaddr_in addr;
uint8_t buffer[SCTP_RECV_BUFFER_SIZE];
DevAssert(sctp_cnx != NULL); DevAssert(sctp_cnx != NULL);
memset((void *)&addr, 0, sizeof(struct sockaddr_in)); int flags = 0;
from_len = (socklen_t)sizeof(struct sockaddr_in); struct sctp_sndrcvinfo sinfo={0};
memset((void *)&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); uint8_t buffer[SCTP_RECV_BUFFER_SIZE];
n = sctp_recvmsg(sctp_cnx->sd, (void *)buffer, SCTP_RECV_BUFFER_SIZE, int n = sctp_recvmsg(sctp_cnx->sd, (void *)buffer, SCTP_RECV_BUFFER_SIZE,
(struct sockaddr *)&addr, &from_len, NULL, NULL,
&sinfo, &flags); &sinfo, &flags);
if (n < 0) { if (n < 0) {
...@@ -1049,8 +1042,8 @@ sctp_eNB_read_from_socket( ...@@ -1049,8 +1042,8 @@ sctp_eNB_read_from_socket(
sctp_cnx->ppid); sctp_cnx->ppid);
} }
SCTP_DEBUG("[%d][%d] Msg of length %d received from port %u, on stream %d, PPID %d\n", SCTP_DEBUG("[%d][%d] Msg of length %d received, on stream %d, PPID %d\n",
sinfo.sinfo_assoc_id, sctp_cnx->sd, n, ntohs(addr.sin_port), sinfo.sinfo_assoc_id, sctp_cnx->sd, n,
sinfo.sinfo_stream, ntohl(sinfo.sinfo_ppid)); sinfo.sinfo_stream, ntohl(sinfo.sinfo_ppid));
sctp_itti_send_new_message_ind(sctp_cnx->task_id, sctp_itti_send_new_message_ind(sctp_cnx->task_id,
......
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