diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f8a6006bf..70ea409d36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -464,6 +464,9 @@ target_include_directories(f1ap PUBLIC F1AP_DIR) target_link_libraries(f1ap PUBLIC asn1_f1ap GTPV1U) target_link_libraries(f1ap PRIVATE ngap nr_rrc HASHTABLE f1ap_lib) target_include_directories(f1ap PRIVATE ${F1AP_DIR}/lib) +if(E2_AGENT) + target_compile_definitions(f1ap PRIVATE E2_AGENT) +endif() # LPP ############## @@ -1288,6 +1291,9 @@ add_library(L2 ) target_link_libraries(L2 PRIVATE x2ap s1ap lte_rrc m2ap) target_link_libraries(L2 PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) +if(E2_AGENT) + target_compile_definitions(L2 PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT) +endif() add_library(MAC_UE_NR ${MAC_NR_SRC_UE}) target_link_libraries(MAC_UE_NR PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs PUBLIC nr_ue_power_procedures nr_ue_ra_procedures) @@ -1303,6 +1309,9 @@ add_library(L2_NR target_link_libraries(L2_NR PRIVATE ds alg) target_link_libraries(L2_NR PRIVATE f1ap_lib) target_include_directories(L2_NR PRIVATE ${F1AP_DIR}/lib) +if(E2_AGENT) + target_compile_definitions(L2_NR PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT) +endif() add_library(e1_if ${NR_RRC_DIR}/cucp_cuup_direct.c diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 82984657d3..9a2b834ae3 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -118,6 +118,15 @@ void nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t { } +/* this is a hack, but necessary for E2 agent. We compile in all of RRC + * (because of CMakeLists.txt), but we don't need it (only nr_radio_config.c). + * however, if E2 agent is defined, the following functions are used in + * rrc_gNB.c, but defined in RAN functions. In order to avoid pulling this in + * here as well, only provide a prototype (and abort if they are ever called). */ +void signal_rrc_msg(void /*const nr_rrc_class_e nr_channel, const uint32_t rrc_msg_id, const byte_array_t rrc_ba*/ ) { abort(); } +void signal_rrc_state_changed_to(void /* const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state */) { abort(); } +void signal_ue_id(void /* const gNB_RRC_UE_t *rrc_ue_context, const uint16_t class, const uint32_t msg_id */) { abort(); } + /* Function to set or overwrite PTRS DL RRC parameters */ static void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, long *ptrsNrb, long *ptrsMcs, long *epre_Ratio, long *reOffset) { diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 85c165b00d..6be851c0a6 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -120,6 +120,15 @@ void nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t { } +/* this is a hack, but necessary for E2 agent. We compile in all of RRC + * (because of CMakeLists.txt), but we don't need it (only nr_radio_config.c). + * however, if E2 agent is defined, the following functions are used in + * rrc_gNB.c, but defined in RAN functions. In order to avoid pulling this in + * here as well, only provide a prototype (and abort if they are ever called). */ +void signal_rrc_msg(void /*const nr_rrc_class_e nr_channel, const uint32_t rrc_msg_id, const byte_array_t rrc_ba*/ ) { abort(); } +void signal_rrc_state_changed_to(void /* const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state */) { abort(); } +void signal_ue_id(void /* const gNB_RRC_UE_t *rrc_ue_context, const uint16_t class, const uint32_t msg_id */) { abort(); } + extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration void e1_bearer_context_setup(const e1ap_bearer_setup_req_t *req) { abort(); }