diff --git a/.gitignore b/.gitignore index 35696f4cbf1c075fb22d99f43a73eaab3e2debaa..005112518510d2fd4bed64960897ae7ac6fa6f39 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,5 @@ # log and exec file log/ -lte_build_oai/ +*build_oai/ targets/bin/ diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index e7da79dda0666d486d7ead0b24ac6707b0b5d06a..172e11bf7d35c345ff6f3e1201697fc6171e8059 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -530,8 +530,8 @@ message(${F1AP_C_DIR}) message(${F1AP_DIR}) add_library(F1AP - ${F1AP_DIR}/DU_F1AP.c - ${F1AP_DIR}/CU_F1AP.c + ${F1AP_DIR}/f1ap_du.c + ${F1AP_DIR}/f1ap_cu.c ${F1AP_DIR}/f1ap_itti_messaging.c ${F1AP_DIR}/f1ap_encoder.c ${F1AP_DIR}/f1ap_decoder.c diff --git a/cmake_targets/lte_noS1_build_oai/CMakeLists.template b/cmake_targets/lte_noS1_build_oai/CMakeLists.template deleted file mode 100644 index c8fc68da529fa4db87461e2b27cfeab044165061..0000000000000000000000000000000000000000 --- a/cmake_targets/lte_noS1_build_oai/CMakeLists.template +++ /dev/null @@ -1,9 +0,0 @@ -set(ENABLE_ITTI True) -set(ENABLE_USE_MME False) -set(PDCP_USE_NETLINK True) -set(LINK_ENB_PDCP_TO_IP_DRIVER True) -set(LINK_ENB_PDCP_TO_GTPV1U False) -set(PDCP_USE_NETLINK_QUEUES False) -set(LINUX True) -set(SECU False) -set(NAS_UE False) diff --git a/cmake_targets/oaisim_build_oai/CMakeLists.template b/cmake_targets/oaisim_build_oai/CMakeLists.template deleted file mode 100644 index 22faac75b5855fd33b2fb6630c5dde36e8fe83a4..0000000000000000000000000000000000000000 --- a/cmake_targets/oaisim_build_oai/CMakeLists.template +++ /dev/null @@ -1,60 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING True ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY True ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME True ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U True) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD True ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_UE True) -set ( NAS_MME False ) -set ( NAS_UE True ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NO_RRM True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR2 True ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PDCP_USE_NETLINK True ) -set ( PDCP_MSG_PRINT False ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( RF_BOARD "False" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RRC_DEFAULT_RAB_IS_AM True) -set ( RRC_MSG_PRINT False ) -set ( SECU False ) -set ( SMBV False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( XER_PRINT False ) diff --git a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template deleted file mode 100644 index b18b23ee9abf72e93a74a9d70a9edede932a0b8c..0000000000000000000000000000000000000000 --- a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template +++ /dev/null @@ -1,62 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 False ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST False ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False ) -set ( ENABLE_USE_CPU_EXECUTION_TIME False ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE False ) -set ( EPC_BUILD True ) -set ( EXMIMO_IOT False ) -set ( JUMBO_FRAME False ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U True) -set ( LINUX_LIST False ) -set ( LINUX False ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD False ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_EPC True ) -set ( NAS_MME True ) -set ( NAS_NETLINK False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NO_RRM False ) -set ( OAISIM False ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK False ) -set ( OPENAIR2 False ) -set ( OPENAIR_LTE False ) -set ( PACKAGE_NAME "EPC" ) -set ( PDCP_MSG_PRINT False ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM False ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( SECU False ) -set ( SMBV False ) -set ( TEST_OMG False ) -set ( UPDATE_RELEASE_9 True) -set ( UPDATE_RELEASE_10 True) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( XER_PRINT False ) -set ( XFORMS False ) diff --git a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template deleted file mode 100644 index bc416cff55fef58c4a19492585c07addd4f60115..0000000000000000000000000000000000000000 --- a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template +++ /dev/null @@ -1,63 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set ( DEBUG_OMG False ) -set ( DISABLE_XER_PRINT False ) -set ( DRIVER2013 True ) -set ( ENABLE_ITTI True ) -set ( ENABLE_NAS_UE_LOGGING False ) -set ( ENABLE_NEW_MULTICAST True ) -set ( ENABLE_RAL False ) -set ( ENABLE_SECURITY False ) -set ( ENABLE_STANDALONE_EPC False) -set ( ENABLE_USE_CPU_EXECUTION_TIME True ) -set ( ENABLE_USE_MME False ) -set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False) -set ( ENABLE_VCD_FIFO False ) -set ( ENB_MODE True ) -set ( EXMIMO_IOT True ) -set ( JUMBO_FRAME True ) -set ( LARGE_SCALE False ) -set ( LINK_ENB_PDCP_TO_GTPV1U False) -set ( LINUX_LIST False ) -set ( LINUX True ) -set ( LOCALIZATION False ) -set ( LOG_NO_THREAD 1 ) -set ( DEADLINE_SCHEDULER False ) -set ( MAC_CONTEXT 1 ) -set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False ) -set ( MESSAGE_CHART_GENERATOR_RLC_MAC False ) -set ( MESSAGE_CHART_GENERATOR_PHY False ) -set ( MSG_PRINT False ) -set ( MU_RECEIVER False ) -set ( NAS_ADDRESS_FIX False ) -set ( NAS_BUILT_IN_UE False) -set ( NAS_MME False ) -set ( NAS_UE False ) -set ( NB_ANTENNAS_RX "2" ) -set ( NB_ANTENNAS_TX "2" ) -set ( NO_RRM True ) -set ( OAISIM True ) -set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) -set ( OAI_NW_DRIVER_USE_NETLINK True ) -set ( OPENAIR2 True ) -set ( OPENAIR_LTE True ) -set ( PACKAGE_NAME "oaisim" ) -set ( PDCP_USE_NETLINK True ) -set ( PDCP_MSG_PRINT False ) -set ( PHY_CONTEXT False ) -set ( PHY_EMUL False ) -set ( PHYSIM True ) -set ( RF_BOARD "False" ) -set ( RRC_ASN1_VERSION "Rel10" ) -set ( RLC_STOP_ON_LOST_PDU False ) -set ( RRC_MSG_PRINT False ) -set ( SECU False ) -set ( SMBV False ) -set ( TEST_OMG False ) -set ( USE_3GPP_ADDR_AS_LINK_ADDR False ) -set ( USE_MME "R10" ) -set ( XER_PRINT False ) -set ( DEBUG_PHY False ) -set ( DEBUG_PHY_PROC False) -set ( DEBUG_DLSCH False) diff --git a/openair2/COMMON/f1ap_messages_types.h b/openair2/COMMON/f1ap_messages_types.h index 6fa58425fd0c4b774d8c4d0f772bf77ad15a78cf..15b6ba2650e6fa113ff850b882596981b4a043a1 100644 --- a/openair2/COMMON/f1ap_messages_types.h +++ b/openair2/COMMON/f1ap_messages_types.h @@ -103,6 +103,8 @@ typedef struct f1ap_setup_req_s { uint16_t num_ssi[F1AP_MAX_NB_CELLS]; uint8_t sst[F1AP_MAX_NB_CELLS][16]; uint8_t sd[F1AP_MAX_NB_CELLS][16]; + // tdd_flag = 0 means FDD, 1 means TDD + int tdd_flag; union { struct { diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 077265b246eb02633422183dd9c44b9f6340b8ab..37cdf06ed2124c4a36c2021d96d5b4bcaccd1afc 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -195,7 +195,7 @@ void *eNB_app_task(void *args_p) break; case F1AP_SETUP_RESP: - AssertFatal(RC.rrc[0]->node_type == ngran_eNB_DU, "Should not have received F1AP_REGISTER_ENB_CNF\n"); + AssertFatal(RC.rrc[0]->node_type == ngran_eNB_DU, "Should not have received F1AP_REGISTER_ENB_CNF in CU/eNB\n"); LOG_I(ENB_APP, "[eNB %d] Received %s: associated ngran_eNB_CU %s with %d cells to activate\n", instance, ITTI_MSG_NAME (msg_p), F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate); diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index dcad36dc71eb7327ce4c25e87b842399c82d59da..93a49cca2e198e8c6dd810d40bac7ec0e90f206c 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2453,6 +2453,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) { if (rrc->carrier[0].sib1->tdd_Config) { LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k); + F1AP_SETUP_REQ (msg_p).tdd_flag = 1; F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_arfcn = freq_to_arfcn10(rrc->carrier[0].sib1->freqBandIndicator, rrc->carrier[0].dl_CarrierFreq); // For LTE use scs field to carry prefix type and number of antennas @@ -2466,6 +2467,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) { } else { LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k); + F1AP_SETUP_REQ (msg_p).tdd_flag = 0; F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_arfcn = freq_to_arfcn10(rrc->carrier[0].sib1->freqBandIndicator, rrc->carrier[0].dl_CarrierFreq); diff --git a/openair2/F1AP/CU_F1AP.c b/openair2/F1AP/f1ap_cu.c similarity index 99% rename from openair2/F1AP/CU_F1AP.c rename to openair2/F1AP/f1ap_cu.c index 337f411c5b884769af46d2b1efeae796dcbad0a3..7c2c6441045ec0970cb334bae023482e9d34159a 100644 --- a/openair2/F1AP/CU_F1AP.c +++ b/openair2/F1AP/f1ap_cu.c @@ -32,10 +32,10 @@ #include "conversions.h" #include "f1ap_common.h" -#include "cu_f1ap_defs.h" +#include "f1ap_cu_defs.h" #include "f1ap_encoder.h" #include "f1ap_decoder.h" -#include "cu_f1ap_task.h" +#include "f1ap_cu_task.h" #include "platform_types.h" #include "common/utils/LOG/log.h" #include "intertask_interface.h" @@ -148,18 +148,21 @@ void *F1AP_CU_task(void *arg) { case SCTP_NEW_ASSOCIATION_IND: LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_IND\n"); + LOG_I(DU_F1AP, "--------------3--------------\n"); CU_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg), &received_msg->ittiMsg.sctp_new_association_ind); break; case SCTP_NEW_ASSOCIATION_RESP: LOG_I(CU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n"); + LOG_I(DU_F1AP, "--------------4--------------\n"); CU_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), &received_msg->ittiMsg.sctp_new_association_resp); break; case SCTP_DATA_IND: LOG_I(CU_F1AP, "SCTP_DATA_IND\n"); + LOG_I(DU_F1AP, "--------------5--------------\n"); CU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind); break; diff --git a/openair2/F1AP/cu_f1ap_defs.h b/openair2/F1AP/f1ap_cu_defs.h similarity index 100% rename from openair2/F1AP/cu_f1ap_defs.h rename to openair2/F1AP/f1ap_cu_defs.h diff --git a/openair2/F1AP/cu_f1ap_task.h b/openair2/F1AP/f1ap_cu_task.h similarity index 100% rename from openair2/F1AP/cu_f1ap_task.h rename to openair2/F1AP/f1ap_cu_task.h diff --git a/openair2/F1AP/f1ap_decoder.c b/openair2/F1AP/f1ap_decoder.c index 3be1013b4100bb6580de33047dd10b3957c1bf9b..a18ad270f4149d14afff81d786412ec4f46d5091 100644 --- a/openair2/F1AP/f1ap_decoder.c +++ b/openair2/F1AP/f1ap_decoder.c @@ -39,7 +39,7 @@ #include "f1ap_common.h" #include "f1ap_decoder.h" -static int f1ap_eNB_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) +static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) { MessageDef *message_p; MessagesIds message_id; @@ -76,28 +76,17 @@ static int f1ap_eNB_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) return 0; } -static int f1ap_eNB_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) +static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) { - MessageDef *message_p; - MessagesIds message_id; - asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} }; DevAssert(pdu != NULL); switch(pdu->choice.successfulOutcome->procedureCode) { - // case F1AP_ProcedureCode_id_F1Setup: - // res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); - // message_id = F1AP_F1_SETUP_LOG; - // message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, res.result.encoded + sizeof (IttiMsgText)); - // message_p->ittiMsg.f1ap_s1_setup_log.size = res.result.encoded; - // memcpy(&message_p->ittiMsg.f1ap_s1_setup_log.text, res.buffer, res.result.encoded); - // itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); - // free(res.buffer); - // break; + case F1AP_ProcedureCode_id_F1Setup: + LOG_I(F1AP, "get F1AP_ProcedureCode_id_F1Setup\n"); + break; default: - // F1AP_ERROR("Unknown procedure ID (%d) for successfull outcome message\n", - // (int)pdu->choice.successfulOutcome->procedureCode); - printf("Unknown procedure ID (%d) for successfull outcome message\n", + LOG_E(F1AP,"Unknown procedure ID (%d) for successfull outcome message\n", (int)pdu->choice.successfulOutcome->procedureCode); return -1; } @@ -105,28 +94,19 @@ static int f1ap_eNB_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) return 0; } -static int f1ap_eNB_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu) +static int f1ap_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu) { - MessageDef *message_p; - MessagesIds message_id; - asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} }; DevAssert(pdu != NULL); switch(pdu->choice.unsuccessfulOutcome->procedureCode) { - // case F1AP_ProcedureCode_id_F1Setup: - // res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu); - // message_id = F1AP_F1_SETUP_LOG; - // message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, res.result.encoded + sizeof (IttiMsgText)); - // message_p->ittiMsg.f1ap_f1_setup_log.size = res.result.encoded; - // memcpy(&message_p->ittiMsg.f1ap_f1_setup_log.text, res.buffer, res.result.encoded); - // itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); - // free(res.buffer); - // break; + case F1AP_ProcedureCode_id_F1Setup: + LOG_I(F1AP, "get F1AP_ProcedureCode_id_F1Setup\n"); + break; default: // F1AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n", // (int)pdu->choice.unsuccessfulOutcome->procedureCode); - printf("Unknown procedure ID (%d) for unsuccessfull outcome message\n", + LOG_E(F1AP, "Unknown procedure ID (%d) for unsuccessfull outcome message\n", (int)pdu->choice.unsuccessfulOutcome->procedureCode); return -1; } @@ -148,27 +128,26 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t 0, 0); - //xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu_p); + //xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu); + //LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code); if (dec_ret.code != RC_OK) { - //F1AP_ERROR("Failed to decode pdu\n"); - printf("Failed to decode pdu\n"); + LOG_E(F1AP, "Failed to decode pdu\n"); return -1; } switch(pdu->present) { case F1AP_F1AP_PDU_PR_initiatingMessage: - return f1ap_eNB_decode_initiating_message(pdu); + return f1ap_decode_initiating_message(pdu); case F1AP_F1AP_PDU_PR_successfulOutcome: - return f1ap_eNB_decode_successful_outcome(pdu); + return f1ap_decode_successful_outcome(pdu); case F1AP_F1AP_PDU_PR_unsuccessfulOutcome: - return f1ap_eNB_decode_unsuccessful_outcome(pdu); + return f1ap_decode_unsuccessful_outcome(pdu); default: - //F1AP_DEBUG("Unknown presence (%d) or not implemented\n", (int)pdu->present); - printf("Unknown presence (%d) or not implemented\n", (int)pdu->present); + LOG_D(F1AP, "Unknown presence (%d) or not implemented\n", (int)pdu->present); break; } diff --git a/openair2/F1AP/DU_F1AP.c b/openair2/F1AP/f1ap_du.c similarity index 99% rename from openair2/F1AP/DU_F1AP.c rename to openair2/F1AP/f1ap_du.c index 229d594f8d142868d3ab0c982abfaedc0fc3792d..978a0356cfeb6bedae8aabd6e3e94ea51bb93e01 100644 --- a/openair2/F1AP/DU_F1AP.c +++ b/openair2/F1AP/f1ap_du.c @@ -32,10 +32,10 @@ #include "conversions.h" #include "f1ap_common.h" -#include "du_f1ap_defs.h" +#include "f1ap_du_defs.h" #include "f1ap_encoder.h" #include "f1ap_decoder.h" -#include "du_f1ap_task.h" +#include "f1ap_du_task.h" #include "platform_types.h" #include "common/utils/LOG/log.h" #include "intertask_interface.h" @@ -130,6 +130,7 @@ void *F1AP_DU_task(void *arg) { // 2. store the message in f1ap context, that is also stored in RC // 2. send a sctp_association req LOG_I(DU_F1AP, "F1AP_SETUP_REQ\n"); + LOG_I(DU_F1AP, "--------------0--------------\n"); DU_send_sctp_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg), &F1AP_SETUP_REQ(received_msg)); break; @@ -138,6 +139,7 @@ void *F1AP_DU_task(void *arg) { // 1. store the respon // 2. send the f1setup_req LOG_I(DU_F1AP, "SCTP_NEW_ASSOCIATION_RESP\n"); + LOG_I(DU_F1AP, "--------------1--------------\n"); DU_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg), &received_msg->ittiMsg.sctp_new_association_resp); break; @@ -145,6 +147,7 @@ void *F1AP_DU_task(void *arg) { case SCTP_DATA_IND: // ex: any F1 incoming message for DU ends here LOG_I(DU_F1AP, "SCTP_DATA_IND\n"); + LOG_I(DU_F1AP, "--------------2--------------\n"); DU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind); break; @@ -464,7 +467,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_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)); OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018 - "1", + "1",//f1ap_setup_req->mib, sizeof("1")); OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018 diff --git a/openair2/F1AP/du_f1ap_defs.h b/openair2/F1AP/f1ap_du.h similarity index 100% rename from openair2/F1AP/du_f1ap_defs.h rename to openair2/F1AP/f1ap_du.h diff --git a/openair2/F1AP/f1ap_du_defs.h b/openair2/F1AP/f1ap_du_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..a93591106f5e7981802e55709ab1c201828ab003 --- /dev/null +++ b/openair2/F1AP/f1ap_du_defs.h @@ -0,0 +1,63 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#include <stdint.h> + +#include "queue.h" +#include "tree.h" + +#include "sctp_eNB_defs.h" + +#ifndef DU_F1AP_DEFS_H_ +#define DU_F1AP_DEFS_H_ + +struct du_f1ap_instance_s; +typedef struct du_f1ap_instance_s { + /* Next f1ap du association. + * Only used for virtual mode. + */ + + /* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */ + instance_t instance; + + // F1_Setup_Req payload + uint32_t gNB_DU_id; + char *gNB_DU_name; + + /* Unique eNB_id to identify the eNB within EPC. + * In our case the eNB is a macro eNB so the id will be 20 bits long. + * For Home eNB id, this field should be 28 bits long. + */ + uint32_t eNB_id; + + /* Tracking area code */ + uint16_t tac; + + /* Mobile Country Code + * Mobile Network Code + */ + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + +} du_f1ap_instance_t; + +#endif /* DU_F1AP_DEFS_H_ */ diff --git a/openair2/F1AP/du_f1ap_task.h b/openair2/F1AP/f1ap_du_task.h similarity index 100% rename from openair2/F1AP/du_f1ap_task.h rename to openair2/F1AP/f1ap_du_task.h diff --git a/openair2/F1AP/f1ap_handlers.c b/openair2/F1AP/f1ap_handlers.c index 4501975d7ab0ffb3d07ccd8de38c18c96ac86bdb..b0836297486ebc654ab9dadffe0d2fb5b120ef78 100644 --- a/openair2/F1AP/f1ap_handlers.c +++ b/openair2/F1AP/f1ap_handlers.c @@ -52,13 +52,17 @@ int f1ap_handle_f1_setup_request(uint32_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); +static +int f1ap_handle_f1_setup_response(uint32_t assoc_id, + uint32_t stream, + F1AP_F1AP_PDU_t *pdu); /* Handlers matrix. Only f1 related procedure present here */ f1ap_message_decoded_callback f1ap_messages_callback[][3] = { { 0, 0, 0 }, /* Reset */ - { f1ap_handle_f1_setup_request, 0, 0 }, /* F1Setup */ + { f1ap_handle_f1_setup_request, f1ap_handle_f1_setup_response, 0 }, /* F1Setup */ { 0, 0, 0 }, /* ErrorIndication */ { f1ap_handle_f1_setup_request, 0, 0 }, /* gNBDUConfigurationUpdate */ { f1ap_handle_f1_setup_request, 0, 0 }, /* gNBCUConfigurationUpdate */ @@ -151,3 +155,13 @@ int f1ap_handle_f1_setup_request(uint32_t assoc_id, return 0; } + +static +int f1ap_handle_f1_setup_response(uint32_t assoc_id, + uint32_t stream, + F1AP_F1AP_PDU_t *pdu) +{ + printf("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"); + + return 0; +} diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c index 03b13c879c74c890fc02293331f6478d10119936..49b078dede0389c650b742fe4867b593a8bd00da 100644 --- a/targets/COMMON/create_tasks.c +++ b/targets/COMMON/create_tasks.c @@ -35,8 +35,8 @@ # include "RRC/LTE/rrc_defs.h" # endif # include "sctp_eNB_task.h" -# include "cu_f1ap_task.h" -# include "du_f1ap_task.h" +# include "f1ap_cu_task.h" +# include "f1ap_du_task.h" # include "enb_app.h" extern RAN_CONTEXT_t RC;