Commit c8742f26 authored by Bing-Kai Hong's avatar Bing-Kai Hong

Normalized message output

parent 988d98a4
...@@ -84,7 +84,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -84,7 +84,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) F1AP_F1AP_PDU_t *pdu)
{ {
printf("CU_handle_F1_SETUP_REQUEST\n"); LOG_D(CU_F1AP, "CU_handle_F1_SETUP_REQUEST\n");
MessageDef *message_p; MessageDef *message_p;
F1AP_F1SetupRequest_t *container; F1AP_F1SetupRequest_t *container;
...@@ -112,7 +112,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -112,7 +112,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
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);
printf("F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id); LOG_D(CU_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,
...@@ -122,13 +122,13 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -122,13 +122,13 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
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';
printf ("F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name); LOG_D(CU_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;
printf ("F1AP_SETUP_REQ(message_p).num_cells_available %d \n", F1AP_SETUP_REQ(message_p).num_cells_available); LOG_D(CU_F1AP, "F1AP_SETUP_REQ(message_p).num_cells_available %d \n", 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;
...@@ -139,7 +139,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -139,7 +139,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
/* tac */ /* 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_celles_item_p->served_Cell_Information.fiveGS_TAC), F1AP_SETUP_REQ(message_p).tac[i]);
printf ("F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]); LOG_D(CU_F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n", 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_celles_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
...@@ -150,11 +150,11 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -150,11 +150,11 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
// 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_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity,
F1AP_SETUP_REQ(message_p).nr_cellid[i]); F1AP_SETUP_REQ(message_p).nr_cellid[i]);
printf("[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %d\n", assoc_id, LOG_D(CU_F1AP, "[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %d\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],
F1AP_SETUP_REQ(message_p).nr_cellid[i]); F1AP_SETUP_REQ(message_p).nr_cellid[i]);
printf("nr_cellId : %x %x %x %x %x\n", LOG_D(CU_F1AP, "nr_cellId : %x %x %x %x %x\n",
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0], served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1], served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2], served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2],
...@@ -162,7 +162,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -162,7 +162,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]); served_celles_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_celles_item_p->served_Cell_Information.nRPCI;
printf ("F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n", i, F1AP_SETUP_REQ(message_p).nr_pci[i]); LOG_D(CU_F1AP, "F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n", i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
// System Information // System Information
/* mib */ /* mib */
...@@ -172,7 +172,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -172,7 +172,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
/* 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_celles_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_celles_item_p->gNB_DU_System_Information->mIB_message.size;
printf ("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]); LOG_D(CU_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]);
/* 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_celles_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
...@@ -181,7 +181,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -181,7 +181,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
/* 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_celles_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_celles_item_p->gNB_DU_System_Information->sIB1_message.size;
printf ("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]); LOG_D(CU_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]);
} }
...@@ -294,7 +294,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -294,7 +294,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List; ie->value.present = F1AP_F1SetupResponseIEs__value_PR_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;
printf("num_cells_to_activate = %d \n", num_cells_to_activate); LOG_D(CU_F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
for (i=0; for (i=0;
i<num_cells_to_activate; i<num_cells_to_activate;
i++) { i++) {
...@@ -335,13 +335,13 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -335,13 +335,13 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
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));
printf("SI %d: "); LOG_D(CU_F1AP, "SI %d: ");
for (int n=0;n<f1ap_setup_resp->SI_container_length[i][0];n++) printf("%2x ",f1ap_setup_resp->SI_container[i][0][n]); for (int n=0;n<f1ap_setup_resp->SI_container_length[i][0];n++) LOG_D(CU_F1AP, "%2x ",f1ap_setup_resp->SI_container[i][0][n]);
printf("\n"); LOG_D(CU_F1AP, "\n");
OCTET_STRING_fromBuf(&gNB_CUSystemInformation->sImessage, OCTET_STRING_fromBuf(&gNB_CUSystemInformation->sImessage,
f1ap_setup_resp->SI_container[i][0], f1ap_setup_resp->SI_container_length[i][0]); f1ap_setup_resp->SI_container[i][0], f1ap_setup_resp->SI_container_length[i][0]);
printf("f1ap_setup_resp->SI_container_length = %d \n" , f1ap_setup_resp->SI_container_length[0][0]); LOG_D(CU_F1AP, "f1ap_setup_resp->SI_container_length = %d \n" , f1ap_setup_resp->SI_container_length[0][0]);
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation; cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
...@@ -362,24 +362,17 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, ...@@ -362,24 +362,17 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(CU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
// 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);
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//printf("F1 setup response present = %d\n", out->value.present);
//f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->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) {
printf("CU_send_F1_SETUP_FAILURE\n"); LOG_D(CU_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;
...@@ -454,7 +447,7 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) { ...@@ -454,7 +447,7 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(CU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
...@@ -858,7 +851,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ ...@@ -858,7 +851,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(CU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
......
...@@ -59,7 +59,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -59,7 +59,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
printf("CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER\n"); LOG_D(CU_F1AP, "CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER\n");
// decode the F1 message // decode the F1 message
// get the rrc message from the contauiner // get the rrc message from the contauiner
// call func rrc_eNB_decode_ccch: <-- needs some update here // call func rrc_eNB_decode_ccch: <-- needs some update here
...@@ -90,7 +90,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -90,7 +90,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true); F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID; du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
printf("du_ue_f1ap_id %lu \n", du_ue_f1ap_id); LOG_D(CU_F1AP, "du_ue_f1ap_id %lu \n", du_ue_f1ap_id);
/* NRCGI /* NRCGI
* TODO: process NRCGI * TODO: process NRCGI
...@@ -117,9 +117,9 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -117,9 +117,9 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ccch_sdu_len = ie->value.choice.RRCContainer.size; ccch_sdu_len = ie->value.choice.RRCContainer.size;
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf, memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
ccch_sdu_len); ccch_sdu_len);
printf ("RRCContainer(CCCH) :"); LOG_D(CU_F1AP, "RRCContainer(CCCH) :");
for (int i=0;i<ie->value.choice.RRCContainer.size;i++) printf("%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]); for (int i=0;i<ie->value.choice.RRCContainer.size;i++) LOG_D(CU_F1AP, "%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
LOG_D(CU_F1AP, "\n");
// Find instance from nr_cellid // Find instance from nr_cellid
int rrc_inst = -1; int rrc_inst = -1;
for (int i=0;i<RC.nb_inst;i++) { for (int i=0;i<RC.nb_inst;i++) {
...@@ -276,22 +276,12 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -276,22 +276,12 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(CU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
#ifdef F1AP_TEST
printf("\n");
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
return -1;
}
#endif
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id, buffer, len, 0); cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id, buffer, len, 0);
return 0; return 0;
} }
...@@ -304,7 +294,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -304,7 +294,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
printf("CU_handle_UL_RRC_MESSAGE_TRANSFER \n"); LOG_D(CU_F1AP, "CU_handle_UL_RRC_MESSAGE_TRANSFER \n");
MessageDef *message_p; MessageDef *message_p;
F1AP_ULRRCMessageTransfer_t *container; F1AP_ULRRCMessageTransfer_t *container;
...@@ -336,14 +326,14 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -336,14 +326,14 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true); F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID; cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
printf("cu_ue_f1ap_id %lu \n", cu_ue_f1ap_id); LOG_D(CU_F1AP, "cu_ue_f1ap_id %lu \n", cu_ue_f1ap_id);
/* GNB_DU_UE_F1AP_ID */ /* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true); F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID; du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
printf("du_ue_f1ap_id %lu \n", du_ue_f1ap_id); LOG_D(CU_F1AP, "du_ue_f1ap_id %lu \n", du_ue_f1ap_id);
/* mandatory */ /* mandatory */
...@@ -351,7 +341,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -351,7 +341,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true); F1AP_ProtocolIE_ID_id_SRBID, true);
srb_id = ie->value.choice.SRBID; srb_id = ie->value.choice.SRBID;
printf("srb_id %lu \n", srb_id); LOG_D(CU_F1AP, "srb_id %lu \n", srb_id);
// issue in here // issue in here
...@@ -366,8 +356,9 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -366,8 +356,9 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ccch_sdu_len = ie->value.choice.RRCContainer.size; ccch_sdu_len = ie->value.choice.RRCContainer.size;
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf, memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
ccch_sdu_len); ccch_sdu_len);
printf ("RRCContainer(CCCH) :"); LOG_D(CU_F1AP, "RRCContainer(CCCH) :");
for (int i=0;i<ie->value.choice.RRCContainer.size;i++) printf("%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]); for (int i=0;i<ie->value.choice.RRCContainer.size;i++) LOG_D(CU_F1AP, "%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
LOG_D(CU_F1AP, "\n");
return 0; return 0;
} }
...@@ -120,25 +120,25 @@ void *F1AP_CU_task(void *arg) { ...@@ -120,25 +120,25 @@ void *F1AP_CU_task(void *arg) {
switch (ITTI_MSG_ID(received_msg)) { switch (ITTI_MSG_ID(received_msg)) {
case SCTP_NEW_ASSOCIATION_IND: case SCTP_NEW_ASSOCIATION_IND:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_IND for instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg)); LOG_I(CU_F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_IND for instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg), cu_task_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_ind); &received_msg->ittiMsg.sctp_new_association_ind);
break; break;
case SCTP_NEW_ASSOCIATION_RESP: case SCTP_NEW_ASSOCIATION_RESP:
LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_RESP for instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg)); LOG_I(CU_F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_RESP for instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), cu_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp); &received_msg->ittiMsg.sctp_new_association_resp);
break; break;
case SCTP_DATA_IND: case SCTP_DATA_IND:
LOG_I(CU_F1AP, "SCTP_DATA_IND for Instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg)); LOG_I(CU_F1AP, "CU Task Received SCTP_DATA_IND for Instance %d\n",ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg), cu_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_data_ind); &received_msg->ittiMsg.sctp_data_ind);
break; break;
case F1AP_SETUP_RESP: // from rrc case F1AP_SETUP_RESP: // from rrc
LOG_W(CU_F1AP, "F1AP_SETUP_RESP\n"); LOG_I(CU_F1AP, "CU Task Received F1AP_SETUP_RESP\n");
// CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), // CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg)); // &F1AP_SETUP_RESP(received_msg));
CU_send_F1_SETUP_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg), CU_send_F1_SETUP_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
...@@ -146,7 +146,7 @@ void *F1AP_CU_task(void *arg) { ...@@ -146,7 +146,7 @@ void *F1AP_CU_task(void *arg) {
break; break;
case F1AP_DL_RRC_MESSAGE: // from rrc case F1AP_DL_RRC_MESSAGE: // from rrc
LOG_W(CU_F1AP, "F1AP_DL_RRC_MESSAGE\n"); LOG_I(CU_F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
// CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), // CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg)); // &F1AP_SETUP_RESP(received_msg));
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg), CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg),
......
...@@ -356,18 +356,10 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance) { ...@@ -356,18 +356,10 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(CU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
printf("\n");
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
return -1;
}
//AssertFatal(1==0,"Not implemented yet\n");
return 0; return 0;
} }
...@@ -869,15 +861,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { ...@@ -869,15 +861,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(CU_F1AP, "Failed to encode F1 setup request\n");
return -1;
}
printf("\n");
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
return -1; return -1;
} }
......
...@@ -33,33 +33,35 @@ ...@@ -33,33 +33,35 @@
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_decoder.h" #include "f1ap_decoder.h"
int asn1_decoder_xer_print = 1;
static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
{ {
MessageDef *message_p; //MessageDef *message_p;
MessagesIds message_id; //MessagesIds message_id;
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} }; //asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage->procedureCode) { switch(pdu->choice.initiatingMessage->procedureCode) {
case F1AP_ProcedureCode_id_F1Setup: case F1AP_ProcedureCode_id_F1Setup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); //res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
printf("f1ap_eNB_decode_initiating_message!\n"); LOG_I(F1AP, "f1ap_eNB_decode_initiating_message!\n");
break; break;
case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer: case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); //res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
printf("f1ap_eNB_decode_initiating_message!\n"); LOG_I(F1AP, "f1ap_eNB_decode_initiating_message!\n");
break; break;
case F1AP_ProcedureCode_id_DLRRCMessageTransfer: case F1AP_ProcedureCode_id_DLRRCMessageTransfer:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); //res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
printf("f1ap_eNB_decode_initiating_message!\n"); LOG_I(F1AP, "f1ap_eNB_decode_initiating_message!\n");
break; break;
case F1AP_ProcedureCode_id_ULRRCMessageTransfer: case F1AP_ProcedureCode_id_ULRRCMessageTransfer:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); //res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
printf("f1ap_eNB_decode_initiating_message!\n"); LOG_I(F1AP, "f1ap_eNB_decode_initiating_message!\n");
break; break;
// case F1AP_ProcedureCode_id_InitialContextSetup: // case F1AP_ProcedureCode_id_InitialContextSetup:
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); // res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
...@@ -75,7 +77,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) ...@@ -75,7 +77,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
default: default:
// F1AP_ERROR("Unknown procedure ID (%d) for initiating message\n", // F1AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
// (int)pdu->choice.initiatingMessage->procedureCode); // (int)pdu->choice.initiatingMessage->procedureCode);
printf("Unknown procedure ID (%d) for initiating message\n", LOG_E(F1AP, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode); (int)pdu->choice.initiatingMessage->procedureCode);
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n", AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode); (int)pdu->choice.initiatingMessage->procedureCode);
...@@ -138,7 +140,11 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t ...@@ -138,7 +140,11 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
0, 0,
0); 0);
if (asn1_decoder_xer_print) {
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT START----------------- \n");
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu); xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
}
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code); //LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
if (dec_ret.code != RC_OK) { if (dec_ret.code != RC_OK) {
...@@ -157,7 +163,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t ...@@ -157,7 +163,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
return f1ap_decode_unsuccessful_outcome(pdu); return f1ap_decode_unsuccessful_outcome(pdu);
default: default:
LOG_D(F1AP, "Unknown presence (%d) or not implemented\n", (int)pdu->present); LOG_E(F1AP, "Unknown presence (%d) or not implemented\n", (int)pdu->present);
break; break;
} }
......
...@@ -49,7 +49,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -49,7 +49,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu) { F1AP_F1AP_PDU_t *pdu) {
printf("DU_handle_DL_RRC_MESSAGE_TRANSFER \n"); LOG_D(DU_F1AP, "DU_handle_DL_RRC_MESSAGE_TRANSFER \n");
MessageDef *message_p; MessageDef *message_p;
F1AP_DLRRCMessageTransfer_t *container; F1AP_DLRRCMessageTransfer_t *container;
...@@ -81,14 +81,14 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -81,14 +81,14 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true); F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID; cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
printf("cu_ue_f1ap_id %lu \n", cu_ue_f1ap_id); LOG_D(DU_F1AP, "cu_ue_f1ap_id %lu \n", cu_ue_f1ap_id);
/* GNB_DU_UE_F1AP_ID */ /* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true); F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID; du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
printf("du_ue_f1ap_id %lu \n", du_ue_f1ap_id); LOG_D(DU_F1AP, "du_ue_f1ap_id %lu \n", du_ue_f1ap_id);
/* optional */ /* optional */
...@@ -103,7 +103,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -103,7 +103,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true); F1AP_ProtocolIE_ID_id_SRBID, true);
srb_id = ie->value.choice.SRBID; srb_id = ie->value.choice.SRBID;
printf("srb_id %lu \n", srb_id); LOG_D(DU_F1AP, "srb_id %lu \n", srb_id);
/* optional */ /* optional */
...@@ -112,7 +112,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -112,7 +112,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_ExecuteDuplication, true); F1AP_ProtocolIE_ID_id_ExecuteDuplication, true);
executeDuplication = ie->value.choice.ExecuteDuplication; executeDuplication = ie->value.choice.ExecuteDuplication;
printf("ExecuteDuplication %d \n", executeDuplication); LOG_D(DU_F1AP, "ExecuteDuplication %d \n", executeDuplication);
} }
// issue in here // issue in here
...@@ -127,9 +127,9 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -127,9 +127,9 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
ccch_sdu_len = ie->value.choice.RRCContainer.size; ccch_sdu_len = ie->value.choice.RRCContainer.size;
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf, memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
ccch_sdu_len); ccch_sdu_len);
printf ("RRCContainer(CCCH) :"); LOG_D(DU_F1AP, "RRCContainer(CCCH) :");
for (int i=0;i<ie->value.choice.RRCContainer.size;i++) printf("%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]); for (int i=0;i<ie->value.choice.RRCContainer.size;i++) LOG_D(DU_F1AP, "%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
LOG_D(DU_F1AP, "\n");
/* optional */ /* optional */
/* RAT_FrequencyPriorityInformation */ /* RAT_FrequencyPriorityInformation */
...@@ -157,7 +157,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, ...@@ -157,7 +157,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
uint8_t *sduP, uint8_t *sduP,
sdu_size_t sdu_lenP) { sdu_size_t sdu_lenP) {
printf("DU_send_UL_RRC_MESSAGE_TRANSFER \n"); LOG_D(DU_F1AP, "DU_send_UL_RRC_MESSAGE_TRANSFER \n");
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_ULRRCMessageTransfer_t *out; F1AP_ULRRCMessageTransfer_t *out;
...@@ -215,19 +215,10 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, ...@@ -215,19 +215,10 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(DU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
printf("\n");
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//AssertFatal(1==0,"Not implemented yet\n");
return 0; return 0;
} }
...@@ -313,7 +304,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, ...@@ -313,7 +304,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(DU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
......
...@@ -69,7 +69,7 @@ void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1 ...@@ -69,7 +69,7 @@ void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1
*f1ap_du_data = *f1ap_setup_req; *f1ap_du_data = *f1ap_setup_req;
//printf("sib itti message %s\n", f1ap_setup_req_t->sib1[0]); //printf("sib itti message %s\n", f1ap_setup_req_t->sib1[0]);
printf("nr_cellid : %llx (%lld)",f1ap_setup_req->nr_cellid[0],f1ap_setup_req->nr_cellid[0]); //printf("nr_cellid : %llx (%lld)",f1ap_setup_req->nr_cellid[0],f1ap_setup_req->nr_cellid[0]);
//du_f1ap_register_to_sctp //du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p); itti_send_msg_to_task(TASK_SCTP, instance, message_p);
...@@ -139,7 +139,7 @@ void *F1AP_DU_task(void *arg) { ...@@ -139,7 +139,7 @@ void *F1AP_DU_task(void *arg) {
// 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message, // 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message,
// 2. store the message in f1ap context, that is also stored in RC // 2. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req // 2. send a sctp_association req
LOG_I(DU_F1AP, "F1AP_SETUP_REQ\n"); LOG_I(DU_F1AP, "DU Task Received F1AP_SETUP_REQ\n");
du_task_send_sctp_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg), du_task_send_sctp_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_REQ(received_msg)); &F1AP_SETUP_REQ(received_msg));
break; break;
...@@ -147,14 +147,14 @@ void *F1AP_DU_task(void *arg) { ...@@ -147,14 +147,14 @@ void *F1AP_DU_task(void *arg) {
case SCTP_NEW_ASSOCIATION_RESP: case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon // 1. store the respon
// 2. send the f1setup_req // 2. send the f1setup_req
LOG_I(DU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n"); LOG_I(DU_F1AP, "DU Task Received SCTP_NEW_ASSOCIATION_RESP\n");
du_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), du_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp); &received_msg->ittiMsg.sctp_new_association_resp);
break; break;
case SCTP_DATA_IND: case SCTP_DATA_IND:
// ex: any F1 incoming message for DU ends here // ex: any F1 incoming message for DU ends here
LOG_I(DU_F1AP, "SCTP_DATA_IND\n"); LOG_I(DU_F1AP, "DU Task Received SCTP_DATA_IND\n");
du_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg), du_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_data_ind); &received_msg->ittiMsg.sctp_data_ind);
break; break;
......
...@@ -298,17 +298,10 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) { ...@@ -298,17 +298,10 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(DU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
printf("\n");
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
return 0; return 0;
} }
...@@ -688,16 +681,10 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) { ...@@ -688,16 +681,10 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); LOG_E(DU_F1AP, "Failed to encode F1 setup request\n");
return -1; return -1;
} }
printf("\n");
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0); //du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
return 0; return 0;
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_encoder.h" #include "f1ap_encoder.h"
int asn1_encoder_xer_print = 1;
/* /*
static inline int f1ap_encode_initiating(f1ap_message *message, static inline int f1ap_encode_initiating(f1ap_message *message,
uint8_t **buffer, uint8_t **buffer,
...@@ -76,14 +78,21 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) ...@@ -76,14 +78,21 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
DevAssert(buffer != NULL); DevAssert(buffer != NULL);
DevAssert(length != NULL); DevAssert(length != NULL);
if (asn1_encoder_xer_print) {
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT START ----------------- \n");
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu); xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
}
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer); encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) { if (encoded < 0) {
LOG_E(F1AP, "Failed to encode F1AP message\n"); LOG_E(F1AP, "Failed to encode F1AP message\n");
return -1; return -1;
} }
*length = encoded; *length = encoded;
/* Is the following needed? I moved the code here from CU_F1AP.c/DU_F1AP.c */ /* Is the following needed? I moved the code here from CU_F1AP.c/DU_F1AP.c */
// ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, pdu); // ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, pdu);
return encoded; return encoded;
......
...@@ -117,7 +117,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, ...@@ -117,7 +117,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
} }
/* Calling the right handler */ /* Calling the right handler */
printf("Calling handler with instance %d\n",instance); LOG_I(DU_F1AP, "Calling handler with instance %d\n",instance);
ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1]) ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])
(instance, assoc_id, stream, &pdu); (instance, assoc_id, stream, &pdu);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
......
...@@ -55,7 +55,7 @@ void du_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint ...@@ -55,7 +55,7 @@ void du_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint
sctp_data_req->buffer_length = buffer_length; sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream; sctp_data_req->stream = stream;
printf("Sending ITTI message to SCTP Task\n"); LOG_I(F1AP, "Sending ITTI message to SCTP Task\n");
itti_send_msg_to_task(TASK_SCTP, instance, message_p); itti_send_msg_to_task(TASK_SCTP, instance, message_p);
} }
......
...@@ -5775,7 +5775,7 @@ rrc_eNB_generate_RRCConnectionSetup( ...@@ -5775,7 +5775,7 @@ rrc_eNB_generate_RRCConnectionSetup(
F1AP_DL_RRC_MESSAGE (message_p).execute_duplication = 1; F1AP_DL_RRC_MESSAGE (message_p).execute_duplication = 1;
F1AP_DL_RRC_MESSAGE (message_p).RAT_frequency_priority_information.en_dc = 0; F1AP_DL_RRC_MESSAGE (message_p).RAT_frequency_priority_information.en_dc = 0;
itti_send_msg_to_task (TASK_CU_F1, UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), message_p); itti_send_msg_to_task (TASK_CU_F1, UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), message_p);
LOG_E(RRC, "F1AP_DL_RRC_MESSAGE\n"); LOG_D(RRC, "Send F1AP_DL_RRC_MESSAGE with ITTI\n");
break; break;
case ngran_eNB_DU : case ngran_eNB_DU :
case ngran_gNB_DU : case ngran_gNB_DU :
......
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