diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d3c9e5390..da1a10adb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -477,7 +477,7 @@ add_library(f1ap ${F1AP_DIR}/f1ap_itti_messaging.c) 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_link_libraries(f1ap PRIVATE ngap nr_rrc ds f1ap_lib) target_include_directories(f1ap PRIVATE ${F1AP_DIR}/lib) if(E2_AGENT) target_compile_definitions(f1ap PRIVATE E2_AGENT) @@ -617,12 +617,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/utils/T # set the T_LIB name to T if the target exists, otherwise leave empty set(T_LIB $) -add_library(HASHTABLE - ${OPENAIR_DIR}/common/utils/hashtable/hashtable.c - ${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c -) -include_directories(${OPENAIR_DIR}/common/utils/hashtable) - add_library(UTIL ${OPENAIR_DIR}/common/utils/LOG/vcd_signal_dumper.c ${OPENAIR2_DIR}/UTIL/OPT/probe.c @@ -1709,7 +1703,7 @@ add_dependencies(lte-softmodem oai_iqplayer) target_link_libraries(lte-softmodem PRIVATE -Wl,--start-group - lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB + lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB ${NAS_UE_LIB} ITTI SIMU shlib_loader -Wl,--end-group z dl) @@ -1766,7 +1760,7 @@ add_executable(lte-uesoftmodem target_link_libraries(lte-uesoftmodem PRIVATE -Wl,--start-group lte_rrc nr_rrc s1ap x2ap m2ap m3ap - SECURITY UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON + SECURITY UTIL SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB ${NAS_UE_LIB} ITTI shlib_loader -Wl,--end-group z dl) @@ -1819,7 +1813,7 @@ add_executable(nr-softmodem target_link_libraries(nr-softmodem PRIVATE -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY + UTIL SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY ITTI ${NAS_UE_LIB} lte_rrc nr_rrc ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU x2ap f1ap m2ap m3ap e1ap shlib_loader @@ -1894,7 +1888,7 @@ add_executable(nr-uesoftmodem target_link_libraries(nr-uesoftmodem PRIVATE -Wl,--start-group - nr_rrc SECURITY UTIL HASHTABLE SCHED_RU_LIB SCHED_NR_UE_LIB + nr_rrc SECURITY UTIL SCHED_RU_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE MAC_NR_COMMON NFAPI_LIB ITTI SIMU shlib_loader time_management @@ -2012,7 +2006,7 @@ add_executable(nr_dlsim ${PHY_INTERFACE_DIR}/queue_t.c ) target_link_libraries(nr_dlsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common ) target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2042,7 +2036,7 @@ add_executable(nr_ulsim ) target_link_libraries(nr_ulsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2112,7 +2106,7 @@ if (${T_TRACER}) #all "add_library" definitions ITTI lte_rrc nr_rrc s1ap x2ap m2ap m3ap f1ap params_libconfig - oai_eth_transpro HASHTABLE UTIL + oai_eth_transpro UTIL SECURITY SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt index 84668852ae..f4611914d4 100644 --- a/common/utils/CMakeLists.txt +++ b/common/utils/CMakeLists.txt @@ -17,9 +17,6 @@ add_subdirectory(time_manager) add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c reverse_bits.c) target_include_directories(utils PUBLIC .) target_link_libraries(utils PRIVATE ${T_LIB}) -if (ENABLE_TESTS) - add_subdirectory(hashtable/tests) -endif() add_subdirectory(barrier) add_subdirectory(actor) add_subdirectory(shm_iq_channel) diff --git a/common/utils/ds/CMakeLists.txt b/common/utils/ds/CMakeLists.txt index b5f5efb47a..22dc7a3c63 100644 --- a/common/utils/ds/CMakeLists.txt +++ b/common/utils/ds/CMakeLists.txt @@ -2,6 +2,8 @@ add_library(ds OBJECT byte_array.c byte_array_producer.c seq_arr.c + hashtable.c + obj_hashtable.c ) target_include_directories(ds PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/common/utils/hashtable/hashtable.c b/common/utils/ds/hashtable.c similarity index 100% rename from common/utils/hashtable/hashtable.c rename to common/utils/ds/hashtable.c diff --git a/common/utils/hashtable/hashtable.h b/common/utils/ds/hashtable.h similarity index 100% rename from common/utils/hashtable/hashtable.h rename to common/utils/ds/hashtable.h diff --git a/common/utils/hashtable/obj_hashtable.c b/common/utils/ds/obj_hashtable.c similarity index 100% rename from common/utils/hashtable/obj_hashtable.c rename to common/utils/ds/obj_hashtable.c diff --git a/common/utils/hashtable/obj_hashtable.h b/common/utils/ds/obj_hashtable.h similarity index 100% rename from common/utils/hashtable/obj_hashtable.h rename to common/utils/ds/obj_hashtable.h diff --git a/common/utils/ds/tests/CMakeLists.txt b/common/utils/ds/tests/CMakeLists.txt index a3ef512f09..a38fba2dab 100644 --- a/common/utils/ds/tests/CMakeLists.txt +++ b/common/utils/ds/tests/CMakeLists.txt @@ -2,3 +2,9 @@ add_executable(test_seq_arr test_seq_array.c) target_link_libraries(test_seq_arr ds alg) add_dependencies(tests test_seq_arr) add_test(NAME test_seq_arr COMMAND test_seq_arr) # no options required + +add_executable(test_hashtable test_hashtable.cpp) +add_dependencies(tests test_hashtable) +target_link_libraries(test_hashtable PRIVATE ds GTest::gtest) +add_test(NAME test_hashtable + COMMAND ./test_hashtable) diff --git a/common/utils/hashtable/tests/test_hashtable.cpp b/common/utils/ds/tests/test_hashtable.cpp similarity index 100% rename from common/utils/hashtable/tests/test_hashtable.cpp rename to common/utils/ds/tests/test_hashtable.cpp diff --git a/common/utils/hashtable/tests/CMakeLists.txt b/common/utils/hashtable/tests/CMakeLists.txt deleted file mode 100644 index baf2461262..0000000000 --- a/common/utils/hashtable/tests/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_executable(test_hashtable test_hashtable.cpp) -add_dependencies(tests test_hashtable) -target_link_libraries(test_hashtable PRIVATE HASHTABLE GTest::gtest) -add_test(NAME test_hashtable - COMMAND ./test_hashtable) diff --git a/openair2/F1AP/CMakeLists.txt b/openair2/F1AP/CMakeLists.txt index 53ab2823ed..052964b3e1 100644 --- a/openair2/F1AP/CMakeLists.txt +++ b/openair2/F1AP/CMakeLists.txt @@ -3,7 +3,7 @@ add_subdirectory(MESSAGES) if(ENABLE_TESTS) add_executable(f1ap_ids_test f1ap_ids_test.c f1ap_ids.c) - target_link_libraries(f1ap_ids_test HASHTABLE minimal_lib) + target_link_libraries(f1ap_ids_test ds minimal_lib) add_dependencies(tests f1ap_ids_test) add_test(NAME F1AP_ID_test COMMAND f1ap_ids_test) diff --git a/openair2/F1AP/f1ap_ids.c b/openair2/F1AP/f1ap_ids.c index 5569d60c48..d222d9e35a 100644 --- a/openair2/F1AP/f1ap_ids.c +++ b/openair2/F1AP/f1ap_ids.c @@ -25,7 +25,7 @@ #include "f1ap_ids.h" #include -#include "common/utils/hashtable/hashtable.h" +#include "ds/hashtable.h" #include "common/utils/assertions.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 03b8ecc2d3..fdb5204081 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -32,7 +32,7 @@ #define MBMS_MULTICAST_OUT #include "assertions.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "pdcp.h" #include "pdcp_util.h" #include "pdcp_sequence_manager.h" diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index 4559eb3273..cd9f34b750 100644 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -37,7 +37,7 @@ #include "common/platform_types.h" #include "common/platform_constants.h" -# include "hashtable.h" +#include "ds/hashtable.h" # include "LTE_asn_constant.h" # include "common/utils/LOG/log.h" #include "intertask_interface.h" diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index e588c2665b..aefe34eec3 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -53,7 +53,7 @@ #include "f1ap_messages_types.h" #include "gnb_config.h" #include "gtpv1_u_messages_types.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "intertask_interface.h" #include "common/utils/LOG/log.h" #include "nfapi/oai_integration/vendor_ext.h" diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index c8ea0fa878..6b327d92bc 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -35,7 +35,7 @@ #include #include "assertions.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "oai_asn1.h" #include "rrc_defs.h" #include "rrc_extern.h"