Commit 1c8618ef authored by Raymond Knopp's avatar Raymond Knopp

fixed bug with fiveGS_TAC IE and added RRC_Version IE in F1-Setup-Req

parent 666aee7f
...@@ -135,58 +135,58 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -135,58 +135,58 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
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_celles_item_p; F1AP_GNB_DU_Served_Cells_Item_t *served_cells_item_p;
served_celles_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_celles_item_p->served_Cell_Information.fiveGS_TAC) { if (served_cells_item_p->served_Cell_Information.fiveGS_TAC) {
OCTET_STRING_TO_INT16(served_celles_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_celles_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_celles_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],
(long long unsigned int)F1AP_SETUP_REQ(message_p).nr_cellid[i]); (long long unsigned int)F1AP_SETUP_REQ(message_p).nr_cellid[i]);
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n", LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0], served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1], served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2], served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[3], served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[3],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]); served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]);
/* - nRPCI */ /* - nRPCI */
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_celles_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_celles_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));
memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_celles_item_p->gNB_DU_System_Information->mIB_message.buf, memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_cells_item_p->gNB_DU_System_Information->mIB_message.buf,
served_celles_item_p->gNB_DU_System_Information->mIB_message.size); served_cells_item_p->gNB_DU_System_Information->mIB_message.size);
/* Convert the mme name to a printable string */ /* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).mib[i][served_celles_item_p->gNB_DU_System_Information->mIB_message.size] = '\0'; F1AP_SETUP_REQ(message_p).mib[i][served_cells_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
F1AP_SETUP_REQ(message_p).mib_length[i] = served_celles_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_celles_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_celles_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,
served_celles_item_p->gNB_DU_System_Information->sIB1_message.size); served_cells_item_p->gNB_DU_System_Information->sIB1_message.size);
/* Convert the mme name to a printable string */ /* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).sib1[i][served_celles_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0'; F1AP_SETUP_REQ(message_p).sib1[i][served_cells_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
F1AP_SETUP_REQ(message_p).sib1_length[i] = served_celles_item_p->gNB_DU_System_Information->sIB1_message.size; F1AP_SETUP_REQ(message_p).sib1_length[i] = served_cells_item_p->gNB_DU_System_Information->sIB1_message.size;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).sib1[%d] %s , len = %d \n", LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).sib1[%d] %s , len = %d \n",
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]);
} }
......
...@@ -195,6 +195,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -195,6 +195,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007 served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char*)&f1ap_du_data->tac[i], (const char*)&f1ap_du_data->tac[i],
3); 3);
...@@ -397,6 +398,18 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -397,6 +398,18 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c5. RRC VERSION */
ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
ie->value.choice.RRC_Version.latest_RRC_Version.buf=calloc(1,sizeof(char));
ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
ie->value.choice.RRC_Version.latest_RRC_Version.size = 1;
ie->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) {
LOG_E(F1AP, "Failed to encode F1 setup request\n"); LOG_E(F1AP, "Failed to encode F1 setup request\n");
...@@ -864,6 +877,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, ...@@ -864,6 +877,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007 served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char *) &f1ap_setup_req->tac[i], (const char *) &f1ap_setup_req->tac[i],
3); 3);
......
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