Commit 75ad3da9 authored by Laurent Thomas's avatar Laurent Thomas

start new gtpu

parent 228be922
...@@ -405,6 +405,7 @@ add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs ...@@ -405,6 +405,7 @@ add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace") add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace") add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
add_boolean_option(NEW_GTPU False "NEW_GTP")
set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti) set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
add_library(ITTI add_library(ITTI
...@@ -413,7 +414,6 @@ add_library(ITTI ...@@ -413,7 +414,6 @@ add_library(ITTI
) )
add_dependencies(ITTI rrc_flag) add_dependencies(ITTI rrc_flag)
set(ITTI_LIB ITTI) set(ITTI_LIB ITTI)
set(GTPU_need_ITTI ${OPENAIR3_DIR}/GTPV1-U/gtpv1u_eNB.c)
################################################## ##################################################
...@@ -2217,15 +2217,19 @@ set (GTPV1U_SRC ...@@ -2217,15 +2217,19 @@ set (GTPV1U_SRC
add_library(GTPV1U ${GTPV1U_SRC}) add_library(GTPV1U ${GTPV1U_SRC})
add_dependencies(GTPV1U rrc_flag) add_dependencies(GTPV1U rrc_flag)
#add_library (GTPV1U_OCP add_library (GTPV1U_OCP
#${OPENAIR3_DIR}/ocp-gtp/gtp_itf.cpp ${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
#) ${RRC_DIR}/rrc_eNB_GTPV1U.c
#include_directories(${OPENAIR3_DIR}/ocp-gtp) ${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp
)
add_dependencies(GTPV1U_OCP rrc_flag)
include_directories(${OPENAIR3_DIR}/ocp-gtp)
#NR case #NR case
set (NR_GTPV1U_SRC set (NR_GTPV1U_SRC
${NR_RRC_DIR}/rrc_gNB_GTPV1U.c ${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
${RRC_DIR}/rrc_eNB_GTPV1U.c ${RRC_DIR}/rrc_eNB_GTPV1U.c
${GTPV1U_DIR}/gtpv1u_eNB.c
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTrxn.c ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTrxn.c
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c
...@@ -2235,6 +2239,12 @@ set (NR_GTPV1U_SRC ...@@ -2235,6 +2239,12 @@ set (NR_GTPV1U_SRC
add_library(NR_GTPV1U ${NR_GTPV1U_SRC}) add_library(NR_GTPV1U ${NR_GTPV1U_SRC})
add_dependencies(NR_GTPV1U rrc_flag) add_dependencies(NR_GTPV1U rrc_flag)
if (${NEW_GTPU})
set(GTPV1U GTPV1U_OCP)
else()
set(GTPV1U NR_GTPV1U)
endif()
set (MME_APP_SRC set (MME_APP_SRC
${OPENAIR3_DIR}/MME_APP/mme_app.c ${OPENAIR3_DIR}/MME_APP/mme_app.c
${OPENAIR3_DIR}/MME_APP/mme_config.c ${OPENAIR3_DIR}/MME_APP/mme_config.c
...@@ -2864,7 +2874,6 @@ add_executable(lte-softmodem ...@@ -2864,7 +2874,6 @@ add_executable(lte-softmodem
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${XFORMSINTERFACE_SOURCE} ${XFORMSINTERFACE_SOURCE}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
...@@ -2874,7 +2883,7 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer) ...@@ -2874,7 +2883,7 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
target_link_libraries (lte-softmodem target_link_libraries (lte-softmodem
-Wl,--start-group -Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB ${GTPV1U} SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl) -Wl,--end-group z dl)
...@@ -2905,7 +2914,6 @@ add_executable(ocp-enb ...@@ -2905,7 +2914,6 @@ add_executable(ocp-enb
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${XFORMSINTERFACE_SOURCE} ${XFORMSINTERFACE_SOURCE}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
...@@ -2915,7 +2923,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l ...@@ -2915,7 +2923,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l
target_link_libraries (ocp-enb target_link_libraries (ocp-enb
-Wl,--start-group -Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB ${GTPV1U} SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl) -Wl,--end-group z dl)
...@@ -2985,7 +2993,7 @@ endif() ...@@ -2985,7 +2993,7 @@ endif()
target_link_libraries (lte-uesoftmodem target_link_libraries (lte-uesoftmodem
-Wl,--start-group -Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP F1AP_LIB RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP F1AP_LIB
GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON ${GTPV1U} SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
-Wl,--end-group z dl) -Wl,--end-group z dl)
...@@ -3018,7 +3026,6 @@ add_executable(nr-softmodem ...@@ -3018,7 +3026,6 @@ add_executable(nr-softmodem
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${GTPU_need_ITTI}
${XFORMSINTERFACE_SOURCE} ${XFORMSINTERFACE_SOURCE}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
...@@ -3027,7 +3034,7 @@ add_executable(nr-softmodem ...@@ -3027,7 +3034,7 @@ add_executable(nr-softmodem
target_link_libraries (nr-softmodem target_link_libraries (nr-softmodem
-Wl,--start-group -Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS ${GTPV1U} SECU_CN SECU_OSA
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
...@@ -3057,7 +3064,6 @@ add_executable(ocp-gnb ...@@ -3057,7 +3064,6 @@ add_executable(ocp-gnb
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${XFORMS_SOURCE_NR} ${XFORMS_SOURCE_NR}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
...@@ -3067,7 +3073,7 @@ add_executable(ocp-gnb ...@@ -3067,7 +3073,7 @@ add_executable(ocp-gnb
target_link_libraries (ocp-gnb target_link_libraries (ocp-gnb
-Wl,--start-group -Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS ${GTPV1U} SECU_CN SECU_OSA
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON
...@@ -3371,7 +3377,7 @@ add_executable(test_epc_generate_scenario ...@@ -3371,7 +3377,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
) )
target_link_libraries (test_epc_generate_scenario target_link_libraries (test_epc_generate_scenario
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP ${GTPV1U} LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
) )
add_executable(test_epc_play_scenario add_executable(test_epc_play_scenario
...@@ -3390,7 +3396,7 @@ add_executable(test_epc_play_scenario ...@@ -3390,7 +3396,7 @@ add_executable(test_epc_play_scenario
) )
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario target_link_libraries (test_epc_play_scenario
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP ${GTPV1U} LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
) )
...@@ -3436,7 +3442,7 @@ if (${T_TRACER}) ...@@ -3436,7 +3442,7 @@ if (${T_TRACER})
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
CN_UTILS GTPV1U NR_GTPV1U SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB CN_UTILS ${GTPV1U} SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts) ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
if (TARGET ${i}) if (TARGET ${i})
add_dependencies(${i} generate_T) add_dependencies(${i} generate_T)
...@@ -3534,7 +3540,6 @@ add_executable(nr-ittisim ...@@ -3534,7 +3540,6 @@ add_executable(nr-ittisim
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${GTPU_need_ITTI}
${XFORMSINTERFACE_SOURCE} ${XFORMSINTERFACE_SOURCE}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
...@@ -3543,7 +3548,7 @@ add_executable(nr-ittisim ...@@ -3543,7 +3548,7 @@ add_executable(nr-ittisim
target_link_libraries (nr-ittisim target_link_libraries (nr-ittisim
-Wl,--start-group -Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS ${GTPV1U} SECU_CN SECU_OSA
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
......
...@@ -115,7 +115,7 @@ void msc_log_message( ...@@ -115,7 +115,7 @@ void msc_log_message(
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded #define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
msc_interface_t msc_interface; extern msc_interface_t msc_interface;
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2) #define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2)
#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use #define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
#define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end #define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end
......
...@@ -341,6 +341,7 @@ void * rrc_enb_process_msg(void*); ...@@ -341,6 +341,7 @@ void * rrc_enb_process_msg(void*);
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\ TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\
TASK_DEF(OCP_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\ TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
......
...@@ -78,7 +78,6 @@ int otg_enabled; ...@@ -78,7 +78,6 @@ int otg_enabled;
uint64_t downlink_frequency[MAX_NUM_CCs][4]; uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int split73; int split73;
int usrp_tx_thread = 0;
char * split73_config; char * split73_config;
int split73; int split73;
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0}; AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0};
......
...@@ -118,7 +118,6 @@ uint16_t sl_ahead; ...@@ -118,7 +118,6 @@ uint16_t sl_ahead;
extern int emulate_rf; extern int emulate_rf;
extern int numerology; extern int numerology;
extern int usrp_tx_thread;
/*************************************************************/ /*************************************************************/
/* Functions to attach and configure RRU */ /* Functions to attach and configure RRU */
......
...@@ -181,7 +181,6 @@ extern void *udp_eNB_task(void *args_p); ...@@ -181,7 +181,6 @@ extern void *udp_eNB_task(void *args_p);
int transmission_mode=1; int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
int usrp_tx_thread = 0;
static char *parallel_config = NULL; static char *parallel_config = NULL;
......
...@@ -155,7 +155,6 @@ int card_offset = 0; ...@@ -155,7 +155,6 @@ int card_offset = 0;
uint64_t num_missed_slots = 0; // counter for the number of missed slots uint64_t num_missed_slots = 0; // counter for the number of missed slots
int transmission_mode = 1; int transmission_mode = 1;
int numerology = 0; int numerology = 0;
int usrp_tx_thread = 0;
int oaisim_flag = 0; int oaisim_flag = 0;
int emulate_rf = 0; int emulate_rf = 0;
......
...@@ -70,7 +70,6 @@ uint32_t timing_advance = 0; ...@@ -70,7 +70,6 @@ uint32_t timing_advance = 0;
int transmission_mode=1; int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
int usrp_tx_thread = 0;
int config_sync_var=-1; int config_sync_var=-1;
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
static softmodem_params_t softmodem_params; static softmodem_params_t softmodem_params;
char *parallel_config=NULL; char *parallel_config=NULL;
char *worker_config=NULL; char *worker_config=NULL;
msc_interface_t msc_interface;
int usrp_tx_thread = 0;
static mapping softmodem_funcs[] = MAPPING_SOFTMODEM_FUNCTIONS; static mapping softmodem_funcs[] = MAPPING_SOFTMODEM_FUNCTIONS;
......
...@@ -90,6 +90,7 @@ extern "C" ...@@ -90,6 +90,7 @@ extern "C"
#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n" #define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n" #define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */ /* command line parameters common to eNodeB and UE */
...@@ -113,6 +114,7 @@ extern "C" ...@@ -113,6 +114,7 @@ extern "C"
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat"; #define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
extern int usrp_tx_thread;
#define CMDLINE_PARAMS_DESC { \ #define CMDLINE_PARAMS_DESC { \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)},\ {"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)},\
{"split73", CONFIG_HLP_SPLIT73, 0, strptr:(char **)&SPLIT73, defstrval:NULL, TYPE_STRING, sizeof(SPLIT73)},\ {"split73", CONFIG_HLP_SPLIT73, 0, strptr:(char **)&SPLIT73, defstrval:NULL, TYPE_STRING, sizeof(SPLIT73)},\
...@@ -139,6 +141,7 @@ extern "C" ...@@ -139,6 +141,7 @@ extern "C"
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \ {"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
{"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \ {"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
// global var for openair performance profiler // global var for openair performance profiler
int opp_enabled = 0; int opp_enabled = 0;
double cpu_freq_GHz __attribute__ ((aligned(32)));
double get_cpu_freq_GHz(void) double get_cpu_freq_GHz(void)
{ {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <linux/types.h> #include <linux/types.h>
// global var to enable openair performance profiler // global var to enable openair performance profiler
extern int opp_enabled; extern int opp_enabled;
double cpu_freq_GHz __attribute__ ((aligned(32)));; extern double cpu_freq_GHz __attribute__ ((aligned(32)));;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
typedef struct { typedef struct {
......
...@@ -68,6 +68,7 @@ int sl_ahead = 0; ...@@ -68,6 +68,7 @@ int sl_ahead = 0;
//void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); //void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */ /* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
msc_interface_t msc_interface;
uint64_t get_softmodem_optmask(void) {return 0;} uint64_t get_softmodem_optmask(void) {return 0;}
softmodem_params_t *get_softmodem_params(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;}
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
# ifndef __RLC_UM_TEST_H__ # ifndef __RLC_UM_TEST_H__
# define __RLC_UM_TEST_H__ # define __RLC_UM_TEST_H__
rlc_um_entity_t um_tx;
rlc_um_entity_t um_rx;
void rlc_um_v9_3_0_test_windows_5(void); void rlc_um_v9_3_0_test_windows_5(void);
void rlc_um_v9_3_0_test_windows_10(void); void rlc_um_v9_3_0_test_windows_10(void);
......
...@@ -52,6 +52,8 @@ extern boolean_t pdcp_data_ind( ...@@ -52,6 +52,8 @@ extern boolean_t pdcp_data_ind(
//#define TRACE_RLC_PAYLOAD 1 //#define TRACE_RLC_PAYLOAD 1
#define DEBUG_RLC_DATA_REQ 1 #define DEBUG_RLC_DATA_REQ 1
logical_chan_id_t rlc_mbms_rbid2lcid_ue [MAX_MOBILES_PER_ENB][NB_RB_MBMS_MAX]; /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX]; /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char *dataP, const signed long sizeP) void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char *dataP, const signed long sizeP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -133,13 +133,13 @@ typedef struct { ...@@ -133,13 +133,13 @@ typedef struct {
#define RLC_MAX_MBMS_LC (LTE_maxSessionPerPMCH * LTE_maxServiceCount) #define RLC_MAX_MBMS_LC (LTE_maxSessionPerPMCH * LTE_maxServiceCount)
#define RLC_MAX_LC ((max_val_LTE_DRB_Identity+1)* MAX_MOBILES_PER_ENB) #define RLC_MAX_LC ((max_val_LTE_DRB_Identity+1)* MAX_MOBILES_PER_ENB)
void (*rlc_rrc_data_ind)( extern void (*rlc_rrc_data_ind)(
const protocol_ctxt_t *const ctxtP, const protocol_ctxt_t *const ctxtP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
const sdu_size_t sdu_sizeP, const sdu_size_t sdu_sizeP,
const uint8_t *const sduP) __attribute__ ((aligned(32))); const uint8_t *const sduP) __attribute__ ((aligned(32)));
void (*rlc_rrc_data_conf)( extern void (*rlc_rrc_data_conf)(
const protocol_ctxt_t *const ctxtP, const protocol_ctxt_t *const ctxtP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
const mui_t muiP, const mui_t muiP,
...@@ -184,8 +184,8 @@ typedef struct rlc_mbms_id_s { ...@@ -184,8 +184,8 @@ typedef struct rlc_mbms_id_s {
//rlc_mbms_t rlc_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h //rlc_mbms_t rlc_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
//rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h //rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h extern rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h extern rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
#define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD] #define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD]
; ;
...@@ -201,8 +201,6 @@ rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_ ...@@ -201,8 +201,6 @@ rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_
rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD] = lOG_cH_iD; \ rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD] = lOG_cH_iD; \
} while (0); } while (0);
logical_chan_id_t rlc_mbms_rbid2lcid_ue [MAX_MOBILES_PER_ENB][NB_RB_MBMS_MAX]; /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX]; /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
#define RLC_COLL_KEY_VALUE(eNB_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \ #define RLC_COLL_KEY_VALUE(eNB_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \
...@@ -250,7 +248,7 @@ logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX]; ...@@ -250,7 +248,7 @@ logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX];
(((hash_key_t)(sESSION_ID)) << 37) | \ (((hash_key_t)(sESSION_ID)) << 37) | \
(((hash_key_t)(0x0000000000000001)) << 63)) (((hash_key_t)(0x0000000000000001)) << 63))
hash_table_t *rlc_coll_p __attribute__ ((aligned(32))); extern hash_table_t *rlc_coll_p __attribute__ ((aligned(32)));
/*! \fn tbs_size_t mac_rlc_serialize_tb (char* bufferP, list_t transport_blocksP) /*! \fn tbs_size_t mac_rlc_serialize_tb (char* bufferP, list_t transport_blocksP)
* \brief Serialize a list of transport blocks coming from RLC in order to be processed by MAC. * \brief Serialize a list of transport blocks coming from RLC in order to be processed by MAC.
......
...@@ -297,7 +297,11 @@ int nas_change_mtu(struct net_device *dev, int mtu) ...@@ -297,7 +297,11 @@ int nas_change_mtu(struct net_device *dev, int mtu)
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)
void nas_tx_timeout(struct net_device *dev) void nas_tx_timeout(struct net_device *dev)
#else
void nas_tx_timeout(struct net_device *dev, unsigned int x)
#endif
{ {
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Transmitter timeout, serious problems. // Transmitter timeout, serious problems.
......
...@@ -302,7 +302,11 @@ void ue_ip_change_rx_flags(struct net_device *dev_pP, int flagsP) { ...@@ -302,7 +302,11 @@ void ue_ip_change_rx_flags(struct net_device *dev_pP, int flagsP) {
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)
void ue_ip_tx_timeout(struct net_device *dev_pP) { void ue_ip_tx_timeout(struct net_device *dev_pP) {
#else
void ue_ip_tx_timeout(struct net_device *dev_pP, unsigned int x) {
#endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Transmitter timeout, serious problems. // Transmitter timeout, serious problems.
ue_ip_priv_t *priv_p = netdev_priv(dev_pP); ue_ip_priv_t *priv_p = netdev_priv(dev_pP);
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
#include "pdcp.h" #include "pdcp.h"
#include "gtpv1u_eNB_task.h" #include "gtpv1u_eNB_task.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "intertask_interface.h" #include "intertask_interface.h"
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
# include "common/ran_context.h" # include "common/ran_context.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
...@@ -181,21 +182,16 @@ void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ( ...@@ -181,21 +182,16 @@ void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(
LOG_W(RRC, "[eNB] In %s: invalid UE\n", __func__); LOG_W(RRC, "[eNB] In %s: invalid UE\n", __func__);
return; return;
} }
gtpv1u_enb_delete_tunnel_req_t tmp={0};
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL, 0, tmp.rnti = ue_context_pP->ue_context.rnti;
"0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", tmp.from_gnb = 0;
ue_context_pP->ue_context.eNB_ue_s1ap_id); tmp.num_erab = ue_context_pP->ue_context.nb_of_e_rabs;
MessageDef *msg = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ);
memset(&GTPV1U_ENB_DELETE_TUNNEL_REQ(msg), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg)));
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg).rnti = ue_context_pP->ue_context.rnti;
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg).from_gnb = 0;
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg).num_erab = ue_context_pP->ue_context.nb_of_e_rabs;
for (int e_rab = 0; e_rab < ue_context_pP->ue_context.nb_of_e_rabs; e_rab++) { for (int e_rab = 0; e_rab < ue_context_pP->ue_context.nb_of_e_rabs; e_rab++) {
const rb_id_t gtp_ebi = ue_context_pP->ue_context.enb_gtp_ebi[e_rab]; const rb_id_t gtp_ebi = ue_context_pP->ue_context.enb_gtp_ebi[e_rab];
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg).eps_bearer_id[e_rab] = gtp_ebi; tmp.eps_bearer_id[e_rab] = gtp_ebi;
} }
itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(enb_mod_idP), msg); gtpv1u_delete_s1u_tunnel(enb_mod_idP,&tmp);
} }
...@@ -48,11 +48,12 @@ ...@@ -48,11 +48,12 @@
#include "pdcp_primitives.h" #include "pdcp_primitives.h"
#include "UTIL/OSA/osa_defs.h" #include "UTIL/OSA/osa_defs.h"
#include "msc.h" #include <common/utils/msc/msc.h>
#include "LTE_UERadioAccessCapabilityInformation.h" #include "LTE_UERadioAccessCapabilityInformation.h"
#include "gtpv1u_eNB_task.h" #include "gtpv1u_eNB_task.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "RRC/LTE/rrc_eNB_GTPV1U.h" #include "RRC/LTE/rrc_eNB_GTPV1U.h"
#include "TLVDecoder.h" #include "TLVDecoder.h"
......
...@@ -148,7 +148,6 @@ extern void *udp_eNB_task(void *args_p); ...@@ -148,7 +148,6 @@ extern void *udp_eNB_task(void *args_p);
int transmission_mode=1; int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
int usrp_tx_thread = 0;
double cpuf; double cpuf;
......
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <netdb.h>
#include <openair2/COMMON/platform_types.h>
#include <openair3/UTILS/conversions.h>
#include "common/utils/LOG/log.h"
#include <common/utils/ocp_itti/intertask_interface.h>
#include <openair2/COMMON/gtpv1_u_messages_types.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
//#include <openair1/PHY/phy_extern.h>
#include <map>
using namespace std;
#pragma pack(1)
typedef struct Gtpv1uMsgHeader {
uint8_t PN:1;
uint8_t S:1;
uint8_t E:1;
uint8_t spare:1;
uint8_t PT:1;
uint8_t version:3;
uint8_t msgType;
uint16_t msgLength;
uint32_t teid;
} __attribute__((packed)) Gtpv1uMsgHeaderT;
#pragma pack()
// TS 29.060, table 7.1 defines the possible message types
// here are all the possible messages (3GPP R16)
#define GTP_ECHO_REQ (1)
#define GTP_ECHO_RSP (2)
#define GTP_ERROR_INDICATION (26)
#define GTP_SUPPORTED_EXTENSION_HEADER_INDICATION (31)
#define GTP_END_MARKER (254)
#define GTP_GPDU (255)
typedef struct ocp_gtpv1u_bearer_s {
/* TEID used in dl and ul */
teid_t teid_incoming; ///< eNB TEID
teid_t teid_outgoing; ///< Remote TEID
in_addr_t outgoing_ip_addr;
struct in6_addr outgoing_ip6_addr;
tcp_udp_port_t outgoing_port;
uint16_t seqNum;
uint8_t npduNum;
} ocp_gtpv1u_bearer_t;
typedef struct {
map<int, ocp_gtpv1u_bearer_t> bearers;
} teidData_t;
typedef struct {
rnti_t rnti;
} rntiData_t;
class gtpEndPoint {
public:
openAddr_t addr;
map<int,teidData_t> ue2te_mapping;
map<int,rntiData_t> te2ue_mapping;
};
class gtpEndPoints {
public:
pthread_mutex_t gtp_lock=PTHREAD_MUTEX_INITIALIZER;
// the instance id will be the Linux socket handler, as this is uniq
map<int, gtpEndPoint> instances;
};
gtpEndPoints globGtp;
#ifdef __cplusplus
extern "C" {
#endif
static uint32_t gtpv1uNewTeid(void) {
#ifdef GTPV1U_LINEAR_TEID_ALLOCATION
g_gtpv1u_teid = g_gtpv1u_teid + 1;
return g_gtpv1u_teid;
#else
return random() + random() % (RAND_MAX - 1) + 1;
#endif
}
#define GTPV1U_HEADER_SIZE (8)
static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, uint32_t teid, uint8_t *Msg,int msgLen,
bool seqNumFlag, bool npduNumFlag, bool extHdrFlag, int seqNum, int npduNum, int extHdrType) {
AssertFatal(extHdrFlag==false,"Not developped");
int headerAdditional=0;
if ( seqNumFlag || npduNumFlag || extHdrFlag)
headerAdditional=4;
uint8_t *buffer;
int fullSize=GTPV1U_HEADER_SIZE+headerAdditional+msgLen;
AssertFatal((buffer=(uint8_t *) malloc(fullSize)) != NULL, "");
Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *)buffer ;
msgHdr->PN=npduNumFlag;
msgHdr->S=seqNumFlag;
msgHdr->E=extHdrFlag;
msgHdr->spare=0;
msgHdr->PT=1;
msgHdr->version=1;
msgHdr->msgType=GTP_GPDU;
msgHdr->msgLength=htons(msgLen);
msgHdr->teid=htonl(teid);
if(seqNumFlag || extHdrFlag || npduNumFlag) {
*((uint16_t *) (buffer+8)) = seqNumFlag ? htons(seqNum) : 0x0000;
*((uint8_t *) (buffer+10)) = npduNumFlag ? htons(npduNum) : 0x00;
*((uint8_t *) (buffer+11)) = extHdrFlag ? htons(extHdrType) : 0x00;
}
memcpy(buffer+GTPV1U_HEADER_SIZE+headerAdditional, Msg, msgLen);
static struct sockaddr_in to= {0};
to.sin_family = AF_INET;
to.sin_port = htons(peerPort);
to.sin_addr.s_addr = peerIp ;
LOG_D(GTPU,"sending packet size: %d to %s\n",fullSize, inet_ntoa(to.sin_addr) );
if (sendto(h, (void *)buffer, (size_t)fullSize, 0,(struct sockaddr *)&to, sizeof(to) ) != fullSize ) {
LOG_E(GTPU,
"[SD %d] Failed to send data to " IPV4_ADDR " on port %d, buffer size %u\n",
h, IPV4_ADDR_FORMAT(peerIp), peerPort, fullSize);
free(buffer);
return GTPNOK;
}
free(buffer);
return !GTPNOK;
}
static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, bool seqNumFlag, bool npduNumFlag) {
uint8_t *buffer=req->buffer+req->offset;
size_t length=req->length;
uint64_t rnti=req->rnti;
int rab_id=req->rab_id;
pthread_mutex_lock(&globGtp.gtp_lock);
auto inst=&globGtp.instances[instance];
auto ptrRnti=inst->ue2te_mapping.find(rnti);
if ( ptrRnti==inst->ue2te_mapping.end() ) {
LOG_E(GTPU, "Gtpv1uProcessUlpReq failed: while getting ue rnti %lx in hashtable ue_mapping\n", rnti);
pthread_mutex_unlock(&globGtp.gtp_lock);
return;
}
auto ptr=ptrRnti->second.bearers;
if ( ptr.find(rab_id) == ptr.end() ) {
LOG_E(GTPU,"sending a packet to a non existant RNTI:RAB: %lx/%x\n", rnti, rab_id);
pthread_mutex_unlock(&globGtp.gtp_lock);
return;
} else
LOG_D(GTPU,"sending a packet to RNTI:RAB:teid %lx/%x/%x, len %lu, oldseq %d, oldnum %d\n",
rnti, rab_id,ptr[rab_id].teid_outgoing,length, ptr[rab_id].seqNum,ptr[rab_id].npduNum );
if(seqNumFlag)
ptr[rab_id].seqNum++;
if(npduNumFlag)
ptr[rab_id].npduNum++;
pthread_mutex_unlock(&globGtp.gtp_lock);
gtpv1uCreateAndSendMsg(instance,
ptr[rab_id].outgoing_ip_addr,
ptr[rab_id].outgoing_port,
ptr[rab_id].teid_outgoing,
buffer, length, false, false, false, ptr[rab_id].seqNum, ptr[rab_id].npduNum, 0) ;
}
static int udpServerSocket(openAddr_s addr) {
LOG_I(GTPU, "Initializing UDP for local address %s with port %s\n", addr.originHost, addr.originService);
int status;
struct addrinfo hints= {0}, *servinfo, *p;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_PASSIVE;
if ((status = getaddrinfo(addr.originHost, addr.originService, &hints, &servinfo)) != 0) {
LOG_E(GTPU,"getaddrinfo error: %s\n", gai_strerror(status));
return -1;
}
int sockfd=-1;
// loop through all the results and bind to the first we can
for(p = servinfo; p != NULL; p = p->ai_next) {
if ((sockfd = socket(p->ai_family, p->ai_socktype,
p->ai_protocol)) == -1) {
LOG_W(GTPU,"socket: %s\n", strerror(errno));
continue;
}
if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) {
close(sockfd);
LOG_W(GTPU,"bind: %s\n", strerror(errno));
continue;
}
break; // if we get here, we must have connected successfully
}
if (p == NULL) {
// looped off the end of the list with no successful bind
LOG_E(GTPU,"failed to bind socket: %s %s \n", addr.originHost, addr.originService);
return -1;
}
freeaddrinfo(servinfo); // all done with this structure
int sendbuff = 1000*1000*10;
AssertFatal(0==setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &sendbuff, sizeof(sendbuff)),"");
LOG_D(GTPU,"Created listener for paquets to: %s:%s, send buffer size: %d\n", addr.originHost, addr.originService,sendbuff);
return sockfd;
}
instance_t ocp_gtpv1Init(openAddr_t context) {
pthread_mutex_lock(&globGtp.gtp_lock);
int id=udpServerSocket(context);
if (id>=0) {
globGtp.instances[id].addr=context;
itti_subscribe_event_fd(OCP_GTPV1_U, id);
} else
LOG_E(GTPU,"can't create GTP-U instance\n");
pthread_mutex_unlock(&globGtp.gtp_lock);
return id;
}
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
LOG_D(GTPU, "Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %d\n",
create_tunnel_req->rnti,
create_tunnel_req->num_tunnels,
create_tunnel_req->sgw_S1u_teid[0]);
pthread_mutex_lock(&globGtp.gtp_lock);
auto inst=&globGtp.instances[instance];
auto it=inst->ue2te_mapping.find(create_tunnel_req->rnti);
if ( it != inst->ue2te_mapping.end() ) {
LOG_W(GTPU,"Create a config for a already existing GTP tunnel (rnti %x)\n", create_tunnel_req->rnti);
inst->ue2te_mapping.erase(it);
}
rntiData_t rntiData= {create_tunnel_req->rnti};
for (int i = 0; i < create_tunnel_req->num_tunnels; i++) {
ocp_gtpv1u_bearer_t gtpv1u_ue_data;
uint32_t s1u_teid=gtpv1uNewTeid();
while ( inst->te2ue_mapping.find(s1u_teid) != inst->te2ue_mapping.end() ) {
LOG_W(GTPU, "generated a random Teid that exists, re-generating (%u)\n",s1u_teid);
s1u_teid=gtpv1uNewTeid();
};
inst->te2ue_mapping[s1u_teid]=rntiData;
int addrs_length_in_bytes = create_tunnel_req->sgw_addr[i].length / 8;
switch (addrs_length_in_bytes) {
case 4:
memcpy(&gtpv1u_ue_data.outgoing_ip_addr,create_tunnel_req->sgw_addr[i].buffer,4);
break;
case 16:
memcpy(&gtpv1u_ue_data.outgoing_ip6_addr.s6_addr,
create_tunnel_req->sgw_addr[i].buffer,
16);
break;
case 20:
memcpy(&gtpv1u_ue_data.outgoing_ip_addr,create_tunnel_req->sgw_addr[i].buffer,4);
memcpy(&gtpv1u_ue_data.outgoing_ip6_addr.s6_addr,
create_tunnel_req->sgw_addr[i].buffer+4,
16);
default:
AssertFatal(false, "SGW Address size impossible");
}
gtpv1u_ue_data.teid_incoming = s1u_teid;
gtpv1u_ue_data.outgoing_port=2152;
gtpv1u_ue_data.teid_outgoing= create_tunnel_req->sgw_S1u_teid[i];
inst->ue2te_mapping[create_tunnel_req->rnti].bearers[create_tunnel_req->eps_bearer_id[i]]=gtpv1u_ue_data;
LOG_D(GTPU, "Created tunnel %x for RNTI %x, SGW: " IPV4_ADDR ":%d\n",
s1u_teid, create_tunnel_req->rnti,
IPV4_ADDR_FORMAT(inst->ue2te_mapping[create_tunnel_req->rnti].bearers[create_tunnel_req->eps_bearer_id[i]].outgoing_ip_addr),
inst->ue2te_mapping[create_tunnel_req->rnti].bearers[create_tunnel_req->eps_bearer_id[i]].outgoing_port );
create_tunnel_resp->status=0;
create_tunnel_resp->rnti=create_tunnel_req->rnti;
create_tunnel_resp->num_tunnels=create_tunnel_req->num_tunnels;
create_tunnel_resp->enb_S1u_teid[i]=gtpv1u_ue_data.teid_incoming;
create_tunnel_resp->eps_bearer_id[i] = create_tunnel_req->eps_bearer_id[i];
//TBD: fix me this is quite bad, for IPv4 only and
// Overcomplex stuff to fill InitialContextSetupResponse in S1AP
int status;
struct addrinfo hints= {0}, *servinfo, *p;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_PASSIVE;
openAddr_t *addr=&globGtp.instances[instance].addr;
if ((status = getaddrinfo(addr->originHost, addr->originService, &hints, &servinfo)) != 0) {
LOG_E(GTPU,"getaddrinfo error: %s\n", gai_strerror(status));
pthread_mutex_unlock(&globGtp.gtp_lock);
return -1;
}
// TBD: we take the first IPv4 addr, but it should be coded in the right way
for(p = servinfo; p != NULL; p = p->ai_next)
if (p->ai_family == AF_INET) {
struct sockaddr_in *ipv4P=(struct sockaddr_in *)p->ai_addr;
memcpy(create_tunnel_resp->enb_addr.buffer,
&ipv4P->sin_addr.s_addr, sizeof(ipv4P->sin_addr.s_addr));
create_tunnel_resp->enb_addr.length = sizeof(ipv4P->sin_addr.s_addr);
break;
}
if ( p == NULL )
LOG_E(GTPU,"can't translate IP address string: %s\n",addr->originHost);
freeaddrinfo(servinfo); // all done with this structure
}
pthread_mutex_unlock(&globGtp.gtp_lock);
return !GTPNOK;
}
int ocp_gtpv1u_update_s1u_tunnel(
const instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req,
const rnti_t prior_rnti
) {
LOG_D(GTPU, "Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %d, eps_bearer_id %d\n",
prior_rnti,
create_tunnel_req->rnti,
create_tunnel_req->num_tunnels,
create_tunnel_req->sgw_S1u_teid[0],
create_tunnel_req->eps_bearer_id[0]);
pthread_mutex_lock(&globGtp.gtp_lock);
auto inst=&globGtp.instances[instance];
if ( inst->ue2te_mapping.find(create_tunnel_req->rnti) != inst->ue2te_mapping.end() ) {
LOG_E(GTPU,"Update a existing GTP tunnel to a already existing tunnel (new rnti %x, old rnti %x)\n", create_tunnel_req->rnti, prior_rnti);
}
auto it=inst->ue2te_mapping.find(prior_rnti);
if ( it != inst->ue2te_mapping.end() ) {
LOG_W(GTPU,"Update a not existing tunnel, start create the new one (new rnti %x, old rnti %x)\n", create_tunnel_req->rnti, prior_rnti);
gtpv1u_enb_create_tunnel_resp_t tmp;
(void)ocp_gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp);
pthread_mutex_unlock(&globGtp.gtp_lock);
return 0;
}
inst->ue2te_mapping[create_tunnel_req->rnti]=it->second;
inst->ue2te_mapping.erase(it);
pthread_mutex_unlock(&globGtp.gtp_lock);
return 0;
}
int ocp_gtpv1u_create_x2u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP,
gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP){
AssertFatal( false, "to be developped\n");
}
int ocp_gtpv1u_delete_s1u_tunnel( const instance_t instance,
const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
LOG_D(GTPU, "Start delete tunnels for RNTI %x, num_erab %d, eps_bearer_id %d \n",
req_pP->rnti,
req_pP->num_erab,
req_pP->eps_bearer_id[0]);
pthread_mutex_lock(&globGtp.gtp_lock);
auto inst=&globGtp.instances[instance];
auto it=inst->ue2te_mapping.find(req_pP->rnti);
if ( it == inst->ue2te_mapping.end() ) {
LOG_W(GTPU,"Delete a non existing GTP tunnel\n");
pthread_mutex_unlock(&globGtp.gtp_lock);
return -1;
}
for (auto j=it->second.bearers.begin();
j!=it->second.bearers.end();
++j)
inst->te2ue_mapping.erase(j->second.teid_incoming);
inst->ue2te_mapping.erase(it);
pthread_mutex_unlock(&globGtp.gtp_lock);
return !GTPNOK;
}
static int Gtpv1uHandleEchoReq(int h,
uint8_t *msgBuf,
uint32_t msgBufLen,
uint16_t peerPort,
uint32_t peerIp) {
LOG_E(GTPU,"to be dev\n");
int rc = GTPNOK;
return rc;
}
static int Gtpv1uHandleError(int h,
uint8_t *msgBuf,
uint32_t msgBufLen,
uint16_t peerPort,
uint32_t peerIp) {
LOG_E(GTPU,"to be dev\n");
int rc = GTPNOK;
return rc;
}
static int Gtpv1uHandleSupportedExt(int h,
uint8_t *msgBuf,
uint32_t msgBufLen,
uint16_t peerPort,
uint32_t peerIp) {
LOG_E(GTPU,"to be dev\n");
int rc = GTPNOK;
return rc;
}
static int Gtpv1uHandleEndMarker(int h,
uint8_t *msgBuf,
uint32_t msgBufLen,
uint16_t peerPort,
uint32_t peerIp) {
LOG_E(GTPU,"to be dev\n");
int rc = GTPNOK;
return rc;
}
static int Gtpv1uHandleGpdu(int h,
uint8_t *msgBuf,
uint32_t msgBufLen,
uint16_t peerPort,
uint32_t peerIp) {
Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *) msgBuf;
if ( msgHdr->version != 1 || msgHdr->PT != 1 ) {
LOG_E(GTPU, "Received a packet that is not GTP header\n");
return GTPNOK;
}
pthread_mutex_lock(&globGtp.gtp_lock);
// the socket Linux file handler is the instance id
auto inst=&globGtp.instances[h];
auto tunnel=inst->te2ue_mapping.find(ntohl(msgHdr->teid));
if ( tunnel == inst->te2ue_mapping.end() ) {
LOG_E(GTPU,"Received a incoming packet on non open teid (%d)\n", msgHdr->teid);
pthread_mutex_unlock(&globGtp.gtp_lock);
return GTPNOK;
}
int offset=8;
if( msgHdr->E || msgHdr->S ||msgHdr->PN)
offset+=4;
/*
gtpv1u_enb_tunnel_data_ind_t tmp;
protocol_ctxt_t ctxt;
ctxt.module_id = 0;
ctxt.enb_flag = 1;
ctxt.instance = 0;
ctxt.frame = 0;
ctxt.subframe = 0;
ctxt.eNB_index = 0;
ctxt.configured = 1;
ctxt.brOption = 0;
result = pdcp_data_req(&ctxt,
SRB_FLAG_YES,
RRC_DCCH_DATA_REQ(msg_p).rb_id,
RRC_DCCH_DATA_REQ(msg_p).muip,
RRC_DCCH_DATA_REQ(msg_p).confirmp,
RRC_DCCH_DATA_REQ(msg_p).sdu_size,
RRC_DCCH_DATA_REQ(msg_p).sdu_p,
RRC_DCCH_DATA_REQ(msg_p).mode,
NULL, NULL);
ctxt.rnti = rnti;
pdcp_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
MessageDef *msg_p=itti_alloc_new_message_sized(OCP_GTPV1_U,GTPV1U_ENB_TUNNEL_DATA_IND,
sizeof(MessageDef) + msgBufLen);
GTPV1U_ENB_TUNNEL_DATA_IND(msg_p).buffer=(uint8_t *)(msg_p+1);
memcpy(GTPV1U_ENB_TUNNEL_DATA_IND(msg_p).buffer,msgBuf,msgBufLen);
GTPV1U_ENB_TUNNEL_DATA_IND(msg_p).length=msgBufLen;
GTPV1U_ENB_TUNNEL_DATA_IND(msg_p).offset=offset;
pthread_mutex_unlock(&globGtp.gtp_lock);
inst->addr.dlCallBack(msg_p);
*/
// could be a full itti msg, make it in the call back if you need
//itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(0), msg_p);
LOG_D(GTPU,"Received a %d bytes packet for: teid:%x\n",
msgBufLen-offset,
ntohl(msgHdr->teid));
return !GTPNOK;
}
void gtpv1uReceiver(int h) {
uint8_t udpData[65536];
int udpDataLen;
socklen_t from_len;
struct sockaddr_in addr;
from_len = (socklen_t)sizeof(struct sockaddr_in);
if ((udpDataLen = recvfrom(h, udpData, sizeof(udpData), 0,
(struct sockaddr *)&addr, &from_len)) < 0) {
LOG_E(GTPU, "Recvfrom failed %s\n", strerror(errno));
return;
} else if (udpDataLen == 0) {
LOG_W(GTPU, "Recvfrom returned 0\n");
return;
} else {
uint8_t msgType = *((uint8_t *)(udpData + 1));
LOG_D(GTPU, "Received GTP data, msg type: %x\n", msgType);
switch(msgType) {
case GTP_ECHO_RSP:
break;
case GTP_ECHO_REQ:
Gtpv1uHandleEchoReq( h, udpData, udpDataLen, htons(addr.sin_port), addr.sin_addr.s_addr);
break;
case GTP_ERROR_INDICATION:
Gtpv1uHandleError( h, udpData, udpDataLen, htons(addr.sin_port), addr.sin_addr.s_addr);
break;
case GTP_SUPPORTED_EXTENSION_HEADER_INDICATION:
Gtpv1uHandleSupportedExt( h, udpData, udpDataLen, htons(addr.sin_port), addr.sin_addr.s_addr);
break;
case GTP_END_MARKER:
Gtpv1uHandleEndMarker( h, udpData, udpDataLen, htons(addr.sin_port), addr.sin_addr.s_addr);
break;
case GTP_GPDU:
Gtpv1uHandleGpdu( h, udpData, udpDataLen, htons(addr.sin_port), addr.sin_addr.s_addr);
break;
default:
LOG_E(GTPU, "Received a GTP packet of unknown type: %d\n",msgType);
break;
}
}
}
void *ocp_gtpv1uTask(void *args) {
while(1) {
/* Trying to fetch a message from the message queue.
If the queue is empty, this function will block till a
message is sent to the task.
*/
MessageDef *message_p = NULL;
itti_receive_msg(OCP_GTPV1_U, &message_p);
if (message_p != NULL ) {
switch (ITTI_MSG_ID(message_p)) {
// DATA TO BE SENT TO UDP
case GTPV1U_ENB_TUNNEL_DATA_REQ: {
gtpv1uSend(ITTI_MESSAGE_GET_INSTANCE(message_p),
&GTPV1U_ENB_TUNNEL_DATA_REQ(message_p), false, false);
itti_free(OCP_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer);
}
break;
case TERMINATE_MESSAGE:
break;
case TIMER_HAS_EXPIRED:
LOG_E(GTPU, "Received unexpected timer expired (no need of timers in this version) %s\n", ITTI_MSG_NAME(message_p));
break;
case GTPV1U_ENB_DATA_FORWARDING_REQ:
case GTPV1U_ENB_DATA_FORWARDING_IND:
case GTPV1U_ENB_END_MARKER_REQ:
case GTPV1U_ENB_END_MARKER_IND:
case GTPV1U_ENB_S1_REQ:
LOG_E(GTPU, "to be developped %s\n", ITTI_MSG_NAME(message_p));
abort();
break;
default:
LOG_E(GTPU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
abort();
break;
}
AssertFatal(EXIT_SUCCESS==itti_free(OCP_GTPV1_U, message_p), "Failed to free memory!\n");
}
struct epoll_event *events;
int nb_events = itti_get_events(OCP_GTPV1_U, &events);
if (nb_events > 0 && events!= NULL )
for (int i = 0; i < nb_events; i++)
gtpv1uReceiver(events[i].data.fd);
}
return NULL;
}
#ifdef __cplusplus
}
#endif
#ifndef __UDP_ITF_H__
#define __UDP_ITF_H__
#define GTPNOK -1
# define GTPU_HEADER_OVERHEAD_MAX 64
#ifdef __cplusplus
extern "C" {
#endif
#include <openair3/GTPV1-U/gtpv1u_eNB_defs.h>
#if defined(NEW_GTPU)
#define gtpv1u_create_s1u_tunnel ocp_gtpv1u_create_s1u_tunnel
#define gtpv1u_update_s1u_tunnel ocp_gtpv1u_update_s1u_tunnel
#define gtpv1u_delete_s1u_tunnel ocp_gtpv1u_delete_s1u_tunnel
#define gtpv1u_create_x2u_tunnel ocp_gtpv1u_create_x2u_tunnel
#endif
typedef struct openAddr_s {
char originHost[HOST_NAME_MAX];
char originService[HOST_NAME_MAX];
char destinationHost[HOST_NAME_MAX];
char destinationService[HOST_NAME_MAX];
instance_t originInstance;
} openAddr_t;
// the init function create a gtp instance and return the gtp instance id
// the parameter originInstance will be sent back in each message from gtp to the creator
instance_t ocp_gtpv1Init(openAddr_t context);
void ocp_gtpv1uReceiver(int h);
void ocp_gtpv1uProcessTimeout(int handle,void *arg);
int ocp_gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp);
int ocp_gtpv1u_update_s1u_tunnel(const instance_t instanceP,
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP,
const rnti_t prior_rnti
);
int ocp_gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
int ocp_gtpv1u_create_x2u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP,
gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP);
void *ocp_gtpv1uTask(void *args);
#ifdef __cplusplus
}
#endif
#endif
...@@ -1329,7 +1329,7 @@ extern "C" { ...@@ -1329,7 +1329,7 @@ extern "C" {
if(is_equal(s->sample_rate, (double)7.68e6)) if(is_equal(s->sample_rate, (double)7.68e6))
s->tx_forward_nsamps = 50; s->tx_forward_nsamps = 50;
if (device->recplay_state != NULL) { // record mode if (device->recplay_state != NULL) { // record mode
device->recplay_state->ms_sample = (iqrec_t *) malloc(openair0_cfg[0].recplay_conf->u_sf_max * sizeof(iqrec_t)); device->recplay_state->ms_sample = (iqrec_t *) malloc(openair0_cfg[0].recplay_conf->u_sf_max * sizeof(iqrec_t));
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
# include "enb_app.h" # include "enb_app.h"
# include "openair2/LAYER2/MAC/mac_proto.h" # include "openair2/LAYER2/MAC/mac_proto.h"
#include <executables/split_headers.h> #include <executables/split_headers.h>
#include <openair3/ocp-gtpu/gtp_itf.h>
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
# include "mce_app.h" # include "mce_app.h"
# include "mme_app.h" # include "mme_app.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
//extern RAN_CONTEXT_t RC; //extern RAN_CONTEXT_t RC;
int create_tasks_mbms(uint32_t enb_nb) { int create_tasks_mbms(uint32_t enb_nb) {
......
...@@ -170,7 +170,6 @@ extern void init_eNB_afterRU(void); ...@@ -170,7 +170,6 @@ extern void init_eNB_afterRU(void);
int transmission_mode=1; int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
int usrp_tx_thread = 0;
THREAD_STRUCT thread_struct; THREAD_STRUCT thread_struct;
/* struct for ethernet specific parameters given in eNB conf file */ /* struct for ethernet specific parameters given in eNB conf file */
......
...@@ -168,7 +168,6 @@ extern void get_uethreads_params(void); ...@@ -168,7 +168,6 @@ extern void get_uethreads_params(void);
int transmission_mode=1; int transmission_mode=1;
int usrp_tx_thread = 0;
char *usrp_args=NULL; char *usrp_args=NULL;
......
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