diff --git a/CMakeLists.txt b/CMakeLists.txt
index 10b595a4d9..4b2a3b41d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -508,9 +508,6 @@ include_directories ("${OPENAIR_DIR}/radio/COMMON")
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
##############################################################
-add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????" ON)
-add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????" ON)
-
add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE" ON)
add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE" ON)
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE" ON)
@@ -1483,10 +1480,6 @@ add_library(L2_UE_LTE_NR
)
target_link_libraries(L2_UE_LTE_NR PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
-if (NOT ${NOS1})
-target_compile_definitions(L2_UE PUBLIC -DPDCP_USE_NETLINK)
-endif()
-
target_link_libraries(L2_UE PRIVATE asn1_lte_rrc_hdrs)
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
@@ -1885,13 +1878,6 @@ set (SIMUSRC
add_library(SIMU STATIC ${SIMUSRC} )
target_include_directories(SIMU PUBLIC ${OPENAIR1_DIR}/SIMULATION/TOOLS ${OPENAIR1_DIR}/SIMULATION/RF)
-add_library(SIMU_ETH STATIC
- ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
- ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
- ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
-)
-target_link_libraries(SIMU_ETH PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
-
include_directories("${NFAPI_DIR}/nfapi/public_inc")
include_directories("${NFAPI_DIR}/common/public_inc")
include_directories("${NFAPI_DIR}/pnf/public_inc")
@@ -1940,8 +1926,6 @@ add_executable(lte-softmodem
${OPENAIR_DIR}/executables/create_tasks_mbms.c
${OPENAIR_DIR}/radio/COMMON/common_lib.c
${OPENAIR_DIR}/radio/COMMON/record_player.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
- ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${PHY_INTERFACE_DIR}/queue_t.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
@@ -1954,7 +1938,7 @@ 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
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 SIMU_ETH shlib_loader
+ ${NAS_UE_LIB} ITTI SIMU shlib_loader
-Wl,--end-group z dl)
target_link_libraries(lte-softmodem PRIVATE pthread m CONFIG_LIB rt sctp)
@@ -1998,22 +1982,17 @@ add_executable(lte-uesoftmodem
${OPENAIR_DIR}/executables/create_tasks_ue.c
${OPENAIR_DIR}/radio/COMMON/common_lib.c
${OPENAIR_DIR}/radio/COMMON/record_player.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
- ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
)
-if (NOT ${NOS1})
- target_compile_definitions(lte-uesoftmodem PRIVATE -DPDCP_USE_NETLINK)
-endif()
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
- PHY_UE PHY_RU L2_UE L2_LTE SIMU SIMU_ETH NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
+ 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)
@@ -2038,8 +2017,6 @@ add_executable(nr-softmodem
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR_DIR}/radio/COMMON/common_lib.c
${OPENAIR_DIR}/radio/COMMON/record_player.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
- ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${PHY_INTERFACE_DIR}/queue_t.c
@@ -2050,7 +2027,7 @@ 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
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 SIMU_ETH
+ 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
-Wl,--end-group z dl)
@@ -2081,7 +2058,6 @@ target_link_libraries(nr-softmodem PRIVATE
add_executable(nr-cuup
executables/nr-cuup.c
executables/softmodem-common.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${NR_RRC_DIR}/rrc_gNB_UE_context.c
${OPENAIR2_DIR}/E1AP/e1ap_setup.c
${NR_PDCP_SRC}
@@ -2090,7 +2066,7 @@ add_executable(nr-cuup
target_link_libraries(nr-cuup PRIVATE
CONFIG_LIB ITTI SCTP_CLIENT
- GTPV1U e1ap f1ap SIMU_ETH
+ GTPV1U e1ap f1ap
z sctp dl pthread shlib_loader ${T_LIB})
target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
if(E2_AGENT)
@@ -2109,9 +2085,7 @@ add_executable(nr-uesoftmodem
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR_DIR}/radio/COMMON/common_lib.c
${OPENAIR_DIR}/radio/COMMON/record_player.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c
- ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
)
@@ -2121,7 +2095,7 @@ target_link_libraries(nr-uesoftmodem PRIVATE
nr_rrc SECURITY UTIL HASHTABLE SCHED_RU_LIB SCHED_NR_UE_LIB
PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB MISC_NFAPI_NR_LIB
- ITTI LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} SIMU SIMU_ETH shlib_loader
+ ITTI LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} SIMU shlib_loader
-Wl,--end-group z dl)
target_link_libraries(nr-uesoftmodem PRIVATE pthread m CONFIG_LIB rt nr_ue_phy_meas)
@@ -2221,14 +2195,13 @@ add_executable(nr_psbchsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/psbchsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/executables/softmodem-common.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
${NFAPI_USER_DIR}/gnb_ind_vars.c
${PHY_INTERFACE_DIR}/queue_t.c
)
target_link_libraries(nr_psbchsim PRIVATE
- -Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -lz -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 CONFIG_LIB L2_NR -lz -Wl,--end-group
m pthread ${T_LIB} ITTI dl shlib_loader
)
target_link_libraries(nr_psbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
@@ -2248,14 +2221,13 @@ add_executable(nr_dlsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/executables/softmodem-common.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
${NFAPI_USER_DIR}/gnb_ind_vars.c
${PHY_INTERFACE_DIR}/queue_t.c
)
target_link_libraries(nr_dlsim PRIVATE
- -Wl,--start-group UTIL SIMU SIMU_ETH 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 -lz -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 HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group
m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas
)
target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
@@ -2284,7 +2256,6 @@ add_executable(nr_ulsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/executables/softmodem-common.c
- ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
${NFAPI_USER_DIR}/gnb_ind_vars.c
@@ -2296,7 +2267,7 @@ if (ENABLE_LDPC_T2)
endif()
target_link_libraries(nr_ulsim PRIVATE
- -Wl,--start-group UTIL SIMU SIMU_ETH 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 -lz -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 HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group
m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas
)
target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
@@ -2344,7 +2315,7 @@ endforeach(myExe)
#ensure that the T header files are generated before targets depending on them
if (${T_TRACER})
foreach(i
- #all "add_executable" definitions (except tests, rb_tool, updatefw)
+ #all "add_executable" definitions (except tests, updatefw)
lte-softmodem lte-uesoftmodem nr-softmodem
nr-uesoftmodem dlsim dlsim_tm4 dlsim_tm7
ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim
@@ -2359,7 +2330,7 @@ if (${T_TRACER})
MISC_NFAPI_LTE_LIB MISC_NFAPI_NR_LIB
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_UE_NR ngap
- CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU SIMU_ETH OPENAIR0_LIB
+ CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc_t2 ldpc_cl ldpc_cuda ldpc dfts config_internals nr_common)
if (TARGET ${i})
add_dependencies(${i} generate_T)
@@ -2367,86 +2338,6 @@ if (${T_TRACER})
endforeach(i)
endif (${T_TRACER})
-##################################################
-# Generated specific cases is not regular code
-###############################################
-
-################
-# Kernel modules
-###############
-# Set compiler options for kernel modules
-# we need to get out cmake to use the regular Linux Kernel process
-# this is documented as https://www.kernel.org/doc/Documentation/kbuild/modules.txt
-######################################
-
-# retrieve the compiler options to send it to gccxml
-get_directory_property(DirDefs COMPILE_DEFINITIONS )
-foreach( d ${DirDefs} )
- set(module_cc_opt "${module_cc_opt} -D${d}")
-endforeach()
-get_directory_property( DirDefs INCLUDE_DIRECTORIES )
-foreach( d ${DirDefs} )
- set(module_cc_opt "${module_cc_opt} -I${d}")
-endforeach()
-
-EXECUTE_PROCESS(COMMAND uname -r
- OUTPUT_VARIABLE os_release
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-SET(module_build_path /lib/modules/${os_release}/build)
-
-function(make_driver name dir)
- file(MAKE_DIRECTORY ${OPENAIR_BIN_DIR}/${name})
- foreach(f IN ITEMS ${ARGN})
- list(APPEND src_path_list ${dir}/${f})
- string(REGEX REPLACE "c *$" "o" obj ${f})
- set(objs "${objs} ${obj}")
- endforeach()
- CONFIGURE_FILE(${OPENAIR_CMAKE}/tools/Kbuild.cmake ${OPENAIR_BIN_DIR}/${name}/Kbuild)
- add_custom_command(OUTPUT ${name}.ko
- COMMAND make -C ${module_build_path} M=${OPENAIR_BIN_DIR}/${name}
- WORKING_DIRECTORY ${OPENAIR_BIN_DIR}/${name}
- COMMENT "building ${module}.ko"
- VERBATIM
- SOURCES ${src_path_list}
- )
- add_custom_target(${name} DEPENDS ${name}.ko)
-endfunction(make_driver name dir src)
-
-# nashmesh module
-################
-list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
-set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK")
-# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
-# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
-if (OAI_NW_DRIVER_USE_NETLINK)
- list(APPEND nasmesh_src netlink.c)
-endif()
-make_driver(nasmesh ${OPENAIR2_DIR}/NETWORK_DRIVER/MESH ${nasmesh_src})
-
-# user space tool for configuring MESH IP driver
-################
-add_executable(rb_tool
- ${OPENAIR2_DIR}/NETWORK_DRIVER/MESH/RB_TOOL/rb_tool.c
-)
-target_include_directories(rb_tool PRIVATE ${OPENAIR2_DIR}/NETWORK_DRIVER/MESH/)
-
-# ???
-####################
-list(APPEND oai_nw_drv_src device.c common.c ioctl.c classifier.c tool.c)
-if(OAI_NW_DRIVER_USE_NETLINK)
- list(APPEND oai_nw_drv_src netlink.c)
-endif()
-make_driver(oai_nw_drv ${OPENAIR2_DIR}/NETWORK_DRIVER/LTE ${oai_nw_drv_src})
-
-
-# ue_ip: purpose ???
-###############
-list(APPEND ue_ip_src device.c common.c)
-if(OAI_NW_DRIVER_USE_NETLINK)
- list(APPEND ue_ip_src netlink.c)
-endif()
-make_driver(ue_ip ${OPENAIR2_DIR}/NETWORK_DRIVER/UE_IP ${ue_ip_src})
-
include(${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/CMakeLists.txt)
set(ENABLE_TESTS OFF CACHE STRING "Activate build of tests")
diff --git a/NOTICE.md b/NOTICE.md
index b92941540d..10f3bd295b 100644
--- a/NOTICE.md
+++ b/NOTICE.md
@@ -4,15 +4,6 @@ For more details of the license, refer to [LICENSE](LICENSE) file in the same di
However, the source code also contains third party software that is acknowledged here for reference.
-## Credits for LFDS user space source code located in folder openair2/UTILS/LFDS/ ##
-
-See on [liblfds website](https://liblfds.org/) the license section.
-
-
-"There is no license. You are free to use this software in any way, for any purpose. Go forth and create wealth!
-If however for legal reasons a licence is required, the license of your choice will be granted."
-
-
## Credits for source code common/utils/collection/queue.h: ##
The Regents of the University of California: BSD 3-Clause Licence.
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 3e688923fb..cd7e326be8 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -85,7 +85,7 @@ Options:
--RU
Makes the OAI RRU
--UE
- Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file
+ Makes the UE specific parts (usim, nvram) from the given configuration file
--nrUE
Makes the NR UE softmodem
--UE-conf-nvram [configuration file]
@@ -271,9 +271,6 @@ function main() {
--UE-gen-nvram)
gen_nvram_path=$(readlink -f "$2")
shift 2;;
- --UE-ip)
- TARGET_LIST="$TARGET_LIST ue_ip"
- shift;;
-w | --hardware)
case "$2" in
"USRP" | "BLADERF" | "LMSSDR" | "IRIS")
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 356229762f..ac336478df 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -171,10 +171,6 @@ clean_kernel() {
$SUDO iptables -t filter -F
$SUDO iptables -t raw -F
echo_info "Flushed iptables"
- $SUDO rmmod nasmesh > /dev/null 2>&1
- $SUDO rmmod oai_nw_drv > /dev/null 2>&1
- $SUDO rmmod ue_ip > /dev/null 2>&1
- echo_info "removed drivers from kernel"
}
clean_all_files() {
diff --git a/cmake_targets/tools/init_nas_nos1 b/cmake_targets/tools/init_nas_nos1
deleted file mode 100755
index a94639026a..0000000000
--- a/cmake_targets/tools/init_nas_nos1
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-#/*
-# * 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
-# */
-
-# file init_nas_nos1
-# brief loads the nasmesh module and sets up the radio bearers (used to provide ip interface without S1 interface)
-# author Florian Kaltenberger
-#
-#######################################
-
-load_module() {
- mod_name=${1##*/}
- mod_name=${mod_name%.*}
- if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
- then
- echo "module $mod_name already loaded: I remove it first"
- sudo rmmod $mod_name
- fi
- echo loading $mod_name
- sudo insmod $1
-}
-
-load_module $OPENAIR_DIR/cmake_targets/ran_build/build/nasmesh.ko
-
-if [ "$1" = "eNB" ]; then
- echo "bring up oai0 interface for enb"
- sudo ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255
- $OPENAIR_DIR/cmake_targets/ran_build/build/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.2 -r 1
-else
- if [ "$1" = "UE" ]; then
- echo "bring up oai0 interface for UE"
- sudo ifconfig oai0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255
- $OPENAIR_DIR/cmake_targets/ran_build/build/rb_tool -a -c0 -i0 -z0 -s 10.0.1.2 -t 10.0.1.1 -r 1
- fi
-fi
diff --git a/cmake_targets/tools/init_nas_s1 b/cmake_targets/tools/init_nas_s1
deleted file mode 100755
index deee97634c..0000000000
--- a/cmake_targets/tools/init_nas_s1
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-
-#WARNING: this file may not work properly, be sure to know what you
-#do when using it
-
-#/*
-# * 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
-# */
-
-################################################################################
-# file init_nas_s1
-# brief loads the ue_ip module and sets up IP for the UE
-# you may want to edit it to fit your settings (replace oip0 by oipX for
-# instance)
-# author Florian Kaltenberger
-#
-#######################################
-
-LTEIF=oip1
-#OPENAIR_DIR=/home/oai/svn-oai/openair4G
-
-load_module() {
- mod_name=${1##*/}
- mod_name=${mod_name%.*}
- if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
- then
- echo "module $mod_name already loaded: I remove it first"
- sudo rmmod $mod_name
- fi
- echo loading $mod_name
- sudo insmod $1
-}
-
-load_module ../ran_build/build/ue_ip.ko
-
-if [ "$1" = "UE" ]; then
- echo "bring up $LTEIF interface for UE"
- sudo ifconfig $LTEIF up
-fi
-
-sudo ip route flush cache
-sleep 1
-sudo sysctl -w net.ipv4.conf.all.log_martians=1
-echo "Disabling reverse path filtering"
-sudo sysctl -w net.ipv4.conf.all.rp_filter=0
-sudo ip route flush cache
-
-# Check table 200 lte in /etc/iproute2/rt_tables
-fgrep lte /etc/iproute2/rt_tables > /dev/null
-if [ $? -ne 0 ]; then
- echo "200 lte " >> /etc/iproute2/rt_tables
-fi
-sudo ip rule add fwmark 1 table lte
-sudo ip route add default dev $LTEIF table lte
diff --git a/common/config/DOC/config/rtusage.md b/common/config/DOC/config/rtusage.md
index 42ef93bffc..3b51e1afd2 100644
--- a/common/config/DOC/config/rtusage.md
+++ b/common/config/DOC/config/rtusage.md
@@ -68,7 +68,6 @@ To get help on supported parameters you can use specific options:
--worker-config: two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'
--nbiot-disable: disable nb-iot, even if defined in config
--noS1: Disable s1 interface
- --nokrnmod: (noS1 only): Use tun instead of namesh module
--------------------------------------------------------------------
[LIBCONFIG] (root): 4/4 parameters successfully set, (4 to default value)
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
index 932f458a77..025091249b 100644
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -13,6 +13,6 @@ add_subdirectory(T)
add_subdirectory(nr)
add_subdirectory(LOG)
add_subdirectory(threadPool)
-add_library(utils utils.c system.c time_meas.c time_stat.c)
+add_library(utils utils.c system.c time_meas.c time_stat.c tun_if.c)
target_include_directories(utils PUBLIC .)
target_link_libraries(utils PRIVATE ${T_LIB})
diff --git a/common/utils/tun_if.c b/common/utils/tun_if.c
new file mode 100644
index 0000000000..4d04325998
--- /dev/null
+++ b/common/utils/tun_if.c
@@ -0,0 +1,283 @@
+/*
+ * 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
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "tun_if.h"
+#include "common/platform_constants.h"
+#include "common/utils/LOG/log.h"
+#include "common/utils/system.h"
+
+int nas_sock_fd[MAX_MOBILES_PER_ENB * 2]; // Allocated for both LTE UE and NR UE.
+int nas_sock_mbms_fd;
+
+static int tun_alloc(char *dev)
+{
+ struct ifreq ifr;
+ int fd, err;
+
+ if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
+ LOG_E(UTIL, "failed to open /dev/net/tun\n");
+ return -1;
+ }
+
+ memset(&ifr, 0, sizeof(ifr));
+ /* Flags: IFF_TUN - TUN device (no Ethernet headers)
+ * IFF_TAP - TAP device
+ *
+ * IFF_NO_PI - Do not provide packet information
+ */
+ ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
+
+ if (*dev)
+ strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name) - 1);
+
+ if ((err = ioctl(fd, TUNSETIFF, (void *)&ifr)) < 0) {
+ close(fd);
+ return err;
+ }
+
+ strcpy(dev, ifr.ifr_name);
+ return fd;
+}
+
+int tun_init_mbms(char *ifprefix, int id)
+{
+ int ret;
+ char ifname[64];
+
+ sprintf(ifname, "%s%d", ifprefix, id);
+ nas_sock_mbms_fd = tun_alloc(ifname);
+
+ if (nas_sock_mbms_fd == -1) {
+ LOG_E(UTIL, "Error opening mbms socket %s (%d:%s)\n", ifname, errno, strerror(errno));
+ exit(1);
+ }
+
+ LOG_D(UTIL, "Opened socket %s with fd %d\n", ifname, nas_sock_mbms_fd);
+ ret = fcntl(nas_sock_mbms_fd, F_SETFL, O_NONBLOCK);
+
+ if (ret == -1) {
+ LOG_E(UTIL, "Error fcntl (%d:%s)\n", errno, strerror(errno));
+ return 0;
+ }
+
+ struct sockaddr_nl nas_src_addr = {0};
+ nas_src_addr.nl_family = AF_NETLINK;
+ nas_src_addr.nl_pid = 1;
+ nas_src_addr.nl_groups = 0; /* not in mcast groups */
+ ret = bind(nas_sock_mbms_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
+
+ return 1;
+}
+
+int tun_init(const char *ifprefix, int num_if, int id)
+{
+ int ret;
+ char ifname[64];
+
+ int begx = (id == 0) ? 0 : id - 1;
+ int endx = (id == 0) ? num_if : id;
+ for (int i = begx; i < endx; i++) {
+ sprintf(ifname, "%s%d", ifprefix, i + 1);
+ nas_sock_fd[i] = tun_alloc(ifname);
+
+ if (nas_sock_fd[i] == -1) {
+ LOG_E(UTIL, "Error opening socket %s (%d:%s)\n", ifname, errno, strerror(errno));
+ return 0;
+ }
+
+ LOG_I(UTIL, "Opened socket %s with fd nas_sock_fd[%d]=%d\n", ifname, i, nas_sock_fd[i]);
+ ret = fcntl(nas_sock_fd[i], F_SETFL, O_NONBLOCK);
+
+ if (ret == -1) {
+ LOG_E(UTIL, "Error fcntl (%d:%s)\n", errno, strerror(errno));
+
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * \brief set a genneric interface parameter
+ * \param ifn the name of the interface to modify
+ * \param if_addr the address that needs to be modified
+ * \param operation one of SIOCSIFADDR (set interface address), SIOCSIFNETMASK
+ * (set network mask), SIOCSIFBRDADDR (set broadcast address), SIOCSIFFLAGS
+ * (set flags)
+ * \return true on success, false otherwise
+ */
+static bool setInterfaceParameter(int sock_fd, const char *ifn, int af, const char *if_addr, int operation)
+{
+ DevAssert(af == AF_INET || af == AF_INET6);
+ struct ifreq ifr = {0};
+ strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name));
+ struct in6_ifreq ifr6 = {0};
+
+ void *ioctl_opt = NULL;
+ if (af == AF_INET) {
+ struct sockaddr_in addr = {.sin_family = AF_INET};
+ int ret = inet_pton(af, if_addr, &addr.sin_addr);
+ if (ret != 1) {
+ LOG_E(OIP, "inet_pton(): cannot convert %s to IPv4 network address\n", if_addr);
+ return false;
+ }
+ memcpy(&ifr.ifr_ifru.ifru_addr,&addr,sizeof(struct sockaddr_in));
+ ioctl_opt = 𝔦
+ } else {
+ struct sockaddr_in6 addr6 = {.sin6_family = AF_INET6};
+ int ret = inet_pton(af, if_addr, &addr6.sin6_addr);
+ if (ret != 1) {
+ LOG_E(OIP, "inet_pton(): cannot convert %s to IPv6 network address\n", if_addr);
+ return false;
+ }
+ memcpy(&ifr6.ifr6_addr, &addr6.sin6_addr, sizeof(struct in6_addr));
+ // we need to get the if index to put it into ifr6
+ if (ioctl(sock_fd, SIOGIFINDEX, &ifr) < 0) {
+ LOG_E(OIP, "ioctl() failed: errno %d, %s\n", errno, strerror(errno));
+ return false;
+ }
+ ifr6.ifr6_ifindex = ifr.ifr_ifindex;
+ ifr6.ifr6_prefixlen = 64;
+ ioctl_opt = &ifr6;
+ }
+
+ bool success = ioctl(sock_fd, operation, ioctl_opt) == 0;
+ if (!success)
+ LOG_E(OIP, "Setting operation %d for %s: ioctl call failed: %d, %s\n", operation, ifn, errno, strerror(errno));
+ return success;
+}
+
+/*
+ * \brief bring interface up (up != 0) or down (up == 0)
+ */
+typedef enum { INTERFACE_DOWN, INTERFACE_UP } if_action_t;
+static bool change_interface_state(int sock_fd, const char *ifn, if_action_t if_action)
+{
+ const char* action = if_action == INTERFACE_DOWN ? "DOWN" : "UP";
+
+ struct ifreq ifr = {0};
+ strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name));
+ /* get flags of this interface: see netdevice(7) */
+ bool success = ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t)&ifr) == 0;
+ if (!success)
+ goto fail_interface_state;
+
+ if (if_action == INTERFACE_UP) {
+ ifr.ifr_flags |= IFF_UP | IFF_NOARP | IFF_POINTOPOINT;
+ ifr.ifr_flags &= ~IFF_MULTICAST;
+ } else {
+ ifr.ifr_flags &= ~IFF_UP;
+ }
+
+ success = ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t)&ifr) == 0;
+ if (!success)
+ goto fail_interface_state;
+ return true;
+
+fail_interface_state:
+ LOG_E(OIP, "Bringing interface %s for %s: ioctl call failed: %d, %s\n", action, ifn, errno, strerror(errno));
+ return false;
+}
+
+// non blocking full configuration of the interface (address, and the two lest octets of the address)
+bool tun_config(int interface_id, const char *ipv4, const char *ipv6, const char *ifpref)
+{
+ char interfaceName[IFNAMSIZ];
+ snprintf(interfaceName, sizeof(interfaceName), "%s%d", ifpref, interface_id);
+
+ AssertFatal(ipv4 != NULL || ipv6 != NULL, "need to have IP address, but none given\n");
+
+ int sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock_fd < 0) {
+ LOG_E(UTIL, "Failed creating socket for interface management: %d, %s\n", errno, strerror(errno));
+ return false;
+ }
+
+ change_interface_state(sock_fd, interfaceName, INTERFACE_DOWN);
+ bool success = true;
+ if (ipv4 != NULL)
+ success = setInterfaceParameter(sock_fd, interfaceName, AF_INET, ipv4, SIOCSIFADDR);
+ // set the machine network mask for IPv4
+ if (success && ipv4 != NULL)
+ success = setInterfaceParameter(sock_fd, interfaceName, AF_INET, "255.255.255.0", SIOCSIFNETMASK);
+
+ if (ipv6 != NULL) {
+ // for setting the IPv6 address, we need an IPv6 socket. For setting IPv4,
+ // we need an IPv4 socket. So do all operations using IPv4 socket, except
+ // for setting the IPv6
+ int sock_fd = socket(AF_INET6, SOCK_DGRAM, 0);
+ if (sock_fd < 0) {
+ LOG_E(UTIL, "Failed creating socket for interface management: %d, %s\n", errno, strerror(errno));
+ success = false;
+ }
+ success = success && setInterfaceParameter(sock_fd, interfaceName, AF_INET6, ipv6, SIOCSIFADDR);
+ close(sock_fd);
+ }
+
+ if (success)
+ success = change_interface_state(sock_fd, interfaceName, INTERFACE_UP);
+
+ if (success)
+ LOG_I(OIP, "Interface %s successfully configured, IPv4 %s, IPv6 %s\n", interfaceName, ipv4, ipv6);
+ else
+ LOG_E(OIP, "Interface %s couldn't be configured (IPv4 %s, IPv6 %s)\n", interfaceName, ipv4, ipv6);
+
+ close(sock_fd);
+ return success;
+}
+
+void setup_ue_ipv4_route(int interface_id, const char *ipv4, const char *ifpref)
+{
+ int table_id = interface_id - 1 + 10000;
+ char interfaceName[IFNAMSIZ];
+ snprintf(interfaceName, sizeof(interfaceName), "%s%d", ifpref, interface_id);
+
+ char command_line[500];
+ int res = sprintf(command_line,
+ "ip rule add from %s/32 table %d && "
+ "ip rule add to %s/32 table %d && "
+ "ip route add default dev %s table %d",
+ ipv4,
+ table_id,
+ ipv4,
+ table_id,
+ interfaceName,
+ table_id);
+
+ if (res < 0) {
+ LOG_E(UTIL, "Could not create ip rule/route commands string\n");
+ return;
+ }
+ background_system(command_line);
+}
+
diff --git a/common/utils/tun_if.h b/common/utils/tun_if.h
new file mode 100644
index 0000000000..45ae34983f
--- /dev/null
+++ b/common/utils/tun_if.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
+ */
+
+#ifndef TUN_IF_H_
+#define TUN_IF_H_
+
+#include
+
+/* TODO: doc */
+int tun_init(const char *ifprefix, int num_if, int id);
+
+/* TODO: doc */
+int tun_init_mbms(char *ifsuffix, int id);
+
+/*! \fn int tun_config(char*, int, int)
+ * \brief This function initializes the nasmesh interface using the basic values,
+ * basic address, network mask and broadcast address, as the default configured
+ * ones
+ * \param[in] interface_id number of this interface, prepended after interface
+ * name
+ * \param[in] ipv4 IPv4 address of this interface as a string
+ * \param[in] ipv6 IPv6 address of this interface as a string
+ * \param[in] ifprefix interface name prefix to which an interface number will
+ * be appended
+ * \return true on success, otherwise false
+ * \note
+ * @ingroup _nas
+ */
+bool tun_config(int interface_id, const char *ipv4, const char *ipv6, const char *ifprefix);
+
+/*!
+ * \brief Setup a IPv4 rule in table (interface_id - 1 + 10000) and route to
+ * force packets coming into interface back through it, and workaround
+ * net.ipv4.conf.all.rp_filter=2 (strict source filtering would filter out
+ * responses of packets going out through interface to another IP address not
+ * in same subnet).
+ * \param[in] interface_id number of this interface, prepended after interface
+ * name
+ * \param[in] ipv4 IPv4 address of the UE
+ * \param[in] ifprefix interface name prefix to which an interface number will
+ * be appended
+ */
+void setup_ue_ipv4_route(int interface_id, const char *ipv4, const char *ifpref);
+
+#endif /*TUN_IF_H_*/
diff --git a/doc/BUILD.md b/doc/BUILD.md
index e99f88fca4..3e06e79d01 100644
--- a/doc/BUILD.md
+++ b/doc/BUILD.md
@@ -38,7 +38,6 @@ Running the [build_oai](../cmake_targets/build_oai) script also generates some
- `conf2uedata`: a binary used to build the (4G) UE data from a configuration file. The created file emulates the sim card of a 3GPP compliant phone.
- `nvram`: a binary used to build (4G) UE (IMEI...) and EMM (IMSI, registered PLMN) non volatile data.
-- `rb_tool`: radio bearer utility for (4G) UE
- `genids` T Tracer utility, used at build time to generate `T_IDs.h` include file. This binary is located in the [T Tracer source file directory](../common/utils/T) .
The build system for OAI uses [cmake](https://cmake.org/) which is a tool to generate makefiles. The `build_oai` script is a wrapper using `cmake` and `make`/`ninja` to ease the oai build and use. It logs the `cmake` and `ninja`/`make` commands it executes. The file describing how to build the executables from source files is the [CMakeLists.txt](../CMakeLists.txt), it is used as input by cmake to generate the makefiles.
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 72c03efe96..5ae52a3c3a 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -866,6 +866,8 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../common/config/config_cmdline.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/time_meas.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/time_meas.h \
+@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/tun_if.h \
+@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/tun_if.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/utils.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/oai_asn1.h \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/system.h \
@@ -1874,10 +1876,6 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR_UE/rrc_defs.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR_UE/L2_interface_ue.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/rb_config.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/rb_config.c \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/nas_config.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NAS/nas_config.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_internode.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_defs.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/cucp_cuup_if.h \
@@ -2308,13 +2306,6 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_ESTIMATION/nr_freq_equalization.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/ETH_TRANSPORT/proto.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/ETH_TRANSPORT/multicast_link.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/ETH_TRANSPORT/socket.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/ETH_TRANSPORT/socket.c \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/ETH_TRANSPORT/defs.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/RF/adc.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/RF/dac.c \
@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SIMULATION/RF/rf.h \
diff --git a/doc/L1SIM.md b/doc/L1SIM.md
index 56be7f93b6..a78d3c328a 100644
--- a/doc/L1SIM.md
+++ b/doc/L1SIM.md
@@ -45,7 +45,7 @@ $ source oaienv
$ cd cmake_targets/tools
$ sudo -E ./init_nas_nos1 eNB
$ cd ../ran_build/build
-$ sudo -E ./lte-softmodem -O YYY.conf --noS1 --nokrnmod 0
+$ sudo -E ./lte-softmodem -O YYY.conf --noS1
```
# How to run a UE with the noS1 option
@@ -59,7 +59,7 @@ $ source oaienv
$ cd cmake_targets/tools
$ sudo -E ./init_nas_nos1 UE
$ cd ../ran_build/build
-$ sudo ./lte-uesoftmodem -O XXX.conf -r 25 --siml1 --noS1 --nokrnmod 0
+$ sudo ./lte-uesoftmodem -O XXX.conf -r 25 --siml1 --noS1
```
That should give you equivalent functionality to what you had with oaisim including noise and RF channel emulation (path loss / fading, etc.). You should also be able to run multiple UEs.
diff --git a/doc/iqrecordplayer_usage.md b/doc/iqrecordplayer_usage.md
index 603a74f4b5..69c675c996 100644
--- a/doc/iqrecordplayer_usage.md
+++ b/doc/iqrecordplayer_usage.md
@@ -33,7 +33,7 @@ than the value of `--subframes-max` parameter.
>Recording session example:
```bash
-./nr-uesoftmodem -O /home/oaitests/mediatek_sim.conf --sa --nokrnmod 1 --numerology 1 -r 106 -C 3649440000 --band 78 -E --ue-fo-compensation --device.recplay.subframes-record 1 --device.recplay.subframes-file /home/iqs/oai-nrUE-17042023.dat --device.recplay.use-mmap 1 --device.recplay.subframes-max 30000
+./nr-uesoftmodem -O /home/oaitests/mediatek_sim.conf --sa --numerology 1 -r 106 -C 3649440000 --band 78 -E --ue-fo-compensation --device.recplay.subframes-record 1 --device.recplay.subframes-file /home/iqs/oai-nrUE-17042023.dat --device.recplay.use-mmap 1 --device.recplay.subframes-max 30000
............................................
............................................
............................................
@@ -54,7 +54,7 @@ options for replay mode are:
>Replay mode session example:
```bash
-./nr-uesoftmodem -O /home/oaitests/mediatek_sim.conf --sa --nokrnmod 1 --numerology 1 -r 106 -C 3649440000 --band 78 -E --ue-fo-compensation --device.recplay.subframes-replay 1 --device.recplay.subframes-file /home/iqs/oai-nrUE-17042023.dat --device.recplay.use-mmap 1 --device.recplay.subframes-loops 1
+./nr-uesoftmodem -O /home/oaitests/mediatek_sim.conf --sa --numerology 1 -r 106 -C 3649440000 --band 78 -E --ue-fo-compensation --device.recplay.subframes-replay 1 --device.recplay.subframes-file /home/iqs/oai-nrUE-17042023.dat --device.recplay.use-mmap 1 --device.recplay.subframes-loops 1
..................................
..................................
[HW] Replay iqs from USRP B200 device, bandwidth 4.000000e+07
diff --git a/executables/lte-enb.c b/executables/lte-enb.c
index 8f50dfc63d..1a26644a43 100644
--- a/executables/lte-enb.c
+++ b/executables/lte-enb.c
@@ -85,7 +85,6 @@
#include "executables/lte-softmodem.h"
#include "s1ap_eNB.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "T.h"
diff --git a/executables/lte-ru.c b/executables/lte-ru.c
index 54747a9578..0ae8b86216 100644
--- a/executables/lte-ru.c
+++ b/executables/lte-ru.c
@@ -72,8 +72,6 @@ static int DEFRUTPCORES[] = {2,4,6,8};
#include "ENB_APP/enb_paramdef.h"
#include "common/config/config_userapi.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
-
#include "T.h"
#include "executables/softmodem-common.h"
diff --git a/executables/lte-softmodem.c b/executables/lte-softmodem.c
index a895b7b614..99f98d4f83 100644
--- a/executables/lte-softmodem.c
+++ b/executables/lte-softmodem.c
@@ -407,18 +407,14 @@ extern void phy_free_RU(RU_t *);
static void init_pdcp(void)
{
pdcp_layer_init();
- uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
- (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
+ uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? 0 : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_NOS1)
- pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
+ pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT;
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_W_MBMS_BIT;
pdcp_module_init(pdcp_initmask, 0);
-
- pdcp_set_rlc_data_req_func(rlc_data_req);
- pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
static void wait_nfapi_init(char *thread_name) {
diff --git a/executables/lte-softmodem.h b/executables/lte-softmodem.h
index 6bc6d27f21..0f5559c7d3 100644
--- a/executables/lte-softmodem.h
+++ b/executables/lte-softmodem.h
@@ -26,7 +26,6 @@
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "s1ap_eNB.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "executables/softmodem-common.h"
diff --git a/executables/lte-ue.c b/executables/lte-ue.c
index 6c5cfd3f32..ee51346f46 100644
--- a/executables/lte-ue.c
+++ b/executables/lte-ue.c
@@ -80,11 +80,6 @@ void init_UE_threads_stub(int);
void init_UE_single_thread_stub(int);
void *UE_thread(void *arg);
int init_timer_thread(void);
-extern void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
- unsigned char _multicast_group,
- char *multicast_ifname);
-extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
-
int tx_req_num_elems;
extern uint16_t sf_ahead;
@@ -364,10 +359,9 @@ void init_UE_stub_single_thread(int nb_inst,
init_UE_single_thread_stub(nb_inst);
printf("UE threads created \n");
- if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
- LOG_I(PHY,"Starting multicast link on %s\n",emul_iface);
- multicast_link_start(ue_stub_rx_handler,0,emul_iface);
- }
+ AssertFatal(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF,
+ "unsupported NFAPI mode %d\n",
+ NFAPI_MODE);
}
void init_UE_standalone_thread(int ue_idx) {
@@ -408,8 +402,9 @@ void init_UE_stub(int nb_inst,
printf("UE threads created \n");
LOG_I(PHY,"Starting multicast link on %s\n",emul_iface);
- if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF)
- multicast_link_start(ue_stub_rx_handler,0,emul_iface);
+ AssertFatal(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF,
+ "unsupported NFAPI mode %d\n",
+ NFAPI_MODE);
}
@@ -2356,15 +2351,7 @@ static void *timer_thread( void *param ) {
}
nanosleep(&t_sleep, (struct timespec *)NULL);
- UE_tport_t pdu;
- pdu.header.packet_type = TTI_SYNC;
- pdu.header.absSF = (timer_frame*10)+timer_subframe;
-
- if (NFAPI_MODE != NFAPI_UE_STUB_PNF && NFAPI_MODE != NFAPI_MODE_STANDALONE_PNF) {
- multicast_link_write_sock(0,
- (char *)&pdu,
- sizeof(UE_tport_header_t));
- }
+ AssertFatal(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF, "unsupported NFAPI mode %d\n", NFAPI_MODE);
} else {
wait_on_condition(&UE->timer_mutex,&UE->timer_cond,&UE->instance_cnt_timer,"timer_thread");
release_thread(&UE->timer_mutex,&UE->instance_cnt_timer,"timer_thread");
diff --git a/executables/lte-uesoftmodem.c b/executables/lte-uesoftmodem.c
index fa32d877f6..a75a22fba4 100644
--- a/executables/lte-uesoftmodem.c
+++ b/executables/lte-uesoftmodem.c
@@ -488,18 +488,21 @@ static inline void wait_nfapi_init(char *thread_name) {
}
static void init_pdcp(int ue_id) {
- uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
+ uint32_t pdcp_initmask = !IS_SOFTMODEM_NOS1 ? LINK_ENB_PDCP_TO_GTPV1U_BIT : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}
- if (IS_SOFTMODEM_NOKRNMOD)
- pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
+ // previous code was:
+ // if (IS_SOFTMODEM_NOKRNMOD)
+ // pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
+ // The kernel module (KRNMOD) has been removed from the project, so the 'if'
+ // was removed but the flag 'pdcp_initmask' was kept, as "no kernel module"
+ // was always set. further refactoring could take it out
+ pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
pdcp_module_init(pdcp_initmask, ue_id);
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
}
// Stupid function addition because UE itti messages queues definition is common with eNB
diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index 1f5fca077c..6efd26dfd7 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -75,7 +75,6 @@
#include "UTIL/OPT/opt.h"
#include "gnb_paramdef.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include
#include "T.h"
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 24a1ecd719..aff3b5b8c2 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -65,7 +65,6 @@ static int DEFRUTPCORES[] = {-1,-1,-1,-1};
#include "GNB_APP/gnb_paramdef.h"
#include "common/config/config_userapi.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include
diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h
index 589bc537f5..b50389e7d0 100644
--- a/executables/nr-softmodem-common.h
+++ b/executables/nr-softmodem-common.h
@@ -30,8 +30,6 @@
#include "PHY/types.h"
#include
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
-
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
#define CONFIG_HLP_ULMAXE "set the eNodeB max ULSCH erros\n"
@@ -103,8 +101,8 @@
#define CONFIG_HLP_TELN "Start embedded telnet server \n"
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
-#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
#define CONFIG_HLP_AGC "Rx Gain control used for UE"
+
/*--------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index b188ead832..ac8a6c13ef 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -140,8 +140,6 @@ uint8_t nb_antenna_rx = 1;
int otg_enabled;
-#include
-
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
@@ -542,10 +540,8 @@ static void wait_nfapi_init(char *thread_name) {
}
void init_pdcp(void) {
- uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
- PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT:
- LINK_ENB_PDCP_TO_GTPV1U_BIT;
-
+ uint32_t pdcp_initmask = IS_SOFTMODEM_NOS1 ? ENB_NAS_USE_TUN_BIT : LINK_ENB_PDCP_TO_GTPV1U_BIT;
+
if (!NODE_IS_DU(get_node_type())) {
nr_pdcp_layer_init(get_node_type() == ngran_gNB_CUCP);
nr_pdcp_module_init(pdcp_initmask, 0);
@@ -654,12 +650,7 @@ int main( int argc, char **argv ) {
itti_init(TASK_MAX, tasks_info);
// initialize mscgen log after ITTI
init_opt();
- if(PDCP_USE_NETLINK && !IS_SOFTMODEM_NOS1) {
- netlink_init();
- if (get_softmodem_params()->nsa) {
- init_pdcp();
- }
- }
+
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index 20fc4248bd..aa25518712 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -326,22 +326,25 @@ void init_openair0()
static void init_pdcp(int ue_id)
{
- uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
+ uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : LINK_ENB_PDCP_TO_GTPV1U_BIT;
/*if (IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}*/
- if (IS_SOFTMODEM_NOKRNMOD) {
- pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
- }
+ // previous code was:
+ // if (IS_SOFTMODEM_NOKRNMOD)
+ // pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
+ // The kernel module (KRNMOD) has been removed from the project, so the 'if'
+ // was removed but the flag 'pdcp_initmask' was kept, as "no kernel module"
+ // was always set. further refactoring could take it out
+ pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
+
if (get_softmodem_params()->nsa && rlc_module_init(0) != 0) {
LOG_I(RLC, "Problem at RLC initiation \n");
}
nr_pdcp_layer_init(false);
nr_pdcp_module_init(pdcp_initmask, ue_id);
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
}
// Stupid function addition because UE itti messages queues definition is common with eNB
diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h
index 779f0049d8..204b16b109 100644
--- a/executables/nr-uesoftmodem.h
+++ b/executables/nr-uesoftmodem.h
@@ -3,9 +3,6 @@
#include
#include
#include "PHY/defs_nr_UE.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
-
-
#define CONFIG_HLP_IF_FREQ "IF frequency for RF, if needed\n"
#define CONFIG_HLP_IF_FREQ_OFF "UL IF frequency offset for RF, if needed\n"
diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c
index 6f5cabdede..be2a79eb64 100644
--- a/executables/softmodem-common.c
+++ b/executables/softmodem-common.c
@@ -97,7 +97,7 @@ void get_common_options(configmodule_interface_t *cfg, uint32_t execmask)
uint32_t glog_level=0 ;
uint32_t start_telnetsrv = 0, start_telnetclt = 0;
uint32_t start_websrv = 0;
- uint32_t noS1 = 0, nokrnmod = 1, nonbiot = 0;
+ uint32_t noS1 = 0, nonbiot = 0;
uint32_t rfsim = 0, do_forms = 0;
int nfapi_index = 0;
char *logmem_filename = NULL;
@@ -146,10 +146,6 @@ void get_common_options(configmodule_interface_t *cfg, uint32_t execmask)
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
}
- if (nokrnmod) {
- set_softmodem_optmask(SOFTMODEM_NOKRNMOD_BIT);
- }
-
if (nonbiot) {
set_softmodem_optmask(SOFTMODEM_NONBIOT_BIT);
}
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index a696c064a4..110a5c60a7 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -99,7 +99,6 @@ extern "C"
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_RFSIM "Run in rf simulator mode\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_USRP_THREAD "having extra thead for usrp tx\n"
#define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR 'MONOLITHIC', 'PNF', 'VNF', 'AERIAL','UE_STUB_PNF','UE_STUB_OFFNET','STANDALONE_PNF'\n"
@@ -173,7 +172,6 @@ extern int usrp_tx_thread;
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, .strptr=&worker_config, .defstrval=NULL, TYPE_STRING, 0}, \
{"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, .uptr=&noS1, .defintval=0, TYPE_UINT, 0}, \
{"rfsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, .uptr=&rfsim, .defintval=0, TYPE_UINT, 0}, \
- {"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, .uptr=&nokrnmod, .defintval=1, TYPE_UINT, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, .uptr=&nonbiot, .defuintval=0, TYPE_UINT, 0}, \
{"chest-freq", CONFIG_HLP_CHESTFREQ, 0, .iptr=&CHEST_FREQ, .defintval=0, TYPE_INT, 0}, \
{"chest-time", CONFIG_HLP_CHESTTIME, 0, .iptr=&CHEST_TIME, .defintval=0, TYPE_INT, 0}, \
@@ -224,7 +222,6 @@ extern int usrp_tx_thread;
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
{ .s3a = { config_checkstr_assign_integer, \
{"MONOLITHIC", "PNF", "VNF", "AERIAL","UE_STUB_PNF","UE_STUB_OFFNET","STANDALONE_PNF"}, \
{NFAPI_MONOLITHIC, NFAPI_MODE_PNF, NFAPI_MODE_VNF, NFAPI_MODE_AERIAL,NFAPI_UE_STUB_PNF,NFAPI_UE_STUB_OFFNET,NFAPI_MODE_STANDALONE_PNF}, \
@@ -278,7 +275,6 @@ extern int usrp_tx_thread;
/***************************************************************************************************************************************/
#define SOFTMODEM_NOS1_BIT (1<<0)
-#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
#define SOFTMODEM_NONBIOT_BIT (1<<2)
#define SOFTMODEM_RFSIM_BIT (1<<10)
#define SOFTMODEM_SIML1_BIT (1<<12)
@@ -298,7 +294,6 @@ extern int usrp_tx_thread;
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
-#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
#define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT)
#define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT)
#define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT)
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/sldch.c b/openair1/PHY/LTE_UE_TRANSPORT/sldch.c
index 8769d5f81b..2f7f652b5d 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/sldch.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/sldch.c
@@ -31,8 +31,6 @@
*/
#include "PHY/defs_UE.h"
-extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
-
void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx) {
UE_tport_t pdu;
@@ -54,10 +52,5 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx)
sldch->payload_length,
sldch_header_len+sizeof(SLDCH_t)-sizeof(uint8_t*)+sldch->payload_length);
- multicast_link_write_sock(0,
- (char *)&pdu,
- sldch_header_len+sizeof(SLDCH_t));
-
+ AssertFatal(false, "multicast_link_write_sock() not implemented\n");
}
-
-
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/slsch.c b/openair1/PHY/LTE_UE_TRANSPORT/slsch.c
index e4e94a232d..8dda31fbe4 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/slsch.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/slsch.c
@@ -31,10 +31,6 @@
*/
#include "PHY/defs_UE.h"
-extern int
-multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
-
-
void generate_slsch(PHY_VARS_UE *ue,SLSCH_t *slsch,int frame_tx,int subframe_tx) {
UE_tport_t pdu;
@@ -58,9 +54,6 @@ void generate_slsch(PHY_VARS_UE *ue,SLSCH_t *slsch,int frame_tx,int subframe_tx)
slsch->payload_length,
slsch_header_len+sizeof(SLSCH_t)-sizeof(uint8_t*)+slsch->payload_length);
- multicast_link_write_sock(0,
- (char *)&pdu,
- slsch_header_len+sizeof(SLSCH_t)-sizeof(uint8_t*)+slsch->payload_length);
-
+ AssertFatal(false, "multicast_link_write_sock() not implemented\n");
}
}
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index a30c56b48a..2ab028b6a9 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -648,5 +648,4 @@ static inline void stop_meas_nr_ue_phy(PHY_VARS_NR_UE *ue, int meas_index) {
stop_meas(&ue->phy_cpu_stats.cpu_time_stats[meas_index]);
}
-#include "SIMULATION/ETH_TRANSPORT/defs.h"
#endif
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/Makefile.inc b/openair1/SIMULATION/ETH_TRANSPORT/Makefile.inc
deleted file mode 100644
index b865ef7612..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/Makefile.inc
+++ /dev/null
@@ -1,6 +0,0 @@
-ETHERNET_TRANSPORT_OBJS = $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o
-ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/multicast_link.o
-ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/socket.o
-ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/bypass_session_layer.o
-ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/emu_transport.o
-ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/pgm_link.o
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/README.txt b/openair1/SIMULATION/ETH_TRANSPORT/README.txt
deleted file mode 100644
index a1c1ed9562..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/README.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-For reliable UDP multicast, the libpgm-dev should be installed on the machines,
-otherwise the old multicast method using simply UDP will be used, resulting in
-packet loss and unexpected behaviour of oaisim.
-
-To compile OAI with PGM:
-
-For Ubuntu 12.04 and earliers:
- sudo apt-get install libpgm-dev
- is sufficient
-
-For Ubuntu older than 12.04:
-
-wget http://openpgm.googlecode.com/files/libpgm-5.1.118.tar.gz
-tar xvf libpgm-5.1.118.tar.gz
-cd libpgm-5.1.118/openpgm/pgm
-./configure --prefix=/usr
-make
-sudo make install
-
-We have to clean oaisim compilation and re-compile
-
-
-When running OAI, the -D should be used to provide the NIC to bind.
-Parameter can be either an interface name or an ip address (refer to this link
-for more informations: http://code.google.com/p/openpgm/wiki/OpenPgmConceptsTransport)
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/defs.h b/openair1/SIMULATION/ETH_TRANSPORT/defs.h
deleted file mode 100644
index 384f25e950..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/defs.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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
- */
-
-/*! \file defs.h
- * \brief specifies the data structure and variable for phy emulation
- * \author Navid Nikaein, Raymomd Knopp and Hicham Anouar
- * \date 2011
- * \version 1.1
- * \company Eurecom
- * \email: navid.nikaein@eurecom.fr
- */
-
-#ifndef __BYPASS_SESSION_LAYER_DEFS_H__
-# define __BYPASS_SESSION_LAYER_DEFS_H__
-//-----------------------------------------------------------------------------
-//#include "openair_defs.h"
-#include "common/openairinterface5g_limits.h"
-#include "PHY/defs_common.h"
-#include "PHY/LTE_TRANSPORT/uci_common.h"
-
-typedef enum emu_transport_info_e {
- EMU_TRANSPORT_INFO_ERROR = 0x0,
- EMU_TRANSPORT_INFO_WAIT_PM,
- EMU_TRANSPORT_INFO_WAIT_SM,
- EMU_TRANSPORT_INFO_SYNC,
- EMU_TRANSPORT_INFO_ENB,
- EMU_TRANSPORT_INFO_UE,
- EMU_TRANSPORT_INFO_RELEASE
-} emu_transport_info_t;
-
-#define WAIT_PM_TRANSPORT 1
-#define WAIT_SM_TRANSPORT 2
-#define SYNC_TRANSPORT 3
-#define ENB_TRANSPORT 4
-#define UE_TRANSPORT 5
-#define RELEASE_TRANSPORT 6
-
-#define WAIT_SYNC_TRANSPORT 1
-#define SYNCED_TRANSPORT 2
-//#define WAIT_ENB_TRANSPORT 2
-//#define WAIT_UE_TRANSPORT 3
-
-
-#define BYPASS_RX_BUFFER_SIZE 64000
-#define BYPASS_TX_BUFFER_SIZE 64000
-
-typedef unsigned int (*tx_handler_t) (unsigned char, char*, unsigned int*, unsigned int*);
-typedef unsigned int (*rx_handler_t) (unsigned char, char*, unsigned int);
-
-/*************************************************************/
-
-typedef struct eNB_cntl_s {
- uint32_t pbch_flag:1;
- uint32_t pmch_flag:1;
- uint32_t pss:2;
- uint32_t sss:8;
- uint32_t cfi:2;
- uint32_t phich:19; // max 200 bit
- // uint32_t pbch_payload:24;
- uint32_t pbch_payload;
-} eNB_cntl;
-
-typedef struct UE_cntl_s {
- uint8_t pucch_flag:3; // 0,7 = none, 1 = type 1, 2=type 1a, 3=type 1b, 4=type 2, 5=type 2a, 6=type 2b
- uint8_t pucch_Ncs1:3; // physical configuration of pucch, for abstraction purposes
- uint32_t pucch_payload:21; // ack/nak/cqi information
- uint8_t sr:1;
- uint8_t pusch_flag:1; // 0=none,1=active
- uint8_t pucch_sel:1;
- //uint32_t pusch_uci; // uci information on pusch
- uint8_t pusch_uci[MAX_CQI_BYTES];
- uint8_t uci_format;
- uint8_t length_uci;
- uint8_t pusch_ri:2; // ri information on pusch
- uint8_t pusch_ack:2; // ack/nak on pusch
- uint8_t prach_flag:1; // 0=none,1=active
- uint8_t prach_id:6; // this is the PHY preamble index for the prach
-} UE_cntl;
-
-#define MAX_TRANSPORT_BLOCKS_BUFFER_SIZE 16384
-//#define MAX_PMCH_TRANSPORT_BLOCKS_BUFFER_SIZE 8192 // 16384
-#define MAX_NUM_DCI 5+1 // +1: for PMCH/MCH
-
-typedef struct eNB_transport_info_s {
- eNB_cntl cntl;
- uint8_t num_pmch;
- uint8_t num_common_dci;
- uint8_t num_ue_spec_dci;
- DCI_ALLOC_t dci_alloc[MAX_NUM_DCI];
- uint8_t dlsch_type[MAX_NUM_DCI];
- uint8_t harq_pid[MAX_NUM_DCI];
- uint8_t ue_id[MAX_NUM_DCI];
- uint16_t tbs[MAX_NUM_DCI*2]; // times 2 for dual-stream MIMO formats
- uint8_t transport_blocks[MAX_TRANSPORT_BLOCKS_BUFFER_SIZE];
- //uint8_t pmch_transport_blocks[MAX_PMCH_TRANSPORT_BLOCKS_BUFFER_SIZE];
-} __attribute__((__packed__)) eNB_transport_info_t ;
-
-typedef struct UE_transport_info_s {
- UE_cntl cntl;
- uint8_t num_eNB;
- uint16_t rnti[NUMBER_OF_CONNECTED_eNB_MAX];
- uint8_t eNB_id[NUMBER_OF_CONNECTED_eNB_MAX];
- uint8_t harq_pid[NUMBER_OF_CONNECTED_eNB_MAX];
- uint16_t tbs[NUMBER_OF_CONNECTED_eNB_MAX];
- uint8_t transport_blocks[MAX_TRANSPORT_BLOCKS_BUFFER_SIZE];//*NUMBER_OF_CONNECTED_eNB_MAX];
-} __attribute__((__packed__)) UE_transport_info_t ;
-
-/*! \brief */
-typedef struct bypass_msg_header_s {
- unsigned char Message_type; /*! \brief control or data*/
- //unsigned char nb_master; /*! \brief */
- unsigned char master_id; /*! \brief */
- unsigned int nb_enb; /*! \brief */
- unsigned int nb_ue; /*! \brief */
- unsigned int nb_flow; /*! \brief */
- unsigned int frame;
- unsigned int subframe;
- uint64_t seq_num;
- unsigned int failing_master_id;
-} __attribute__((__packed__)) bypass_msg_header_t;
-
-typedef struct bypass_proto2multicast_header_s {
- unsigned int size;
-} bypass_proto2multicast_header_t;
-
-#endif /* __BYPASS_SESSION_LAYER_DEFS_H__ */
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
deleted file mode 100644
index d0f0eab4a6..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
- * 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
- */
-
-/*! \file phy_emulation.c
- * \brief implements the underlying protocol for emulated data exchange over Ethernet using IP multicast
- * \author Navid Nikaein
- * \date 2011 - 2014
- * \version 1.1
- * \company Eurecom
- * \email: navid.nikaein@eurecom.fr
- */
-
-
-#include "PHY/defs.h"
-#include "PHY/extern.h"
-#include "common/ran_context.h"
-#include "defs.h"
-#include "extern.h"
-#include "proto.h"
-#include "UTIL/LOG/log.h"
-#include "UTIL/LOG/vcd_signal_dumper.h"
-#include "openair1/SIMULATION/ETH_TRANSPORT/extern.h"
-unsigned char Emulation_status;
-unsigned char emu_tx_status;
-unsigned char emu_rx_status;
-
-#if !defined(ENABLE_NEW_MULTICAST)
-pthread_mutex_t Tx_mutex;
-pthread_cond_t Tx_cond;
-char Tx_mutex_var;
-#endif
-
-/* Handlers for RX and TX */
-rx_handler_t rx_handler;
-tx_handler_t tx_handler;
-
-eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
-uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
-
-UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
-
-UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2];
-
-extern unsigned int Master_list_rx;
-
-extern unsigned char NB_INST;
-//#define DEBUG_CONTROL 1
-//#define DEBUG_EMU 1
-
-void emu_transport_sync(void)
-{
- LOG_D(EMU, "Entering EMU transport SYNC is primary master %d\n",
- oai_emulation.info.is_primary_master);
-
- if (oai_emulation.info.is_primary_master == 0) {
-retry:
- bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
- // just wait to recieve the master 0 msg
- Master_list_rx = oai_emulation.info.master_list - 1;
-
- if (bypass_rx_data(0,0,0,1) == -1) {
- /* In case the master is not ready at time we send the first message */
- sleep(1);
- goto retry;
- }
- } else {
- bypass_rx_data(0,0,0,0);
- bypass_tx_data(WAIT_PM_TRANSPORT,0,0);
- }
-
- if (oai_emulation.info.master_list!=0) {
-retry2:
- bypass_tx_data(SYNC_TRANSPORT,0,0);
-
- if (bypass_rx_data(0,0,0,0) == -1) {
- goto retry2;
- }
-
- // i received the sync from all secondary masters
- if (emu_rx_status == SYNCED_TRANSPORT) {
- emu_tx_status = SYNCED_TRANSPORT;
- }
-
- LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
- }
-
- LOG_D(EMU, "Leaving EMU transport SYNC is primary master %d\n",
- oai_emulation.info.is_primary_master);
-}
-
-void emu_transport(unsigned int frame, unsigned int last_slot,
- unsigned int next_slot,lte_subframe_t direction,
- unsigned char frame_type,
- int ethernet_flag )
-{
- if (ethernet_flag == 0) {
- return;
- }
-
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(
- VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_IN);
-
- if ((frame_type == 1) && (direction == SF_S)) {
- if ((next_slot % 2) == 0) {
- emu_transport_DL(frame, last_slot, next_slot);
- } else {
- emu_transport_UL(frame, last_slot , next_slot);
- }
-
- //DL
- } else {
- if ((next_slot % 2) == 0) {
- if (((frame_type == 1) && (direction == SF_DL )) || (frame_type == 0) ) {
- emu_transport_DL(frame, last_slot, next_slot);
- }
- }
-
- // UL
- if (((frame_type == 1) && (direction == SF_UL)) || (frame_type == 0) ) {
- emu_transport_UL(frame, last_slot, next_slot);
- }
- }
-
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(
- VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_OUT);
-}
-
-
-void emu_transport_DL(unsigned int frame, unsigned int last_slot,
- unsigned int next_slot)
-{
- LOG_D(EMU, "Entering EMU transport DL, is primary master %d\n",
- oai_emulation.info.is_primary_master);
-
- if (oai_emulation.info.is_primary_master == 0) {
- if (oai_emulation.info.nb_enb_local > 0) { // send in DL if
- bypass_tx_data(ENB_TRANSPORT, frame, next_slot);
- bypass_rx_data(frame, last_slot, next_slot, 1);
- } else {
- bypass_tx_data(WAIT_SM_TRANSPORT,frame,next_slot);
- bypass_rx_data(frame, last_slot, next_slot, 0);
- }
- } else { // PM
- if (oai_emulation.info.nb_enb_local>0) { // send in DL if
- bypass_rx_data(frame, last_slot, next_slot, 1);
- bypass_tx_data(ENB_TRANSPORT, frame, next_slot);
- } else {
- bypass_rx_data(frame, last_slot, next_slot, 0);
- bypass_tx_data(WAIT_SM_TRANSPORT,frame,next_slot);
- }
- }
-
- LOG_D(EMU, "Leaving EMU transport DL, is primary master %d\n",
- oai_emulation.info.is_primary_master);
-}
-
-void emu_transport_UL(unsigned int frame, unsigned int last_slot,
- unsigned int next_slot)
-{
- LOG_D(EMU, "Entering EMU transport UL, is primary master %d\n",
- oai_emulation.info.is_primary_master);
-
- if (oai_emulation.info.is_primary_master == 0) {
- if (oai_emulation.info.nb_ue_local > 0) {
- bypass_tx_data(UE_TRANSPORT, frame, next_slot);
- bypass_rx_data(frame, last_slot, next_slot, 1);
- } else {
- bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot);
- bypass_rx_data(frame,last_slot, next_slot, 0);
- }
- } else {
- if (oai_emulation.info.nb_ue_local > 0) {
- bypass_rx_data(frame, last_slot, next_slot, 1);
- bypass_tx_data(UE_TRANSPORT, frame, next_slot);
- } else {
- bypass_rx_data(frame,last_slot, next_slot, 0);
- bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot);
- }
- }
-
- LOG_D(EMU, "Leaving EMU transport UL, is primary master %d\n",
- oai_emulation.info.is_primary_master);
-}
-
-void emu_transport_release(void)
-{
- bypass_tx_data(RELEASE_TRANSPORT,0,0);
- LOG_E(EMU," tx RELEASE_TRANSPORT \n");
-}
-
-unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,
- unsigned int *Nbytes,unsigned int *Nb_flows)
-{
-
- return *Nbytes;
-}
-
-unsigned int emul_rx_data(void)
-{
- return(0);
-}
-
-unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer,
- unsigned int Nbytes)
-{
- unsigned short Rx_size=0;
- return (Rx_size+2);
-}
-
-void clear_eNB_transport_info(uint8_t nb_eNB)
-{
- uint8_t eNB_id;
- uint8_t CC_id;
-
- for (eNB_id=0; eNB_idpbch_pdu =
- eNB_transport_info[enb_id][CC_id].cntl.pbch_payload;
- /* LOG_I(EMU," RX slot %d ENB TRANSPORT pbch payload %d pdu[0] %d pdu[0] %d \n",
- next_slot ,
- eNB_transport_info[enb_id][CC_id].cntl.pbch_payload,
- ((uint8_t*)RC.eNB[enb_id]->pbch_pdu)[0],
- ((uint8_t*)RC.eNB[enb_id]->pbch_pdu)[1]);
- */
- // }
- //CFI
- // not needed yet
-
- //PHICH
- // to be added later
-
- //DCI
- nb_total_dci= eNB_transport_info[enb_id][CC_id].num_pmch +
- eNB_transport_info[enb_id][CC_id].num_ue_spec_dci +
- eNB_transport_info[enb_id][CC_id].num_common_dci;
-
- RC.eNB[enb_id][CC_id]->num_ue_spec_dci[(next_slot>>1)&1] =
- eNB_transport_info[enb_id][CC_id].num_ue_spec_dci;
- RC.eNB[enb_id][CC_id]->num_common_dci[(next_slot>>1)&1] =
- eNB_transport_info[enb_id][CC_id].num_common_dci;
-#ifdef DEBUG_EMU
- LOG_D(EMU, "Fill phy vars eNB %d for slot %d, DCI found %d \n",
- enb_id, next_slot, nb_total_dci);
-#endif
-
- if (nb_total_dci >0) {
-
- memcpy(RC.eNB[enb_id][CC_id]->dci_alloc[(next_slot>>1)&1],
- eNB_transport_info[enb_id][CC_id].dci_alloc,
- (nb_total_dci) * sizeof(DCI_ALLOC_t));
-
- n_dci_dl=0;
-
- // fill dlsch_eNB structure from DCI
- for (n_dci = 0; n_dci < nb_total_dci; n_dci++) {
-
- //exclude ul dci
- if ((eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].format > 0) || (eNB_transport_info[enb_id][CC_id].num_pmch > 0 )) {
-#ifdef DEBUG_EMU
- LOG_D(EMU, "dci spec %d common %d pmch %d tbs is %d payload offset %d\n",
- eNB_transport_info[enb_id][CC_id].num_ue_spec_dci,
- eNB_transport_info[enb_id][CC_id].num_common_dci,
- eNB_transport_info[enb_id][CC_id].num_pmch,
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl],
- payload_offset);
-#endif
-
- switch (eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]) {
- case 0: //SI:
- memcpy(RC.eNB[enb_id][CC_id]->dlsch_SI->harq_processes[0]->b,
- &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
-#ifdef DEBUG_EMU
- LOG_D(EMU, "SI eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]%d \n",
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
-#endif
- break;
-
- case 1: //RA:
- memcpy(RC.eNB[enb_id][CC_id]->dlsch_ra->harq_processes[0]->b,
- &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
-#ifdef DEBUG_EMU
- LOG_D(EMU, "RA eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]%d \n",
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
-#endif
- break;
-
- case 2://TB0:
- harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
- ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
- RC.eNB[enb_id][CC_id]->dlsch[ue_id][0]->rnti=
- eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
- dlsch_eNB = RC.eNB[enb_id][CC_id]->dlsch[ue_id][0];
-#ifdef DEBUG_EMU
- LOG_D(EMU,
- " enb_id %d ue id is %d rnti is %x dci index %d, harq_pid %d tbs %d \n",
- enb_id, ue_id, eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti,
- n_dci_dl, harq_pid, eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
-
- for (i=0; iharq_processes[harq_pid]->b,
- &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
- break;
-
- case 3://TB1:
- harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
- ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
- RC.eNB[enb_id][CC_id]->dlsch[ue_id][1]->rnti=
- eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
- dlsch_eNB = RC.eNB[enb_id][CC_id]->dlsch[ue_id][1];
-
- memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
- &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
- break;
-
- case 5:
- memcpy(RC.eNB[enb_id][CC_id]->dlsch_MCH->harq_processes[0]->b,
- &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
-#ifdef DEBUG_EMU
- LOG_D(EMU, "PMCH eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl] %d \n",
- eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
-#endif
- break;
-
- default:
- LOG_W(EMU,"not supported dlsch type %d \n", eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]);
- break;
- }
-
- payload_offset += eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl];
- }
-
- n_dci_dl++;
- }
-
-#ifdef DEBUG_EMU
- LOG_D(EMU, "Fill phy eNB vars done next slot %d !\n", next_slot);
-#endif
- }
-}
-
-void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot)
-{
- int n_enb;//index
- int enb_id;
- // int harq_id;
- // int payload_offset = 0;
- unsigned short rnti;
- unsigned int harq_pid;
- LTE_UE_ULSCH_t *ulsch;
- PUCCH_FMT_t pucch_format;
- // uint8_t ue_transport_info_index[NUMBER_OF_eNB_MAX];
- uint8_t subframe = (last_slot+1)>>1;
-
- memcpy(&ue_cntl_delay[ue_id][CC_id][(last_slot+1)%2], &UE_transport_info[ue_id][CC_id].cntl,
- sizeof(UE_cntl));
-
-#ifdef DEBUG_EMU
- LOG_D(EMU,
- "Last slot %d subframe %d CC_id %d: Fill phy vars UE %d : PRACH is (%d,%d) preamble (%d,%d) SR (%d,%d), pucch_sel (%d, %d)\n",
-
- last_slot,subframe,CC_id, ue_id,
- UE_transport_info[ue_id][CC_id].cntl.prach_flag,
- ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag,
- UE_transport_info[ue_id][CC_id].cntl.prach_id,
- ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_id,
- UE_transport_info[ue_id][CC_id].cntl.sr,
- ue_cntl_delay[ue_id][CC_id][last_slot%2].sr,
- UE_transport_info[ue_id][CC_id].cntl.pucch_sel,
- ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_sel);
-#endif
- //ue_cntl_delay[subframe%2].prach_flag ;
- PHY_vars_UE_g[ue_id][CC_id]->generate_prach = ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag;//UE_transport_info[ue_id][CC_id].cntl.prach_flag;
-
- if (PHY_vars_UE_g[ue_id][CC_id]->generate_prach == 1) {
- // if (PHY_vars_UE_g[ue_id][CC_id]->prach_resources[enb_id] == NULL)
- // PHY_vars_UE_g[ue_id][CC_id]->prach_resources[enb_id] = malloc(sizeof(PRACH_RESOURCES_t));
- //ue_cntl_delay[subframe%2].prach_id;
- PHY_vars_UE_g[ue_id][CC_id]->prach_PreambleIndex =
- ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_id;
- }
-
- pucch_format= ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_flag;// UE_transport_info[ue_id][CC_id].cntl.pucch_flag;
-
- if ((last_slot + 1) % 2 == 0) {
- if (pucch_format == pucch_format1) { // UE_transport_info[ue_id][CC_id].cntl.sr;
- PHY_vars_UE_g[ue_id][CC_id]->sr[subframe] = ue_cntl_delay[ue_id][CC_id][last_slot%2].sr;
- } else if ((pucch_format == pucch_format1a) ||
- (pucch_format == pucch_format1b)) {
- PHY_vars_UE_g[ue_id][CC_id]->pucch_payload[0] = ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_payload;
- //UE_transport_info[ue_id][CC_id].cntl.pucch_payload;
- }
-
- PHY_vars_UE_g[ue_id][CC_id]->pucch_sel[subframe] =
- ue_cntl_delay[ue_id][CC_id][last_slot%2].pucch_sel;
- }
-
-#ifdef DEBUG_EMU
- LOG_D(EMU,"subframe %d trying to copy the payload from num eNB %d to UE %d \n",
- subframe, UE_transport_info[ue_id][CC_id].num_eNB, ue_id);
-#endif
-
- for (n_enb = 0; n_enb < UE_transport_info[ue_id][CC_id].num_eNB; n_enb++) {
-
- rnti = UE_transport_info[ue_id][CC_id].rnti[n_enb];
- enb_id = UE_transport_info[ue_id][CC_id].eNB_id[n_enb];
-
- PHY_vars_UE_g[ue_id][CC_id]->pdcch_vars[0][enb_id]->crnti=rnti;
- PHY_vars_UE_g[ue_id][CC_id]->pdcch_vars[1][enb_id]->crnti=rnti;
-
- harq_pid = UE_transport_info[ue_id][CC_id].harq_pid[n_enb];
-
- PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_RI[0] =
- ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri & 0x1;
- PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_RI[1] =
- (ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri>>1) & 0x1;
-
- PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_ACK[0]=
- ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack & 0x1;
- PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_ACK[1]=
- (ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack>>1) & 0x1;
- //*(uint32_t *)ulsch->o = ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci;
-
- if ((last_slot % 2) == 1) {
- PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->O =
- ue_cntl_delay[ue_id][CC_id][last_slot%2].length_uci;
- PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->uci_format =
- ue_cntl_delay[ue_id][CC_id][last_slot%2].uci_format;
-
- memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o,
- ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci,
- MAX_CQI_BYTES);
-
- ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id];
- // if (((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1)
- LOG_D(EMU,
- "[UE %d] subframe %d last slot %d copy the payload from eNB %d to UE %d with harq id %d cqi (val %d, length %d) \n",
- ue_id, subframe, last_slot, enb_id, ue_id, harq_pid,
- ((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1,
- PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->O);
- }
-
- memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->harq_processes[harq_pid]->b,
- UE_transport_info[ue_id][CC_id].transport_blocks,
- UE_transport_info[ue_id][CC_id].tbs[enb_id]);
-
- //ue_transport_info_index[enb_id]+=UE_transport_info[ue_id][CC_id].tbs[enb_id];
-
- //UE_transport_info[ue_id][CC_id].transport_blocks+=ue_transport_info_index[enb_id];
- //LOG_T(EMU,"ulsch tbs is %d\n", UE_transport_info[ue_id][CC_id].tbs[enb_id]);
- }
-}
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/extern.h b/openair1/SIMULATION/ETH_TRANSPORT/extern.h
deleted file mode 100644
index ecd0d301d6..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/extern.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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
- */
-
-/*! \file extern.h
- * \brief specifies the extern variables for phy emulation
- * \author Navid Nikaein and Raymomd Knopp and Hicham Anouar
- * \date 2011
- * \version 1.1
- * \company Eurecom
- * \email: navid.nikaein@eurecom.fr
- */
-
-#ifndef __BYPASS_SESSION_LAYER_EXTERN_H__
-# define __BYPASS_SESSION_LAYER_EXTERN_H__
-
-#include
-
-
-extern unsigned char Emulation_status;
-extern unsigned char emu_tx_status;
-extern unsigned char emu_rx_status;
-//extern unsigned int Master_list;
-//extern unsigned short Master_id;
-//extern unsigned int Is_primary_master;
-
-#if !defined(ENABLE_NEW_MULTICAST)
-extern pthread_mutex_t Tx_mutex;
-extern pthread_cond_t Tx_cond;
-extern char Tx_mutex_var;
-#endif
-
-extern rx_handler_t rx_handler;
-extern tx_handler_t tx_handler;
-
-extern eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
-extern uint16_t eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
-
-extern UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
-
-extern UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][MAX_NUM_CCs][2];
-
-#endif
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c b/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c
deleted file mode 100644
index 281d42a7a6..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * 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
- */
-
-/*! \file multicast_link.c
- * \brief
- * \author Lionel Gauthier and Navid Nikaein
- * \date 2011
- * \version 1.1
- * \company Eurecom
- * \email: navid.nikaein@eurecom.fr
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#define MULTICAST_LINK_C
-
-#include "socket.h"
-#include "multicast_link.h"
-
-#include "common/utils/LOG/log.h"
-
-extern unsigned short Master_id;
-
-const char *multicast_group_list[MULTICAST_LINK_NUM_GROUPS] = {
- "239.0.0.161",
- "239.0.0.162",
- "239.0.0.163",
- "239.0.0.164"
-};
-
-static multicast_group_t group_list[MULTICAST_LINK_NUM_GROUPS];
-
-/* Socket file descriptors we want to wake up for, using select() */
-static fd_set socks;
-/* Highest #'d file descriptor, needed for select() */
-static int highsock;
-#if ! defined(ENABLE_NEW_MULTICAST)
-static pthread_t main_loop_thread;
-#endif
-static void (*rx_handler) (unsigned int, char *);
-static unsigned char multicast_group;
-static char *multicast_if;
-
-//------------------------------------------------------------------------------
-void
-multicast_link_init(void)
-{
- //------------------------------------------------------------------------------
- int group;
- int multicast_loop;
- int reuse_addr = 1;
- static struct ip_mreq command;
- struct sockaddr_in sin;
- // struct ifreq ifr;
-
- for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
- //strcpy (group_list[group].host_addr, multicast_group_list[group]);
- strncpy (group_list[group].host_addr, multicast_group_list[group], sizeof(group_list[group].host_addr));
- group_list[group].host_addr[sizeof(group_list[group].host_addr) - 1] = 0; // terminate string
- group_list[group].port = 46014 + group;
- group_list[group].socket = make_socket_inet(
- SOCK_DGRAM,
- &group_list[group].port, &sin);
-
- LOG_D(PHY, "multicast_link_init(): Created socket %d for group %d, port %d\n",
- group_list[group].socket,group,group_list[group].port);
-
- /* Used so we can re-bind to our port while a previous connection is still
- * in TIME_WAIT state.
- */
- if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
- &reuse_addr, sizeof (reuse_addr)) < 0) {
- LOG_E(PHY, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
- exit (EXIT_FAILURE);
- }
-
- if (multicast_if != NULL) {
- if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
- multicast_if, strlen(multicast_if)) < 0) {
- LOG_E(PHY,
- "[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
- multicast_if);
- LOG_E(PHY,
- "[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
- exit (EXIT_FAILURE);
- }
- }
-
-#if !defined(ENABLE_NEW_MULTICAST)
- /* Make the socket blocking */
- socket_setnonblocking(group_list[group].socket);
-#endif
-
- multicast_loop = 0;
-
- if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
- &multicast_loop, sizeof (multicast_loop)) < 0) {
- LOG_E(PHY,
- "[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
- __FILE__, __LINE__);
- exit (EXIT_FAILURE);
- }
-
- // Join the broadcast group:
- command.imr_multiaddr.s_addr = inet_addr (group_list[group].host_addr);
- command.imr_interface.s_addr = htonl (INADDR_ANY);
-
- if (command.imr_multiaddr.s_addr == -1) {
- LOG_E(PHY, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
- exit (EXIT_FAILURE);
- }
-
- if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
- &command, sizeof (command)) < 0) {
- LOG_E(PHY, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
- __LINE__);
- exit (EXIT_FAILURE);
- }
-
- memset (&group_list[group].sock_remote_addr, 0, sizeof (struct sockaddr_in));
- group_list[group].sock_remote_addr.sin_family = AF_INET;
- group_list[group].sock_remote_addr.sin_addr.s_addr = inet_addr (multicast_group_list[group]);
- group_list[group].sock_remote_addr.sin_port = htons (group_list[group].port);
- }
-}
-
-//------------------------------------------------------------------------------
-void
-multicast_link_build_select_list (void)
-{
- //------------------------------------------------------------------------------
- int group;
-
- /* First put together fd_set for select(), which will
- consist of the sock veriable in case a new connection
- is coming in, plus all the sockets we have already
- accepted. */
-
-
- /* FD_ZERO() clears out the fd_set called socks, so that
- it doesn't contain any file descriptors. */
-
- FD_ZERO (&socks);
-
-
- /* Loops through all the possible connections and adds
- those sockets to the fd_set */
-
- for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
- if (group_list[group].socket != 0) {
- FD_SET (group_list[group].socket, &socks);
-
- if (group_list[group].socket > highsock) {
- highsock = group_list[group].socket;
- }
- }
- }
-}
-
-void
-multicast_link_read_data (int groupP)
-{
- int num_bytes;
-
- if ((groupP < MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) {
- if ((num_bytes = recvfrom (group_list[groupP].socket,
- group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) {
- LOG_E(PHY, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
- errno, strerror(errno), __FILE__, __LINE__);
- } else {
- rx_handler(num_bytes,group_list[groupP].rx_buffer);
- }
- } else {
- LOG_E(PHY, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
- }
-}
-
-//------------------------------------------------------------------------------
-void
-multicast_link_read (void)
-{
- //------------------------------------------------------------------------------
- int group; /* Current item in connectlist for for loops */
-
- /* Now check connectlist for available data */
-
- /* Run through our sockets and check to see if anything
- happened with them, if so 'service' them. */
-
- for (group = multicast_group; group < MULTICAST_LINK_NUM_GROUPS ; group++) {
- if (FD_ISSET (group_list[group].socket, &socks)) {
- multicast_link_read_data (group);
- break;
- }
- } /* for (all entries in queue) */
-}
-
-//------------------------------------------------------------------------------
-int
-multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP)
-{
- //------------------------------------------------------------------------------
- int num;
-
- if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
- (struct sockaddr *) &group_list[groupP].sock_remote_addr,
- sizeof (group_list[groupP].sock_remote_addr))) < 0) {
- LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
- errno, strerror(errno),
- __FILE__, __LINE__);
- }
-
- return num;
-}
-
-int multicast_link_read_data_from_sock(uint8_t is_master)
-{
- struct timeval timeout, *timeout_p;
- int readsocks; /* Number of sockets ready for reading */
-
- timeout.tv_sec = 0;
- timeout.tv_usec = 15000;
-
- if (is_master == 0) {
- /* UE will block indefinetely if no data is sent from eNB
- * NOTE: a NULL timeout for select will block indefinetely
- */
- timeout_p = NULL;
- } else {
- /* In case of eNB set the timeout to 500 usecs after which we consider
- * the packets as dropped.
- */
- timeout_p = &timeout;
- }
-
- highsock = -1;
-
- multicast_link_build_select_list ();
-
- LOG_D(PHY, "Stuck on select with timeout %s\n",
- timeout_p == NULL ? "infinite" : "15000 usecs");
-
- readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
-
- if (readsocks < 0) {
- LOG_E(PHY, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
- exit(EXIT_FAILURE);
- } else if (readsocks > 0) {
- multicast_link_read();
- } else {
- /* Timeout */
- LOG_I(PHY, "Multicast select time-out\n");
- return 1;
- }
-
- return 0;
-}
-
-void* multicast_link_main_loop (void *param)
-{
- while (1) {
- multicast_link_read_data_from_sock(0);
- }
-
- return NULL;
-}
-
-void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
- unsigned char _multicast_group, char *multicast_ifname)
-{
- rx_handler = rx_handlerP;
- multicast_group = _multicast_group;
- multicast_if = multicast_ifname;
- LOG_I(PHY, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
- (multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
- rx_handler);
- multicast_link_init ();
-#if ! defined(ENABLE_NEW_MULTICAST)
- LOG_D(PHY, "[MULTICAST] multicast link start thread\n");
-
- if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop,
- NULL) != 0) {
- LOG_E(PHY, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
- errno, strerror(errno));
- exit(EXIT_FAILURE);
- } else {
- pthread_detach(main_loop_thread); // disassociate from parent
- LOG_I(PHY, "[MULTICAST LINK] Thread detached\n");
- }
-
-#endif
-}
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.h b/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.h
deleted file mode 100644
index fdea20455b..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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
- */
-
-/*! \file multicast_link.h
- * \brief
- * \author Lionel Gauthier and Navid Nikaein
- * \date 2011
- * \version 1.1
- * \company Eurecom
- * \email: navid.nikaein@eurecom.fr
- */
-
-#ifndef __MULTICAST_LINK_H__
-# define __MULTICAST_LINK_H__
-# ifdef MULTICAST_LINK_C
-# define private_multicast_link(x) x
-# define public_multicast_link(x) x
-# else
-# define private_multicast_link(x)
-# define public_multicast_link(x) extern x
-# endif
-# include "stdint.h"
-
-private_multicast_link (typedef struct multicast_group_t {
- int socket;
- struct sockaddr_in sock_remote_addr;
- char host_addr[16];
- uint16_t port;
- char rx_buffer[40000];
-} multicast_group_t;)
-
-#define MULTICAST_LINK_NUM_GROUPS 4
-
-extern const char *multicast_group_list[MULTICAST_LINK_NUM_GROUPS];
-
-private_multicast_link(void multicast_link_init (void));
-private_multicast_link(void multicast_link_read_data (int groupP));
-private_multicast_link(void multicast_link_read (void));
-private_multicast_link(void *multicast_link_main_loop (void *param));
-
-public_multicast_link(int multicast_link_write_sock (int groupP, char *dataP, uint32_t sizeP));
-public_multicast_link(void multicast_link_start ( void (*rx_handlerP) (unsigned int, char*), unsigned char multicast_group, char * multicast_ifname));
-# ifdef BYPASS_PHY
-public_multicast_link(pthread_mutex_t Bypass_phy_wr_mutex);
-public_multicast_link(pthread_cond_t Bypass_phy_wr_cond);
-public_multicast_link(char Bypass_phy_wr);
-# endif //BYPASS_PHY
-#endif
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c b/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
deleted file mode 100644
index 75f5e83632..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * 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
- */
-
-/*! \file netlink_init.c
-* \brief initiate the netlink socket for communication with nas dirver
-* \author Navid Nikaein and Raymomd Knopp
-* \date 2011
-* \version 1.0
-* \company Eurecom
-* \email: navid.nikaein@eurecom.fr
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "common/platform_constants.h"
-
-#include
-#include
-#include
-#include
-#include "common/openairinterface5g_limits.h"
-
-#include "pdcp.h"
-
-char nl_rx_buf[NL_MAX_PAYLOAD];
-
-struct sockaddr_nl nas_src_addr, nas_dest_addr;
-struct nlmsghdr *nas_nlh_tx = NULL;
-struct nlmsghdr *nas_nlh_rx = NULL;
-struct iovec nas_iov_tx;
-struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
-
-int nas_sock_fd[MAX_MOBILES_PER_ENB*2]; //Allocated for both LTE UE and NR UE.
-
-int nas_sock_mbms_fd;
-
-struct msghdr nas_msg_tx;
-struct msghdr nas_msg_rx;
-
-#define GRAAL_NETLINK_ID 31
-
-static int tun_alloc(char *dev) {
- struct ifreq ifr;
- int fd, err;
-
- if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
- LOG_E(PDCP, "[TUN] failed to open /dev/net/tun\n");
- return -1;
- }
-
- memset(&ifr, 0, sizeof(ifr));
- /* Flags: IFF_TUN - TUN device (no Ethernet headers)
- * IFF_TAP - TAP device
- *
- * IFF_NO_PI - Do not provide packet information
- */
- ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
-
- if( *dev )
- strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)-1);
-
- if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
- close(fd);
- return err;
- }
-
- strcpy(dev, ifr.ifr_name);
- return fd;
-}
-
-
-int netlink_init_mbms_tun(char *ifprefix, int id) {//for UE, id = 1, 2, ...,
- int ret;
- char ifname[64];
-
- if (id > 0) {
- sprintf(ifname, "oaitun_%.3s%d", ifprefix, id-1);
- }
- else {
- sprintf(ifname, "oaitun_%.3s1", ifprefix); // added "1": for historical reasons
- }
- nas_sock_mbms_fd = tun_alloc(ifname);
-
- if (nas_sock_mbms_fd == -1) {
- printf("[NETLINK] Error opening mbms socket %s (%d:%s)\n",ifname,errno, strerror(errno));
- exit(1);
- }
-
- printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_mbms_fd);
- ret = fcntl(nas_sock_mbms_fd,F_SETFL,O_NONBLOCK);
-
- if (ret == -1) {
- printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
-
- if (LINK_ENB_PDCP_TO_IP_DRIVER) {
- exit(1);
- }
- }
-
- memset(&nas_src_addr, 0, sizeof(nas_src_addr));
- nas_src_addr.nl_family = AF_NETLINK;
- nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
- nas_src_addr.nl_groups = 0; /* not in mcast groups */
- ret = bind(nas_sock_mbms_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
-
- return 1;
-}
-
-int netlink_init_tun(char *ifprefix, int num_if, int id) {//for UE, id = 1, 2, ...,
- int ret;
- char ifname[64];
-
- int begx = (id == 0) ? 0 : id - 1;
- int endx = (id == 0) ? num_if : id;
- for (int i = begx; i < endx; i++) {
- sprintf(ifname, "oaitun_%.3s%d",ifprefix,i+1);
- nas_sock_fd[i] = tun_alloc(ifname);
-
- if (nas_sock_fd[i] == -1) {
- LOG_E(PDCP, "TUN: Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
- return 0;
- }
-
- LOG_I(PDCP, "TUN: Opened socket %s with fd nas_sock_fd[%d]=%d\n",
- ifname, i, nas_sock_fd[i]);
- ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
-
- if (ret == -1) {
- LOG_E(PDCP, "TUN: Error fcntl (%d:%s)\n",errno, strerror(errno));
-
- if (LINK_ENB_PDCP_TO_IP_DRIVER) {
- exit(1);
- }
- }
- } /* for */
-
- return 1;
-}
-
-
-int netlink_init(void) {
- int ret;
- nas_sock_fd[0] = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
-
- if (nas_sock_fd[0] == -1) {
- printf("[NETLINK] Error opening GRAAL_NETLINK_ID socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
-
- if (LINK_ENB_PDCP_TO_IP_DRIVER) {
- exit(1);
- }
- }
-
- printf("[NETLINK] Opened socket with fd %d\n",nas_sock_fd[0]);
- ret = fcntl(nas_sock_fd[0],F_SETFL,O_NONBLOCK);
-
- if (ret == -1) {
- printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
-
- if (LINK_ENB_PDCP_TO_IP_DRIVER) {
- exit(1);
- }
- }
-
- memset(&nas_src_addr, 0, sizeof(nas_src_addr));
- nas_src_addr.nl_family = AF_NETLINK;
- nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
- nas_src_addr.nl_groups = 0; /* not in mcast groups */
- ret = bind(nas_sock_fd[0], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
- memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
- nas_dest_addr.nl_family = AF_NETLINK;
- nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
- nas_dest_addr.nl_groups = 0; /* unicast */
- // TX PART
- free(nas_nlh_tx);
- nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
- memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
- /* Fill the netlink message header */
- nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
- nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
- nas_nlh_tx->nlmsg_flags = 0;
- nas_iov_tx.iov_base = (void *)nas_nlh_tx;
- nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
- memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
- nas_msg_tx.msg_name = (void *)&nas_dest_addr;
- nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
- nas_msg_tx.msg_iov = &nas_iov_tx;
- nas_msg_tx.msg_iovlen = 1;
- // RX PART
- memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
- nas_msg_rx.msg_name = (void *)&nas_src_addr;
- nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
- nas_msg_rx.msg_iov = &nas_iov_rx;
- nas_msg_rx.msg_iovlen = 1;
- return(nas_sock_fd[0]);
-}
-
-void netlink_cleanup(void)
-{
- free(nas_nlh_tx);
- nas_nlh_tx = NULL;
-}
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/proto.h b/openair1/SIMULATION/ETH_TRANSPORT/proto.h
deleted file mode 100644
index bc6990ac3e..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/proto.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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
- */
-
-/*! \file proto.h
-* \brief
-* \author Navid Nikaein
-* \date 2011
-* \version 1.0
-* \company Eurecom
-* \email: navid.nikaein@eurecom.fr
-*/
-
-#include "SIMULATION/ETH_TRANSPORT/defs.h"
-
-#ifndef EMU_PROTO_H_
-#define EMU_PROTO_H_
-
-void init_bypass (void);
-void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char *, unsigned int *, unsigned int *),unsigned int (*rx_handlerP) (unsigned char,char *,unsigned int));
-int bypass_rx_data(unsigned int frame, unsigned int last_slot,
- unsigned int next_slot, uint8_t is_master);
-void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot,
- unsigned int next_slot, uint8_t is_master);
-void bypass_tx_data (emu_transport_info_t Type, unsigned int frame, unsigned int next_slot);
-
-void emulation_tx_rx(void);
-
-unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int *Nbytes,unsigned int *Nb_flows);
-unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer, unsigned int Nbytes);
-
-unsigned int emul_rx_data(void);
-
-void emu_transport_info(unsigned int last_slot, unsigned int next_slot);
-void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot);
-void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot);
-void emu_transport_sync(void);
-void emu_transport(unsigned int frame, unsigned int last_slot,unsigned int next_slot, lte_subframe_t direction, unsigned char frame_type, int ethernet_flag );
-void emu_transport_DL(unsigned int frame, unsigned int last_slot,unsigned int next_slot);
-void emu_transport_UL(unsigned int frame, unsigned int last_slot,unsigned int next_slot);
-void emu_transport_release(void);
-
-int multicast_link_read_data_from_sock(uint8_t eNB_flag);
-
-void clear_eNB_transport_info(uint8_t);
-void clear_UE_transport_info(uint8_t);
-int netlink_init(void);
-int netlink_init_tun(char *ifsuffix, int num_if, int id);
-int netlink_init_mbms_tun(char *ifsuffix, int id);
-void netlink_cleanup(void);
-
-#endif /* EMU_PROTO_H_ */
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/socket.c b/openair1/SIMULATION/ETH_TRANSPORT/socket.c
deleted file mode 100644
index 2b28a66170..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/socket.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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
- */
-
-/*! \file socket.c
-* \brief
-* \author Lionel Gauthier
-* \date 2011
-* \version 1.0
-* \company Eurecom
-* \email: lionel.gauthier@eurecom.fr
-*/
-
-#include
-#include
-#include
-#include
-//#include
-#include
-#include
-#include
-
-#define SOCKET_C
-//#include "openair_defs.h"
-#include "socket.h"
-
-#define msg printf
-//------------------------------------------------------------------------------
-void
-socket_setnonblocking (int sockP)
-{
- //------------------------------------------------------------------------------
-
- int opts;
-
- opts = fcntl (sockP, F_GETFL);
-
- if (opts < 0) {
- perror ("fcntl(F_GETFL)");
- exit (EXIT_FAILURE);
- }
-
- opts = (opts | O_NONBLOCK);
-
- if (fcntl (sockP, F_SETFL, opts) < 0) {
- perror ("fcntl(F_SETFL)");
- exit (EXIT_FAILURE);
- }
-
- return;
-}
-
-//------------------------------------------------------------------------------
-int
-make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP)
-{
- //------------------------------------------------------------------------------
-
- int sock;
- unsigned int length = sizeof (struct sockaddr_in);
- struct sockaddr_in name;
-
-
- assert ((typeP == SOCK_STREAM) || (typeP == SOCK_DGRAM));
-
- /* Create the socket. */
- sock = socket (PF_INET, typeP, 0);
-
- if (sock < 0) {
- fprintf (stderr, "ERROR: %s line %d socket %m", __FILE__, __LINE__);
- exit (EXIT_FAILURE);
- }
-
- /* Give the socket a name. */
- name.sin_family = AF_INET;
- name.sin_port = htons (*portP);
- name.sin_addr.s_addr = htonl (INADDR_ANY);
-
- if (bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0) {
- close (sock);
- fprintf (stderr, "ERROR: %s line %d bind port %d %m", __FILE__, __LINE__, *portP);
- exit (EXIT_FAILURE);
- }
-
- if (ptr_addressP != NULL) {
- getsockname (sock, (struct sockaddr *) ptr_addressP, &length);
- }
-
- msg("[SOCKET] bound socket port %d\n", *portP);
- return sock;
-}
-
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/socket.h b/openair1/SIMULATION/ETH_TRANSPORT/socket.h
deleted file mode 100644
index e9ca36bee2..0000000000
--- a/openair1/SIMULATION/ETH_TRANSPORT/socket.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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
- */
-
-/*! \file socket.h
-* \brief
-* \author Lionel Gauthier
-* \date 2011
-* \version 1.0
-* \company Eurecom
-* \email: lionel.gauthier@eurecom.fr
-*/
-
-#ifndef __SIMULATION_ETH_TRANSPORT_SOCKET__H__
-#define __SIMULATION_ETH_TRANSPORT_SOCKET__H__
-
-# ifdef SOCKET_C
-# define private_socket(x) x
-# define public_socket(x) x
-# else
-# define private_socket(x)
-# define public_socket(x) extern x
-# endif
-# include "stdint.h"
-public_socket (void socket_setnonblocking (int sockP);
- )
-public_socket (int make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP);
- )
-#endif
diff --git a/openair1/SIMULATION/LTE_PHY/dummy_functions.c b/openair1/SIMULATION/LTE_PHY/dummy_functions.c
index fcbab51f4b..fd682d2f78 100644
--- a/openair1/SIMULATION/LTE_PHY/dummy_functions.c
+++ b/openair1/SIMULATION/LTE_PHY/dummy_functions.c
@@ -47,8 +47,6 @@ SLDCH_t *ue_get_sldch(module_id_t module_idP, int CC_id,frame_t frameP, sub_fram
SLSCH_t *ue_get_slsch(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame_t subframe) {return(NULL);}
-void multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP) {}
-
uint16_t
ue_process_rar(const module_id_t module_idP,
const int CC_id,
diff --git a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
index 224a98ebde..8ccca9f478 100644
--- a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
+++ b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
@@ -279,14 +279,13 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id
uint8_t *mb = malloc16(ie->value.choice.RRCContainer.size);
memcpy(mb, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
LOG_D(F1AP, "Calling pdcp_data_ind for UE RNTI %lx srb_id %lu with size %ld (DCCH) \n", ctxt.rntiMaybeUEid, srb_id, ie->value.choice.RRCContainer.size);
- //for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
- // printf("%02x ", mb->data[i]);
- //printf("\n");
- pdcp_data_ind (&ctxt,
- 1, // srb_flag
- 0, // embms_flag
- srb_id,
- ie->value.choice.RRCContainer.size,
- mb, NULL, NULL);
+ nr_pdcp_data_ind(&ctxt,
+ 1, // srb_flag
+ 0, // embms_flag
+ srb_id,
+ ie->value.choice.RRCContainer.size,
+ mb,
+ NULL,
+ NULL);
return 0;
}
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index 28cd37f3af..c63487e1ce 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -49,8 +49,7 @@
#include "common/ngran_types.h"
#include "common/openairinterface5g_limits.h"
#include "executables/lte-softmodem.h"
-#include "SIMULATION/ETH_TRANSPORT/proto.h"
-#include "openair2/RRC/NAS/nas_config.h"
+#include "common/utils/tun_if.h"
#include "intertask_interface.h"
#include "openair3/S1AP/s1ap_eNB.h"
#include
@@ -113,7 +112,7 @@ struct sockaddr_in prose_ctrl_addr;
struct sockaddr_in prose_pdcp_addr;
struct sockaddr_in pdcp_sin;
/* pdcp module parameters and related functions*/
-static pdcp_params_t pdcp_params= {0,NULL};
+static pdcp_params_t pdcp_params = {0};
rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];
rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB]; // for noS1 mode
unsigned int pdcp_eNB_UE_instance_to_rnti_index;
@@ -298,8 +297,8 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %ld \n", srb_flagP, rb_idP);
}
- rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP,
- confirmP, sdu_buffer_sizeP, pdcp_pdu_p,NULL,NULL);
+ rlc_status =
+ rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p, NULL, NULL);
} else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
LOG_E(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
@@ -467,9 +466,16 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1)) {
LOG_D(PDCP, "pdcp data req on drb %ld, size %d, rnti %lx\n", rb_idP, pdcp_pdu_size, ctxt_pP->rntiMaybeUEid);
- rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
- confirmP, pdcp_pdu_size, pdcp_pdu_p,sourceL2Id,
- destinationL2Id);
+ rlc_status = rlc_data_req(ctxt_pP,
+ srb_flagP,
+ MBMS_FLAG_NO,
+ rb_idP,
+ muiP,
+ confirmP,
+ pdcp_pdu_size,
+ pdcp_pdu_p,
+ sourceL2Id,
+ destinationL2Id);
ret = false;
switch (rlc_status) {
case RLC_OP_STATUS_OK:
@@ -2279,63 +2285,38 @@ void rrc_pdcp_config_req (
}
}
-pdcp_data_ind_func_t get_pdcp_data_ind_func() {
- return pdcp_params.pdcp_data_ind_func;
-}
-
-void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req) {
- pdcp_params.send_rlc_data_req_func = send_rlc_data_req;
-}
-
-void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind) {
- pdcp_params.pdcp_data_ind_func = pdcp_data_ind;
-}
-
uint64_t pdcp_module_init( uint64_t pdcp_optmask, int id) {
/* temporary enforce netlink when UE_NAS_USE_TUN is set,
this is while switching from noS1 as build option
to noS1 as config option */
if ( pdcp_optmask & UE_NAS_USE_TUN_BIT) {
- pdcp_params.optmask = pdcp_params.optmask | PDCP_USE_NETLINK_BIT ;
+ pdcp_params.optmask = pdcp_params.optmask;
}
pdcp_params.optmask = pdcp_params.optmask | pdcp_optmask ;
- LOG_I(PDCP, "pdcp init,%s %s\n",
- ((LINK_ENB_PDCP_TO_GTPV1U)?"usegtp":""),
- ((PDCP_USE_NETLINK)?"usenetlink":""));
- if (PDCP_USE_NETLINK) {
- nas_getparams();
-
- if(UE_NAS_USE_TUN) {
- int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)? MAX_MOBILES_PER_ENB : 1;
- netlink_init_tun("ue",num_if, id);
- if (IS_SOFTMODEM_NOS1)
- nas_config(1, 1, 2, "ue");
- netlink_init_mbms_tun("uem", id);
- nas_config_mbms(1, 2, 2, "uem");
- LOG_I(PDCP, "UE pdcp will use tun interface\n");
- } else if(ENB_NAS_USE_TUN) {
- netlink_init_tun("enb", 1, 0);
- nas_config(1, 1, 1, "enb");
- if(pdcp_optmask & ENB_NAS_USE_TUN_W_MBMS_BIT){
- netlink_init_mbms_tun("enm", 0);
- nas_config_mbms(1, 2, 1, "enm");
- LOG_I(PDCP, "ENB pdcp will use mbms tun interface\n");
- }
- LOG_I(PDCP, "ENB pdcp will use tun interface\n");
- } else {
- LOG_I(PDCP, "pdcp will use kernel modules\n");
- netlink_init();
+ if (UE_NAS_USE_TUN) {
+ int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? MAX_MOBILES_PER_ENB : 1;
+ tun_init("oaitun_ue", num_if, id);
+ if (IS_SOFTMODEM_NOS1)
+ tun_config(1, "10.0.1.2", NULL, "oaitun_ue");
+ tun_init_mbms("oaitun_uem", id + 1);
+ tun_config(1, "10.0.2.2", NULL, "oaitun_uem");
+ LOG_I(PDCP, "UE pdcp will use tun interface\n");
+ } else if (ENB_NAS_USE_TUN) {
+ tun_init("oaitun_enb", 1, 0);
+ tun_config(1, "10.0.1.1", NULL, "oaitun_enb");
+ if (pdcp_optmask & ENB_NAS_USE_TUN_W_MBMS_BIT) {
+ tun_init_mbms("oaitun_enm", 1);
+ tun_config(1, "10.0.2.1", NULL, "oaitun_enm");
+ LOG_I(PDCP, "ENB pdcp will use mbms tun interface\n");
}
- }else{
- if(pdcp_optmask & ENB_NAS_USE_TUN_W_MBMS_BIT){
- LOG_W(PDCP, "ENB pdcp will use tun interface for MBMS\n");
- netlink_init_mbms_tun("enm", 0);
- nas_config_mbms_s1(1, 2, 1, "enm");
- }else
- LOG_E(PDCP, "ENB pdcp will not use tun interface\n");
- }
+ LOG_I(PDCP, "ENB pdcp will use tun interface\n");
+ } else if (pdcp_optmask & ENB_NAS_USE_TUN_W_MBMS_BIT) {
+ tun_init_mbms("oaitun_enm", 0);
+ tun_config(1, "10.0.2.1", NULL, "oaitun_enm");
+ LOG_I(PDCP, "ENB pdcp will use mbms tun interface\n");
+ }
pthread_create(&pdcp_stats_thread_desc,NULL,pdcp_stats_thread,NULL);
@@ -2362,7 +2343,7 @@ pdcp_free (
void pdcp_module_cleanup (void)
//-----------------------------------------------------------------------------
{
- netlink_cleanup();
+ // empty - we could free all contexts, not implemented
}
//-----------------------------------------------------------------------------
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
index 4a7f71b315..7a2ce5b84c 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
@@ -47,43 +47,16 @@
#include "openair3/SECU/secu_defs.h"
-typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *const,
- const srb_flag_t,
- const MBMS_flag_t,
- const rb_id_t,
- const mui_t,
- confirm_t,
- sdu_size_t,
- uint8_t *,
- const uint32_t *const,
- const uint32_t *const);
-
-typedef bool(pdcp_data_ind_t)(const protocol_ctxt_t *,
- const srb_flag_t,
- const MBMS_flag_t,
- const rb_id_t,
- const sdu_size_t,
- uint8_t *,
- const uint32_t *const,
- const uint32_t *const);
-typedef pdcp_data_ind_t* pdcp_data_ind_func_t;
-
#define MAX_NUMBER_NETIF 1 //16
#define ENB_NAS_USE_TUN_W_MBMS_BIT (1<< 10)
-#define PDCP_USE_NETLINK_BIT (1<< 11)
-#define LINK_ENB_PDCP_TO_IP_DRIVER_BIT (1<< 13)
#define LINK_ENB_PDCP_TO_GTPV1U_BIT (1<< 14)
#define UE_NAS_USE_TUN_BIT (1<< 15)
#define ENB_NAS_USE_TUN_BIT (1<< 16)
typedef struct {
uint64_t optmask;
- send_rlc_data_req_func_t send_rlc_data_req_func;
- pdcp_data_ind_func_t pdcp_data_ind_func;
} pdcp_params_t;
-#define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
-#define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT)
#define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT)
#define UE_NAS_USE_TUN ( get_pdcp_optmask() & UE_NAS_USE_TUN_BIT)
#define ENB_NAS_USE_TUN ( get_pdcp_optmask() & ENB_NAS_USE_TUN_BIT)
@@ -279,7 +252,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
const uint32_t *const sourceL2Id,
const uint32_t *const destinationL2Id);
-/*! \fn bool pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, uint8_t*, bool)
+/*! \fn bool pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, uint8_t*, uint32_t, uint32_t)
* \brief This functions handles data transfer indications coming from RLC
* \param[in] ctxt_pP Running context.
* \param[in] Shows if rb is SRB
@@ -287,12 +260,20 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
* \param[in] rab_id Radio Bearer ID
* \param[in] sdu_buffer_size Size of incoming SDU in bytes
* \param[in] sdu_buffer Buffer carrying SDU
- * \param[in] is_data_plane flag to indicate whether the userplane data belong to the control plane or data plane
+ * \param[in] srcID
+ * \param[in] dstID
* \return TRUE on success, false otherwise
* \note None
* @ingroup _pdcp
*/
-pdcp_data_ind_t pdcp_data_ind;
+bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
+ const srb_flag_t srb_flagP,
+ const MBMS_flag_t MBMS_flagP,
+ const rb_id_t rb_idP,
+ const sdu_size_t sdu_buffer_sizeP,
+ uint8_t *const sdu_buffer_pP,
+ const uint32_t *const srcID,
+ const uint32_t *const dstID);
/*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t)
* \brief This functions initializes relevant PDCP entity
@@ -381,9 +362,6 @@ int pdcp_fifo_flush_sdus ( const protocol_ctxt_t *const ct
int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t *const ctxt_pP);
void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t *const ctxt_pP);
-void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req);
-void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind);
-pdcp_data_ind_func_t get_pdcp_data_ind_func(void);
//-----------------------------------------------------------------------------
int pdcp_fifo_flush_mbms_sdus ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_mbms_sdus_fromtun ( const protocol_ctxt_t *const ctxt_pP);
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index 11ee36669b..5f54bf6f04 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -31,8 +31,6 @@
#define PDCP_FIFO_C
-
-
extern int otg_enabled;
#include "pdcp.h"
@@ -49,7 +47,6 @@ extern int otg_enabled;
#include "../MAC/mac_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
-#include "NETWORK_DRIVER/LITE/constant.h"
//#include "SIMULATION/ETH_TRANSPORT/extern.h"
#include "common/utils/LOG/log.h"
#include "UTIL/OTG/otg_tx.h"
@@ -63,23 +60,12 @@ extern int otg_enabled;
#include
#include
-#include "NETWORK_DRIVER/UE_IP/constant.h"
-
-extern char nl_rx_buf[NL_MAX_PAYLOAD];
-extern struct sockaddr_nl nas_src_addr, nas_dest_addr;
-extern struct nlmsghdr *nas_nlh_tx;
-extern struct nlmsghdr *nas_nlh_rx;
-extern struct iovec nas_iov_tx;
-extern struct iovec nas_iov_rx;
extern int nas_sock_fd[MAX_MOBILES_PER_ENB];
extern int nas_sock_mbms_fd;
-extern struct msghdr nas_msg_tx;
-extern struct msghdr nas_msg_rx;
-
-
+static char nl_rx_buf[NL_MAX_PAYLOAD];
# include "openair3/ocp-gtpu/gtp_itf.h"
@@ -136,12 +122,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
log_dump(PDCP, pdcpData, pdcpHead->data_size, LOG_DUMP_CHAR,"PDCP output to be sent to TUN interface: \n");
ret = write(nas_sock_fd[0], pdcpData, pdcpHead->data_size);
LOG_T(PDCP,"[NB PDCP_FIFOS] ret %d TRIED TO PUSH DATA TO rb_id %d handle %d sizeToWrite %d\n",ret,rb_id,nas_sock_fd[0],pdcpHead->data_size);
- } else if (PDCP_USE_NETLINK) {
- int sizeToWrite= sizeof (pdcp_data_ind_header_t) + pdcpHead->data_size;
- memcpy(NLMSG_DATA(nas_nlh_tx), (uint8_t *) pdcpHead, sizeToWrite);
- nas_nlh_tx->nlmsg_len = sizeToWrite;
- ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0);
- } // PDCP_USE_NETLINK
+ }
AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s), nas_sock_fd[0]: %d\n", errno, strerror(errno), nas_sock_fd[0]);
@@ -418,13 +399,14 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
rb_id_t rab_id = 0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 1 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 1 );
+ struct msghdr nas_msg_rx;
len = recvmsg(nas_sock_fd[0], &nas_msg_rx, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 0 );
if (len > 0) {
- for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
- NLMSG_OK (nas_nlh_rx, len);
- nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, len)) {
+ for (struct nlmsghdr *nas_nlh_rx = (struct nlmsghdr *)nl_rx_buf;
+ NLMSG_OK(nas_nlh_rx, len);
+ nas_nlh_rx = NLMSG_NEXT(nas_nlh_rx, len)) {
if (nas_nlh_rx->nlmsg_type == NLMSG_DONE) {
LOG_D(PDCP, "[PDCP][NETLINK] RX NLMSG_DONE\n");
//return;
@@ -526,7 +508,7 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
ctxt.rntiMaybeUEid = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
if (rab_id != 0) {
- if (rab_id == UE_IP_DEFAULT_RAB_ID) {
+ if (rab_id == 1) {
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%lx, enb_flag=%d)\n", ctxt.module_id, ctxt.rntiMaybeUEid, ctxt.enb_flag);
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rntiMaybeUEid, ctxt.enb_flag);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
@@ -700,7 +682,7 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
//UE
if (!ctxt.enb_flag) {
if (rab_id != 0) {
- if (rab_id == UE_IP_DEFAULT_RAB_ID) {
+ if (rab_id == 1) {
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%lx, enb_flag=%d)\n", ctxt.module_id, ctxt.rntiMaybeUEid, ctxt.enb_flag);
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rntiMaybeUEid, ctxt.enb_flag);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
@@ -807,15 +789,10 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
} /* pdcp_fifo_read_input_sdus_frompc5s */
//-----------------------------------------------------------------------------
-int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
- if (UE_NAS_USE_TUN || ENB_NAS_USE_TUN) {
- return pdcp_fifo_read_input_sdus_fromtun (ctxt_pP);
- } else if (PDCP_USE_NETLINK) {
- pdcp_fifo_read_input_sdus_frompc5s (ctxt_pP);
- return pdcp_fifo_read_input_sdus_fromnetlinksock(ctxt_pP);
- } /* PDCP_USE_NETLINK */
-
- return 0;
+int pdcp_fifo_read_input_sdus(const protocol_ctxt_t *const ctxt_pP)
+{
+ DevAssert(UE_NAS_USE_TUN || ENB_NAS_USE_TUN);
+ return pdcp_fifo_read_input_sdus_fromtun(ctxt_pP);
}
//TTN for D2D (PC5S)
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
deleted file mode 100644
index b832fee136..0000000000
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * 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
- */
-
-/*! \file pdcp_netlink.c
- * \brief pdcp communication with linux IP interface,
- * have a look at http://man7.org/linux/man-pages/man7/netlink.7.html for netlink.
- * Read operation from netlink should be achieved in an asynchronous way to avoid
- * subframe overload, netlink congestion...
- * \author Sebastien ROUX
- * \date 2013
- * \version 0.1
- * @ingroup pdcp
- */
-
-#define _GNU_SOURCE // required for pthread_setname_np()
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* Bugfix for version of GCC = 4.4.3 (Ubuntu 10.04) */
-#if GCC_VERSION <= 40403
- #include
-#endif
-
-#include
-
-#include "assertions.h"
-#include "queue.h"
-#include "liblfds611.h"
-
-#include "common/utils/LOG/log.h"
-#include "common/utils/system.h"
-#include "LAYER2/MAC/mac_extern.h"
-
-#include "pdcp.h"
-#include "pdcp_primitives.h"
-
-
-#define PDCP_QUEUE_NB_ELEMENTS 200
-
-extern char nl_rx_buf[NL_MAX_PAYLOAD];
-extern struct nlmsghdr *nas_nlh_rx;
-extern struct iovec nas_iov_rx;
-extern int nas_sock_fd;
-extern struct msghdr nas_msg_rx;
-
-
-static pthread_t pdcp_netlink_thread;
-
-/* We use lock-free queues between the User-plane driver running in kernel-space
- * and the corresponding entity in User-space.
- * one queue for eNBs (index 0)/one queue for UEs (index 1)
- */
-static struct lfds611_queue_state **pdcp_netlink_queue_enb = NULL;
-static struct lfds611_queue_state **pdcp_netlink_queue_ue = NULL;
-static uint32_t *pdcp_netlink_nb_element_enb = NULL;
-static uint32_t *pdcp_netlink_nb_element_ue = NULL;
-
-time_stats_t ip_pdcp_stats_tmp;
-
-static void *pdcp_netlink_thread_fct(void *arg);
-
-//-----------------------------------------------------------------------------
-int
-pdcp_netlink_init(
- void
-)
-//-----------------------------------------------------------------------------
-{
- int i;
- int nb_inst_enb;
- int nb_inst_ue;
-
- reset_meas(&ip_pdcp_stats_tmp);
- nb_inst_enb = 1;
- nb_inst_ue = 1;
-
- if (LINK_ENB_PDCP_TO_GTPV1U) {
- nb_inst_enb = 0;
- LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
- } else {
- /* #warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues" */
- pdcp_netlink_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state *));
- pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t));
- LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb);
-
- for (i = 0; i < nb_inst_enb; i++) {
- pdcp_netlink_nb_element_enb[i] = 0;
-
- if (lfds611_queue_new(&pdcp_netlink_queue_enb[i], PDCP_QUEUE_NB_ELEMENTS) < 0) {
- LOG_E(PDCP, "Failed to create new FIFO for eNB Netlink -> PDCP communcation instance %d\n", i);
- exit(EXIT_FAILURE);
- }
- }
- }
-
- if (nb_inst_ue > 0) {
- pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state *));
- pdcp_netlink_nb_element_ue = malloc(nb_inst_ue * sizeof(uint32_t));
- LOG_I(PDCP, "[NETLINK] Creating %d queues for UE Netlink -> PDCP communication\n", nb_inst_ue);
-
- for (i = 0; i < nb_inst_ue; i++) {
- pdcp_netlink_nb_element_ue[i] = 0;
-
- if (lfds611_queue_new(&pdcp_netlink_queue_ue[i], PDCP_QUEUE_NB_ELEMENTS) < 0) {
- LOG_E(PDCP, "Failed to create new FIFO for UE Netlink -> PDCP communcation instance %d\n", i);
- exit(EXIT_FAILURE);
- }
- }
- }
-
- if ((nb_inst_ue + nb_inst_enb) > 0) {
- /* Create one thread that fetchs packets from the netlink.
- * When the netlink fifo is full, packets are silently dropped, this behaviour
- * should be avoided if we want a reliable link.
- */
- threadCreate(&pdcp_netlink_thread, pdcp_netlink_thread_fct, (void*)NULL, "PDCP netlink", -1, OAI_PRIORITY_RT_LOW );
- }
-
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-int
-pdcp_netlink_dequeue_element(
- const protocol_ctxt_t *const ctxt_pP,
- struct pdcp_netlink_element_s **data_ppP
-)
-//-----------------------------------------------------------------------------
-{
- int ret = 0;
-
- if (ctxt_pP->enb_flag) {
- ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->module_id], (void **)data_ppP);
-
- if (ret != 0) {
- LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", ctxt_pP->module_id);
- }
- } else {
- ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ctxt_pP->module_id], (void **)data_ppP);
-
- if (ret != 0) {
- LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ctxt_pP->module_id);
- }
- }
-
- return ret;
-}
-
-//-----------------------------------------------------------------------------
-static
-void *pdcp_netlink_thread_fct(void *arg)
-//-----------------------------------------------------------------------------
-{
- int len = 0;
- struct pdcp_netlink_element_s *new_data_p = NULL;
- uint8_t pdcp_thread_read_state ;
- eNB_flag_t eNB_flag = 0;
- module_id_t module_id = 0;
- pdcp_thread_read_state = 0;
- memset(nl_rx_buf, 0, NL_MAX_PAYLOAD);
- LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd);
-
- while (1) {
- len = recvmsg(nas_sock_fd, &nas_msg_rx, 0);
-
- if (len == 0) {
- /* Other peer (kernel) has performed an orderly shutdown
- */
- LOG_E(PDCP, "[NETLINK_THREAD] Kernel module has closed the netlink\n");
- exit(EXIT_FAILURE);
- } else if (len < 0) {
- /* There was an error */
- LOG_E(PDCP, "[NETLINK_THREAD] An error occured while reading netlink (%d:%s)\n",
- errno, strerror(errno));
- exit(EXIT_FAILURE);
- } else {
- /* Normal read.
- * NOTE: netlink messages can be assembled to form a multipart message
- */
- for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
- NLMSG_OK(nas_nlh_rx, (unsigned int)len);
- nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, len)) {
- start_meas(&ip_pdcp_stats_tmp);
-
- /* There is no need to check for nlmsg_type because
- * the header is not set in our drivers.
- */
- if (pdcp_thread_read_state == 0) {
- new_data_p = malloc(sizeof(struct pdcp_netlink_element_s));
-
- if (nas_nlh_rx->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) {
- pdcp_thread_read_state = 1;
- memcpy((void *)&new_data_p->pdcp_read_header, (void *)NLMSG_DATA(nas_nlh_rx), sizeof(pdcp_data_req_header_t));
- LOG_I(PDCP, "[NETLINK_THREAD] RX pdcp_data_req_header_t inst %u, "
- "rb_id %ld data_size %d\n",
- new_data_p->pdcp_read_header.inst,
- new_data_p->pdcp_read_header.rb_id,
- new_data_p->pdcp_read_header.data_size);
- } else {
- LOG_E(PDCP, "[NETLINK_THREAD] WRONG size %d should be sizeof "
- "%lu ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n",
- nas_nlh_rx->nlmsg_len,
- sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
- }
- } else {
- pdcp_thread_read_state = 0;
- module_id = 0;
- new_data_p->data = malloc(sizeof(uint8_t) * new_data_p->pdcp_read_header.data_size);
- /* Copy the data */
- memcpy(new_data_p->data, NLMSG_DATA(nas_nlh_rx), new_data_p->pdcp_read_header.data_size);
-
- if (eNB_flag) {
- if (pdcp_netlink_nb_element_enb[module_id]
- > PDCP_QUEUE_NB_ELEMENTS) {
- LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%lu)\n",
- module_id, (intptr_t)pdcp_netlink_nb_element_enb);
- }
-
- LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d\n", module_id);
- /* Enqueue the element in the right queue */
- lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_enb[module_id], new_data_p);
- stop_meas(&ip_pdcp_stats_tmp);
- copy_meas(&eNB_pdcp_stats[module_id].pdcp_ip,&ip_pdcp_stats_tmp);
- } else {
- if (pdcp_netlink_nb_element_ue[module_id]
- > PDCP_QUEUE_NB_ELEMENTS) {
- LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%lu)\n",
- module_id, (intptr_t)pdcp_netlink_nb_element_ue);
- }
-
- LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d\n", module_id);
- /* Enqueue the element in the right queue */
- lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_ue[module_id], new_data_p);
- stop_meas(&ip_pdcp_stats_tmp);
- copy_meas(&UE_pdcp_stats[module_id].pdcp_ip,&ip_pdcp_stats_tmp);
- }
- }
- }
- }
- }
-
- return NULL;
-}
-
diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
index 4582a85795..d9efb52776 100644
--- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
@@ -367,14 +367,14 @@ static void enqueue_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
if (pthread_mutex_unlock(&pq.m) != 0) abort();
}
-bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP,
- const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_id,
- const sdu_size_t sdu_buffer_size,
- uint8_t *const sdu_buffer,
- const uint32_t *const srcID,
- const uint32_t *const dstID)
+bool nr_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
+ const srb_flag_t srb_flagP,
+ const MBMS_flag_t MBMS_flagP,
+ const rb_id_t rb_id,
+ const sdu_size_t sdu_buffer_size,
+ uint8_t *const sdu_buffer,
+ const uint32_t *const srcID,
+ const uint32_t *const dstID)
{
enqueue_pdcp_data_ind(ctxt_pP,
srb_flagP,
@@ -594,7 +594,7 @@ void nr_pdcp_layer_init(bool uses_e1)
#include "nfapi/oai_integration/vendor_ext.h"
#include "executables/lte-softmodem.h"
-#include "openair2/RRC/NAS/nas_config.h"
+#include "common/utils/tun_if.h"
uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id)
{
@@ -608,48 +608,29 @@ uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id)
initialized = 1;
if (pthread_mutex_unlock(&m) != 0) abort();
-#if 0
- pdcp_optmask = _pdcp_optmask;
- return pdcp_optmask;
-#endif
- /* temporary enforce netlink when UE_NAS_USE_TUN is set,
- this is while switching from noS1 as build option
- to noS1 as config option */
- if ( _pdcp_optmask & UE_NAS_USE_TUN_BIT) {
- pdcp_optmask = pdcp_optmask | PDCP_USE_NETLINK_BIT ;
- }
-
pdcp_optmask = pdcp_optmask | _pdcp_optmask ;
- LOG_I(PDCP, "pdcp init,%s %s\n",
- ((LINK_ENB_PDCP_TO_GTPV1U)?"usegtp":""),
- ((PDCP_USE_NETLINK)?"usenetlink":""));
- if (PDCP_USE_NETLINK) {
- nas_getparams();
-
- if(UE_NAS_USE_TUN) {
- char *ifsuffix_ue = get_softmodem_params()->nsa ? "nrue" : "ue";
- int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)? MAX_MOBILES_PER_ENB : 1;
- netlink_init_tun(ifsuffix_ue, num_if, id);
- //Add --nr-ip-over-lte option check for next line
- if (IS_SOFTMODEM_NOS1){
- nas_config(1, 1, !get_softmodem_params()->nsa ? 2 : 3, ifsuffix_ue);
- set_qfi_pduid(7, 10);
- }
- LOG_I(PDCP, "UE pdcp will use tun interface\n");
- start_pdcp_tun_ue();
- } else if(ENB_NAS_USE_TUN) {
- char *ifsuffix_base_s = get_softmodem_params()->nsa ? "gnb" : "enb";
- netlink_init_tun(ifsuffix_base_s, 1, id);
- nas_config(1, 1, 1, ifsuffix_base_s);
- LOG_I(PDCP, "ENB pdcp will use tun interface\n");
- start_pdcp_tun_enb();
- } else {
- LOG_I(PDCP, "pdcp will use kernel modules\n");
- abort();
- netlink_init();
+ if (UE_NAS_USE_TUN) {
+ char *ifprefix = get_softmodem_params()->nsa ? "oaitun_nrue" : "oaitun_ue";
+ int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)
+ ? MAX_MOBILES_PER_ENB
+ : 1;
+ tun_init(ifprefix, num_if, id);
+ if (IS_SOFTMODEM_NOS1) {
+ const char *ip = !get_softmodem_params()->nsa ? "10.0.1.2" : "10.0.1.3";
+ tun_config(1, ip, NULL, ifprefix);
+ set_qfi_pduid(7, 10);
}
+ LOG_I(PDCP, "UE pdcp will use tun interface\n");
+ start_pdcp_tun_ue();
+ } else if (ENB_NAS_USE_TUN) {
+ char *ifprefix = get_softmodem_params()->nsa ? "oaitun_gnb" : "oaitun_enb";
+ tun_init(ifprefix, 1, id);
+ tun_config(1, "10.0.1.1", NULL, ifprefix);
+ LOG_I(PDCP, "ENB pdcp will use tun interface\n");
+ start_pdcp_tun_enb();
}
+
return pdcp_optmask ;
}
@@ -1313,7 +1294,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
exit(1);
}
memcpy(memblock, sdu_buffer, sdu_buffer_size);
- int ret=pdcp_data_ind(ctxt_pP,srb_flagP, false, rb_id, sdu_buffer_size, memblock, NULL, NULL);
+ int ret = nr_pdcp_data_ind(ctxt_pP, srb_flagP, false, rb_id, sdu_buffer_size, memblock, NULL, NULL);
if (!ret) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
/* what to do in case of failure? for the moment: nothing */
@@ -1337,16 +1318,6 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
return false;
}
-void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind)
-{
- /* nothing to do */
-}
-
-void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req)
-{
- /* nothing to do */
-}
-
//Dummy function needed due to LTE dependencies
void
pdcp_mbms_run ( const protocol_ctxt_t *const ctxt_pP){
diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h
index 54a5e0dcbc..101200615e 100644
--- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h
+++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h
@@ -37,14 +37,14 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
sdu_size_t sdu_sizeP,
uint8_t *sdu_pP);
-bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP,
- const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_id,
- const sdu_size_t sdu_buffer_size,
- uint8_t *const sdu_buffer,
- const uint32_t *const srcID,
- const uint32_t *const dstID);
+bool nr_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
+ const srb_flag_t srb_flagP,
+ const MBMS_flag_t MBMS_flagP,
+ const rb_id_t rb_id,
+ const sdu_size_t sdu_buffer_size,
+ uint8_t *const sdu_buffer,
+ const uint32_t *const srcID,
+ const uint32_t *const dstID);
void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
ue_id_t UEid,
diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
index 4f34a64999..46b4dad519 100644
--- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
@@ -519,7 +519,7 @@ rb_found:
}
memcpy(memblock, buf, size);
LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__);
- if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
+ if (!nr_pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
/* what to do in case of failure? for the moment: nothing */
}
diff --git a/openair2/LAYER2/rlc_v2/rlc_oai_api.c b/openair2/LAYER2/rlc_v2/rlc_oai_api.c
index d9798f6138..e8e70aec41 100644
--- a/openair2/LAYER2/rlc_v2/rlc_oai_api.c
+++ b/openair2/LAYER2/rlc_v2/rlc_oai_api.c
@@ -418,7 +418,7 @@ rb_found:
exit(1);
}
memcpy(memblock, buf, size);
- if (!get_pdcp_data_ind_func()(&ctx, is_srb, is_mbms, rb_id, size, memblock, NULL, NULL)) {
+ if (!pdcp_data_ind(&ctx, is_srb, is_mbms, rb_id, size, memblock, NULL, NULL)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed (is_srb %d rb_id %d rnti %d)\n",
__FILE__, __LINE__, __FUNCTION__,
is_srb, rb_id, ue->rnti);
diff --git a/openair2/NETWORK_DRIVER/LITE/RB_TOOL/Makefile b/openair2/NETWORK_DRIVER/LITE/RB_TOOL/Makefile
deleted file mode 100644
index a939acb7ce..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/RB_TOOL/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-CC = gcc
-
-NAS_DIR = ..
-
-rb_tool: rb_tool.c
- $(CC) rb_tool.c -o rb_tool -I../ -g -ggdb
-
-all: rb_tool
-
-clean:
- rm rb_tool
diff --git a/openair2/NETWORK_DRIVER/LITE/RB_TOOL/rb_tool.c b/openair2/NETWORK_DRIVER/LITE/RB_TOOL/rb_tool.c
deleted file mode 100644
index 465e134d76..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/RB_TOOL/rb_tool.c
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * 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
- */
-
-/***************************************************************************
- rb_tool.c - User-space utility for driving NASMESH IOCTL interface
- -------------------
- copyright : (C) 2008 by Eurecom
- email : raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr
-***************************************************************************
-
-***************************************************************************/
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-//#include "rrc_nas_primitives.h"
-#include "ioctl.h"
-#include "constant.h"
-
-
-#define NIPADDR(addr) \
- (uint8_t)(addr & 0x000000FF), \
- (uint8_t)((addr & 0x0000FF00) >> 8), \
- (uint8_t)((addr & 0x00FF0000) >> 16), \
- (uint8_t)((addr & 0xFF000000) >> 24)
-
-
-
-#define NIP6ADDR(addr) \
- ntohs((addr)->s6_addr16[0]), \
- ntohs((addr)->s6_addr16[1]), \
- ntohs((addr)->s6_addr16[2]), \
- ntohs((addr)->s6_addr16[3]), \
- ntohs((addr)->s6_addr16[4]), \
- ntohs((addr)->s6_addr16[5]), \
- ntohs((addr)->s6_addr16[6]), \
- ntohs((addr)->s6_addr16[7])
-
-
-// Global variables
-
-int fd;
-//ioctl
-char dummy_buffer[1024];
-struct oai_nw_drv_ioctl gifr;
-//int wait_start_nas;
-
-//---------------------------------------------------------------------------
-void IAL_NAS_ioctl_init(int inst)
-//---------------------------------------------------------------------------
-{
- struct oai_nw_drv_msg_statistic_reply *msgrep;
- int err,rc;
- sprintf(gifr.name, "oai%d",inst);
- // Get an UDP IPv6 socket ??
- fd=socket(AF_INET6, SOCK_DGRAM, 0);
-
- if (fd<0) {
- printf("Error opening socket\n");
- exit(1);
- }
-
- sprintf(gifr.name, "oai%d",inst);
- gifr.type = OAI_NW_DRV_MSG_STATISTIC_REQUEST;
- memset ((void *)dummy_buffer,0,800);
- gifr.msg= &(dummy_buffer[0]);
- msgrep=(struct oai_nw_drv_msg_statistic_reply *)(gifr.msg);
- printf("ioctl :Statistics requested\n");
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
-
- if (err<0) {
- printf("IOCTL error, err=%d\n",err);
- rc = -1;
- }
-
- printf("tx_packets = %u, rx_packets = %u\n", msgrep->tx_packets, msgrep->rx_packets);
- printf("tx_bytes = %u, rx_bytes = %u\n", msgrep->tx_bytes, msgrep->rx_bytes);
- printf("tx_errors = %u, rx_errors = %u\n", msgrep->tx_errors, msgrep->rx_errors);
- printf("tx_dropped = %u, rx_dropped = %u\n", msgrep->tx_dropped, msgrep->rx_dropped);
-}
-
-#define NO_ACTION_RB 0
-#define ADD_RB 1
-#define DEL_RB 2
-
-//---------------------------------------------------------------------------
-int main(int argc,char **argv)
-//---------------------------------------------------------------------------
-{
- int done;
- int rc;
- int meas_polling_counter;
- fd_set readfds;
- struct timeval tv;
- int i;
- int err;
- char *buffer;
- int c;
- int action;
- int rbset = 0;
- int cxset = 0;
- int classrefset = 0;
- int instset = 0;
- int saddr_ipv4set = 0;
- int saddr_ipv6set = 0;
- int daddr_ipv4set = 0;
- int daddr_ipv6set = 0;
- int dscpset = 0;
- int dplen = 0;
- int splen = 0;
- int mpls_outlabelset = 0;
- int mpls_inlabelset;
- char rb[20];
- char cx[20];
- char classref[20];
- char dscp[20];
- char inst[20];
- char mpls_outgoinglabel[100];
- char mpls_incominglabel[100];
- int index;
- struct oai_nw_drv_msg_rb_establishment_request *msgreq;
- struct oai_nw_drv_msg_class_add_request *msgreq_class;
- in_addr_t saddr_ipv4;
- in_addr_t daddr_ipv4;
- struct in6_addr saddr_ipv6;
- struct in6_addr daddr_ipv6;
- unsigned int mpls_outlabel;
- unsigned int mpls_inlabel;
- char addr_str[46];
- char mask_len_delims[] = "/";
- char *result;
- // scan options
- rb[0] = '\0';
- cx[0] = '\0';
- dscp[0] = '\0';
- mpls_incominglabel[0] = '\0';
- mpls_outgoinglabel[0] = '\0';
- action = NO_ACTION_RB;
-
- while ((c = getopt (argc, argv, "adr:i:c:f:l:m:s:t:x:y:z:")) != -1)
- switch (c) {
- case 'a':
- action = ADD_RB;
- break;
-
- case 'd':
- action = DEL_RB;
- break;
-
- case 'r':
- strcpy(rb,optarg);
- rbset = 1;
- break;
-
- case 'i':
- strcpy(inst,optarg);
- instset = 1;
- break;
-
- case 'c':
- strcpy(cx,optarg);
- cxset = 1;
- break;
-
- case 'f':
- strcpy(classref,optarg);
- classrefset = 1;
- break;
-
- case 'l':
- strcpy(mpls_outgoinglabel,optarg);
- mpls_outlabelset=1;
- break;
-
- case 'm':
- strcpy(mpls_incominglabel,optarg);
- mpls_inlabelset=1;
- break;
-
- case 's':
- result = strtok( optarg, mask_len_delims );
-
- if ( result != NULL ) {
- inet_aton(result,&saddr_ipv4);
- printf("Arg Source Addr IPv4 string: %s\n",result);
- saddr_ipv4set = 1;
- } else {
- printf("Arg Source Addr IPv4 string: ERROR\n");
- break;
- }
-
- result = strtok( NULL, mask_len_delims );
-
- if ( result != NULL ) {
- splen = atoi(result);
- } else {
- splen = 32;
- }
-
- printf("Arg Source Addr IPv4 mask len: %d\n",splen);
- break;
-
- case 't':
- result = strtok( optarg, mask_len_delims );
-
- if ( result != NULL ) {
- inet_aton(result,&daddr_ipv4);
- printf("Arg Dest Addr IPv4 string: %s\n",result);
- daddr_ipv4set = 1;
- } else {
- printf("Arg Dest Addr IPv4 string: ERROR\n");
- break;
- }
-
- result = strtok( NULL, mask_len_delims );
-
- if ( result != NULL ) {
- dplen = atoi(result);
- } else {
- dplen = 32;
- }
-
- printf("Arg Dest Addr IPv4 mask len: %d\n",dplen);
- break;
-
- case 'x':
- result = strtok( optarg, mask_len_delims );
-
- if ( result != NULL ) {
- printf("Arg Source Addr IPv6 string: %s\n",result);
- inet_pton(AF_INET6,result,(void *)&saddr_ipv6);
- saddr_ipv6set = 1;
- } else {
- printf("Arg Source Addr IPv6 string: ERROR\n");
- break;
- }
-
- result = strtok( NULL, mask_len_delims );
-
- if ( result != NULL ) {
- splen = atoi(result);
- } else {
- splen = 128;
- }
-
- printf("Arg Source Addr IPv6 mask len: %d\n",splen);
- break;
-
- case 'y':
- result = strtok( optarg, mask_len_delims );
-
- if ( result != NULL ) {
- printf("Arg Dest Addr IPv6 string: %s\n",result);
- inet_pton(AF_INET6,result,(void *)&daddr_ipv6);
- daddr_ipv6set = 1;
- } else {
- printf("Arg Dest Addr IPv6 string: ERROR\n");
- break;
- }
-
- result = strtok( NULL, mask_len_delims );
-
- if ( result != NULL ) {
- dplen = atoi(result);
- } else {
- dplen = 128;
- }
-
- printf("Arg Dest Addr IPv6 mask len: %d\n",dplen);
- break;
-
- case 'z':
- dscpset=1;
- strcpy(dscp,optarg);
- break;
-
- case '?':
- if (isprint (optopt))
- fprintf (stderr, "Unknown option `-%c'.\n", optopt);
- else
- fprintf (stderr,
- "Unknown option character `\\x%x'.\n",
- optopt);
-
- return 1;
-
- default:
- abort ();
- }
-
- printf ("action = %d, rb = %s,cx = %s\n", action, rb, cx);
-
- if (rbset==0) {
- printf("ERROR: Specify a RAB id!!\n");
- exit(-1);
- }
-
- if (cxset==0) {
- printf("ERROR: Specify an LCR !!\n");
- exit(-1);
- }
-
- if (classrefset==0) {
- printf("ERROR: Specify an Class reference !!\n");
- exit(-1);
- }
-
- if (instset==0) {
- printf("ERROR: Specify an interface !!\n");
- exit(-1);
- }
-
- if ((mpls_outlabelset == 0) && (saddr_ipv4set==0) && (saddr_ipv6set==0)) {
- printf("ERROR: Specify a source IP address\n");
- exit(-1);
- }
-
- if ((mpls_outlabelset == 0) && (daddr_ipv4set==0) && (daddr_ipv6set==0)) {
- printf("ERROR: Specify a destination IP address\n");
- exit(-1);
- }
-
- if ((mpls_outlabelset == 1) && (mpls_inlabelset == 0)) {
- printf("ERROR: Specify an incoming MPLS label\n");
- exit(-1);
- }
-
- if ((mpls_inlabelset == 1) && (mpls_outlabelset == 0)) {
- printf("ERROR: Specify an outgoing MPLS label\n");
- exit(-1);
- }
-
- IAL_NAS_ioctl_init(atoi(inst));
- msgreq = (struct oai_nw_drv_msg_rb_establishment_request *)(gifr.msg);
- msgreq->rab_id = atoi(rb);
- msgreq->lcr = atoi(cx);
- msgreq->qos = 0;
-
- if (action == ADD_RB) {
- gifr.type = OAI_NW_DRV_MSG_RB_ESTABLISHMENT_REQUEST;
- printf("OAI_NW_DRV_MSG_RB_ESTABLISHMENT_REQUEST: RB %d LCR %d QOS %d\n ", msgreq->rab_id, msgreq->lcr, msgreq->qos);
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- }
-
- // only add classification rule
- if ((action == ADD_RB ) || (action == NO_ACTION_RB)) {
- if (saddr_ipv4set == 1) {
- msgreq_class = (struct oai_nw_drv_msg_class_add_request *)(gifr.msg);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->version = 4;
- msgreq_class->classref = atoi(classref) + (msgreq_class->lcr<<8);
- msgreq_class->dir = OAI_NW_DRV_DIRECTION_SEND;
- msgreq_class->fct = OAI_NW_DRV_FCT_QOS_SEND;
- msgreq_class->saddr.ipv4 = saddr_ipv4;
- msgreq_class->daddr.ipv4 = daddr_ipv4;
- msgreq_class->dplen = dplen;
- msgreq_class->splen = splen;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = OAI_NW_DRV_PROTOCOL_DEFAULT;
-
- if (dscpset==0) {
- msgreq_class->dscp=0;
- } else {
- msgreq_class->dscp=atoi(dscp);
- }
-
- printf("OAI_NW_DRV_MSG_CLASS_ADD_REQUEST: OAI_NW_DRV_DIRECTION_SEND RB %d LCR %d ClassRef %d ", msgreq_class->rab_id, msgreq_class->lcr, msgreq_class->classref);
- printf("IPV4: Source = %d.%d.%d.%d/%d ", NIPADDR(msgreq_class->saddr.ipv4), msgreq_class->splen);
- printf(" IPV4: Dest = %d.%d.%d.%d/%d\n", NIPADDR(msgreq_class->daddr.ipv4), msgreq_class->dplen);
- gifr.type = OAI_NW_DRV_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->version = 4;
- msgreq_class->classref = atoi(classref) + 1 + (msgreq_class->lcr<<8);
- msgreq_class->dir = OAI_NW_DRV_DIRECTION_RECEIVE;
- msgreq_class->fct = OAI_NW_DRV_FCT_QOS_SEND;
- msgreq_class->daddr.ipv4 = saddr_ipv4;
- msgreq_class->saddr.ipv4 = daddr_ipv4;
- msgreq_class->dplen = splen;
- msgreq_class->splen = dplen;
- printf("OAI_NW_DRV_MSG_CLASS_ADD_REQUEST: OAI_NW_DRV_DIRECTION_RECEIVE RB %d LCR %d ClassRef %d ", msgreq_class->rab_id, msgreq_class->lcr, msgreq_class->classref);
- printf("IPV4: Source = %d.%d.%d.%d/%d ", NIPADDR(msgreq_class->saddr.ipv4), msgreq_class->splen);
- printf("IPV4: Dest = %d.%d.%d.%d/%d\n", NIPADDR(msgreq_class->daddr.ipv4), msgreq_class->dplen);
- gifr.type = OAI_NW_DRV_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- }
-
- if (saddr_ipv6set == 1) {
- msgreq_class = (struct oai_nw_drv_msg_class_add_request *)(gifr.msg);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->version = 6;
- msgreq_class->dplen = dplen;
- msgreq_class->splen = splen;
-
- if (dscpset==0)
- msgreq_class->dscp = 0;
- else
- msgreq_class->dscp = atoi(dscp);
-
- msgreq_class->classref = atoi(classref) + (msgreq_class->lcr<<8);
- msgreq_class->dir = OAI_NW_DRV_DIRECTION_SEND;
- msgreq_class->fct = OAI_NW_DRV_FCT_QOS_SEND;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = OAI_NW_DRV_PROTOCOL_DEFAULT;
- memcpy(&msgreq_class->saddr.ipv6,&saddr_ipv6,16);
- memcpy(&msgreq_class->daddr.ipv6,&daddr_ipv6,16);
- printf("OAI_NW_DRV_MSG_CLASS_ADD_REQUEST: OAI_NW_DRV_DIRECTION_SEND RB %d LCR %d ClassRef %d ", msgreq_class->rab_id, msgreq_class->lcr, msgreq_class->classref);
- printf("IPV6: Source = %x:%x:%x:%x:%x:%x:%x:%x/%d ", NIP6ADDR(&msgreq_class->saddr.ipv6), msgreq_class->splen);
- printf("IPV6: Dest = %x:%x:%x:%x:%x:%x:%x:%x/%d\n", NIP6ADDR(&msgreq_class->daddr.ipv6), msgreq_class->dplen);
- gifr.type = OAI_NW_DRV_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->dplen = splen;
- msgreq_class->splen = dplen;
- msgreq_class->classref = atoi(classref) + 1 + (msgreq_class->lcr<<8);
- msgreq_class->dir = OAI_NW_DRV_DIRECTION_RECEIVE;
- memcpy(&msgreq_class->daddr.ipv6,&saddr_ipv6,16);
- memcpy(&msgreq_class->saddr.ipv6,&daddr_ipv6,16);
- printf("OAI_NW_DRV_MSG_CLASS_ADD_REQUEST: OAI_NW_DRV_DIRECTION_RECEIVE RB %d LCR %d ClassRef %d ", msgreq_class->rab_id, msgreq_class->lcr, msgreq_class->classref);
- printf("IPV6: Source = %x:%x:%x:%x:%x:%x:%x:%x/%d ", NIP6ADDR(&msgreq_class->saddr.ipv6), msgreq_class->splen);
- printf("IPV6: Dest = %x:%x:%x:%x:%x:%x:%x:%x/%d\n", NIP6ADDR(&msgreq_class->daddr.ipv6), msgreq_class->dplen);
- gifr.type = OAI_NW_DRV_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- }
-
- if (mpls_inlabelset == 1) {
- msgreq_class = (struct oai_nw_drv_msg_class_add_request *)(gifr.msg);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->version = OAI_NW_DRV_MPLS_VERSION_CODE;
-
- if (dscpset==0)
- msgreq_class->dscp=0;
- else
- msgreq_class->dscp=atoi(dscp);
-
- msgreq_class->classref = atoi(classref) + (msgreq_class->lcr<<8);
- //msgreq_class->classref = 4 + (msgreq_class->lcr<<3);
- msgreq_class->dir=OAI_NW_DRV_DIRECTION_SEND;
- msgreq_class->fct=OAI_NW_DRV_FCT_QOS_SEND;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = OAI_NW_DRV_PROTOCOL_DEFAULT;
- mpls_outlabel = atoi(mpls_outgoinglabel);
- printf("Setting MPLS outlabel %u with exp %d\n",mpls_outlabel,msgreq_class->dscp);
- msgreq_class->daddr.mpls_label = mpls_outlabel;
- gifr.type = OAI_NW_DRV_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->classref = atoi(classref) + 1 + (msgreq_class->lcr<<8);
- //msgreq_class->classref = 5 + (msgreq_class->lcr<<3);
- msgreq_class->dir=OAI_NW_DRV_DIRECTION_RECEIVE;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = OAI_NW_DRV_PROTOCOL_DEFAULT;
- mpls_inlabel = atoi(mpls_incominglabel);
- printf("Setting MPLS inlabel %u with exp %d\n",mpls_inlabel,msgreq_class->dscp);
- msgreq_class->daddr.mpls_label = mpls_inlabel;
- gifr.type = OAI_NW_DRV_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- }
- } else if (action == DEL_RB) {
- gifr.type = OAI_NW_DRV_MSG_RB_RELEASE_REQUEST;
- err=ioctl(fd, OAI_NW_DRV_IOCTL_RRM, &gifr);
- }
-}
diff --git a/openair2/NETWORK_DRIVER/LITE/classifier.c b/openair2/NETWORK_DRIVER/LITE/classifier.c
deleted file mode 100644
index bc6888279b..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/classifier.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * 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
- */
-
-/*! \file classifier.c
-* \brief Classify IP packets
-* \author Navid Nikaein, Lionel GAUTHIER, Raymond knopp
-* \company Eurecom
-* \email: navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr, knopp@eurecom.fr
-*/
-
-
-#include "local.h"
-#include "proto_extern.h"
-#include
-#include
-#ifdef MPLS
-#include
-#endif
-
-
-#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
-#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
-#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
-#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
-#define IN_MULTICAST(a) IN_CLASSD(a)
-#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
-/* Address to accept any incoming messages. */
-#define INADDR_ANY ((unsigned long int) 0x00000000)
-/* Address to send to all hosts. */
-#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
-/* Address indicating an error return. */
-#define INADDR_NONE ((unsigned long int) 0xffffffff)
-
-
-#define NIPADDR(addr) \
- (uint8_t)(addr & 0x000000FF), \
- (uint8_t)((addr & 0x0000FF00) >> 8), \
- (uint8_t)((addr & 0x00FF0000) >> 16), \
- (uint8_t)((addr & 0xFF000000) >> 24)
-
-#define NIP6ADDR(addr) \
- ntohs((addr)->s6_addr16[0]), \
- ntohs((addr)->s6_addr16[1]), \
- ntohs((addr)->s6_addr16[2]), \
- ntohs((addr)->s6_addr16[3]), \
- ntohs((addr)->s6_addr16[4]), \
- ntohs((addr)->s6_addr16[5]), \
- ntohs((addr)->s6_addr16[6]), \
- ntohs((addr)->s6_addr16[7])
-
-
-#define IN6_IS_ADDR_UNSPECIFIED(a) \
- (((__const uint32_t *) (a))[0] == 0 \
- && ((__const uint32_t *) (a))[1] == 0 \
- && ((__const uint32_t *) (a))[2] == 0 \
- && ((__const uint32_t *) (a))[3] == 0)
-
-#define IN6_IS_ADDR_LOOPBACK(a) \
- (((__const uint32_t *) (a))[0] == 0 \
- && ((__const uint32_t *) (a))[1] == 0 \
- && ((__const uint32_t *) (a))[2] == 0 \
- && ((__const uint32_t *) (a))[3] == htonl (1))
-
-#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
-
-#define IN6_IS_ADDR_LINKLOCAL(a) \
- ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
- == htonl (0xfe800000))
-
-#define IN6_IS_ADDR_SITELOCAL(a) \
- ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
- == htonl (0xfec00000))
-
-#define IN6_IS_ADDR_V4MAPPED(a) \
- ((((__const uint32_t *) (a))[0] == 0) \
- && (((__const uint32_t *) (a))[1] == 0) \
- && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
-
-#define IN6_IS_ADDR_V4COMPAT(a) \
- ((((__const uint32_t *) (a))[0] == 0) \
- && (((__const uint32_t *) (a))[1] == 0) \
- && (((__const uint32_t *) (a))[2] == 0) \
- && (ntohl (((__const uint32_t *) (a))[3]) > 1))
-
-#define IN6_ARE_ADDR_EQUAL(a,b) \
- ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \
- && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \
- && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
- && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
-
-#define IN6_IS_ADDR_MC_NODELOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) \
- && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
-
-#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) \
- && ((((__const uint8_t *) (a))[1] & 0xf) == 0x2))
-
-#define IN6_IS_ADDR_MC_SITELOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) \
- && ((((__const uint8_t *) (a))[1] & 0xf) == 0x5))
-
-#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) \
- && ((((__const uint8_t *) (a))[1] & 0xf) == 0x8))
-
-#define IN6_IS_ADDR_MC_GLOBAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) \
- && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
-
-#define IN6_ARE_ADDR_MASKED_EQUAL(a,b,m) \
- (((((__const uint32_t *) (a))[0] & (((__const uint32_t *) (m))[0])) == (((__const uint32_t *) (b))[0] & (((__const uint32_t *) (m))[0]))) \
- && ((((__const uint32_t *) (a))[1] & (((__const uint32_t *) (m))[1])) == (((__const uint32_t *) (b))[1] & (((__const uint32_t *) (m))[1]))) \
- && ((((__const uint32_t *) (a))[2] & (((__const uint32_t *) (m))[2])) == (((__const uint32_t *) (b))[2] & (((__const uint32_t *) (m))[2]))) \
- && ((((__const uint32_t *) (a))[3] & (((__const uint32_t *) (m))[3])) == (((__const uint32_t *) (b))[3] & (((__const uint32_t *) (m))[3]))))
-
-#define IN_ARE_ADDR_MASKED_EQUAL(a,b,m) \
- (((((__const uint8_t *) (a))[0] & (((__const uint8_t *) (m))[0])) == (((__const uint8_t *) (b))[0] & (((__const uint8_t *) (m))[0]))) \
- && ((((__const uint8_t *) (a))[1] & (((__const uint8_t *) (m))[1])) == (((__const uint8_t *) (b))[1] & (((__const uint8_t *) (m))[1]))) \
- && ((((__const uint8_t *) (a))[2] & (((__const uint8_t *) (m))[2])) == (((__const uint8_t *) (b))[2] & (((__const uint8_t *) (m))[2]))) \
- && ((((__const uint8_t *) (a))[3] & (((__const uint8_t *) (m))[3])) == (((__const uint8_t *) (b))[3] & (((__const uint8_t *) (m))[3]))))
-
-
-//---------------------------------------------------------------------------
-// Find the IP traffic type (UNICAST, MULTICAST, BROADCAST)
-ip_traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb)
-{
- //---------------------------------------------------------------------------
- ip_traffic_type_t traffic_type = TRAFFIC_IPVX_TYPE_UNKNOWN;
-
- if (skb!=NULL) {
- switch (ntohs(skb->protocol)) {
- case ETH_P_IPV6:
- traffic_type = TRAFFIC_IPV6_TYPE_UNKNOWN;
-#ifdef OAI_DRV_DEBUG_CLASS
- printk("SOURCE ADDR %X:%X:%X:%X:%X:%X:%X:%X",NIP6ADDR(&(ipv6_hdr(skb)->saddr)));
- printk(" DEST ADDR %X:%X:%X:%X:%X:%X:%X:%X\n",NIP6ADDR(&(ipv6_hdr(skb)->daddr)));
-#endif
-
- if (IN6_IS_ADDR_MULTICAST(&ipv6_hdr(skb)->daddr.in6_u.u6_addr32[0])) {
- traffic_type = TRAFFIC_IPV6_TYPE_MULTICAST;
-
- } else {
- traffic_type = TRAFFIC_IPV6_TYPE_UNICAST;
- }
-
- break;
-
-
- case ETH_P_IP:
- traffic_type = TRAFFIC_IPV4_TYPE_UNKNOWN;
-
- //print_TOOL_pk_ipv4((struct iphdr *)skb->network_header);
- if (IN_MULTICAST(htonl(ip_hdr(skb)->daddr))) {
- traffic_type = TRAFFIC_IPV4_TYPE_MULTICAST;
- } else {
- traffic_type = TRAFFIC_IPV4_TYPE_UNICAST;
- }
-
- // TO DO BROADCAST
-
- break;
-
- case ETH_P_ARP:
- traffic_type = TRAFFIC_IPV4_TYPE_BROADCAST;
- break;
-
- default:
- ;
- }
- }
-
- return traffic_type;
-}
-
diff --git a/openair2/NETWORK_DRIVER/LITE/common.c b/openair2/NETWORK_DRIVER/LITE/common.c
deleted file mode 100644
index 2ae6f5279d..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/common.c
+++ /dev/null
@@ -1,451 +0,0 @@
-/*
- * 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
- */
-
-/*! \file common.c
-* \brief implementation of emultor tx and rx
-* \author Navid Nikaein, Lionel GAUTHIER, and Raymomd Knopp
-* \date 2011
-* \version 1.0
-* \company Eurecom
-* \email: navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
-*/
-
-#include "local.h"
-#include "proto_extern.h"
-#ifndef OAI_NW_DRIVER_USE_NETLINK
-#include "rtai_fifos.h"
-#endif
-
-
-#include
-#ifdef OAI_NW_DRIVER_TYPE_ETHERNET
-#include
-#endif
-
-#include
-#include
-
-#define NIPADDR(addr) \
- (uint8_t)(addr & 0x000000FF), \
- (uint8_t)((addr & 0x0000FF00) >> 8), \
- (uint8_t)((addr & 0x00FF0000) >> 16), \
- (uint8_t)((addr & 0xFF000000) >> 24)
-
-#define NIP6ADDR(addr) \
- ntohs((addr)->s6_addr16[0]), \
- ntohs((addr)->s6_addr16[1]), \
- ntohs((addr)->s6_addr16[2]), \
- ntohs((addr)->s6_addr16[3]), \
- ntohs((addr)->s6_addr16[4]), \
- ntohs((addr)->s6_addr16[5]), \
- ntohs((addr)->s6_addr16[6]), \
- ntohs((addr)->s6_addr16[7])
-
-
-//#define OAI_DRV_DEBUG_SEND
-//#define OAI_DRV_DEBUG_RECEIVE
-void oai_nw_drv_common_class_wireless2ip(uint16_t dlen,
- void *pdcp_sdu,
- int inst,
- OaiNwDrvRadioBearerId_t rb_id)
-{
-
- //---------------------------------------------------------------------------
- struct sk_buff *skb;
- struct ipversion *ipv;
- struct oai_nw_drv_priv *gpriv=netdev_priv(oai_nw_drv_dev[inst]);
- unsigned int hard_header_len = 0;
- uint16_t *p_ether_type;
- uint16_t ether_type;
-#ifdef OAI_DRV_DEBUG_RECEIVE
- int i;
- unsigned char *addr;
-#endif
- unsigned char protocol;
- struct iphdr *network_header;
-
-#ifdef NAS_ADDRESS_FIX
- uint32_t odaddr,osaddr;
- unsigned char *addr,*daddr,*saddr,*ifaddr;
- uint16_t *cksum,check;
-#endif // NAS_ADDRESS_FIX
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] begin RB %d Inst %d Length %d bytes\n",__FUNCTION__, rb_id,inst,dlen);
-#endif
-
- skb = dev_alloc_skb( dlen + 2 );
-
- if(!skb) {
- printk("[OAI_IP_DRV][%s] low on memory\n",__FUNCTION__);
- ++gpriv->stats.rx_dropped;
- return;
- }
-
- skb_reserve(skb,2);
- memcpy(skb_put(skb, dlen), pdcp_sdu,dlen);
-
- skb->dev = oai_nw_drv_dev[inst];
- hard_header_len = oai_nw_drv_dev[inst]->hard_header_len;
-
- skb_set_mac_header(skb, 0);
- skb_set_network_header(skb, hard_header_len);
- skb->mark = rb_id;
- skb->pkt_type = PACKET_HOST;
-
-
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] Receiving packet @%p of size %d from PDCP \n",__FUNCTION__, skb->data, skb->len);
-
- for (i=0; ilen; i++)
- printk("%2x ",((unsigned char *)(skb->data))[i]);
-
- printk("\n");
-#endif
-
-
-
- // LG TEST skb->ip_summed = CHECKSUM_NONE;
- skb->ip_summed = CHECKSUM_UNNECESSARY;
-
-
- ipv = (struct ipversion *)skb_network_header(skb);
-
- switch (ipv->version) {
-
- case 6:
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] receive IPv6 message\n",__FUNCTION__);
-#endif
- skb_set_network_header(skb, hard_header_len);
-
- //skb->network_header = &skb->data[hard_header_len];
- if (hard_header_len == 0) {
- skb->protocol = htons(ETH_P_IPV6);
- } else {
-#ifdef OAI_NW_DRIVER_TYPE_ETHERNET
- skb->protocol = eth_type_trans(skb, oai_nw_drv_dev[inst]);
-#else
-#endif
- }
-
- //printk("Writing packet with protocol %x\n",ntohs(skb->protocol));
- break;
-
- case 4:
-#ifdef NAS_ADDRESS_FIX
- // Make the third byte of both the source and destination equal to the fourth of the destination
- daddr = (unsigned char *)&((struct iphdr *)&skb->data[hard_header_len])->daddr;
- odaddr = ((struct iphdr *)skb->data)->daddr;
- //sn = addr[3];
- saddr = (unsigned char *)&((struct iphdr *)&skb->data[hard_header_len])->saddr;
- osaddr = ((struct iphdr *)&skb->data[hard_header_len])->saddr;
-
- if (daddr[0] == saddr[0]) {// same network
- daddr[2] = daddr[3]; // set third byte of destination to that of local machine so that local IP stack accepts the packet
- saddr[2] = daddr[3]; // set third byte of source to that of local machine so that local IP stack accepts the packet
- } else { // get the 3rd byte from device address in net_device structure
- ifaddr = (unsigned char *)(&(((struct in_device *)((oai_nw_drv_dev[inst])->ip_ptr))->ifa_list->ifa_local));
-
- if (saddr[0] == ifaddr[0]) { // source is in same network as local machine
- daddr[0] += saddr[3]; // fix address of remote destination to undo change at source
- saddr[2] = ifaddr[2]; // set third byte to that of local machine so that local IP stack accepts the packet
- } else { // source is remote machine from outside network
- saddr[0] -= daddr[3]; // fix address of remote source to be understood by destination
- daddr[2] = daddr[3]; // fix 3rd byte of local address to be understood by IP stack of
- // destination
- }
- }
-
-#endif //NAS_ADDRESS_FIX
-#ifdef OAI_DRV_DEBUG_RECEIVE
- //printk("NAS_TOOL_RECEIVE: receive IPv4 message\n");
- addr = (unsigned char *)&((struct iphdr *)&skb->data[hard_header_len])->saddr;
-
- if (addr) {
- //addr[2]^=0x01;
- printk("[OAI_IP_DRV][%s] Source %d.%d.%d.%d\n",__FUNCTION__, addr[0],addr[1],addr[2],addr[3]);
- }
-
- addr = (unsigned char *)&((struct iphdr *)&skb->data[hard_header_len])->daddr;
-
- if (addr) {
- //addr[2]^=0x01;
- printk("[OAI_IP_DRV][%s] Dest %d.%d.%d.%d\n",__FUNCTION__, addr[0],addr[1],addr[2],addr[3]);
- }
-
- printk("[OAI_IP_DRV][%s] protocol %d\n",__FUNCTION__, ((struct iphdr *)&skb->data[hard_header_len])->protocol);
-#endif
-
- skb_set_network_header(skb, hard_header_len);
- //skb->network_header = &skb->data[hard_header_len];
- network_header = (struct iphdr *)skb_network_header(skb);
- protocol = network_header->protocol;
-
-#ifdef OAI_DRV_DEBUG_RECEIVE
-
- switch (protocol) {
- case IPPROTO_IP:
- printk("[OAI_IP_DRV][%s] Received Raw IPv4 packet\n",__FUNCTION__);
- break;
-
- case IPPROTO_IPV6:
- printk("[OAI_IP_DRV][%s] Received Raw IPv6 packet\n",__FUNCTION__);
- break;
-
- case IPPROTO_ICMP:
- printk("[OAI_IP_DRV][%s] Received Raw ICMP packet\n",__FUNCTION__);
- break;
-
- case IPPROTO_TCP:
- printk("[OAI_IP_DRV][%s] Received TCP packet\n",__FUNCTION__);
- break;
-
- case IPPROTO_UDP:
- printk("[OAI_IP_DRV][%s] Received UDP packet\n",__FUNCTION__);
- break;
-
- default:
- break;
- }
-
-#endif
-
-#ifdef NAS_ADDRESS_FIX
- network_header->check = 0;
- network_header->check = ip_fast_csum((unsigned char *) network_header, network_header->ihl);
- //printk("[OAI_IP_DRV][COMMON][RECEIVE] IP Fast Checksum %x \n", network_header->check);
-
- switch(protocol) {
- case IPPROTO_TCP:
-
- cksum = (uint16_t*)&(((struct tcphdr*)((network_header + (network_header->ihl<<2))))->check);
- check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, 0,0, ~(*cksum));
- //check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
- //check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, dlen, IPPROTO_TCP, ~(*cksum));
-
- *cksum = csum_tcpudp_magic(~osaddr, ~odaddr, 0, 0, ~check);
- //*cksum = csum_tcpudp_magic(~osaddr, ~odaddr, dlen, IPPROTO_TCP, ~check);
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] Inst %d TCP packet calculated CS %x, CS = %x (before), SA (%x)%x, DA (%x)%x\n",__FUNCTION__,
- inst,
- network_header->check,
- *cksum,
- osaddr,
- ((struct iphdr *)skb->data)->saddr,
- odaddr,
- ((struct iphdr *)skb->data)->daddr);
-
- printk("[OAI_IP_DRV][%s] Inst %d TCP packet NEW CS %x\n",__FUNCTION__,
- inst,
- *cksum);
-#endif
- break;
-
- case IPPROTO_UDP:
- cksum = (uint16_t*)&(((struct udphdr*)((network_header + (network_header->ihl<<2))))->check);
- check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, 0,0, ~(*cksum));
- // check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, udp_hdr(skb)->len, IPPROTO_UDP, ~(*cksum));
- //check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, dlen, IPPROTO_UDP, ~(*cksum));
-
- *cksum= csum_tcpudp_magic(~osaddr, ~odaddr,0,0, ~check);
- //*cksum= csum_tcpudp_magic(~osaddr, ~odaddr,udp_hdr(skb)->len, IPPROTO_UDP, ~check);
- //*cksum= csum_tcpudp_magic(~osaddr, ~odaddr,dlen, IPPROTO_UDP, ~check);
-
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] Inst %d UDP packet CS = %x (before), SA (%x)%x, DA (%x)%x\n",__FUNCTION__,
- inst,*cksum,osaddr,((struct iphdr *)&skb->data[hard_header_len])->saddr,odaddr,((struct iphdr *)&skb->data[hard_header_len])->daddr);
-
- printk("[OAI_IP_DRV][%s] Inst %d UDP packet NEW CS %x\n",__FUNCTION__,inst,*cksum);
-#endif
- //if ((check = *cksum) != 0) {
- // src, dst, len, proto, sum
- // }
- break;
-
- default:
- break;
- }
-
-#endif //NAS_ADDRESS_FIX
-
- if (hard_header_len == 0) {
- skb->protocol = htons(ETH_P_IP);
- } else {
-#ifdef OAI_NW_DRIVER_TYPE_ETHERNET
- skb->protocol = eth_type_trans(skb, oai_nw_drv_dev[inst]);
-#else
-#endif
- }
-
- //printk("[OAI_IP_DRV][COMMON] Writing packet with protocol %x\n",ntohs(skb->protocol));
- break;
-
- default:
- // fill skb->pkt_type, skb->dev
-
- skb->protocol = eth_type_trans(skb, oai_nw_drv_dev[inst]);
- // minus 1(short) instead of 2(bytes) because uint16_t*
- p_ether_type = (uint16_t *)(skb_network_header(skb)-2);
- ether_type = ntohs(*p_ether_type);
-
- switch (ether_type) {
- case ETH_P_ARP:
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] ether_type = ETH_P_ARP\n",__FUNCTION__);
-#endif
- //skb->pkt_type = PACKET_HOST;
- skb->protocol = htons(ETH_P_ARP);
- break;
-
- default:
- ;
- }
-
- printk("[OAI_IP_DRV][%s] begin RB %d Inst %d Length %d bytes\n",__FUNCTION__,rb_id,inst,dlen);
- printk("[OAI_IP_DRV][%s] Inst %d: receive unknown message (version=%d)\n",__FUNCTION__,inst,ipv->version);
- }
-
- ++gpriv->stats.rx_packets;
- gpriv->stats.rx_bytes += dlen;
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] sending packet of size %d to kernel\n",__FUNCTION__,skb->len);
-
- for (i=0; ilen; i++)
- printk("%2x ",((unsigned char *)(skb->data))[i]);
-
- printk("\n");
-#endif //OAI_DRV_DEBUG_RECEIVE
- netif_rx_ni(skb);
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] end\n",__FUNCTION__);
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Delete the data
-void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, int inst)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_priv *priv=netdev_priv(oai_nw_drv_dev[inst]);
- ++priv->stats.tx_dropped;
-}
-
-//---------------------------------------------------------------------------
-// Request the transfer of data (QoS SAP)
-void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst)
-{
- //---------------------------------------------------------------------------
- struct pdcp_data_req_header_s pdcph;
- struct oai_nw_drv_priv *priv=netdev_priv(oai_nw_drv_dev[inst]);
-#ifdef LOOPBACK_TEST
- int i;
-#endif
-#ifdef OAI_DRV_DEBUG_SEND
- int j;
-#endif
- unsigned int bytes_wrote;
- // Start debug information
-#ifdef OAI_DRV_DEBUG_SEND
- printk("[OAI_IP_DRV][%s] inst %d begin \n",__FUNCTION__,inst);
-#endif
-
- if (skb==NULL) {
-#ifdef OAI_DRV_DEBUG_SEND
- printk("[OAI_IP_DRV][%s] input parameter skb is NULL \n",__FUNCTION__);
-#endif
- return;
- }
-
- pdcph.data_size = skb->len;
- pdcph.rb_id = skb->mark;
- pdcph.inst = inst;
- pdcph.traffic_type = oai_nw_drv_find_traffic_type(skb);
-
-
- bytes_wrote = oai_nw_drv_netlink_send((char *)&pdcph,OAI_NW_DRV_PDCPH_SIZE);
-#ifdef OAI_DRV_DEBUG_SEND
- printk("[OAI_IP_DRV][%s] Wrote %d bytes (header for %d byte skb) to PDCP RB %d via netlink\n",__FUNCTION__,
- bytes_wrote,skb->len, pdcph.rb_id);
-#endif
-
-
- if (bytes_wrote != OAI_NW_DRV_PDCPH_SIZE) {
- printk("[OAI_IP_DRV][%s] problem while writing PDCP's header (bytes wrote = %d to fifo %d)\n",__FUNCTION__,bytes_wrote,IP2PDCP_FIFO);
- printk("rb_id %u, Wrote %u, Header Size %lu \n", pdcph.rb_id , bytes_wrote, OAI_NW_DRV_PDCPH_SIZE);
- priv->stats.tx_dropped ++;
- return;
- }
-
- bytes_wrote += oai_nw_drv_netlink_send((char *)skb->data,skb->len);
-
-
- if (bytes_wrote != skb->len+OAI_NW_DRV_PDCPH_SIZE) {
- printk("[OAI_IP_DRV][%s] Inst %d, RB_ID %u: problem while writing PDCP's data, bytes_wrote = %u, Data_len %u, PDCPH_SIZE %lu\n",
- __FUNCTION__,
- inst,
- pdcph.rb_id,
- bytes_wrote,
- skb->len,
- OAI_NW_DRV_PDCPH_SIZE); // congestion
-
- priv->stats.tx_dropped ++;
- return;
- }
-
-#ifdef OAI_DRV_DEBUG_SEND
- printk("[OAI_IP_DRV][%s] Sending packet of size %d to PDCP traffic type %d\n",__FUNCTION__,skb->len, pdcph.traffic_type);
-
- for (j=0; jlen; j++)
- printk("%2x ",((unsigned char *)(skb->data))[j]);
-
- printk("\n");
-#endif
-
- priv->stats.tx_bytes += skb->len;
- priv->stats.tx_packets ++;
-#ifdef OAI_DRV_DEBUG_SEND
- printk("[OAI_IP_DRV][%s] end \n",__FUNCTION__);
-#endif
-}
-
-
-//---------------------------------------------------------------------------
-void oai_nw_drv_common_wireless2ip(struct nlmsghdr *nlh)
-{
- //---------------------------------------------------------------------------
-
- struct pdcp_data_ind_header_s *pdcph = (struct pdcp_data_ind_header_s *)NLMSG_DATA(nlh);
- struct oai_nw_drv_priv *priv;
-
- priv = netdev_priv(oai_nw_drv_dev[pdcph->inst]);
-
-#ifdef OAI_DRV_DEBUG_RECEIVE
- printk("[OAI_IP_DRV][%s] QOS receive from PDCP, size %d, rab %d, inst %d\n",__FUNCTION__,
- pdcph->data_size,pdcph->rb_id,pdcph->inst);
-#endif //OAI_DRV_DEBUG_RECEIVE
-
- oai_nw_drv_common_class_wireless2ip(pdcph->data_size,
- (unsigned char *)NLMSG_DATA(nlh) + OAI_NW_DRV_PDCPH_SIZE,
- pdcph->inst,
- pdcph->rb_id);
-}
-
-
diff --git a/openair2/NETWORK_DRIVER/LITE/constant.h b/openair2/NETWORK_DRIVER/LITE/constant.h
deleted file mode 100644
index efeba0b86d..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/constant.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * 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
- */
-
-#ifndef _OAI_NW_DRV_CST
-#define _OAI_NW_DRV_CST
-
-#define MAX_MEASURE_NB 5
-#define OAI_NW_DRV_MAX_LENGTH 180
-
-//Debug flags
-//#define OAI_NW_DRV_DEBUG_DC
-#define OAI_NW_DRV_DEBUG_SEND
-#define OAI_NW_DRV_DEBUG_RECEIVE
-//#define OAI_NW_DRV_DEBUG_CLASS
-//#define OAI_NW_DRV_DEBUG_GC
-//#define OAI_NW_DRV_DEBUG_DC_MEASURE
-//#define OAI_NW_DRV_DEBUG_TIMER
-//#define OAI_NW_DRV_DEBUG_DEVICE
-//#define OAI_NW_DRV_DEBUG_INTERRUPT
-//#define OAI_NW_DRV_DEBUG_TOOL
-
-// Other flags
-#define DEMO_3GSM
-
-// General Constants
-#define OAI_NW_DRV_MTU 1500
-#define OAI_NW_DRV_TX_QUEUE_LEN 100
-#define OAI_NW_DRV_ADDR_LEN 8
-#define OAI_NW_DRV_INET6_ADDRSTRLEN 46
-#define OAI_NW_DRV_INET_ADDRSTRLEN 16
-
-#define OAI_NW_DRV_RESET_RX_FLAGS 0
-
-#define OAI_NW_DRV_CX_MAX 32 //Identical to RRC constant
-//#define OAI_NW_DRV_CX_MULTICAST_ALLNODE 2
-
-#define OAI_NW_DRV_RETRY_LIMIT_DEFAULT 5
-
-#define OAI_NW_DRV_MESSAGE_MAXLEN 5004
-
-#define OAI_NW_DRV_SIG_SRB3 3
-#define OAI_NW_DRV_SIG_SRB4 3 // not used yet
-
-//peer-to-peer messages between NAS entities
-#define OAI_NW_DRV_CMD_OPEN_RB 1
-
-//#define OAI_NW_DRV_IID1_CONTROL 0x0
-//#define OAI_NW_DRV_IID2_CONTROL __constant_htonl(0xffffffff)
-
-//#define OAI_NW_DRV_STATE_IDLE 0
-//#define OAI_NW_DRV_STATE_CONNECTED 1
-//#define OAI_NW_DRV_STATE_ESTABLISHMENT_REQUEST 2
-//#define OAI_NW_DRV_STATE_ESTABLISHMENT_FAILURE 3
-//#define OAI_NW_DRV_STATE_RELEASE_FAILURE 4
-#define OAI_NW_DRV_CX_RELEASE_UNDEF_CAUSE 1
-
-// MT+RG NAS States
-#define OAI_NW_DRV_IDLE 0x01
-// Connection
-#define OAI_NW_DRV_CX_FACH 0x06
-#define OAI_NW_DRV_CX_DCH 0x0A
-#define OAI_NW_DRV_CX_RECEIVED 0x10
-#define OAI_NW_DRV_CX_CONNECTING 0x04
-#define OAI_NW_DRV_CX_RELEASING 0x08
-#define OAI_NW_DRV_CX_CONNECTING_FAILURE 0x14
-#define OAI_NW_DRV_CX_RELEASING_FAILURE 0x18
-// Radio Bearers
-#define OAI_NW_DRV_RB_ESTABLISHING 0x24
-#define OAI_NW_DRV_RB_RELEASING 0x28
-#define OAI_NW_DRV_RB_DCH 0x2A
-
-
-#define OAI_NW_DRV_TIMER_ESTABLISHMENT_DEFAULT 12
-#define OAI_NW_DRV_TIMER_RELEASE_DEFAULT 2
-#define OAI_NW_DRV_TIMER_IDLE UINT_MAX
-#define OAI_NW_DRV_TIMER_TICK HZ
-
-#define OAI_NW_DRV_PDCPH_SIZE sizeof(struct pdcp_data_req_header_s)
-#define OAI_NW_DRV_IPV4_SIZE 20
-#define OAI_NW_DRV_IPV6_SIZE 40
-
-#define OAI_NW_DRV_DIRECTION_SEND 0
-#define OAI_NW_DRV_DIRECTION_RECEIVE 1
-#define OAI_NW_DRV_DIRECTION_FORWARD 2
-
-// function number
-#define OAI_NW_DRV_FCT_DEL_SEND 1
-#define OAI_NW_DRV_FCT_QOS_SEND 2
-#define OAI_NW_DRV_FCT_DC_SEND 3
-#define OAI_NW_DRV_FCT_CTL_SEND 4
-
-// type of IOCTL command
-#define OAI_NW_DRV_IOCTL_RRM 0x89F0
-
-// Error cause
-#define OAI_NW_DRV_ERROR_ALREADYEXIST 1
-#define OAI_NW_DRV_ERROR_NOMEMORY 3
-#define OAI_NW_DRV_ERROR_NOTMT 9
-#define OAI_NW_DRV_ERROR_NOTRG 10
-#define OAI_NW_DRV_ERROR_NOTIDLE 11
-#define OAI_NW_DRV_ERROR_NOTCONNECTED 12
-#define OAI_NW_DRV_ERROR_NORB 14
-#define OAI_NW_DRV_ERROR_NOTCORRECTVALUE 32
-#define OAI_NW_DRV_ERROR_NOTCORRECTLCR 33
-#define OAI_NW_DRV_ERROR_NOTCORRECTDIR 34
-#define OAI_NW_DRV_ERROR_NOTCORRECTDSCP 35
-#define OAI_NW_DRV_ERROR_NOTCORRECTVERSION 36
-#define OAI_NW_DRV_ERROR_NOTCORRECTRABI 37
-
-
-/**********************************************************/
-/* Constants related with IP protocols */
-/**********************************************************/
-
-//#define OAI_NW_DRV_PORT_CONTROL __constant_htons(0xc45)
-//#define OAI_NW_DRV_PORT_AUTHENTICATION __constant_htons(1811)
-
-#define OAI_NW_DRV_TRAFFICCLASS_MASK __constant_htonl(0x0fc00000)
-
-// Network control codepoint 111000 + IP version 6
-#define OAI_NW_DRV_FLOWINFO_NCONTROL __constant_htonl(0x6e000000)
-// network control codepoint 111000
-#define OAI_NW_DRV_DSCP_NCONTROL 56 //0x38
-// default codepoint 1000000
-#define OAI_NW_DRV_DSCP_DEFAULT 64
-#define OAI_NW_DRV_DSCP_MAX 193
-
-#define OAI_NW_DRV_PROTOCOL_DEFAULT 0
-#define OAI_NW_DRV_PROTOCOL_TCP IPPROTO_TCP
-#define OAI_NW_DRV_PROTOCOL_UDP IPPROTO_UDP
-#define OAI_NW_DRV_PROTOCOL_ICMP4 IPPROTO_ICMP
-#define OAI_NW_DRV_PROTOCOL_ICMP6 IPPROTO_ICMPV6
-//#warning "OAI_NW_DRV_PROTOCOL_ARP value 200 may collide with new defined values in kernel"
-#define OAI_NW_DRV_PROTOCOL_ARP 200
-
-#define OAI_NW_DRV_PORT_DEFAULT __constant_htons(65535)
-#define OAI_NW_DRV_PORT_HTTP __constant_htons(80)
-
-#define OAI_NW_DRV_IP_VERSION_ALL 0
-#define OAI_NW_DRV_IP_VERSION_4 4
-#define OAI_NW_DRV_IP_VERSION_6 6
-
-#define OAI_NW_DRV_DEFAULT_IPV4_ADDR 0
-#define OAI_NW_DRV_DEFAULT_IPV6_ADDR0 0
-#define OAI_NW_DRV_DEFAULT_IPV6_ADDR1 0
-#define OAI_NW_DRV_DEFAULT_IPV6_ADDR2 0
-#define OAI_NW_DRV_DEFAULT_IPV6_ADDR3 0
-
-
-#define OAI_NW_DRV_MPLS_VERSION_CODE 99
-
-#define OAI_NW_DRV_NB_INSTANCES_MAX 8
-
-
-#endif
-
diff --git a/openair2/NETWORK_DRIVER/LITE/device.c b/openair2/NETWORK_DRIVER/LITE/device.c
deleted file mode 100644
index 59340784c1..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/device.c
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * 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
- */
-
-/*! \file device.c
-* \brief Networking Device Driver for OpenAirInterface Ethernet
-* \author navid.nikaein, Lionel Gauthier, raymond.knopp,
-* \company Eurecom
-* \email:navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr, raymond.knopp@eurecom.fr
-
-*/
-/*******************************************************************************/
-
-#include "constant.h"
-#include "local.h"
-#include "proto_extern.h"
-
-//#include
-#include
-#include
-#include
-#include
-#include
-#ifdef OAI_NW_DRIVER_TYPE_ETHERNET
-#include
-#endif
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#ifdef OAI_NW_DRIVER_TYPE_ETHERNET
-#include
-#endif
-
-
-struct net_device *oai_nw_drv_dev[OAI_NW_DRV_NB_INSTANCES_MAX];
-
-#ifdef OAI_NW_DRIVER_USE_NETLINK
-extern void oai_nw_drv_netlink_release(void);
-extern int oai_nw_drv_netlink_init(void);
-#endif
-
-uint8_t NULL_IMEI[14]= {0x05, 0x04, 0x03, 0x01, 0x02 ,0x00, 0x00, 0x00, 0x05, 0x04, 0x03 ,0x00, 0x01, 0x08};
-
-static unsigned char oai_nw_drv_IMEI[14];
-static int m_arg=0;
-static unsigned int oai_nw_drv_is_clusterhead=0;
-//---------------------------------------------------------------------------
-int oai_nw_drv_find_inst(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- int i;
-
- for (i=0; ilock = SPIN_LOCK_UNLOCKED;
-
-#ifdef OAI_DRV_DEBUG_INTERRUPT
- printk("INTERRUPT - begin\n");
-#endif
- // spin_lock_irqsave(&priv->lock,flags);
- cxi=0;
- // mesh_GC_receive();
- // mesh_DC_receive(naspriv->cx+cxi);
-#ifndef OAI_NW_DRIVER_USE_NETLINK
- oai_nw_drv_common_wireless2ip();
-#endif
- // spin_unlock_irqrestore(&priv->lock,flags);
-#ifdef OAI_DRV_DEBUG_INTERRUPT
- printk("INTERRUPT: end\n");
-#endif
- // return 0;
-}
-#endif //NETLINK
-//---------------------------------------------------------------------------
-void oai_nw_drv_timer(unsigned long data)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_priv *priv=(struct oai_nw_drv_priv *)data;
- spin_lock(&priv->lock);
- (priv->timer).function=oai_nw_drv_timer;
- (priv->timer).expires=jiffies+OAI_NW_DRV_TIMER_TICK;
- (priv->timer).data=data;
- add_timer(&priv->timer);
- spin_unlock(&priv->lock);
- return;
- // add_timer(&gpriv->timer);
- // spin_unlock(&gpriv->lock);
-}
-
-//---------------------------------------------------------------------------
-// Called by ifconfig when the device is activated by ifconfig
-int oai_nw_drv_open(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_priv *priv=netdev_priv(dev);
-
- // Address has already been set at init
-#ifndef OAI_NW_DRIVER_USE_NETLINK
-
- if (pdcp_2_oai_nw_drv_irq==-EBUSY) {
- printk("[OAI_IP_DRV][%s] : irq failure\n", __FUNCTION__);
- return -EBUSY;
- }
-
-#endif //OAI_NW_DRIVER_USE_NETLINK
-
- if(!netif_queue_stopped(dev))
- netif_start_queue(dev);
- else
- netif_wake_queue(dev);
-
- init_timer(&priv->timer);
- (priv->timer).expires = jiffies+OAI_NW_DRV_TIMER_TICK;
- (priv->timer).data = (unsigned long)priv;
- (priv->timer).function = oai_nw_drv_timer;
- //add_timer(&priv->timer);
-
- printk("[OAI_IP_DRV][%s] name = %s\n", __FUNCTION__, dev->name);
- return 0;
-}
-
-//---------------------------------------------------------------------------
-// Called by ifconfig when the device is desactivated
-int oai_nw_drv_stop(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_priv *priv = netdev_priv(dev);
-
- printk("[OAI_IP_DRV][%s] Begin\n", __FUNCTION__);
- del_timer(&(priv->timer));
- netif_stop_queue(dev);
- // MOD_DEC_USE_COUNT;
- printk("[OAI_IP_DRV][%s] End\n", __FUNCTION__);
- return 0;
-}
-
-//---------------------------------------------------------------------------
-void oai_nw_drv_teardown(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_priv *priv;
- int inst;
-
- printk("[OAI_IP_DRV][%s] Begin\n", __FUNCTION__);
-
- if (dev) {
- priv = netdev_priv(dev);
- inst = oai_nw_drv_find_inst(dev);
-
- if ((inst<0) || (inst>=OAI_NW_DRV_NB_INSTANCES_MAX)) {
- printk("[OAI_IP_DRV][%s] ERROR, couldn't find instance\n", __FUNCTION__);
- return;
- }
-
- /*oai_nw_drv_class_flush_recv_classifier(priv);
-
- for (cxi=0;cxicx+cxi);
- oai_nw_drv_class_flush_send_classifier(priv->cx+cxi);
- }*/
- printk("[OAI_IP_DRV][%s] End\n", __FUNCTION__);
- } // check dev
- else {
- printk("[OAI_IP_DRV][%s] Device is null\n", __FUNCTION__);
- }
-}
-//---------------------------------------------------------------------------
-int oai_nw_drv_set_config(struct net_device *dev, struct ifmap *map)
-{
- //---------------------------------------------------------------------------
- printk("[OAI_IP_DRV][%s] Begin\n", __FUNCTION__);
-
- if (dev->flags & IFF_UP)
- return -EBUSY;
-
- if (map->base_addr != dev->base_addr) {
- printk(KERN_WARNING "[OAI_IP_DRV][%s] Can't change I/O address\n", __FUNCTION__);
- return -EOPNOTSUPP;
- }
-
- if (map->irq != dev->irq)
- dev->irq = map->irq;
-
- printk("[OAI_IP_DRV][%s] End\n", __FUNCTION__);
- return 0;
-}
-
-//---------------------------------------------------------------------------
-//
-int oai_nw_drv_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- int inst;
-
- if (dev) {
- inst = oai_nw_drv_find_inst(dev);
- } else {
- printk("[OAI_IP_DRV][%s] ERROR, device is null\n", __FUNCTION__);
- return -1;
- }
-
- if ((inst>=0) && (inst= KERNEL_VERSION(4,7,0)
- netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
-#ifdef OAI_DRV_DEBUG_DEVICE
- printk("[OAI_IP_DRV][%s] step 1\n", __FUNCTION__);
-#endif
- oai_nw_drv_common_ip2wireless(skb,inst);
-#ifdef OAI_DRV_DEBUG_DEVICE
- printk("[OAI_IP_DRV][%s] step 2\n", __FUNCTION__);
-#endif
- dev_kfree_skb(skb);
-#ifdef OAI_DRV_DEBUG_DEVICE
- printk("[OAI_IP_DRV][%s] step 3\n", __FUNCTION__);
-#endif
- netif_wake_queue(dev);
-#ifdef OAI_DRV_DEBUG_DEVICE
- printk("[OAI_IP_DRV][%s] end\n", __FUNCTION__);
-#endif
- } else {
- printk("[OAI_IP_DRV][%s] ERROR, couldn't find instance\n", __FUNCTION__);
- return(-1);
- }
-
- return 0;
-}
-
-//---------------------------------------------------------------------------
-struct net_device_stats *oai_nw_drv_get_stats(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- // return &((struct oai_nw_drv_priv *)dev->priv)->stats;
- struct oai_nw_drv_priv *priv = netdev_priv(dev);
- //printk("[OAI_IP_DRV][%s]\n", __FUNCTION__);
- return &priv->stats;
-}
-//---------------------------------------------------------------------------
-int oai_nw_drv_set_mac_address(struct net_device *dev, void *mac)
-{
- //---------------------------------------------------------------------------
- struct sockaddr *addr = mac;
- printk("[OAI_IP_DRV][%s] CHANGE MAC ADDRESS\n", __FUNCTION__);
- memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
- return 0;
-}
-//---------------------------------------------------------------------------
-int oai_nw_drv_change_mtu(struct net_device *dev, int mtu)
-{
- //---------------------------------------------------------------------------
- printk("[OAI_IP_DRV][%s] CHANGE MTU %d bytes\n", __FUNCTION__, mtu);
-
- if ((mtu<50) || (mtu>1500))
- return -EINVAL;
-
- dev->mtu = mtu;
- return 0;
-}
-//---------------------------------------------------------------------------
-void oai_nw_drv_change_rx_flags(struct net_device *dev, int flags)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_priv *priv = netdev_priv(dev);
- printk("[OAI_IP_DRV][%s] CHANGE RX FLAGS %08X\n", __FUNCTION__, flags);
- priv->rx_flags ^= flags;
-}
-
-//---------------------------------------------------------------------------
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
-void oai_nw_drv_tx_timeout(struct net_device *dev, unsigned int txqueue)
-#else
-void oai_nw_drv_tx_timeout(struct net_device *dev)
-#endif
-{
- //---------------------------------------------------------------------------
- // Transmitter timeout, serious problems.
- struct oai_nw_drv_priv *priv = netdev_priv(dev);
-
- printk("[OAI_IP_DRV][%s] begin\n", __FUNCTION__);
- // (struct oai_nw_drv_priv *)(dev->priv)->stats.tx_errors++;
- (priv->stats).tx_errors++;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
- netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
- netif_wake_queue(dev);
- printk("[OAI_IP_DRV][%s] transmit timed out %s\n", __FUNCTION__,dev->name);
-}
-
-static const struct net_device_ops nasmesh_netdev_ops = {
- .ndo_open = oai_nw_drv_open,
- .ndo_stop = oai_nw_drv_stop,
- .ndo_start_xmit = oai_nw_drv_hard_start_xmit,
- .ndo_validate_addr = NULL,
- .ndo_get_stats = oai_nw_drv_get_stats,
- .ndo_set_mac_address = oai_nw_drv_set_mac_address,
- .ndo_set_config = oai_nw_drv_set_config,
- .ndo_do_ioctl = oai_nw_drv_CTL_ioctl,
- .ndo_change_mtu = oai_nw_drv_change_mtu,
- .ndo_tx_timeout = oai_nw_drv_tx_timeout,
- .ndo_change_rx_flags = oai_nw_drv_change_rx_flags,
-};
-/*.ndo_set_multicast_list = NULL,*/
-
-//---------------------------------------------------------------------------
-// Initialisation of the network device
-void oai_nw_drv_init(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- uint8_t cxi;
- struct oai_nw_drv_priv *priv;
- int index;
-
- if (dev) {
-
- priv = netdev_priv(dev);
-
- memset(priv, 0, sizeof(struct oai_nw_drv_priv));
-
-
-#ifndef OAI_NW_DRIVER_TYPE_ETHERNET
- dev->type = ARPHRD_EURECOM_LTE;
- dev->features = NETIF_F_NO_CSUM;
- dev->hard_header_len = 0;
- dev->addr_len = ETH_ALEN; // 6
- dev->flags = IFF_BROADCAST | IFF_MULTICAST | IFF_NOARP;
- dev->tx_queue_len = NAS_TX_QUEUE_LEN;
- dev->mtu = NAS_MTU;
-#endif
- // Can be one of the following enum defined in include/linux/netdevice.h:
- // enum netdev_state_t {
- // __LINK_STATE_START,
- // __LINK_STATE_PRESENT,
- // __LINK_STATE_NOCARRIER,
- // __LINK_STATE_LINKWATCH_PENDING,
- // __LINK_STATE_DORMANT,
- // };
- set_bit(__LINK_STATE_PRESENT, &dev->state);
-
- //
- dev->netdev_ops = &nasmesh_netdev_ops;
-#ifdef OAI_NW_DRIVER_TYPE_ETHERNET
- printk("[OAI_IP_DRV][%s] Driver type ETHERNET\n", __FUNCTION__);
- // Memo: linux-source-3.2.0/net/ethernet/eth.c:
- //334 void ether_setup(struct net_device *dev)
- //335 {
- //336 dev->header_ops = ð_header_ops;
- //337 dev->type = ARPHRD_ETHER;
- //338 dev->hard_header_len = ETH_HLEN;
- //339 dev->mtu = ETH_DATA_LEN;
- //340 dev->addr_len = ETH_ALEN;
- //341 dev->tx_queue_len = 1000; /* Ethernet wants good queues */
- //342 dev->flags = IFF_BROADCAST|IFF_MULTICAST;
- //343 dev->priv_flags |= IFF_TX_SKB_SHARING;
- //344
- //345 memset(dev->broadcast, 0xFF, ETH_ALEN);
- //346 }
- ether_setup(dev);
-#endif
- //
- // Initialize private structure
- priv->rx_flags = OAI_NW_DRV_RESET_RX_FLAGS;
- priv->sap[OAI_NW_DRV_RAB_INPUT_SAPI] = PDCP2IP_FIFO;//QOS_DEVICE_CONVERSATIONAL_INPUT;
- priv->sap[OAI_NW_DRV_RAB_OUTPUT_SAPI] = IP2PDCP_FIFO;//QOS_DEVICE_STREAMING_INPUT;
-
- // priv->retry_limit=RETRY_LIMIT_DEFAULT;
- // priv->timer_establishment=TIMER_ESTABLISHMENT_DEFAULT;
- // priv->timer_release=TIMER_RELEASE_DEFAULT;
-
- /*for (dscpi=0; dscpirclassifier[dscpi]=NULL;
- }
- priv->nrclassifier=0;*/
- //
- for (cxi=0; cxicx[cxi].sap[NAS_DC_INPUT_SAPI] = RRC_DEVICE_DC_INPUT0;
- // priv->cx[cxi].sap[NAS_DC_OUTPUT_SAPI] = RRC_DEVICE_DC_OUTPUT0;
- priv->cx[cxi].state = OAI_NW_DRV_IDLE;
- priv->cx[cxi].countimer = OAI_NW_DRV_TIMER_IDLE;
- priv->cx[cxi].retry = 0;
- priv->cx[cxi].lcr = cxi;
- /*priv->cx[cxi].rb = NULL;
- priv->cx[cxi].num_rb = 0;
- // initialisation of the classifier
- for (dscpi=0; dscpi<65; ++dscpi) {
- priv->cx[cxi].sclassifier[dscpi] = NULL;
- priv->cx[cxi].fclassifier[dscpi] = NULL;
- }
-
- priv->cx[cxi].nsclassifier=0;
- priv->cx[cxi].nfclassifier=0;
- */
- // initialisation of the IP address
- oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, (uint8_t *)priv->cx[cxi].iid6, dev->addr_len);
- priv->cx[cxi].iid4=0;
- //
- }
-
- spin_lock_init(&priv->lock);
- //this requires kernel patch for OAI driver: typically for RF/hard realtime emu experimentation
-#define ADDRCONF
-#ifdef ADDRCONF
-
-#ifdef OAI_NW_DRIVER_USE_NETLINK
- oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, dev->dev_addr, dev->addr_len);// IMEI to device address (for stateless autoconfiguration address)
-
- oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, (uint8_t *)priv->cx[0].iid6, dev->addr_len);
-#else
- oai_nw_drv_TOOL_imei2iid(oai_nw_drv_IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
- oai_nw_drv_TOOL_imei2iid(oai_nw_drv_IMEI, (uint8_t *)priv->cx[0].iid6);
-#endif
- // this is more appropriate for user space soft realtime emulation
-#else
-
- // LG: strange
- for (index = 0; index < dev->addr_len; index++) {
- dev->dev_addr[index] = 16*oai_nw_drv_IMEI[index]+oai_nw_drv_IMEI[index+1]);
- }
-
- memcpy((uint8_t *)priv->cx[0].iid6,&oai_nw_drv_IMEI[0],dev->addr_len);
-
- printk("INIT: init IMEI to IID\n");
-#endif
- printk("[OAI_IP_DRV][%s] Setting HW addr to : ", __FUNCTION__);
-
- for (index = 0; index < dev->addr_len; index++) {
- printk("%02X", dev->dev_addr[index]);
- }
-
- printk("\n[OAI_IP_DRV][%s] Setting priv->cx to : ", __FUNCTION__);
-
- for (index = 0; index < 8; index++) {
- printk("%02X", ((uint8_t *)(priv->cx[0].iid6))[index]);
- }
-
- printk("\n");
- printk("[OAI_IP_DRV][%s] INIT: end\n", __FUNCTION__);
- return;
- } else {
- printk("[OAI_IP_DRV][%s] ERROR, Device is NULL!!\n", __FUNCTION__);
- return;
- }
-}
-//---------------------------------------------------------------------------
-int init_module (void)
-{
- //---------------------------------------------------------------------------
- int err,inst, index;
- struct oai_nw_drv_priv *priv;
- char devicename[100];
-
-
- // Initialize parameters shared with RRC
- printk("[OAI_IP_DRV][%s] Starting NASMESH, number of IMEI parameters %d, IMEI ", __FUNCTION__, m_arg);
-
- for (index = 0; index < m_arg; index++) {
- printk("%02X", oai_nw_drv_IMEI[index]);
- }
-
- printk("\n");
-
-#ifndef OAI_NW_DRIVER_USE_NETLINK
-
- if (pdcp_2_oai_nw_drv_irq == -EBUSY || pdcp_2_oai_nw_drv_irq == -EINVAL) {
- printk("[OAI_IP_DRV][%s] No interrupt resource available\n", __FUNCTION__);
- return -EBUSY;
- } else
- printk("[OAI_IP_DRV][%s] Interrupt %d\n", __FUNCTION__, pdcp_2_oai_nw_drv_irq);
-
-#endif //NETLINK
-
- for (inst=0; inst 0x0F) {
- oai_nw_drv_IMEI[8] = oai_nw_drv_IMEI[9] >> 4;
- oai_nw_drv_IMEI[9] = oai_nw_drv_IMEI[9] & 0x0F;
- }
- }
-
- // linux/net/core/dev.c line 4767
- err= register_netdev(oai_nw_drv_dev[inst]);
-
- if (err) {
- printk("[OAI_IP_DRV][%s] (inst %d): error %i registering device %s\n", __FUNCTION__, inst,err, oai_nw_drv_dev[inst]->name);
- } else {
- printk("[OAI_IP_DRV][%s] registering device %s, ifindex = %d\n\n", __FUNCTION__,oai_nw_drv_dev[inst]->name, oai_nw_drv_dev[inst]->ifindex);
- }
- }
- }
-
-#ifdef OAI_NW_DRIVER_USE_NETLINK
- printk("[OAI_IP_DRV][%s] NETLINK INIT\n", __FUNCTION__);
-
- if ((err=oai_nw_drv_netlink_init()) == -1)
- printk("[OAI_IP_DRV][%s] NETLINK failed\n", __FUNCTION__);
-
-#endif //NETLINK
-
- return err;
-
-}
-
-//---------------------------------------------------------------------------
-void cleanup_module(void)
-{
- //---------------------------------------------------------------------------
- int inst;
-
- printk("[OAI_IP_DRV][CLEANUP]nasmesh_cleanup_module: begin\n");
-
-#ifndef OAI_NW_DRIVER_USE_NETLINK
-
- if (pdcp_2_oai_nw_drv_irq!=-EBUSY) {
- pdcp_2_oai_nw_drv_irq=0;
- // Start IRQ linux
- //free_irq(priv->irq, NULL);
- // End IRQ linux
- }
-
-#else // NETLINK
-#endif //NETLINK
-
- for (inst=0; inst"DRV_COPYRIGHT
-
-
-module_param_array_named(oai_nw_drv_IMEI,oai_nw_drv_IMEI,byte,&m_arg,0);
-//module_param_array(oai_nw_drv_IMEI,byte,&m_arg,0444);
-MODULE_PARM_DESC(oai_nw_drv_IMEI,"The IMEI Hardware address (64-bit, decimal nibbles)");
-
-//module_param(oai_nw_drv_is_clusterhead,uint,0444);
-module_param_named(oai_nw_drv_is_clusterhead,oai_nw_drv_is_clusterhead,uint,0444);
-MODULE_PARM_DESC(oai_nw_drv_is_clusterhead,"The Clusterhead Indicator");
-
-//MODULE_AUTHOR(DRV_AUTHOR);
-//MODULE_DESCRIPTION(DRV_DESCRIPTION);
-//MODULE_LICENSE("GPL");
-//MODULE_VERSION(DRV_VERSION);
-
diff --git a/openair2/NETWORK_DRIVER/LITE/ioctl.c b/openair2/NETWORK_DRIVER/LITE/ioctl.c
deleted file mode 100644
index 85c213c5ff..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/ioctl.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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 "local.h"
-#include "ioctl.h"
-#include "proto_extern.h"
-
-#include
-#include
-#include
-
-#define NIP6ADDR(addr) \
- ntohs((addr)->s6_addr16[0]), \
- ntohs((addr)->s6_addr16[1]), \
- ntohs((addr)->s6_addr16[2]), \
- ntohs((addr)->s6_addr16[3]), \
- ntohs((addr)->s6_addr16[4]), \
- ntohs((addr)->s6_addr16[5]), \
- ntohs((addr)->s6_addr16[6]), \
- ntohs((addr)->s6_addr16[7])
-
-uint8_t g_msgrep[OAI_NW_DRV_LIST_CLASS_MAX*sizeof(struct oai_nw_drv_msg_class_list_reply)+1];
-
-// Statistic
-//---------------------------------------------------------------------------
-void oai_nw_drv_set_msg_statistic_reply(struct oai_nw_drv_msg_statistic_reply *msgrep,
- struct oai_nw_drv_priv *priv)
-{
- //---------------------------------------------------------------------------
- msgrep->rx_packets=priv->stats.rx_packets;
- msgrep->tx_packets=priv->stats.tx_packets;
- msgrep->rx_bytes=priv->stats.rx_bytes;
- msgrep->tx_bytes=priv->stats.tx_bytes;
- msgrep->rx_errors=priv->stats.rx_errors;
- msgrep->tx_errors=priv->stats.tx_errors;
- msgrep->rx_dropped=priv->stats.rx_dropped;
- msgrep->tx_dropped=priv->stats.tx_dropped;
-}
-
-//---------------------------------------------------------------------------
-int oai_nw_drv_ioCTL_statistic_request(struct oai_nw_drv_ioctl *gifr,
- struct oai_nw_drv_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_msg_statistic_reply msgrep;
- printk("NAS_IOCTL_STATISTIC: stat requested\n");
- oai_nw_drv_set_msg_statistic_reply(&msgrep,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_STATISTIC: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// IMEI
-// Messages for IMEI transfer
-
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// IOCTL command
-//---------------------------------------------------------------------------
-int oai_nw_drv_CTL_ioctl(struct net_device *dev,
- struct ifreq *ifr,
- int cmd)
-{
- //---------------------------------------------------------------------------
- struct oai_nw_drv_ioctl *gifr;
- struct oai_nw_drv_priv *priv=netdev_priv(dev);
-
- int r;
-
- // printk("NAS_CTL_IOCTL: begin ioctl for instance %d\n",find_inst(dev));
-
- switch(cmd) {
- case OAI_NW_DRV_IOCTL_RRM:
- gifr=(struct oai_nw_drv_ioctl *)ifr;
-
- switch(gifr->type) {
- case OAI_NW_DRV_MSG_STATISTIC_REQUEST:
- r=oai_nw_drv_ioCTL_statistic_request(gifr,priv);
- break;
-
-
- default:
- // printk("NAS_IOCTL_RRM: unkwon request type, type=%x\n", gifr->type);
- r=-EFAULT;
- }
-
- break;
-
- default:
- // printk("NAS_CTL_IOCTL: Unknown ioctl command, cmd=%x\n", cmd);
- r=-EFAULT;
- }
-
- // printk("NAS_CTL_IOCTL: end\n");
- return r;
-}
-
-//---------------------------------------------------------------------------
-void oai_nw_drv_CTL_send(struct sk_buff *skb, int inst)
-{
- //---------------------------------------------------------------------------
- printk("NAS_CTL_SEND - void \n");
-}
diff --git a/openair2/NETWORK_DRIVER/LITE/ioctl.h b/openair2/NETWORK_DRIVER/LITE/ioctl.h
deleted file mode 100644
index d5bab2038c..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/ioctl.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * 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
- */
-
-/***************************************************************************
- ioctl.h - description
- -------------------
- copyright : (C) 2002 by Eurecom
- email : michelle.wetterwald@eurecom.fr
- yan.moret@eurecom.fr
- knopp@eurecom.fr
- ***************************************************************************
-
- ***************************************************************************/
-#ifndef OAI_IOCTL_H
-#define OAI_IOCTL_H
-
-#include
-#include
-#include
-#include
-#include
-
-#include "sap.h"
-
-
-//#include
-
-#define OAI_NW_DRV_MSG_MAXLEN 1100/// change???
-
-// type of CTL message
-#define OAI_NW_DRV_MSG_STATISTIC_REQUEST 1
-#define OAI_NW_DRV_MSG_STATISTIC_REPLY 2
-#define OAI_NW_DRV_MSG_ECHO_REQUEST 3
-#define OAI_NW_DRV_MSG_ECHO_REPLY 4
-#define OAI_NW_DRV_MSG_CX_ESTABLISHMENT_REQUEST 5
-#define OAI_NW_DRV_MSG_CX_ESTABLISHMENT_REPLY 6
-#define OAI_NW_DRV_MSG_CX_RELEASE_REQUEST 7
-#define OAI_NW_DRV_MSG_CX_RELEASE_REPLY 8
-#define OAI_NW_DRV_MSG_CX_LIST_REQUEST 9
-#define OAI_NW_DRV_MSG_CX_LIST_REPLY 10
-#define OAI_NW_DRV_MSG_RB_ESTABLISHMENT_REQUEST 11
-#define OAI_NW_DRV_MSG_RB_ESTABLISHMENT_REPLY 12
-#define OAI_NW_DRV_MSG_RB_RELEASE_REQUEST 13
-#define OAI_NW_DRV_MSG_RB_RELEASE_REPLY 14
-#define OAI_NW_DRV_MSG_RB_LIST_REQUEST 15
-#define OAI_NW_DRV_MSG_RB_LIST_REPLY 16
-#define OAI_NW_DRV_MSG_CLASS_ADD_REQUEST 17
-#define OAI_NW_DRV_MSG_CLASS_ADD_REPLY 18
-#define OAI_NW_DRV_MSG_CLASS_DEL_REQUEST 19
-#define OAI_NW_DRV_MSG_CLASS_DEL_REPLY 20
-#define OAI_NW_DRV_MSG_CLASS_LIST_REQUEST 21
-#define OAI_NW_DRV_MSG_CLASS_LIST_REPLY 22
-#define OAI_NW_DRV_MSG_MEAS_REQUEST 23
-#define OAI_NW_DRV_MSG_MEAS_REPLY 24
-#define OAI_NW_DRV_MSG_IMEI_REQUEST 25
-#define OAI_NW_DRV_MSG_IMEI_REPLY 26
-
-// Max number of entry of a message list
-#define OAI_NW_DRV_LIST_CX_MAX 32
-#define OAI_NW_DRV_LIST_RB_MAX 32
-#define OAI_NW_DRV_LIST_CLASS_MAX 32
-
-typedef unsigned short oai_nw_drv_MsgType_t;
-
-struct oai_nw_drv_ioctl {
- char name[IFNAMSIZ];
- oai_nw_drv_MsgType_t type;
- char *msg;
-};
-
-struct oai_nw_drv_msg_statistic_reply {
- unsigned int rx_packets;
- unsigned int tx_packets;
- unsigned int rx_bytes;
- unsigned int tx_bytes;
- unsigned int rx_errors;
- unsigned int tx_errors;
- unsigned int rx_dropped;
- unsigned int tx_dropped;
-};
-
-struct oai_nw_drv_msg_cx_list_reply {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
- unsigned char state;
- OaiNwDrvCellID_t cellid; // cell identification
- unsigned int iid6[2]; // IPv6 interface identification
- unsigned char iid4; // IPv4 interface identification
- unsigned short num_rb;
- unsigned short nsclassifier;
-};
-struct oai_nw_drv_msg_cx_establishment_reply {
- int status;
-};
-struct oai_nw_drv_msg_cx_establishment_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
- OaiNwDrvCellID_t cellid; // Cell identification
-};
-struct oai_nw_drv_msg_cx_release_reply {
- int status;
-};
-struct oai_nw_drv_msg_cx_release_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
-};
-
-struct oai_nw_drv_msg_rb_list_reply {
- OaiNwDrvRadioBearerId_t rab_id;
- OaiNwDrvSapId_t sapi;
- OaiNwDrvQoSTrafficClass_t qos;
- unsigned char state;
-};
-struct oai_nw_drv_msg_rb_list_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
-};
-struct oai_nw_drv_msg_rb_establishment_reply {
- int status;
-};
-struct oai_nw_drv_msg_rb_establishment_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
- OaiNwDrvRadioBearerId_t rab_id;
- OaiNwDrvQoSTrafficClass_t qos;
-};
-
-struct oai_nw_drv_msg_rb_release_reply {
- int status;
-};
-struct oai_nw_drv_msg_rb_release_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
- OaiNwDrvRadioBearerId_t rab_id;
-};
-/*
-struct saddr {
-
- struct in6_addr ipv6;
- unsigned int ipv4;
-};
-
-struct daddr {
-
- struct in6_addr ipv6;
- unsigned int ipv4;
- unsigned int mpls_label;
-};
-*/
-struct oai_nw_drv_msg_class_add_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
- OaiNwDrvRadioBearerId_t rab_id;
- OaiNwDrvRadioBearerId_t rab_id_rx;
- unsigned char dir; // direction (send or receive, forward)
- unsigned char dscp; // codepoint
- unsigned char fct;
- unsigned short classref;
- unsigned char version;
-
- //struct daddr daddr;
- //struct saddr saddr;
-
- unsigned char splen; // prefix length
-
- union {
- struct in6_addr ipv6;
-
- // begin navid
- //in_addr_t ipv4;
- unsigned int ipv4;
- //end navid
-
- unsigned int mpls_label;
- } daddr; // IP destination address
-
- union {
- struct in6_addr ipv6;
-
- // begin navid
- //in_addr_t ipv4;
- unsigned int ipv4;
- //end navid
-
- } saddr; // IP source address
-
-
- unsigned char dplen; // prefix length
-
- unsigned char protocol; //!< transport layer protocol type (ANY,TCP,UDP,ICMPv4,ICMPv6)
- unsigned char protocol_message_type; //!< transport layer protocol message (ROUTER_ADV, ROUTER_SOLL, etc.)
- unsigned short sport; //!< source port
- unsigned short dport; //!< destination port
-};
-
-struct oai_nw_drv_msg_class_add_reply {
- int status;
-};
-struct oai_nw_drv_msg_class_del_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
- unsigned char dir; // direction (send or receive)
- unsigned char dscp; // codepoint
- unsigned short classref;
-};
-struct oai_nw_drv_msg_class_del_reply {
- int status;
-};
-#define oai_nw_drv_msg_class_list_reply oai_nw_drv_msg_class_add_request
-struct oai_nw_drv_msg_class_list_request {
- OaiNwDrvLocalConnectionRef_t lcr; // Local Connection reference
- unsigned char dir;
- unsigned char dscp;
-};
-
-
-// Messages for Measurement transfer - MW 01/04/2005
-typedef unsigned int nioctlProviderId_t;
-typedef unsigned short nioctlSignalLoss_t;
-typedef struct nioctlMeasures {
- OaiNwDrvCellID_t cell_id;
- OaiNwDrvSigLevel_t level;
- nioctlProviderId_t provider_id;
-} nioctlMeasures_t;
-
-struct oai_nw_drv_msg_measure_request {
- OaiNwDrvNumRGsMeas_t num_cells;
- OaiNwDrvCellID_t cellid[OAI_NW_DRV_MAX_MEASURE_NB]; // Cell identification
- unsigned short num_providers;
- nioctlProviderId_t provider_id[OAI_NW_DRV_MAX_MEASURE_NB]; // Provider identification
-};
-struct oai_nw_drv_msg_measure_reply {
- OaiNwDrvNumRGsMeas_t num_cells;
- nioctlMeasures_t measures[OAI_NW_DRV_MAX_MEASURE_NB];
- nioctlSignalLoss_t signal_lost_flag;
-};
-
-// Messages for Measurement transfer - MW 01/04/2005
-typedef unsigned int nioctlL2Id_t[2];
-
-struct oai_nw_drv_msg_l2id_reply {
- nioctlL2Id_t l2id;
-};
-
-
-#endif
diff --git a/openair2/NETWORK_DRIVER/LITE/local.h b/openair2/NETWORK_DRIVER/LITE/local.h
deleted file mode 100644
index 4ceae1b929..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/local.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * 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
- */
-
-/***************************************************************************
- local.h - description
- -------------------
- copyright : (C) 2002 by Eurecom
- email :navid.nikaein@eurecom.fr
- lionel.gauthier@eurecom.fr
- knopp@eurecom.fr
- ***************************************************************************
-
- ***************************************************************************/
-
-#ifndef OAI_LOCAL_H
-#define OAI_LOCAL_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-//#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define PDCP2IP_FIFO 21
-#define IP2PDCP_FIFO 22
-
-#include "constant.h"
-#include "common/platform_types.h"
-#include "sap.h"
-
-struct cx_entity {
- int sap[OAI_NW_DRV_SAPI_CX_MAX];
- uint8_t state; // state of the connection
- OaiNwDrvLocalConnectionRef_t lcr; // Local connection reference
- OaiNwDrvCellID_t cellid; // cell identification
- uint32_t countimer; // timeout's counter
- uint8_t retry; // number of retransmission
-
- uint32_t iid6[2]; // IPv6 interface identification
- uint8_t iid4; // IPv4 interface identification
- int lastRRCprimitive;
- //measures
- int req_prov_id [OAI_NW_DRV_MAX_MEASURE_NB];
- int num_measures;
- int meas_cell_id[OAI_NW_DRV_MAX_MEASURE_NB];
- int meas_level [OAI_NW_DRV_MAX_MEASURE_NB];
- int provider_id [OAI_NW_DRV_MAX_MEASURE_NB];
-};
-
-struct oai_nw_drv_priv {
- int irq;
- int rx_flags;
- struct timer_list timer;
- spinlock_t lock;
- struct net_device_stats stats;
- uint8_t retry_limit;
- uint32_t timer_establishment;
- uint32_t timer_release;
- struct cx_entity cx[OAI_NW_DRV_CX_MAX];
- //struct classifier_entity *rclassifier[OAI_NW_DRV_DSCP_MAX]; // receive classifier
- uint16_t nrclassifier;
- int sap[OAI_NW_DRV_SAPI_MAX];
- struct sock *nl_sk;
- uint8_t nlmsg[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH+sizeof(struct nlmsghdr)];
- uint8_t xbuffer[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH]; // transmition buffer
- uint8_t rbuffer[OAI_NW_DRV_PRIMITIVE_MAX_LENGTH]; // reception buffer
-};
-
-struct ipversion {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
- uint8_t reserved:4,
- version:4;
-#else
- uint8_t version:4,
- reserved:4;
-#endif
-};
-
-typedef struct pdcp_data_req_header_s {
- rb_id_t rb_id;
- sdu_size_t data_size;
- signed int inst;
- ip_traffic_type_t traffic_type;
-} pdcp_data_req_header_t;
-
-typedef struct pdcp_data_ind_header_s {
- rb_id_t rb_id;
- sdu_size_t data_size;
- signed int inst;
- ip_traffic_type_t dummy_traffic_type;
-} pdcp_data_ind_header_t;
-
-
-
-extern struct net_device *oai_nw_drv_dev[OAI_NW_DRV_NB_INSTANCES_MAX];
-
-extern uint8_t OAI_NW_DRV_NULL_IMEI[14];
-
-
-
-#endif
diff --git a/openair2/NETWORK_DRIVER/LITE/netlink.c b/openair2/NETWORK_DRIVER/LITE/netlink.c
deleted file mode 100644
index 2ad104b421..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/netlink.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * 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
- */
-
-/*! \file netlink.c
-* \brief establish a netlink
-* \author Navid Nikaein, Lionel Gauthier, and Raymond knopp
-* \company Eurecom
-* \email:navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr, knopp@eurecom.fr
-*/
-
-#include
-
-//#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include "local.h"
-#include "proto_extern.h"
-
-//#define NETLINK_DEBUG 1
-
-
-#define OAI_IP_DRIVER_NETLINK_ID 31
-#define NL_DEST_PID 1
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
-struct netlink_kernel_cfg oai_netlink_cfg;
-#endif
-
-static struct sock *nas_nl_sk = NULL;
-static int exit_netlink_thread=0;
-static int nas_netlink_rx_thread(void *);
-
-
-static DEFINE_MUTEX(nasmesh_mutex);
-
-static inline void nasmesh_lock(void)
-{
- mutex_lock(&nasmesh_mutex);
-}
-
-static inline void nasmesh_unlock(void)
-{
- mutex_unlock(&nasmesh_mutex);
-}
-
-// This can also be implemented using thread to get the data from PDCP without blocking.
-static void nas_nl_data_ready (struct sk_buff *skb)
-{
- // wake_up_interruptible(skb->sk->sk_sleep);
- //nasmesh_lock();
- //netlink_rcv_skb(skb, &my_rcv_msg);// my_rcv_msg is the call back func>
- //nasmesh_unlock();
-
- struct nlmsghdr *nlh = NULL;
-
- if (skb) {
-#ifdef NETLINK_DEBUG
- printk("[OAI_IP_DRV][NETLINK] Received socket from PDCP\n");
-#endif //NETLINK_DEBUG
- nlh = (struct nlmsghdr *)skb->data;
- oai_nw_drv_common_wireless2ip(nlh);
- //kfree_skb(skb); // not required,
- }
-}
-
-
-int oai_nw_drv_netlink_init(void)
-{
-
- printk("[OAI_IP_DRV][NETLINK] Running init ...\n");
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
- oai_netlink_cfg.groups = 0;
- oai_netlink_cfg.input = nas_nl_data_ready;
- oai_netlink_cfg.cb_mutex = &nasmesh_mutex;
- oai_netlink_cfg.bind = NULL;
-
- nas_nl_sk = netlink_kernel_create(
- &init_net,
- OAI_IP_DRIVER_NETLINK_ID,
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
- THIS_MODULE,
-# endif
- &oai_netlink_cfg);
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
- nas_nl_sk = netlink_kernel_create(
- &init_net,
- OAI_IP_DRIVER_NETLINK_ID,
- 0,
- nas_nl_data_ready,
- &nasmesh_mutex, // NULL
- THIS_MODULE);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
-
- if (nas_nl_sk == NULL) {
-
- printk("[OAI_IP_DRV][NETLINK] netlink_kernel_create failed \n");
- return(-1);
- }
-
-
-
- return(0);
-
-}
-
-
-void oai_nw_drv_netlink_release(void)
-{
-
- exit_netlink_thread=1;
- printk("[OAI_IP_DRV][NETLINK] Releasing netlink socket\n");
-
- if(nas_nl_sk) {
- netlink_kernel_release(nas_nl_sk); //or skb->sk
-
- }
-
- // printk("[OAI_IP_DRV][NETLINK] Removing netlink_rx_thread\n");
- //kthread_stop(netlink_rx_thread);
-
-}
-
-
-
-
-int oai_nw_drv_netlink_send(unsigned char *data,unsigned int len)
-{
-
-
- struct sk_buff *nl_skb = alloc_skb(NLMSG_SPACE(len),GFP_ATOMIC);
- struct nlmsghdr *nlh = (struct nlmsghdr *)nl_skb->data;
- int status;
-
-
- // printk("[OAI_IP_DRV][NETLINK] Sending %d bytes (%d)\n",len,NLMSG_SPACE(len));
- skb_put(nl_skb, NLMSG_SPACE(len));
- memcpy(NLMSG_DATA(nlh),data,len);
-
- nlh->nlmsg_len = NLMSG_SPACE(len);
-
-
- nlh->nlmsg_pid = 0; /* from kernel */
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
- NETLINK_CB(nl_skb).portid = 0;
-#else
- NETLINK_CB(nl_skb).pid = 0;
-#endif
-
-#ifdef NETLINK_DEBUG
- printk("[OAI_IP_DRV][NETLINK] In nas_netlink_send, nl_skb %p, nl_sk %x, nlh %p, nlh->nlmsg_len %d\n",nl_skb,nas_nl_sk,nlh,nlh->nlmsg_len);
-#endif //DEBUG_NETLINK
-
- if (nas_nl_sk) {
-
- // nasmesh_lock();
- status = netlink_unicast(nas_nl_sk, nl_skb, NL_DEST_PID, MSG_DONTWAIT);
- // mutex_unlock(&nasmesh_mutex);
-
- if (status < 0) {
- printk("[OAI_IP_DRV][NETLINK] SEND status is %d\n",status);
- return(0);
- } else {
-#ifdef NETLINK_DEBUG
- printk("[OAI_IP_DRV][NETLINK] SEND status is %d\n",status);
-#endif
- return len;
- }
- } else {
- printk("[OAI_IP_DRV][SEND] socket is NULL\n");
- return(0);
- }
-}
diff --git a/openair2/NETWORK_DRIVER/LITE/proto_extern.h b/openair2/NETWORK_DRIVER/LITE/proto_extern.h
deleted file mode 100644
index d4289ca1f2..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/proto_extern.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * 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
- */
-
-/***************************************************************************
- proto_extern.h - description
- -------------------
- copyright : (C) 2002 by Eurecom
- email : michelle.wetterwald@eurecom.fr
- yan.moret@eurecom.fr
- knopp@eurecom.fr
- ***************************************************************************
-
-***************************************************************************/
-
-#ifndef __NETWORK_DRIVER_LITE_PROTO_EXTERN__H__
-#define __NETWORK_DRIVER_LITE_PROTO_EXTERN__H__
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-//#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "local.h"
-
-// device.c
-
-
-/** @defgroup _oai_nw_drv_impl_ OAI Network Device for RRC Lite
-* @ingroup _ref_implementation_
-* @{
-\fn int oai_nw_drv_find_inst(struct net_device *dev)
-\brief This function determines the instance id for a particular device pointer.
-@param dev Pointer to net_device structure
- */
-int oai_nw_drv_find_inst(struct net_device *dev);
-
-// common.c
-/**
-\fn void oai_nw_drv_common_class_wireless2ip(unsigned short dlen, void* pdcp_sdu,int inst,OaiNwDrvRadioBearerId_t rb_id)
-\brief Receive classified LTE packet, build skbuff struct with it and deliver it to the OS network layer.
-@param dlen Length of SDU in bytes
-@param pdcp_sdu Pointer to received SDU
-@param inst Instance number
-@param rb_id Radio Bearer Id
- */
-void oai_nw_drv_common_class_wireless2ip(unsigned short dlen,
- void *pdcp_sdu,
- int inst,
- OaiNwDrvRadioBearerId_t rb_id);
-
-/**
-\fn void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst)
-\brief Request the transfer of data (QoS SAP)
-@param skb pointer to socket buffer
-@param inst device instance
- */
-void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst);
-
-/**
-\fn void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, int inst)
-\brief Drop the IP packet comming from the OS network layer.
-@param skb pointer to socket buffer
-@param inst device instance
- */
-void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, int inst);
-
-#ifndef OAI_NW_DRIVER_USE_NETLINK
-/**
-\fn void oai_nw_drv_common_wireless2ip()
-\brief Retrieve PDU from PDCP through RT-fifos for delivery to the IP stack.
- */
-void oai_nw_drv_common_wireless2ip(void);
-#else
-/**
-\fn void oai_nw_drv_common_wireless2ip(struct nlmsghdr *nlh)
-\brief Retrieve PDU from PDCP through netlink sockets for delivery to the IP stack.
- */
-void oai_nw_drv_common_wireless2ip(struct nlmsghdr *nlh);
-#endif //OAI_NW_DRIVER_USE_NETLINK
-
-
-#ifdef OAI_NW_DRIVER_USE_NETLINK
-/**
-\fn int oai_nw_drv_netlink_send(unsigned char *data,unsigned int len)
-\brief Request the transfer of data by PDCP via netlink socket
-@param data pointer to SDU
-@param len length of SDU in bytes
-@returns Numeber of bytes transfered by netlink socket
- */
-int oai_nw_drv_netlink_send(unsigned char *data,unsigned int len);
-
-/**
-\fn void oai_nw_drv_COMMON_QOS_receive(struct nlmsghdr *nlh)
-\brief Request a PDU from PDCP
-@param nlh pointer to netlink message header
- */
-void oai_nw_drv_COMMON_QOS_receive(struct nlmsghdr *nlh);
-
-#endif //OAI_NW_DRIVER_USE_NETLINK
-
-
-
-// iocontrol.c
-void oai_nw_drv_CTL_send(struct sk_buff *skb, int inst);
-int oai_nw_drv_CTL_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-
-// classifier.c
-
-/**
- \brief Find the IP traffic type (UNICAST, MULTICAST, BROADCAST) of the IP packet attached to sk_buff.
-*/
-ip_traffic_type_t oai_nw_drv_find_traffic_type(struct sk_buff *skb);
-
-
-
-// tool.c
-void oai_nw_drv_TOOL_imei2iid(unsigned char *imei, unsigned char *iid);
-void oai_nw_drv_TOOL_eNB_imei2iid(unsigned char *imei, unsigned char *iid, unsigned char len);
-unsigned char oai_nw_drv_TOOL_get_dscp6(struct ipv6hdr *iph);
-unsigned char oai_nw_drv_TOOL_get_dscp4(struct iphdr *iph);
-unsigned char *oai_nw_drv_TOOL_get_protocol6(struct ipv6hdr *iph, unsigned char *protocol);
-unsigned char *oai_nw_drv_TOOL_get_protocol4(struct iphdr *iph, unsigned char *protocol);
-char *oai_nw_drv_TOOL_get_udpmsg(struct udphdr *udph);
-unsigned short oai_nw_drv_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, unsigned char proto, unsigned int udplen, void *data);
-int oai_nw_drv_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, unsigned char plen);
-int oai_nw_drv_TOOL_network4(unsigned int *addr, unsigned int *prefix, unsigned char plen);
-void print_TOOL_pk_icmp6(struct icmp6hdr *icmph);
-
-void print_TOOL_pk_all(struct sk_buff *skb);
-void print_TOOL_pk_ipv6(struct ipv6hdr *iph);
-void print_TOOL_state(unsigned char state);
-void oai_nw_drv_tool_print_buffer(char * buffer,int length);
-#ifdef OAI_NW_DRIVER_USE_NETLINK
-// netlink.c
-
-void oai_nw_drv_netlink_release(void);
-int oai_nw_drv_netlink_init(void);
-
-#endif
-
-/** @} */
-#endif
diff --git a/openair2/NETWORK_DRIVER/LITE/sap.h b/openair2/NETWORK_DRIVER/LITE/sap.h
deleted file mode 100644
index d72a1b10df..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/sap.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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
- */
-
-#ifndef OAI_SAP_H
-#define OAI_SAP_H
-typedef unsigned short OaiNwDrvRadioBearerId_t;
-typedef unsigned int OaiNwDrvSapId_t; // Id of the QoS SAP to use
-typedef unsigned short OaiNwDrvQoSTrafficClass_t; // QoS traffic class requested
-typedef unsigned int OaiNwDrvLocalConnectionRef_t; // local identifier
-typedef unsigned short OaiNwDrvCellID_t; // ID of the cell for connection
-typedef unsigned short OaiNwDrvNumRGsMeas_t; // number of RGs that could be measured
-typedef unsigned int OaiNwDrvSigLevel_t; // Signal level measured
-
-#define OAI_NW_DRV_SAPI_CX_MAX 2
-#define OAI_NW_DRV_MAX_MEASURE_NB 5
-#define OAI_NW_DRV_PRIMITIVE_MAX_LENGTH 180 // maximum length of a NAS primitive
-#define OAI_NW_DRV_SAPI_MAX 4
-#define OAI_NW_DRV_RAB_INPUT_SAPI 2
-#define OAI_NW_DRV_RAB_OUTPUT_SAPI 3
-#define OAI_NW_DRV_MAX_RABS 8 * 64 //NB_RAB_MAX * MAX_MOBILES_PER_RG //27 // = MAXURAB
-#define OAI_NW_DRV_LIST_RB_MAX 32
-#endif
diff --git a/openair2/NETWORK_DRIVER/LITE/tool.c b/openair2/NETWORK_DRIVER/LITE/tool.c
deleted file mode 100644
index d8d0030dd9..0000000000
--- a/openair2/NETWORK_DRIVER/LITE/tool.c
+++ /dev/null
@@ -1,747 +0,0 @@
-/*
- * 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 "local.h"
-#include "proto_extern.h"
-
-//#include
-//#include
-//#include
-//#include
-//#include
-//#include
-
-//#define OAI_NW_DRV_DEBUG_TOOL 1
-
-
-
-//---------------------------------------------------------------------------
-uint8_t oai_nw_drv_TOOL_get_dscp6(struct ipv6hdr *iph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_DSCP6 - begin \n");
-#endif
-
- if (iph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_DSCP6 - input parameter iph is NULL \n");
-#endif
- return 0;
- }
-
- // End debug information
- return (ntohl(((*(__u32 *)iph)&OAI_NW_DRV_TRAFFICCLASS_MASK)))>>22;
- //return ntohs(*(const __be16 *)iph) >> 4; // see linux/dsfield.h
-
-}
-
-//---------------------------------------------------------------------------
-uint8_t oai_nw_drv_TOOL_get_dscp4(struct iphdr *iph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_DSCP4 - begin \n");
-#endif
-
- if (iph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_DSCP4 - input parameter iph is NULL \n");
-#endif
- return 0;
- }
-
- // End debug information
- return (iph->tos);
-
-}
-
-//---------------------------------------------------------------------------
-int oai_nw_drv_TOOL_network6(struct in6_addr *addr, struct in6_addr *prefix, uint8_t plen)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_NETWORK6 - begin \n");
-#endif
-
- if (addr==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_NETWORK6 - input parameter addr is NULL \n");
-#endif
- return 0;
- }
-
- if (prefix==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_NETWORK6 - input parameter prefix is NULL \n");
-#endif
- return 0;
- }
-
- // End debug information
- switch(plen/32) {
- case 0:
- return (((addr->s6_addr32[0]>>(32-plen))<<(32-plen))==prefix->s6_addr[0]);
-
- case 1:
- return ((addr->s6_addr32[0]==prefix->s6_addr[0])&&
- (((addr->s6_addr32[1]>>(64-plen))<<(64-plen))==prefix->s6_addr[1]));
-
- case 2:
- return ((addr->s6_addr32[0]==prefix->s6_addr[0])&&
- (addr->s6_addr32[1]==prefix->s6_addr[1])&&
- (((addr->s6_addr32[2]>>(96-plen))<<(96-plen))==prefix->s6_addr[2]));
-
- case 3:
- return ((addr->s6_addr32[0]==prefix->s6_addr[0])&&
- (addr->s6_addr32[1]==prefix->s6_addr[1])&&
- (addr->s6_addr32[2]==prefix->s6_addr[2])&&
- (((addr->s6_addr32[3]>>(128-plen))<<(128-plen))==prefix->s6_addr[3]));
-
- default:
- return ((addr->s6_addr32[0]==prefix->s6_addr[0])&&
- (addr->s6_addr32[1]==prefix->s6_addr[1])&&
- (addr->s6_addr32[2]==prefix->s6_addr[2])&&
- (addr->s6_addr32[3]==prefix->s6_addr[3]));
- }
-}
-
-//---------------------------------------------------------------------------
-int oai_nw_drv_TOOL_network4(uint32_t *addr, uint32_t *prefix, uint8_t plen)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_NETWORK4 - begin \n");
-#endif
-
- if (addr==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_NETWORK4 - input parameter addr is NULL \n");
-#endif
- return 0;
- }
-
- if (prefix==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_NETWORK4 - input parameter prefix is NULL \n");
-#endif
- return 0;
- }
-
- // End debug information
- if (plen>=32)
- return (*addr==*prefix);
- else
- return (((*addr>>(32-plen))<<(32-plen))==*prefix);
-}
-
-//---------------------------------------------------------------------------
-//struct udphdr *oai_nw_drv_TOOL_get_udp6(struct ipv6hdr *iph){
-//---------------------------------------------------------------------------
-// return (struct udphdr *)((char *)iph+OAI_NW_DRV_IPV6_SIZE); // to modify
-//}
-
-//---------------------------------------------------------------------------
-uint8_t *oai_nw_drv_TOOL_get_protocol6(struct ipv6hdr *iph, uint8_t *protocol)
-{
- //---------------------------------------------------------------------------
- uint16_t size;
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_PROTOCOL6 - begin \n");
-#endif
-
- if (iph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_PROTOCOL6 - input parameter iph is NULL \n");
-#endif
- return NULL;
- }
-
- if (protocol==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_PROTOCOL6 - input parameter protocol is NULL \n");
-#endif
- return NULL;
- }
-
- // End debug information
- *protocol=iph->nexthdr;
- size=OAI_NW_DRV_IPV6_SIZE;
-
- while (1) {
- switch(*protocol) {
- case IPPROTO_UDP:
- case IPPROTO_TCP:
- case IPPROTO_ICMPV6:
- return (uint8_t *)((uint8_t *)iph+size);
-
- case IPPROTO_HOPOPTS:
- case IPPROTO_ROUTING:
- case IPPROTO_DSTOPTS:
- *protocol=((uint8_t *)iph+size)[0];
- size+=((uint8_t *)iph+size)[1]*8+8;
- break;
-
- case IPPROTO_FRAGMENT:
- *protocol=((uint8_t *)iph+size)[0];
- size+=((uint8_t *)iph+size)[1]+8;
- break;
-
- case IPPROTO_NONE:
- case IPPROTO_AH:
- case IPPROTO_ESP:
- default:
- return NULL;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-uint8_t *oai_nw_drv_TOOL_get_protocol4(struct iphdr *iph, uint8_t *protocol)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_PROTOCOL4 - begin \n");
-#endif
-
- if (iph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_PROTOCOL4 - input parameter iph is NULL \n");
-#endif
- return NULL;
- }
-
- if (protocol==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_PROTOCOL4 - input parameter protocol is NULL \n");
-#endif
- return NULL;
- }
-
- // End debug information
- *protocol=iph->protocol;
-
- switch(*protocol) {
- case IPPROTO_UDP:
- case IPPROTO_TCP:
- case IPPROTO_ICMP:
- return (uint8_t *)((uint8_t *)iph+iph->tot_len);
-
- default:
- return NULL;
- }
-}
-
-//---------------------------------------------------------------------------
-// Convert the IMEI to iid
-void oai_nw_drv_TOOL_imei2iid(uint8_t *imei, uint8_t *iid)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_IMEI2IID - begin \n");
-#endif
-
- if (imei==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_IMEI2IID - input parameter imei is NULL \n");
-#endif
- return;
- }
-
- if (iid==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_IMEI2IID - input parameter iid is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- memset(iid, 0, OAI_NW_DRV_ADDR_LEN);
- iid[0] = 0x03;
- iid[1] = 16*imei[0]+imei[1];
- iid[2] = 16*imei[2]+imei[3];
- iid[3] = 16*imei[4]+imei[5];
- iid[4] = 16*imei[6]+imei[7];
- iid[5] = 16*imei[8]+imei[9];
- iid[6] = 16*imei[10]+imei[11];
- iid[7] = 16*imei[12]+imei[13];
-}
-//---------------------------------------------------------------------------
-// Convert the IMEI to iid
-void oai_nw_drv_TOOL_eNB_imei2iid(unsigned char *imei, unsigned char *iid, unsigned char len)
-{
- //---------------------------------------------------------------------------
- unsigned int index;
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_eNB_IMEI2IID - begin \n");
-#endif
-
- if (imei==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_eNB_IMEI2IID - input parameter imei is NULL \n");
-#endif
- return;
- }
-
- if (iid==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_eNB_IMEI2IID - input parameter iid is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- memset(iid, 0, len);
- iid[0] = 0x00; // to be compatible between link local and global
-
- // len -1 because of insertion of 0 above
- for (index = 0; index < (len-1); index++) {
- iid[index+1] = 16*imei[index*2]+imei[index*2+1];
- }
-}
-
-//struct udphdr *oai_nw_drv_TOOL_get_udp4(struct iphdr *iph)
-//{
-// return (struct udphdr *)((char *)iph+OAI_NW_DRV_IPV4_SIZE); // to modify
-//}
-
-
-//---------------------------------------------------------------------------
-char *oai_nw_drv_TOOL_get_udpmsg(struct udphdr *udph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_UDPMSG - begin \n");
-#endif
-
- if (udph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_GET_UDPMSG - input parameter udph is NULL \n");
-#endif
- return NULL;
- }
-
- // End debug information
- return ((char *)udph+sizeof(struct udphdr));
-}
-
-//---------------------------------------------------------------------------
-// Compute the UDP checksum (the data size must be odd)
-uint16_t oai_nw_drv_TOOL_udpcksum(struct in6_addr *saddr, struct in6_addr *daddr, uint8_t proto, uint32_t udplen, void *data)
-{
- //---------------------------------------------------------------------------
- uint32_t i;
- uint16_t *data16;
- uint32_t csum=0;
-
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_UDPCKSUM - begin \n");
-#endif
-
- if (saddr==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_UDPCKSUM - input parameter saddr is NULL \n");
-#endif
- return 0;
- }
-
- if (daddr==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_UDPCKSUM - input parameter daddr is NULL \n");
-#endif
- return 0;
- }
-
- if (data==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_UDPCKSUM - input parameter data is NULL \n");
-#endif
- return 0;
- }
-
- // End debug information
- data16=data;
-
- for (i=0; i<8; ++i) {
- csum+=ntohs(saddr->s6_addr16[i]);
-
- if (csum>0xffff)
- csum-=0xffff;
- }
-
- for (i=0; i<8; ++i) {
- csum+=ntohs(daddr->s6_addr16[i]);
-
- if (csum>0xffff)
- csum-=0xffff;
- }
-
- csum+=(udplen>>16); // udplen checksum
-
- if (csum>0xffff)
- csum -= 0xffff;
-
- csum+=udplen & 0xffff;
-
- if (csum>0xffff)
- csum -= 0xffff;
-
- csum+=proto; // protocol checksum
-
- if (csum>0xffff)
- csum-=0xffff;
-
- for (i = 0; 2*i < udplen; i++) {
- csum+=ntohs(data16[i]);
-
- if (csum>0xffff)
- csum-=0xffff;
- }
-
- return htons((uint16_t)(~csum)&0xffff);
-}
-
-//---------------------------------------------------------------------------
-void print_TOOL_pk_udp(struct udphdr *udph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("PRINT_TOOL_PK_UDP - begin \n");
-#endif
-
- if (udph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_PK_UDP - input parameter udph is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- if (udph!=NULL) {
- printk("UDP:\t source = %u, dest = %u, len = %u, check = %x\n", ntohs(udph->source), ntohs(udph->dest), ntohs(udph->len), udph->check);
- }
-}
-
-//---------------------------------------------------------------------------
-void print_TOOL_pk_tcp(struct tcphdr *tcph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("PRINT_TOOL_PK_TDP - begin \n");
-#endif
-
- if (tcph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_PK_TDP - input parameter tcph is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- if (tcph!=NULL) {
- printk("TCP:\t source = %u, dest = %u\n", tcph->source, tcph->dest);
- }
-}
-
-//---------------------------------------------------------------------------
-void print_TOOL_pk_icmp6(struct icmp6hdr *icmph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("PRINT_TOOL_PK_ICMP6 - begin \n");
-#endif
-
- if (icmph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_PK_ICMP6 - input parameter icmph is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- if (icmph!=NULL) {
- printk("ICMPv6:\t type= %d, code = %d\n", icmph->icmp6_type, icmph->icmp6_code);
-
- switch(icmph->icmp6_type) {
- case ICMPV6_DEST_UNREACH:
- printk("Destination unreachable\n");
- break;
-
- case ICMPV6_PKT_TOOBIG:
- printk("Packet too big\n");
- break;
-
- case ICMPV6_TIME_EXCEED:
- printk("Time exceeded\n");
- break;
-
- case ICMPV6_PARAMPROB:
- printk("Parameter problem\n");
- break;
-
- case ICMPV6_ECHO_REQUEST:
- printk("Echo request\n");
- break;
-
- case ICMPV6_ECHO_REPLY:
- printk("Echo reply\n");
- break;
-
- case ICMPV6_MGM_QUERY:
- printk("Multicast listener query\n");
- break;
-
- case ICMPV6_MGM_REPORT:
- printk("Multicast listener report\n");
- break;
-
- case ICMPV6_MGM_REDUCTION:
- printk("Multicast listener done\n");
- break;
-
- case NDISC_ROUTER_SOLICITATION:
- printk("Router solicitation\n");
- break;
-
- case NDISC_ROUTER_ADVERTISEMENT:
- printk("Router advertisment\n");
- break;
-
- case NDISC_NEIGHBOUR_SOLICITATION:
- printk("Neighbour solicitation\n");
- break;
-
- case NDISC_NEIGHBOUR_ADVERTISEMENT:
- printk("Neighbour advertisment\n");
- break;
-
- case NDISC_REDIRECT:
- printk("redirect message\n");
- break;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-void print_TOOL_pk_ipv6(struct ipv6hdr *iph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("PRINT_TOOL_PK_IPv6 - begin \n");
-#endif
-
- if (iph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_PK_IPv6 - input parameter iph is NULL \n");
-#endif
- return;
- }
-
- // End debug information
-
- if (iph!=NULL) {
- // char addr[OAI_NW_DRV_INET6_ADDRSTRLEN];
- printk("IP:\t version = %u, priority = %u, payload_len = %u\n", iph->version, iph->priority, ntohs(iph->payload_len));
- printk("\t fl0 = %u, fl1 = %u, fl2 = %u\n",iph->flow_lbl[0],iph->flow_lbl[1],iph->flow_lbl[2]);
- printk("\t next header = %u, hop_limit = %u\n", iph->nexthdr, iph->hop_limit);
-
- // inet_ntop(AF_INET6, (void *)(&iph->saddr), addr, OAI_NW_DRV_INET6_ADDRSTRLEN);
- // printk("\t saddr = %s",addr);
- // inet_ntop(AF_INET6, (void *)(&iph->daddr), addr, OAI_NW_DRV_INET6_ADDRSTRLEN);
- // printk(", daddr = %s\n",addr);
- switch(iph->nexthdr) {
- case IPPROTO_UDP:
- print_TOOL_pk_udp((struct udphdr *)((char *)iph+sizeof(struct ipv6hdr)));
- break;
-
- case IPPROTO_TCP:
- print_TOOL_pk_tcp((struct tcphdr *)((char *)iph+sizeof(struct ipv6hdr)));
- break;
-
- case IPPROTO_ICMPV6:
- print_TOOL_pk_icmp6((struct icmp6hdr *)((char *)iph+sizeof(struct ipv6hdr)));
- break;
-
- case IPPROTO_IPV6:
- print_TOOL_pk_ipv6((struct ipv6hdr *)((char *)iph+sizeof(struct ipv6hdr)));
- break;
-
- default:
- printk("Unknown upper layer\n");
- }
- }
-}
-
-//---------------------------------------------------------------------------
-void print_TOOL_pk_ipv4(struct iphdr *iph)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("PRINT_TOOL_PK_IPv4 - begin \n");
-#endif
-
- if (iph==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_PK_IPv4 - input parameter iph is NULL \n");
-#endif
- return;
- }
-
- // End debug information
-
- if (iph!=NULL) {
- // char addr[OAI_NW_DRV_INET_ADDRSTRLEN];
- printk("IP:\t version = %u, IP length = %u\n", iph->version, iph->ihl);
- // inet_ntop(AF_INET, (void *)(&iph->saddr), addr, OAI_NW_DRV_INET_ADDRSTRLEN);
- // printk("\t saddr = %s", addr);
- // inet_ntop(AF_INET, (void *)(&iph->saddr), addr, OAI_NW_DRV_INET_ADDRSTRLEN);
- // printk("\t saddr = %s", addr);
- }
-}
-
-//---------------------------------------------------------------------------
-void print_TOOL_pk_all(struct sk_buff *skb)
-{
- //---------------------------------------------------------------------------
- printk("Skb:\t %u, len = %u\n", (unsigned int)skb, skb->len);
- //navid: need to calculate the current used space: fixme?
- printk("Skb:\t available buf space = %u \n", skb->truesize);
-
- switch (ntohs(skb->protocol)) {
- case ETH_P_IPV6:
- print_TOOL_pk_ipv6((struct ipv6hdr *)skb->network_header);
- break;
-
- case ETH_P_IP:
- print_TOOL_pk_ipv4((struct iphdr *)skb->network_header);
- break;
- }
-}
-
-//---------------------------------------------------------------------------
-/*int isdigit(char c)
-{
- switch(c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- return 1;
- default:
- return 0;
- }
-}*/
-
-/*int oai_nw_drv_TOOL_inet_pton4(char *src, uint32_t *dst)
-{
- uint32_t val;
- int n;
- uint8_t c;
- uint32_t parts[4];
-
- c = *src;
- val=0;
- n=0
- for (;;)
- {
- for (;;)
- {
- if (isdigit(c))
- {
- val = (val * 10) + c - '0';
- c = *++src;
- }
- else
- break;
- }
- if (c == '.')
- {
- if (n>4)
- return -1;
- parts[n]=val;
- c = *++src;
- ++n;
- }
- else
- break;
- }
- if ((c != '\0')||(n!=3))
- return (0);
- if ((parts[0] | parts[1] | parts[2] | val) > 256)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- if (dst)
- dst = htonl(val);
- return (1);
-}*/
-
-
-
-//-----------------------------------------------------------------------------
-// Print the content of a buffer in hexadecimal
-void oai_nw_drv_tool_print_buffer(char * buffer,int length)
-{
- //-----------------------------------------------------------------------------
- int i;
-
- // Start debug information
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_PRINT_BUFFER - begin \n");
-#endif
-
- if (buffer==NULL) {
-#ifdef OAI_NW_DRV_DEBUG_TOOL
- printk("OAI_NW_DRV_TOOL_PRINT_BUFFER - input parameter buffer is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- printk("\nBuffer content: ");
-
- for (i=0; i
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-
-//
-
-//#include "ral_cdma_variables.h"
-//#include "ral_cdma_proto.h"
-
-#include "rrc_nas_primitives.h"
-#include "ioctl.h"
-#include "constant.h"
-
-//#include "nasmt_constant.h"
-//#include "nasmt_iocontrol.h"
-
-
-
-// Global variables
-//int sd_graal;
-int fd;
-//char myIPAddr[16]; // local IP Address
-//int meas_counter;
-//struct ralu_priv ru_priv;
-//struct ralu_priv *ralupriv;
-//ioctl
-char dummy_buffer[1024];
-struct nas_ioctl gifr;
-//int wait_start_nas;
-
-/*
-//---------------------------------------------------------------------------
-int NAS_RALconnect(void)
-//---------------------------------------------------------------------------
-{
- struct sockaddr_un remote;
- int len,s;
-
- if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
- perror("NAS_RALconnect - socket");
- exit(1);
- }
- //
- printf("Trying to connect to NAS ...\n");
- remote.sun_family = AF_UNIX;
- strcpy(remote.sun_path, SOCKET_RAL_TD_CDMA_NAME);
- len = strlen(remote.sun_path) + sizeof(remote.sun_family);
-
- while (wait_start_graal){
- if (connect(s, (struct sockaddr *)&remote, len) == -1) {
- perror("NAS_RALconnect - waiting for connection - ");
- // exit(1);
- wait_start_graal = 1;
- sleep(5);
- } else {
- wait_start_graal =0;
- printf("RAL connected to NAS.\n");
- }
-
- }
- return s;
-}
-
-*/
-
-//---------------------------------------------------------------------------
-void IAL_NAS_ioctl_init(int inst)
-//---------------------------------------------------------------------------
-{
- struct nas_msg_statistic_reply *msgrep;
- int err;
- sprintf(gifr.name, "oai%d",inst);
- // Get an UDP IPv6 socket ??
- fd=socket(AF_INET6, SOCK_DGRAM, 0);
-
- if (fd<0) {
- printf("Error opening socket\n");
- exit(1);
- }
-
- sprintf(gifr.name, "oai%d",inst);
- gifr.type = NAS_MSG_STATISTIC_REQUEST;
- memset ((void *)dummy_buffer,0,800);
- gifr.msg= &(dummy_buffer[0]);
- msgrep=(struct nas_msg_statistic_reply *)(gifr.msg);
- printf("ioctl :Statistics requested\n");
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err<0) {
- printf("IOCTL error, err=%d\n",err);
- }
-
- printf("tx_packets = %u, rx_packets = %u\n", msgrep->tx_packets, msgrep->rx_packets);
- printf("tx_bytes = %u, rx_bytes = %u\n", msgrep->tx_bytes, msgrep->rx_bytes);
- printf("tx_errors = %u, rx_errors = %u\n", msgrep->tx_errors, msgrep->rx_errors);
- printf("tx_dropped = %u, rx_dropped = %u\n", msgrep->tx_dropped, msgrep->rx_dropped);
-}
-
-
-#define ADD_RB 0
-#define DEL_RB 1
-
-//---------------------------------------------------------------------------
-int main(int argc,char **argv)
-//---------------------------------------------------------------------------
-{
- int err = 0;
- int c = 0;
- int action=0,rbset=0,cxset=0,instset=0,saddr_ipv4set=0,saddr_ipv6set=0,daddr_ipv4set=0,daddr_ipv6set=0,dscpset=0,mpls_outlabelset=0,mpls_inlabelset=0;
- char rb[100],cx[100],dscp[100],inst[100],mpls_outgoinglabel[100],mpls_incominglabel[100];
- struct nas_msg_rb_establishment_request *msgreq = NULL;
- struct nas_msg_class_add_request *msgreq_class = NULL;
- in_addr_t saddr_ipv4 = 0,daddr_ipv4 = 0;
- struct in6_addr saddr_ipv6,daddr_ipv6;
- unsigned int mpls_outlabel=0,mpls_inlabel=0;
- char addr_str[46];
- // scan options
- rb[0] = '\0';
- cx[0] = '\0';
- dscp[0] = '\0';
- mpls_incominglabel[0] = '\0';
- mpls_outgoinglabel[0] = '\0';
-
- while ((c = getopt (argc, argv, "adr:i:c:l:m:s:t:x:y:z:")) != -1)
- switch (c) {
- case 'a':
- action = ADD_RB;
- break;
-
- case 'd':
- action = DEL_RB;
- break;
-
- case 'r':
- strcpy(rb,optarg);
- rbset = 1;
- break;
-
- case 'i':
- strcpy(inst,optarg);
- instset = 1;
- break;
-
- case 'c':
- strcpy(cx,optarg);
- cxset = 1;
- break;
-
- case 'l':
- strcpy(mpls_outgoinglabel,optarg);
- mpls_outlabelset=1;
- break;
-
- case 'm':
- strcpy(mpls_incominglabel,optarg);
- mpls_inlabelset=1;
- break;
-
- case 's': {
- struct in_addr a;
- inet_aton(optarg,&a);
- saddr_ipv4 = a.s_addr;
- saddr_ipv4set = 1;
- break;
- }
-
- case 't': {
- struct in_addr a;
- inet_aton(optarg,&a);
- daddr_ipv4 = a.s_addr;
- daddr_ipv4set = 1;
- break;
- }
-
- case 'x':
- printf("IPv6: %s\n",optarg);
- inet_pton(AF_INET6,optarg,(void *)&saddr_ipv6);
- saddr_ipv6set = 1;
- break;
-
- case 'y':
- inet_pton(AF_INET6,optarg,(void *)&daddr_ipv6);
- daddr_ipv6set = 1;
- break;
-
- case 'z':
- dscpset=1;
- strcpy(dscp,optarg);
- break;
-
- case '?':
- if (isprint (optopt))
- fprintf (stderr, "Unknown option `-%c'.\n", optopt);
- else
- fprintf (stderr,
- "Unknown option character `\\x%x'.\n",
- optopt);
-
- return 1;
-
- default:
- abort ();
- }
-
- printf ("action = %d, rb = %s,cx = %s\n", action, rb, cx);
-
- if (rbset==0) {
- printf("ERROR: Specify a RAB id!!\n");
- exit(-1);
- }
-
- if (cxset==0) {
- printf("ERROR: Specify an LCR !!\n");
- exit(-1);
- }
-
- if (instset==0) {
- printf("ERROR: Specify an interface !!\n");
- exit(-1);
- }
-
- if ((mpls_outlabelset == 0) && (saddr_ipv4set==0) && (saddr_ipv6set==0)) {
- printf("ERROR: Specify a source IP address\n");
- exit(-1);
- }
-
- if ((mpls_outlabelset == 0) && (daddr_ipv4set==0) && (daddr_ipv6set==0)) {
- printf("ERROR: Specify a destination IP address\n");
- exit(-1);
- }
-
- if ((mpls_outlabelset == 1) && (mpls_inlabelset == 0)) {
- printf("ERROR: Specify an incoming MPLS label\n");
- exit(-1);
- }
-
- if ((mpls_inlabelset == 1) && (mpls_outlabelset == 0)) {
- printf("ERROR: Specify an outgoing MPLS label\n");
- exit(-1);
- }
-
- IAL_NAS_ioctl_init(atoi(inst));
- msgreq = (struct nas_msg_rb_establishment_request *)(gifr.msg);
- msgreq->rab_id = atoi(rb);
- msgreq->lcr = atoi(cx);
- msgreq->qos = 0;
-
- if (action == ADD_RB) {
- gifr.type = NAS_MSG_RB_ESTABLISHMENT_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
-
- if (saddr_ipv4set == 1) {
- msgreq_class = (struct nas_msg_class_add_request *)(gifr.msg);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->version = 4;
- msgreq_class->classref = 0 + (msgreq_class->lcr<<3);
- msgreq_class->dir = NAS_DIRECTION_SEND;
- msgreq_class->fct = NAS_FCT_QOS_SEND;
- msgreq_class->saddr.ipv4 = saddr_ipv4;
- msgreq_class->daddr.ipv4 = daddr_ipv4;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = NAS_PROTOCOL_DEFAULT;
-
- if (dscpset==0)
- msgreq_class->dscp=0;
- else
- msgreq_class->dscp=atoi(dscp);
-
- gifr.type = NAS_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
-
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->classref = 1+(msgreq_class->lcr<<3);
- msgreq_class->dir = NAS_DIRECTION_RECEIVE;
- msgreq_class->daddr.ipv4 = saddr_ipv4;
- msgreq_class->saddr.ipv4 = daddr_ipv4;
- gifr.type = NAS_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
- }
-
- if (saddr_ipv6set == 1) {
- msgreq_class = (struct nas_msg_class_add_request *)(gifr.msg);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->version = 6;
-
- if (dscpset==0)
- msgreq_class->dscp=0;
- else
- msgreq_class->dscp=atoi(dscp);
-
- msgreq_class->classref = 2+(msgreq_class->lcr<<3);
- msgreq_class->dir=NAS_DIRECTION_SEND;
- msgreq_class->fct=NAS_FCT_QOS_SEND;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = NAS_PROTOCOL_DEFAULT;
- memcpy(&msgreq_class->saddr.ipv6,&saddr_ipv6,16);
- memcpy(&msgreq_class->daddr.ipv6,&daddr_ipv6,16);
- inet_ntop(AF_INET6,(void *)&saddr_ipv6,addr_str,46);
- printf("IPV6: Source %s\n",addr_str);
- inet_ntop(AF_INET6,(void *)&daddr_ipv6,addr_str,46);
- printf("IPV6: Dest %s\n",addr_str);
- gifr.type = NAS_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
-
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->classref = 3+(msgreq_class->lcr<<3);
- msgreq_class->dir=NAS_DIRECTION_RECEIVE;
- memcpy(&msgreq_class->daddr.ipv6,&saddr_ipv6,16);
- memcpy(&msgreq_class->saddr.ipv6,&daddr_ipv6,16);
- gifr.type = NAS_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
- }
-
- if (mpls_inlabelset == 1) {
- msgreq_class = (struct nas_msg_class_add_request *)(gifr.msg);
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->version = NAS_MPLS_VERSION_CODE;
-
- if (dscpset==0)
- msgreq_class->dscp=0;
- else
- msgreq_class->dscp=atoi(dscp);
-
- msgreq_class->classref = 4 + (msgreq_class->lcr<<3);
- msgreq_class->dir=NAS_DIRECTION_SEND;
- msgreq_class->fct=NAS_FCT_QOS_SEND;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = NAS_PROTOCOL_DEFAULT;
- mpls_outlabel = atoi(mpls_outgoinglabel);
- printf("Setting MPLS outlabel %u with exp %d\n",mpls_outlabel,msgreq_class->dscp);
- msgreq_class->daddr.mpls_label = mpls_outlabel;
- gifr.type = NAS_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
-
- msgreq_class->rab_id = atoi(rb);
- msgreq_class->lcr = atoi(cx);
- msgreq_class->classref = 5 + (msgreq_class->lcr<<3);
- msgreq_class->dir=NAS_DIRECTION_RECEIVE;
- // TO BE FIXED WHEN WE CAN SPECIFY A PROTOCOL-based rule
- msgreq_class->protocol = NAS_PROTOCOL_DEFAULT;
- mpls_inlabel = atoi(mpls_incominglabel);
- printf("Setting MPLS inlabel %u with exp %d\n",mpls_inlabel,msgreq_class->dscp);
- msgreq_class->daddr.mpls_label = mpls_inlabel;
- gifr.type = NAS_MSG_CLASS_ADD_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
- }
- } else if (action == DEL_RB) {
- gifr.type = NAS_MSG_RB_RELEASE_REQUEST;
- err=ioctl(fd, NAS_IOCTL_RRM, &gifr);
-
- if (err == -1) perror("ioctl");
- }
-}
diff --git a/openair2/NETWORK_DRIVER/MESH/TESTBENCH/testbench.c b/openair2/NETWORK_DRIVER/MESH/TESTBENCH/testbench.c
deleted file mode 100644
index 121d3bba8b..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/TESTBENCH/testbench.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * 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
-#include
-#include
-#include
-#include
-#include
-#include
-
-typedef unsigned int sdu_size_t;
-typedef unsigned int rb_id_t;
-
-typedef struct pdcp_data_req_header_t {
- rb_id_t rb_id;
- sdu_size_t data_size;
- int inst;
-} pdcp_data_req_header_t;
-
-typedef struct pdcp_data_ind_header_t {
- rb_id_t rb_id;
- sdu_size_t data_size;
- int inst;
-} pdcp_data_ind_header_t;
-
-#define MAX_PAYLOAD 1024 /* maximum payload size*/
-struct sockaddr_nl src_addr, dest_addr;
-struct nlmsghdr *nlh = NULL;
-struct iovec iov;
-int sock_fd;
-struct msghdr msg;
-
-
-void foo( int sig )
-{
-
- printf("I got cntl-C, closing socket\n");
-
-
- close(sock_fd);
- exit(-1);
-}
-
-
-#define OAI_IP_DRIVER_NETLINK_ID 31
-
-void main()
-{
-
-
- struct sigaction newaction;
- int i=0;
- int ret;
- int len;
-
- newaction.sa_handler = foo;
-
- if ( sigaction( SIGINT, &newaction, NULL ) == -1)
- perror("Could not install the new signal handler");
-
- sock_fd = socket(PF_NETLINK, SOCK_RAW,OAI_IP_DRIVER_NETLINK_ID);
-
- printf("Opened socket with fd %d\n",sock_fd);
-
- ret = fcntl(sock_fd,F_SETFL,O_NONBLOCK);
- printf("fcntl returns %d\n",ret);
-
- memset(&src_addr, 0, sizeof(src_addr));
- src_addr.nl_family = AF_NETLINK;
- src_addr.nl_pid = 1;//getpid(); /* self pid */
- src_addr.nl_groups = 0; /* not in mcast groups */
- ret = bind(sock_fd, (struct sockaddr*)&src_addr,
- sizeof(src_addr));
- printf("bind returns %d\n",ret);
-
- memset(&dest_addr, 0, sizeof(dest_addr));
- dest_addr.nl_family = AF_NETLINK;
- dest_addr.nl_pid = 0; /* For Linux Kernel */
- dest_addr.nl_groups = 0; /* unicast */
-
- nlh=(struct nlmsghdr *)malloc(NLMSG_SPACE(MAX_PAYLOAD));
- /* Fill the netlink message header */
- nlh->nlmsg_len = NLMSG_SPACE(MAX_PAYLOAD);
- nlh->nlmsg_pid = 1;//getpid(); /* self pid */
- nlh->nlmsg_flags = 0;
-
- iov.iov_base = (void *)nlh;
- iov.iov_len = nlh->nlmsg_len;
- memset(&msg,0,sizeof(msg));
- msg.msg_name = (void *)&dest_addr;
- msg.msg_namelen = sizeof(dest_addr);
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
-
-
- /* Read message from kernel */
- memset(nlh, 0, NLMSG_SPACE(MAX_PAYLOAD));
-
- while (1) {
- len = recvmsg(sock_fd, &msg, 0);
-
-
- if (len<0) {
-
- // exit(-1);
- } else {
- printf("Received socket with length %d (nlmsg_len = %d)\n",len,nlh->nlmsg_len);
- }
-
- usleep(1000);
- i=i+1;
-
- if ((i % 100) == 0)
- printf("%d\n",i);
-
- /*
- for (i=0;inlmsg_len - sizeof(struct nlmsghdr);i++) {
- printf("%x ",
- ((unsigned char *)NLMSG_DATA(nlh))[i]);
- }
- */
- }
-
- /* Close Netlink Socket */
-
-}
-
-
-
-
diff --git a/openair2/NETWORK_DRIVER/MESH/classifier.c b/openair2/NETWORK_DRIVER/MESH/classifier.c
deleted file mode 100644
index 32d60917f6..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/classifier.c
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
- * 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
- */
-
-/*! \file classifier.c
-* \brief Classify IP packets
-* \author Navid Nikaein, Lionel GAUTHIER, Raymond knopp
-* \company Eurecom
-* \email: navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr, knopp@eurecom.fr
-*/
-
-
-#include "local.h"
-#include "proto_extern.h"
-
-#include
-#include
-
-
-//#define MPLS
-
-#ifdef MPLS
- #include
-#endif
-
-
-//#define NAS_DEBUG_CLASS 1
-//#define NAS_DEBUG_SEND 1
-
-//---------------------------------------------------------------------------
-// Add a new classifier rule (send direction)
-struct classifier_entity *nas_CLASS_add_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref) {
- //---------------------------------------------------------------------------
- struct classifier_entity *gc;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_SCLASSIFIER: begin for dscp %d, classref %d\n", dscp,classref);
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_SCLASSIFIER - input parameter cx is NULL \n");
-#endif
- return NULL;
- }
-
- for (gc=cx->sclassifier[dscp]; gc!=NULL; gc=gc->next) {
- if (gc->classref==classref) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_SCLASSIFIER: classifier already exist for dscp %d, classref %d\n",dscp,classref);
-#endif
- return gc;
- }
- }
-
- gc=(struct classifier_entity *)kmalloc(sizeof(struct classifier_entity), GFP_KERNEL);
-
- if (gc==NULL)
- return NULL;
-
- gc->next=cx->sclassifier[dscp];
- gc->classref=classref;
- cx->sclassifier[dscp]=gc;
- ++cx->nsclassifier;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_SCLASSIFIER: classifier created for dscp %d, classref %d\n",dscp,classref);
-#endif
- return gc;
-}
-
-//---------------------------------------------------------------------------
-// Add a new classifier rule (receive direction)
-struct classifier_entity *nas_CLASS_add_rclassifier(uint8_t dscp,
- uint16_t classref,
- struct nas_priv *gpriv) {
- //---------------------------------------------------------------------------
- struct classifier_entity *gc;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_RCLASSIFIER: begin\n");
-#endif
-
- for (gc=gpriv->rclassifier[dscp]; gc!=NULL; gc=gc->next) {
- if (gc->classref==classref) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_RCLASSIFIER: classifier already exist for dscp %d, classref %d\n",dscp,classref);
-#endif
- return gc;
- }
- }
-
- gc=(struct classifier_entity *)kmalloc(sizeof(struct classifier_entity), GFP_KERNEL);
-
- if (gc==NULL)
- return NULL;
-
- gc->next=gpriv->rclassifier[dscp];
- gc->classref=classref;
- gpriv->rclassifier[dscp]=gc;
- ++gpriv->nrclassifier;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_RCLASSIFIER: classifier created for dscp %d, classref %d\n",dscp,classref);
-#endif
- return gc;
-}
-
-//---------------------------------------------------------------------------
-// Add a new classifier rule (forwarding)
-struct classifier_entity *nas_CLASS_add_fclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref) {
- //---------------------------------------------------------------------------
- struct classifier_entity *gc;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_FCLASSIFIER: begin for dscp %d, classref %d\n", dscp,classref);
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_FCLASSIFIER - input parameter cx is NULL \n");
-#endif
- return NULL;
- }
-
- for (gc=cx->fclassifier[dscp]; gc!=NULL; gc=gc->next) {
- if (gc->classref==classref) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_SCLASSIFIER: classifier already exist for dscp %d, classref %d\n",dscp,classref);
-#endif
- return gc;
- }
- }
-
- gc=(struct classifier_entity *)kmalloc(sizeof(struct classifier_entity), GFP_KERNEL);
-
- if (gc==NULL)
- return NULL;
-
- gc->next=cx->fclassifier[dscp];
- gc->classref=classref;
- cx->fclassifier[dscp]=gc;
- ++cx->nfclassifier;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_ADD_FCLASSIFIER: classifier created for dscp %d, classref %d\n",dscp,classref);
-#endif
- return gc;
-}
-
-
-//---------------------------------------------------------------------------
-void nas_CLASS_flush_sclassifier(struct cx_entity *cx) {
- //---------------------------------------------------------------------------
- uint8_t dscpi;
- struct classifier_entity *gc;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_SCLASSIFIER: begin\n");
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_SCLASSIFIER - input parameter cx is NULL \n");
-#endif
- return;
- }
-
- //
- for (dscpi=0; dscpisclassifier[dscpi]; gc!=NULL; gc=cx->sclassifier[dscpi]) {
- cx->sclassifier[dscpi]=gc->next;
- kfree(gc);
- }
- }
-
- cx->nsclassifier=0;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_SCLASSIFIER: end\n");
-#endif
-}
-//---------------------------------------------------------------------------
-void nas_CLASS_flush_fclassifier(struct cx_entity *cx) {
- //---------------------------------------------------------------------------
- uint8_t dscpi;
- struct classifier_entity *gc;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_FCLASSIFIER: begin\n");
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_FCLASSIFIER - input parameter cx is NULL \n");
-#endif
- return;
- }
-
- //
- for (dscpi=0; dscpifclassifier[dscpi]; gc!=NULL; gc=cx->fclassifier[dscpi]) {
- cx->fclassifier[dscpi]=gc->next;
- kfree(gc);
- }
- }
-
- cx->nfclassifier=0;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_FCLASSIFIER: end\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-void nas_CLASS_flush_rclassifier(struct nas_priv *gpriv) {
- //---------------------------------------------------------------------------
- uint8_t dscpi;
- struct classifier_entity *gc;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_RCLASSIFIER: begin\n");
-#endif
-
- for (dscpi=0; dscpirclassifier[dscpi]; gc!=NULL; gc=gpriv->rclassifier[dscpi]) {
- gpriv->rclassifier[dscpi]=gc->next;
- kfree(gc);
- }
- }
-
- gpriv->nrclassifier=0;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_FLUSH_RCLASSIFIER: end\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Delete a classifier rule (send direction)
-void nas_CLASS_del_sclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref) {
- //---------------------------------------------------------------------------
- struct classifier_entity *p,*np;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_SCLASSIFIER: begin\n");
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_SCLASSIFIER - input parameter cx is NULL \n");
-#endif
- return;
- }
-
- //
- p=cx->sclassifier[dscp];
-
- if (p==NULL)
- return;
-
- if (p->classref==classref) {
- cx->sclassifier[dscp]=p->next;
- kfree(p);
- --cx->nsclassifier;
- return;
- }
-
- for (np=p->next; np!=NULL; p=np) {
- if (np->classref==classref) {
- p->next=np->next;
- kfree(np);
- --cx->nsclassifier;
- return;
- }
- }
-
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_SCLASSIFIER: end\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Delete a classifier rule (send direction)
-void nas_CLASS_del_fclassifier(struct cx_entity *cx, uint8_t dscp, uint16_t classref) {
- //---------------------------------------------------------------------------
- struct classifier_entity *p,*np;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_FCLASSIFIER: begin\n");
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_FCLASSIFIER - input parameter cx is NULL \n");
-#endif
- return;
- }
-
- //
- p=cx->fclassifier[dscp];
-
- if (p==NULL)
- return;
-
- if (p->classref==classref) {
- cx->fclassifier[dscp]=p->next;
- kfree(p);
- --cx->nfclassifier;
- return;
- }
-
- for (np=p->next; np!=NULL; p=np) {
- if (np->classref==classref) {
- p->next=np->next;
- kfree(np);
- --cx->nfclassifier;
- return;
- }
- }
-
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_FCLASSIFIER: end\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Delete a classifier rule (receive direction)
-void nas_CLASS_del_rclassifier(uint8_t dscp, uint16_t classref,struct nas_priv *gpriv) {
- //---------------------------------------------------------------------------
- struct classifier_entity *p,*np;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_RCLASSIFIER: begin\n");
-#endif
- p=gpriv->rclassifier[dscp];
-
- if (p==NULL)
- return;
-
- if (p->classref==classref) {
- gpriv->rclassifier[dscp]=p->next;
- kfree(p);
- --gpriv->nrclassifier;
- return;
- }
-
- for (np=p->next; np!=NULL; p=np) {
- if (np->classref==classref) {
- p->next=np->next;
- kfree(np);
- --gpriv->nrclassifier;
- return;
- }
- }
-
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_DEL_RCLASSIFIER: end\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Search the entity with the IPv6 address 'addr'
-// Navid: the ipv6 classifier is not fully tested
-struct cx_entity *nas_CLASS_cx6(struct sk_buff *skb,
- unsigned char dscp,
- struct nas_priv *gpriv,
- int inst,
- unsigned char *cx_searcher) {
- //---------------------------------------------------------------------------
- unsigned char cxi;
- unsigned int *addr,*dst=NULL;
- struct cx_entity *default_ip=NULL;
- struct classifier_entity *p=NULL;
-
- if (skb!=NULL) {
- for (cxi=*cx_searcher; cxicx[cxi].sclassifier[dscp];
-
- while (p!=NULL) {
- if (p->version == 6) { // verify that this is an IPv4 rule
- if ((addr = (unsigned int *)(&(p->daddr.ipv6)))== NULL) {
- printk("nas_CLASS_cx6: addr is null \n");
- p = p->next;
- continue;
- }
-
-#ifdef NAS_DEBUG_CLASS
- printk("cx %d : %X,%X.%X,%X\n",cxi,addr[0],addr[1],addr[2],addr[3]);
-#endif //NAS_DEBUG_CLASS
-
-
- if ( (dst = &((struct iphdr *)(skb_network_header(skb)))->daddr) == NULL) {
- printk("nas_CLASS_cx6: dst addr is null \n");
- p = p->next;
- continue;
- }
-
- if ((addr[0] == dst[0]) &&
- (addr[1] == dst[1]) &&
- (addr[2] == dst[2]) &&
- (addr[3] == dst[3])) {
- //#ifdef NAS_DEBUG_CLASS
- printk("nas_CLASS_cx6: found cx %d: %X.%X.%X.%X\n",cxi,
- dst[0],
- dst[1],
- dst[2],
- dst[3]);
- //#endif //NAS_DEBUG_CLASS
- return gpriv->cx+cxi;
- }
-
- /*
- else if ((addr[0]==NAS_DEFAULT_IPV6_ADDR0) &&
- (addr[1]==NAS_DEFAULT_IPV6_ADDR1) &&
- (addr[2]==NAS_DEFAULT_IPV6_ADDR2) &&
- (addr[3]==NAS_DEFAULT_IPV6_ADDR3))
- default_ip = gpriv->cx+cxi;
- */
- }
-
- // Go to next classifier entry for connection
- p = p->next;
- }
- }
- }
-
-
- if (dst ) {
- printk("nas_CLASS_cx6 NOT FOUND: %X.%X.%X.%X\n",
- dst[0],
- dst[1],
- dst[2],
- dst[3]);
- }
-
- return default_ip;
-}
-
-//---------------------------------------------------------------------------
-// Search the entity with the IPv4 address 'addr'
-struct cx_entity *nas_CLASS_cx4(struct sk_buff *skb,
- unsigned char dscp,
- struct nas_priv *gpriv,
- int inst,
- unsigned char *cx_searcher) {
- //---------------------------------------------------------------------------
- unsigned char cxi;
- unsigned char *addr;
- uint32_t daddr;
- struct cx_entity *default_ip=NULL;
- struct classifier_entity *p=NULL;
-
- // if (inst >0)
- // return(gpriv->cx); //dump to clusterhead
-
- if (skb!=NULL) {
- daddr = ((struct iphdr *)(skb_network_header(skb)))->daddr;
-
- if (daddr!=0) {
-#ifdef NAS_DEBUG_CLASS
- printk("[NAS][CLASS][IPv4] Searching for %d.%d.%d.%d\n",
- ((unsigned char *)&daddr)[0],
- ((unsigned char *)&daddr)[1],
- ((unsigned char *)&daddr)[2],
- ((unsigned char *)&daddr)[3]);
-#endif
-
- for (cxi=*cx_searcher; cxicx[cxi].sclassifier[dscp];
-
- while (p!=NULL) {
- if (p->version == 4) { // verify that this is an IPv4 rule
-#ifdef NAS_DEBUG_CLASS
- addr = (char *)(&(p->daddr.ipv4));
- printk("found classifier cx %d for destination: %d.%d.%d.%d\n",cxi,addr[0],addr[1],addr[2],addr[3]);
-#endif //NAS_DEBUG_CLASS
-
- if ((p->daddr.ipv4)== daddr) {
- addr = (char *)(&(p->daddr.ipv4));
-#ifdef NAS_DEBUG_CLASS
- printk("found cx %d: %d.%d.%d.%d\n",cxi,
- addr[0],
- addr[1],
- addr[2],
- addr[3]);
-#endif //NAS_DEBUG_CLASS
- return gpriv->cx+cxi;
- }
-
- /*
- else if (gpriv->cx[cxi].sclassifier[dscp]->daddr.ipv4==NAS_DEFAULT_IPV4_ADDR) {
- #ifdef NAS_DEBUG_CLASS
- printk("found default_ip rule\n");
- #endif //NAS_DEBUG_CLASS
- default_ip = gpriv->cx+cxi;
- }
- */
- }
-
- // goto to next classification rule for the connection
- p = p->next;
- }
- }
- }
- }
-
- return default_ip;
-}
-
-#ifdef MPLS
-//---------------------------------------------------------------------------
-// Search the entity with the mpls label and given exp
-struct cx_entity *nas_CLASS_MPLS(struct sk_buff *skb,
- unsigned char exp,
- struct nas_priv *gpriv,
- int inst,
- unsigned char *cx_searcher) {
- //---------------------------------------------------------------------------
- unsigned char cxi;
- struct cx_entity *default_label=NULL;
- struct classifier_entity *p=NULL;
- // if (inst >0)
- // return(gpriv->cx); //dump to clusterhead
-#ifdef NAS_DEBUG_CLASS
- printk("[NAS][CLASS][MPLS] Searching for label %d\n",MPLSCB(skb)->label);
-#endif
-
- for (cxi=*cx_searcher; cxicx[cxi].sclassifier[exp];
-
- while (p!=NULL) {
- if (p->version == NAS_MPLS_VERSION_CODE) { // verify that this is an MPLS rule
-#ifdef NAS_DEBUG_CLASS
- printk("cx %d : label %d\n",cxi,p->daddr.mpls_label);
-#endif //NAS_DEBUG_CLASS
-
- if (p->daddr.mpls_label==MPLSCB(skb)->label) {
-#ifdef NAS_DEBUG_CLASS
- printk("found cx %d: label %d, RB %d\n",cxi,
- MPLSCB(skb)->label,
- p->rab_id);
-#endif //NAS_DEBUG_CLASS
- return gpriv->cx+cxi;
- }
-
- /*
- else if (gpriv->cx[cxi].sclassifier[dscp]->daddr.ipv4==NAS_DEFAULT_IPV4_ADDR) {
- #ifdef NAS_DEBUG_CLASS
- printk("found default_ip rule\n");
- #endif //NAS_DEBUG_CLASS
- default_ip = gpriv->cx+cxi;
- }
- */
- }
-
- // goto to next classification rule for the connection
- p = p->next;
- }
- }
-
- return default_label;
-}
-
-#endif
-
-//---------------------------------------------------------------------------
-// Search the sending function
-void nas_CLASS_send(struct sk_buff *skb,int inst) {
- //---------------------------------------------------------------------------
- struct classifier_entity *p, *sp;
- uint8_t *protocolh,version;
- uint8_t protocol, dscp /*, exp,label*/ ;
- uint16_t classref;
- struct cx_entity *cx;
- //unsigned int i;
- //unsigned int router_adv = 0;
- struct net_device *dev=nasdev[inst];
- struct nas_priv *gpriv=netdev_priv(dev);
- unsigned char cx_searcher,no_connection=1;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_SEND: begin - inst %d\n",inst);
-#endif
-
- if (skb==NULL) {
-#ifdef NAS_DEBUG_SEND
- printk("NAS_CLASS_SEND - input parameter skb is NULL \n");
-#endif
- return;
- }
-
-#ifdef NAS_DEBUG_SEND
- printk("[NAS][CLASS][SEND] Got packet from kernel:\n");
-
- for (int i=0; i<256; i++)
- printk("%2x ",((unsigned char *)skb->data)[i]);
-
- printk("\n");
-#endif
- // find all connections related to socket
- cx_searcher = 0;
- no_connection = 1;
- //while (cx_searcherprotocol)) {
- case ETH_P_IPV6:
- version = 6;
- protocolh=nas_TOOL_get_protocol6(
- (struct ipv6hdr *)(skb_network_header(skb)),
- &protocol);
- dscp=nas_TOOL_get_dscp6(
- (struct ipv6hdr *)(skb_network_header(skb))
- );
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_SEND: %p %d %p %d %p \n",skb, dscp, gpriv, inst, &cx_searcher);
-#endif
- cx=nas_CLASS_cx6(skb,dscp,gpriv,inst,&cx_searcher);
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_SEND: Got IPv6 packet, dscp = %d\n",dscp);
-#endif
- break;
-
- case ETH_P_IP:
- dscp=nas_TOOL_get_dscp4((struct iphdr *)(skb_network_header(skb)));
- cx=nas_CLASS_cx4(skb,dscp,gpriv,inst,&cx_searcher);
- protocolh=nas_TOOL_get_protocol4(
- (struct iphdr *)(skb_network_header(skb)),
- &protocol);
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_SEND: Got IPv4 packet (%x), dscp = %d, cx = %x\n",ntohs(skb->protocol),dscp,cx);
-#endif
- version = 4;
- break;
-#ifdef MPLS
-
- case ETH_P_MPLS_UC:
- cx=nas_CLASS_MPLS(skb,MPLSCB(skb)->exp,gpriv,inst,&cx_searcher);
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_SEND: Got MPLS unicast packet, exp = %d, label = %d, cx = %x\n",MPLSCB(skb)->exp,MPLSCB(skb)->label,cx);
-#endif
- dscp = MPLSCB(skb)->exp;
- version = NAS_MPLS_VERSION_CODE;
- protocol = version;
- break;
-#endif
-
- default:
- printk("NAS_CLASS_SEND: Unknown protocol\n");
- version = 0;
- return;
- }
-
- // If a valid connection for the DSCP/EXP with destination address
- // is found scan all protocol-based classification rules
-
- if (cx) {
- classref=0;
- sp=NULL;
-#ifdef NAS_DEBUG_CLASS
- printk("[NAS][CLASSIFIER] DSCP/EXP %d : looking for classifier entry\n",dscp);
-#endif
-
- for (p=cx->sclassifier[dscp]; p!=NULL; p=p->next) {
-#ifdef NAS_DEBUG_CLASS
- printk("[NAS][CLASSIFIER] DSCP %d p->classref=%d,p->protocol=%d,p->version=%d\n",dscp,p->classref,p->protocol,p->version);
-#endif
- // Check if transport protocol/message match
- /*
- if ((p->protocol == protocol))
- if ((protocol == NAS_PROTOCOL_ICMP6) && (version == 6))
- if (p->protocol_message_type == (p->protocol_message_type )) {
- printk("[GRAAL][CLASSIFIER] Router advertisement\n");
- }
- */
- // normal rule checks that network protocol version matches
-
- if (p->version == version) {
- sp=p;
- classref=sp->classref;
- break;
- }
- }
-
- if (sp!=NULL) {
-#ifdef NAS_DEBUG_CLASS
- char sfct[10], sprotocol[10];
-
- if (sp->fct==nas_COMMON_QOS_send)
- strcpy(sfct, "qos");
-
- if (sp->fct==nas_CTL_send)
- strcpy(sfct, "ctl");
-
- if (sp->fct==nas_COMMON_del_send)
- strcpy(sfct, "del");
-
- if (sp->fct==nas_mesh_DC_send_sig_data_request)
- strcpy(sfct, "dc");
-
- switch(protocol) {
- case NAS_PROTOCOL_UDP:
- strcpy(sprotocol, "udp");
- printk("udp packet\n");
- break;
-
- case NAS_PROTOCOL_TCP:
- strcpy(sprotocol, "tcp");
- printk("tcp packet\n");
- break;
-
- case NAS_PROTOCOL_ICMP4:
- strcpy(sprotocol, "icmp4");
- printk("icmp4 packet\n");
- break;
-
- case NAS_PROTOCOL_ICMP6:
- strcpy(sprotocol, "icmp6");
- print_TOOL_pk_icmp6((struct icmp6hdr *)protocolh);
- break;
-#ifdef MPLS
-
- case NAS_MPLS_VERSION_CODE:
- strcpy(sprotocol,"mpls");
- break;
-#endif
- }
-
- printk("NAS_CLASS_SEND: (dscp %u, %s) received, (classref %u, fct %s, rab_id %u) classifier rule\n",
- dscp, sprotocol, sp->classref, sfct, sp->rab_id);
-#endif
- sp->fct(skb, cx, sp,inst, NULL);
- } // if classifier entry match found
- else {
- printk("NAS_CLASS_SEND: no corresponding item in the classifier, so the message is dropped\n");
- // nas_COMMON_del_send(skb, cx, NULL,inst);
- }
-
- no_connection = 0;
- } // if connection found
-
-#ifdef NAS_DEBUG_CLASS
-
- if (no_connection == 1)
- printk("NAS_CLASS_SEND: no corresponding connection, so the message is dropped\n");
-
-#endif /* NAS_DEBUG_CLASS */
- // } // while loop over connections
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_CLASS_SEND: end\n");
-#endif
-}
diff --git a/openair2/NETWORK_DRIVER/MESH/common.c b/openair2/NETWORK_DRIVER/MESH/common.c
deleted file mode 100644
index c04acded3e..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/common.c
+++ /dev/null
@@ -1,618 +0,0 @@
-/*
- * 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
- */
-
-/*! \file common.c
-* \brief implementation of emultor tx and rx
-* \author Navid Nikaein, Lionel GAUTHIER, and Raymomd Knopp
-* \date 2011
-* \version 1.0
-* \company Eurecom
-* \email: navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
-*/
-
-#include "local.h"
-#include "proto_extern.h"
-
-//#define NAS_DEBUG_RECEIVE 1
-//#define NAS_DEBUG_SEND 1
-//#define NAS_DEBUG_CLASS 1
-//#define NAS_ADDRESS_FIX 1
-
-#include
-
-#include
-#include
-
-
-void nas_COMMON_receive(uint16_t dlen,
- void *pdcp_sdu,
- int inst,
- struct classifier_entity *rclass,
- nasRadioBearerId_t rb_id)
-{
-
- //---------------------------------------------------------------------------
- struct sk_buff *skb;
- struct ipversion *ipv;
- struct nas_priv *gpriv=netdev_priv(nasdev[inst]);
-
- //int i;
-
- unsigned char protocol;
-
-
- //struct udphdr *uh;
- //struct tcphdr *th;
-
- struct iphdr *network_header;
-
-#ifdef NAS_DEBUG_RECEIVE
-
- printk("NAS_COMMON_RECEIVE: begin RB %d Inst %d Length %d bytes\n",rb_id,inst,dlen);
-#endif
- skb = dev_alloc_skb( dlen + 2 );
-
- if(!skb) {
- printk("NAS_COMMON_RECEIVE: low on memory\n");
- ++gpriv->stats.rx_dropped;
- return;
- }
-
- skb_reserve(skb,2);
- memcpy(skb_put(skb, dlen), pdcp_sdu,dlen);
-
- skb->dev = nasdev[inst];
-
- skb_reset_mac_header(skb);
- //printk("[NAC_COMMIN_RECEIVE]: Packet Type %d (%d,%d)",skb->pkt_type,PACKET_HOST,PACKET_BROADCAST);
- skb->pkt_type = PACKET_HOST;
-
- if (rclass->version != NAS_MPLS_VERSION_CODE) { // This is an IP packet
-
- skb->ip_summed = CHECKSUM_NONE;
-
-
- ipv = (struct ipversion *)skb->data;
-
- switch (ipv->version) {
- case 6:
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_RECEIVE: receive IPv6 message\n");
-#endif
-
-
- skb_reset_network_header(skb);
-
- skb->protocol = htons(ETH_P_IPV6);
- // printk("Writing packet with protocol %x\n",ntohs(skb->protocol));
-
- break;
-
- case 4:
-#ifdef NAS_ADDRESS_FIX
- // Make the third byte of both the source and destination equal to the fourth of the destination
-
- unsigned char * ifaddr, *saddr, daddr;
- uint32_t odaddr = 0, osaddr;
- daddr = (unsigned char *)&((struct iphdr *)skb->data)->daddr;
- odaddr = ((struct iphdr *)skb->data)->daddr;
- //sn = addr[3];
- saddr = (unsigned char *)&((struct iphdr *)skb->data)->saddr;
- osaddr = ((struct iphdr *)skb->data)->saddr;
-
- if (daddr[0] == saddr[0]) {// same network
- daddr[2] = daddr[3]; // set third byte of destination to that of local machine so that local IP stack accepts the packet
- saddr[2] = daddr[3]; // set third byte of source to that of local machine so that local IP stack accepts the packet
- } else { // get the 3rd byte from device address in net_device structure
- ifaddr = (unsigned char *)(&(((struct in_device *)((nasdev[inst])->ip_ptr))->ifa_list->ifa_local));
-
- if (saddr[0] == ifaddr[0]) { // source is in same network as local machine
- daddr[0] += saddr[3]; // fix address of remote destination to undo change at source
- saddr[2] = ifaddr[2]; // set third byte to that of local machine so that local IP stack accepts the packet
- } else { // source is remote machine from outside network
- saddr[0] -= daddr[3]; // fix address of remote source to be understood by destination
- daddr[2] = daddr[3]; // fix 3rd byte of local address to be understood by IP stack of
- // destination
- }
- }
-
-#endif //NAS_ADDRESS_FIX
-#ifdef NAS_DEBUG_RECEIVE
- // printk("NAS_TOOL_RECEIVE: receive IPv4 message\n");
- addr = (unsigned char *)&((struct iphdr *)skb->data)->saddr;
-
- if (addr) {
- // addr[2]^=0x01;
- printk("[NAS][COMMON][RECEIVE] Source %d.%d.%d.%d\n",addr[0],addr[1],addr[2],addr[3]);
- }
-
- addr = (unsigned char *)&((struct iphdr *)skb->data)->daddr;
-
- if (addr) {
- // addr[2]^=0x01;
- printk("[NAS][COMMON][RECEIVE] Dest %d.%d.%d.%d\n",addr[0],addr[1],addr[2],addr[3]);
- }
-
- printk("[NAS][COMMON][RECEIVE] protocol %d\n",((struct iphdr *)skb->data)->protocol);
-
-#endif
-
- skb_reset_network_header(skb);
- network_header = (struct iphdr *)skb_network_header(skb);
- protocol = network_header->protocol;
-
-#ifdef NAS_DEBUG_RECEIVE
-
- switch (protocol) {
- case IPPROTO_IP:
- printk("[NAS][COMMON][RECEIVE] Received Raw IPv4 packet\n");
- break;
-
- case IPPROTO_IPV6:
- printk("[NAS][COMMON][RECEIVE] Received Raw IPv6 packet\n");
- break;
-
- case IPPROTO_ICMP:
- printk("[NAS][COMMON][RECEIVE] Received Raw ICMP packet\n");
- break;
-
- case IPPROTO_TCP:
- printk("[NAS][COMMON][RECEIVE] Received TCP packet\n");
- break;
-
- case IPPROTO_UDP:
- printk("[NAS][COMMON][RECEIVE] Received UDP packet\n");
- break;
-
- default:
- break;
- }
-
-#endif
-
-#ifdef NAS_ADDRESS_FIX
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_RECEIVE: dumping the packet before the csum recalculation (len %d)\n",skb->len);
-
- for (i=0; ilen; i++)
- printk("%2x ",((unsigned char *)(skb->data))[i]);
-
- printk("\n");
-#endif //NAS_DEBUG_RECEIVE
-
-
- network_header->check = 0;
- network_header->check = ip_fast_csum((unsigned char *) network_header,
- network_header->ihl);
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON][RECEIVE] IP Fast Checksum %x \n", network_header->check);
-#endif
-
- // if (!(skb->nh.iph->frag_off & htons(IP_OFFSET))) {
-
-
-
-
- switch(protocol) {
-
- case IPPROTO_TCP:
-
- uint16_t *cksum,check;
- cksum = (uint16_t*)&(((struct tcphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
- //check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON] Inst %d TCP packet calculated CS %x, CS = %x (before), SA (%x)%x, DA (%x)%x\n",
- inst,
- network_header->check,
- *cksum,
- osaddr,
- ((struct iphdr *)skb->data)->saddr,
- odaddr,
- ((struct iphdr *)skb->data)->daddr);
-#endif
- check = csum_tcpudp_magic(((struct iphdr *)skb->data)->saddr, ((struct iphdr *)skb->data)->daddr,0,0, ~(*cksum));
- *cksum = csum_tcpudp_magic(~osaddr, ~odaddr, 0, 0, ~check);
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON] Inst %d TCP packet NEW CS %x\n",
- inst,
- *cksum);
-#endif
- break;
-
- case IPPROTO_UDP:
-
- cksum = (uint16_t*)&(((struct udphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
- // check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, udp_hdr(skb)->len, IPPROTO_UDP, ~(*cksum));
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON] Inst %d UDP packet CS = %x (before), SA (%x)%x, DA (%x)%x\n",
- inst,
- *cksum,
- osaddr,
- ((struct iphdr *)skb->data)->saddr,
- odaddr,
- ((struct iphdr *)skb->data)->daddr);
-#endif
- check = csum_tcpudp_magic(((struct iphdr *)skb->data)->saddr, ((struct iphdr *)skb->data)->daddr, 0,0, ~(*cksum));
- *cksum= csum_tcpudp_magic(~osaddr, ~odaddr,0,0, ~check);
- //*cksum= csum_tcpudp_magic(~osaddr, ~odaddr,udp_hdr(skb)->len, IPPROTO_UDP, ~check);
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON] Inst %d UDP packet NEW CS %x\n",
- inst,
- *cksum);
-#endif
- // if ((check = *cksum) != 0) {
- // src, dst, len, proto, sum
-
-
- // }
-
- break;
-
- default:
- break;
- }
-
- // }
-
-#endif //NAS_ADDRESS_FIX
-
- skb->protocol = htons(ETH_P_IP);
- // printk("[NAS][COMMON] Writing packet with protocol %x\n",ntohs(skb->protocol));
- break;
-
- default:
- printk("NAS_COMMON_RECEIVE: begin RB %d Inst %d Length %d bytes\n",rb_id,inst,dlen);
-
- printk("[NAS][COMMON] Inst %d: receive unknown message (version=%d)\n",inst,ipv->version);
-
- }
- } else { // This is an MPLS packet
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_RECEIVE: Received an MPLS packet on RB %d\n",rb_id);
-#endif
- skb->protocol = htons(ETH_P_MPLS_UC);
-
- }
-
- ++gpriv->stats.rx_packets;
- gpriv->stats.rx_bytes += dlen;
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_RECEIVE: sending packet of size %d to kernel\n",skb->len);
-
- for (i=0; ilen; i++)
- printk("%2x ",((unsigned char *)(skb->data))[i]);
-
- printk("\n");
-#endif //NAS_DEBUG_RECEIVE
- netif_rx_ni(skb);
-#ifdef NAS_DEBUG_RECEIVE
- printk("NAS_COMMON_RECEIVE: end\n");
-#endif
-}
-
-//---------------------------------------------------------------------------
-// Delete the data
-void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *sp,int inst,struct nas_priv *gpriv)
-{
- struct nas_priv *priv=netdev_priv(nasdev[inst]);
- //---------------------------------------------------------------------------
- ++priv->stats.tx_dropped;
-}
-
-//---------------------------------------------------------------------------
-// Request the transfer of data (QoS SAP)
-
-void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst, struct nas_priv *gpriv)
-{
- //---------------------------------------------------------------------------
- struct pdcp_data_req_header_s pdcph;
- struct nas_priv *priv=netdev_priv(nasdev[inst]);
-#ifdef LOOPBACK_TEST
- int i;
-#endif
- unsigned int bytes_wrote;
- //unsigned char j;
- // Start debug information
-#ifdef NAS_DEBUG_SEND
- printk("NAS_COMMON_QOS_SEND - inst %d begin \n",inst);
-#endif
-
- // if (cx->state!=NAS_STATE_CONNECTED) // <--- A REVOIR
- // {
- // priv->stats.tx_dropped ++;
- // printk("NAS_QOS_SEND: No connected, so message are dropped \n");
- // return;
- // }
- if (skb==NULL) {
-#ifdef NAS_DEBUG_SEND
- printk("NAS_COMMON_QOS_SEND - input parameter skb is NULL \n");
-#endif
- return;
- }
-
- if (gc==NULL) {
-#ifdef NAS_DEBUG_SEND
- printk("NAS_COMMON_QOS_SEND - input parameter gc is NULL \n");
-#endif
- return;
- }
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_SEND
- printk("NAS_COMMON_QOS_SEND - input parameter cx is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- if (gc->rb==NULL) {
- gc->rb=nas_COMMON_search_rb(cx, gc->rab_id);
-
- if (gc->rb==NULL) {
- ++priv->stats.tx_dropped;
- printk("NAS_COMMON_QOS_SEND: No corresponding Radio Bearer, so message are dropped, rab_id=%u \n", gc->rab_id);
- return;
- }
- }
-
-#ifdef NAS_DEBUG_SEND
- printk("NAS_COMMON_QOS_SEND #1 :");
- printk("lcr %u, rab_id %u, rab_id %u, skb_len %d\n", cx->lcr, (gc->rb)->rab_id, gc->rab_id,skb->len);
- nas_print_classifier(gc);
-#endif
- pdcph.data_size = skb->len;
- pdcph.rb_id = (gc->rb)->rab_id;
- pdcph.inst = inst;
- pdcph.sourceL2Id = 0;
- pdcph.destinationL2Id = 0;
-
- bytes_wrote = nas_netlink_send((char *)&pdcph,NAS_PDCPH_SIZE);
-#ifdef NAS_DEBUG_SEND
- printk("[NAS] Wrote %d bytes (header for %d byte skb) to PDCP via netlink\n",
- bytes_wrote,skb->len);
-#endif
-
- if (bytes_wrote != NAS_PDCPH_SIZE) {
- printk("NAS_COMMON_QOS_SEND: problem while writing PDCP's header (bytes wrote = %d )\n",bytes_wrote);
- printk("rb_id %ld, Wrote %d, Header Size %lu\n", pdcph.rb_id , bytes_wrote, NAS_PDCPH_SIZE);
- return;
- }
-
- bytes_wrote += nas_netlink_send((char *)skb->data,skb->len);
-
- if (bytes_wrote != skb->len+NAS_PDCPH_SIZE) {
- printk("NAS_COMMON_QOS_SEND: Inst %d, RB_ID %ld: problem while writing PDCP's data, bytes_wrote = %d, Data_len %d, PDCPH_SIZE %lu\n",
- inst,
- pdcph.rb_id,
- bytes_wrote,
- skb->len,
- NAS_PDCPH_SIZE); // congestion
- return;
- }
-
-#ifdef NAS_DEBUG_SEND
- printk("NAS_SEND: Sending packet of size %d to PDCP \n",skb->len);
-
- for (j=0; jlen; j++)
- printk("%2x ",((unsigned char *)(skb->data))[j]);
-
- printk("\n");
-#endif
-
- priv->stats.tx_bytes += skb->len;
- priv->stats.tx_packets ++;
-#ifdef NAS_DEBUG_SEND
- printk("NAS_COMMON_QOS_SEND - end \n");
-#endif
-}
-
-void nas_COMMON_QOS_receive(struct nlmsghdr *nlh)
-{
-
- struct pdcp_data_ind_header_s *pdcph = (struct pdcp_data_ind_header_s *)NLMSG_DATA(nlh);
- struct classifier_entity *rclass;
- struct nas_priv *priv;
-
- priv = netdev_priv(nasdev[pdcph->inst]);
-
-
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON][NETLINK] QOS receive from PDCP, size %d, rab %d, inst %d\n",
- pdcph->data_size,pdcph->rb_id,pdcph->inst);
-#endif //NAS_DEBUG_RECEIVE
-
- rclass = nas_COMMON_search_class_for_rb(pdcph->rb_id,priv);
-
- if (rclass) {
-#ifdef NAS_DEBUG_RECEIVE
- printk("[NAS][COMMON][NETLINK] Found corresponding connection in classifier for RAB\n");
-#endif //NAS_DEBUG_RECEIVE
-
- nas_COMMON_receive(pdcph->data_size,
- (unsigned char *)NLMSG_DATA(nlh) + NAS_PDCPH_SIZE,
- pdcph->inst,
- rclass,
- pdcph->rb_id);
- }
-
-}
-
-//---------------------------------------------------------------------------
-struct cx_entity *nas_COMMON_search_cx(nasLocalConnectionRef_t lcr,struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_SEARCH_CX - lcr %d\n",lcr);
-#endif
-
- if (lcrcx+lcr;
- else
- return NULL;
-}
-
-//---------------------------------------------------------------------------
-// Search a Radio Bearer
-struct rb_entity *nas_COMMON_search_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id)
-{
- //---------------------------------------------------------------------------
- struct rb_entity *rb;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_SEARCH_RB - rab_id %d\n", rab_id);
-#endif
-
- for (rb=cx->rb; rb!=NULL; rb=rb->next) {
-#ifdef NAS_DEBUG_CLASS
- printk("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n");
- printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.rab_id %u \n", rb->rab_id, rab_id);
- //printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.sapi %u \n", rb->sapi);
- //printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.qos %u \n", rb->qos);
- //printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.state %u \n", rb->state);
- //printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.retry %u \n", rb->retry);
- //printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.countimer %u \n\n", rb->countimer);
-#endif
-
- if (rb->rab_id==rab_id)
- return rb;
- }
-
- return NULL;
-}
-
- //
- // Search for a classifier with corresponding radio bearer
-
- struct classifier_entity *nas_COMMON_search_class_for_rb(nasRadioBearerId_t rab_id,struct nas_priv *priv)
-{
-
- //struct rb_entity *rb;
- int dscp;
- struct classifier_entity *rclass;
-
-#ifdef NAS_DEBUG_CLASS
- printk("[NAS][COMMON] NAS_COMMON_SEARCH_CLASS_FOR_RB - rab_id %d\n", rab_id);
-#endif
-
- for (dscp=0; dscprclassifier[%d] = %p\n",dscp,priv->rclassifier[dscp]);
- for (rclass=priv->rclassifier[dscp]; rclass!=NULL; rclass=rclass->next) {
-#ifdef NAS_DEBUG_CLASS
- printk("[NAS][COMMON] NAS_COMMON_SEARCH_CLASS_FOR_RB - dscp %d, rb %d\n", dscp,rclass->rab_id);
-#endif
-
- if (rclass->rab_id==rab_id)
- return rclass;
- }
- }
-
- return NULL;
-
-}
-
-//---------------------------------------------------------------------------
-struct rb_entity *nas_COMMON_add_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id, nasQoSTrafficClass_t qos)
-{
- //--------------------------------------------------------------------------
- struct rb_entity *rb;
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_ADD_RB - begin for rab_id %d , qos %d\n", rab_id, qos );
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_ADD_RB - input parameter cx is NULL \n");
-#endif
- return NULL;
- }
-
- rb=nas_COMMON_search_rb(cx, rab_id);
-
- if (rb==NULL) {
- rb=(struct rb_entity *)kmalloc(sizeof(struct rb_entity), GFP_KERNEL);
-
- if (rb!=NULL) {
- rb->retry=0;
- rb->countimer=NAS_TIMER_IDLE;
- rb->rab_id=rab_id;
- // rb->rab_id=rab_id+(32*cx->lcr);
-#ifdef NAS_DEBUG_DC
- printk("NAS_COMMON_ADD_RB: rab_id=%u, mt_id=%u\n",rb->rab_id, cx->lcr);
-#endif
- rb->qos=qos;
- rb->sapi=NAS_RAB_INPUT_SAPI;
- rb->state=NAS_IDLE;
- rb->next=cx->rb;
- cx->rb=rb;
- ++cx->num_rb;
- } else
- printk("NAS_ADD_CTL_RB: no memory\n");
- }
-
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_ADD_RB - end \n" );
-#endif
- return rb;
-}
-
-//---------------------------------------------------------------------------
-void nas_COMMON_flush_rb(struct cx_entity *cx)
-{
- //---------------------------------------------------------------------------
- struct rb_entity *rb;
- struct classifier_entity *gc;
- uint8_t dscp;
- // End debug information
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_FLUSH_RB - begin\n");
-#endif
-
- if (cx==NULL) {
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_FLUSH_RB - input parameter cx is NULL \n");
-#endif
- return;
- }
-
- // End debug information
- for (rb=cx->rb; rb!=NULL; rb=cx->rb) {
- printk("NAS_COMMON_FLUSH_RB: del rab_id %u\n", rb->rab_id);
- cx->rb=rb->next;
- kfree(rb);
- }
-
- cx->num_rb=0;
- cx->rb=NULL;
-
- for(dscp=0; dscpsclassifier[dscp]; gc!=NULL; gc=gc->next)
- gc->rb=NULL;
- }
-
-#ifdef NAS_DEBUG_CLASS
- printk("NAS_COMMON_FLUSH_RB - end\n");
-#endif
-}
diff --git a/openair2/NETWORK_DRIVER/MESH/constant.h b/openair2/NETWORK_DRIVER/MESH/constant.h
deleted file mode 100644
index 5347c5a784..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/constant.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * 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
- */
-
-#ifndef _NAS_CST
-#define _NAS_CST
-
-#define MAX_MEASURE_NB 5
-#define NAS_MAX_LENGTH 180
-
-//Debug flags
-//#define NAS_DEBUG_DC
-//#define NAS_DEBUG_SEND
-//#define NAS_DEBUG_RECEIVE
-//#define NAS_DEBUG_CLASS
-//#define NAS_DEBUG_GC
-//#define NAS_DEBUG_DC_MEASURE
-//#define NAS_DEBUG_TIMER
-//#define NAS_DEBUG_DEVICE
-//#define NAS_DEBUG_INTERRUPT
-//#define NAS_DEBUG_TOOL
-
-// Other flags
-#define DEMO_3GSM
-
-// General Constants
-#define NAS_MTU 1500
-#define NAS_TX_QUEUE_LEN 100
-#define NAS_ADDR_LEN 8
-#define NAS_INET6_ADDRSTRLEN 46
-#define NAS_INET_ADDRSTRLEN 16
-
-#define NAS_CX_MAX 32 //128 //Identical to RRC constant: no you cannot
-/* increase to 128 without risking stack problems: KEEP ATTENTION TO COMPILATION WARNINGS */
-//#define NAS_CX_MULTICAST_ALLNODE 2
-
-#define NAS_RETRY_LIMIT_DEFAULT 5
-
-#define NAS_MESSAGE_MAXLEN 5004
-
-#define NAS_SIG_SRB3 3
-#define NAS_SIG_SRB4 3 // not used yet
-
-//peer-to-peer messages between NAS entities
-#define NAS_CMD_OPEN_RB 1
-
-//#define NAS_IID1_CONTROL 0x0
-//#define NAS_IID2_CONTROL __constant_htonl(0xffffffff)
-
-//#define NAS_STATE_IDLE 0
-//#define NAS_STATE_CONNECTED 1
-//#define NAS_STATE_ESTABLISHMENT_REQUEST 2
-//#define NAS_STATE_ESTABLISHMENT_FAILURE 3
-//#define NAS_STATE_RELEASE_FAILURE 4
-#define NAS_CX_RELEASE_UNDEF_CAUSE 1
-
-// MT+RG NAS States
-#define NAS_IDLE 0x01
-// Connection
-#define NAS_CX_FACH 0x06
-#define NAS_CX_DCH 0x0A
-#define NAS_CX_RECEIVED 0x10
-#define NAS_CX_CONNECTING 0x04
-#define NAS_CX_RELEASING 0x08
-#define NAS_CX_CONNECTING_FAILURE 0x14
-#define NAS_CX_RELEASING_FAILURE 0x18
-// Radio Bearers
-#define NAS_RB_ESTABLISHING 0x24
-#define NAS_RB_RELEASING 0x28
-#define NAS_RB_DCH 0x2A
-
-
-#define NAS_TIMER_ESTABLISHMENT_DEFAULT 12
-#define NAS_TIMER_RELEASE_DEFAULT 2
-#define NAS_TIMER_IDLE UINT_MAX
-#define NAS_TIMER_TICK HZ
-
-#define NAS_PDCPH_SIZE sizeof(struct pdcp_data_req_header_s)
-#define NAS_IPV4_SIZE 20
-#define NAS_IPV6_SIZE 40
-
-#define NAS_DIRECTION_SEND 0
-#define NAS_DIRECTION_RECEIVE 1
-#define NAS_DIRECTION_FORWARD 2
-
-// function number
-#define NAS_FCT_DEL_SEND 1
-#define NAS_FCT_QOS_SEND 2
-#define NAS_FCT_DC_SEND 3
-#define NAS_FCT_CTL_SEND 4
-
-// type of IOCTL command
-#define NAS_IOCTL_RRM 0x89F0
-
-// Error cause
-#define NAS_ERROR_ALREADYEXIST 1
-#define NAS_ERROR_NOMEMORY 3
-#define NAS_ERROR_NOTMT 9
-#define NAS_ERROR_NOTRG 10
-#define NAS_ERROR_NOTIDLE 11
-#define NAS_ERROR_NOTCONNECTED 12
-#define NAS_ERROR_NORB 14
-#define NAS_ERROR_NOTCORRECTVALUE 32
-#define NAS_ERROR_NOTCORRECTLCR 33
-#define NAS_ERROR_NOTCORRECTDIR 34
-#define NAS_ERROR_NOTCORRECTDSCP 35
-#define NAS_ERROR_NOTCORRECTVERSION 36
-#define NAS_ERROR_NOTCORRECTRABI 37
-
-
-/**********************************************************/
-/* Constants related with IP protocols */
-/**********************************************************/
-
-//#define NAS_PORT_CONTROL __constant_htons(0xc45)
-//#define NAS_PORT_AUTHENTICATION __constant_htons(1811)
-
-#define NAS_TRAFFICCLASS_MASK __constant_htonl(0x0fc00000)
-
-// Network control codepoint 111000 + IP version 6
-#define NAS_FLOWINFO_NCONTROL __constant_htonl(0x6e000000)
-// network control codepoint 111000
-#define NAS_DSCP_NCONTROL 56 //0x38
-// default codepoint 1000000
-#define NAS_DSCP_DEFAULT 64
-#define NAS_DSCP_MAX 193
-
-#define NAS_PROTOCOL_DEFAULT 0
-#define NAS_PROTOCOL_TCP IPPROTO_TCP
-#define NAS_PROTOCOL_UDP IPPROTO_UDP
-#define NAS_PROTOCOL_ICMP4 IPPROTO_ICMP
-#define NAS_PROTOCOL_ICMP6 IPPROTO_ICMPV6
-
-#define NAS_PORT_DEFAULT __constant_htons(65535)
-#define NAS_PORT_HTTP __constant_htons(80)
-
-#define NAS_VERSION_DEFAULT 0
-#define NAS_VERSION_4 4
-#define NAS_VERSION_6 0 //?MW
-
-#define NAS_DEFAULT_IPV4_ADDR 0
-#define NAS_DEFAULT_IPV6_ADDR0 0
-#define NAS_DEFAULT_IPV6_ADDR1 0
-#define NAS_DEFAULT_IPV6_ADDR2 0
-#define NAS_DEFAULT_IPV6_ADDR3 0
-
-
-#define NAS_MPLS_VERSION_CODE 99
-
-#define NB_INSTANCES_MAX 64 //16
-
-
-#endif
-
-
-
diff --git a/openair2/NETWORK_DRIVER/MESH/device.c b/openair2/NETWORK_DRIVER/MESH/device.c
deleted file mode 100644
index d86e32e561..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/device.c
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- * 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
- */
-
-/*! \file device.c
-* \brief Networking Device Driver for OpenAirInterface MESH
-* \author navid.nikaein, yan.moret(no longer valid), michelle.wetterwald, raymond.knopp
-* \company Eurecom
-* \email: raymond.knopp@eurecom.fr, navid.nikaein@eurecom.fr, michelle.wetterwald@eurecom.fr,
-
-*/
-/*******************************************************************************/
-
-#include "constant.h"
-#include "local.h"
-#include "proto_extern.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-//#define DEBUG_DEVICE 1
-//#define DEBUG_INTERRUPT 1
-
-struct net_device *nasdev[NB_INSTANCES_MAX];
-
-extern void nas_netlink_release(void);
-extern int nas_netlink_init(void);
-
-//int bytes_wrote;
-//int bytes_read;
-uint8_t NULL_IMEI[14]= {0x05, 0x04, 0x03, 0x01, 0x02 ,0x00, 0x00, 0x00, 0x05, 0x04, 0x03 ,0x00, 0x01, 0x08};
-
-
-static unsigned int nas_IMEI[6]= {0x03, 0x01, 0x02 ,0x00, 0x00, 0x00}; // may change to char
-static int m_arg=0;
-static unsigned int nas_is_clusterhead=0;
-
-
-int find_inst(struct net_device *dev)
-{
-
- int i;
-
- for (i=0; itimer);
- (priv->timer).expires=jiffies+NAS_TIMER_TICK;
- (priv->timer).data=0L;
- (priv->timer).function=nas_mesh_timer;
- // add_timer(&priv->timer);
- //
- */
- printk("OPEN: name = %s, end\n", dev->name);
- return 0;
-}
-
-//---------------------------------------------------------------------------
-// Called by ifconfig when the device is desactivated
-int nas_stop(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- struct nas_priv *priv = netdev_priv(dev);
- printk("STOP: begin\n");
- del_timer(&(priv->timer));
- netif_stop_queue(dev);
- // MOD_DEC_USE_COUNT;
- printk("STOP: name = %s, end\n", dev->name);
- return 0;
-}
-
-//---------------------------------------------------------------------------
-void nas_teardown(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- int cxi;
-
- struct nas_priv *priv;
- int inst;
-
- if (dev) {
- priv = netdev_priv(dev);
- inst = find_inst(dev);
-
- if (inst<0) {
- printk("nas_teardown: ERROR, couldn't find instance\n");
- }
-
- printk("nas_teardown instance %d: begin\n",inst);
-
-
-
- nas_CLASS_flush_rclassifier(priv);
-
- for (cxi=0; cxicx+cxi);
- nas_CLASS_flush_sclassifier(priv->cx+cxi);
- }
-
- printk("nas_teardown: end\n");
- } // check dev
- else {
- printk("nas_teardown: Device is null\n");
- }
-}
-
-//---------------------------------------------------------------------------
-int nas_set_config(struct net_device *dev, struct ifmap *map)
-{
- //---------------------------------------------------------------------------
- printk("SET_CONFIG: begin\n");
-
- if (dev->flags & IFF_UP)
- return -EBUSY;
-
- if (map->base_addr != dev->base_addr) {
- printk(KERN_WARNING "SET_CONFIG: Can't change I/O address\n");
- return -EOPNOTSUPP;
- }
-
- if (map->irq != dev->irq)
- dev->irq = map->irq;
-
- return 0;
-}
-
-//---------------------------------------------------------------------------
-//
-int nas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- // Start debug information
-
- int inst;
-
- if (dev)
- inst = find_inst(dev);
- else {
- printk("nas_hard_start_xmit: ERROR, device is null\n");
- return -1;
- }
-
- if (inst>=0) {
-#ifdef DEBUG_DEVICE
- printk("HARD_START_XMIT: inst %d, begin\n",inst);
-#endif
-
- if (!skb) {
- printk("HARD_START_XMIT - input parameter skb is NULL \n");
- return -1;
- }
-
- // End debug information
- netif_stop_queue(dev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
- || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403)
- netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
-#ifdef DEBUG_DEVICE
- printk("HARD_START_XMIT: step 1\n");
-#endif
- nas_CLASS_send(skb,inst);
-#ifdef DEBUG_DEVICE
- printk("HARD_START_XMIT: step 2\n");
-#endif
- // if (skb==NULL){
- // printk("HARD_START_XMIT - parameter skb is NULL \n");
- // return -1;
- // }else
- dev_kfree_skb(skb);
-#ifdef DEBUG_DEVICE
- printk("HARD_START_XMIT: step 3\n");
-#endif
- netif_wake_queue(dev);
-#ifdef DEBUG_DEVICE
- printk("HARD_START_XMIT: end\n");
-#endif
- } else {
- printk("nas_hard_start_xmit: ERROR, couldn't find instnace\n");
- return(-1);
- }
-
- return 0;
-}
-
-//---------------------------------------------------------------------------
-struct net_device_stats *nas_get_stats(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- // return &((struct nas_priv *)dev->priv)->stats;
- struct nas_priv *priv = netdev_priv(dev);
- return &priv->stats;
-}
-
-//---------------------------------------------------------------------------
-int nas_change_mtu(struct net_device *dev, int mtu)
-{
- //---------------------------------------------------------------------------
-
- printk("CHANGE_MTU: begin\n");
-
- if ((mtu<50) || (mtu>1500))
- return -EINVAL;
-
- dev->mtu = mtu;
- return 0;
-}
-
-//---------------------------------------------------------------------------
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
-void nas_tx_timeout(struct net_device *dev, unsigned int txqueue)
-#else
-void nas_tx_timeout(struct net_device *dev)
-#endif
-{
- //---------------------------------------------------------------------------
- // Transmitter timeout, serious problems.
- struct nas_priv *priv = netdev_priv(dev);
-
- printk("TX_TIMEOUT: begin\n");
- // (struct nas_priv *)(dev->priv)->stats.tx_errors++;
- (priv->stats).tx_errors++;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \
- || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796 && RHEL_RELEASE_CODE != 2403)
- netif_trans_update(dev);
-#else
- dev->trans_start = jiffies;
-#endif
- netif_wake_queue(dev);
- printk("TX_TIMEOUT: transmit timed out %s\n",dev->name);
-}
-
-static const struct net_device_ops nasmesh_netdev_ops = {
-
- .ndo_open = nas_open,
- .ndo_stop = nas_stop,
- .ndo_start_xmit = nas_hard_start_xmit,
- .ndo_validate_addr = NULL,
- .ndo_set_mac_address = NULL,
- .ndo_set_config = nas_set_config,
- .ndo_do_ioctl = nas_CTL_ioctl,
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0) \
- || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1797 && RHEL_RELEASE_CODE != 2403)
- .extended.ndo_change_mtu = nas_change_mtu,
-#else
- .ndo_change_mtu = nas_change_mtu,
-#endif
- .ndo_tx_timeout = nas_tx_timeout,
-};
-
-//---------------------------------------------------------------------------
-// Initialisation of the network device
-void nas_init(struct net_device *dev)
-{
- //---------------------------------------------------------------------------
- uint8_t cxi, dscpi;
- struct nas_priv *priv;
- // int inst;
-
- if (dev) {
- priv = netdev_priv(dev);
- //memset(dev->priv, 0, sizeof(struct nas_priv));
- memset(priv, 0, sizeof(struct nas_priv));
- // priv=(struct nas_priv *)(dev->priv);
- priv=netdev_priv(dev);
- //
- dev->netdev_ops = &nasmesh_netdev_ops;
- // dev->type = ARPHRD_EUROPENAIRMESH;
- //dev->type = ARPHRD_ETHER;
- // dev->features = NETIF_F_NO_CSUM;
- dev->hard_header_len = 0;
- dev->addr_len = NAS_ADDR_LEN;
- dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP;
- dev->tx_queue_len = NAS_TX_QUEUE_LEN;
- dev->mtu = NAS_MTU;
- //
- // Initialize private structure
- // priv->sap[NAS_GC_SAPI] = RRC_DEVICE_GC;
- // priv->sap[NAS_NT_SAPI] = RRC_DEVICE_NT;
- priv->sap[NAS_RAB_INPUT_SAPI] = PDCP2PDCP_USE_RT_FIFO;//QOS_DEVICE_CONVERSATIONAL_INPUT;
- priv->sap[NAS_RAB_OUTPUT_SAPI] = NAS2PDCP_FIFO;//QOS_DEVICE_STREAMING_INPUT;
-
- // priv->retry_limit=RETRY_LIMIT_DEFAULT;
- // priv->timer_establishment=TIMER_ESTABLISHMENT_DEFAULT;
- // priv->timer_release=TIMER_RELEASE_DEFAULT;
-
- for (dscpi=0; dscpi<65; ++dscpi)
- priv->rclassifier[dscpi]=NULL;
-
- priv->nrclassifier=0;
-
- //
- for (cxi=0; cxicx[cxi].sap[NAS_DC_INPUT_SAPI] = RRC_DEVICE_DC_INPUT0;
- // priv->cx[cxi].sap[NAS_DC_OUTPUT_SAPI] = RRC_DEVICE_DC_OUTPUT0;
- priv->cx[cxi].state=NAS_IDLE;
- priv->cx[cxi].countimer=NAS_TIMER_IDLE;
- priv->cx[cxi].retry=0;
- priv->cx[cxi].lcr=cxi;
- priv->cx[cxi].rb=NULL;
- priv->cx[cxi].num_rb=0;
-
- // initialisation of the classifier
- for (dscpi=0; dscpi<65; ++dscpi) {
- priv->cx[cxi].sclassifier[dscpi]=NULL;
- priv->cx[cxi].fclassifier[dscpi]=NULL;
- }
-
- priv->cx[cxi].nsclassifier=0;
- priv->cx[cxi].nfclassifier=0;
- // initialisation of the IP address
- // TOOL_imei2iid(IMEI, (uint8_t *)priv->cx[cxi].iid6);
- priv->cx[cxi].iid4=0;
- //
- }
-
- spin_lock_init(&priv->lock);
- //this requires kernel patch for OAI driver: typically for RF/hard realtime emu experimentation
-#ifdef ADDRCONF
-#ifdef NETLINK
- nas_TOOL_imei2iid(IMEI, dev->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
- nas_TOOL_imei2iid(IMEI, (uint8_t *)priv->cx[0].iid6);
-#else
- nas_TOOL_imei2iid((uint8_t *)nas_IMEI, dev->dev_addr); // IMEI to device address (for stateless autoconfiguration address)
- nas_TOOL_imei2iid((uint8_t *)nas_IMEI, (uint8_t *)priv->cx[0].iid6);
-#endif
- // this is more appropriate for user space soft realtime emulation
-#else
- memcpy(dev->dev_addr,&nas_IMEI[0],8);
- printk("Setting HW addr to : %X%X\n",*((unsigned int *)&dev->dev_addr[0]),*((unsigned int *)&dev->dev_addr[4]));
-
- ((unsigned char*)dev->dev_addr)[7] = (unsigned char)find_inst(dev);
-
- memcpy((uint8_t *)priv->cx[0].iid6,&nas_IMEI[0],8);
-
- printk("INIT: init IMEI to IID\n");
-#endif
-
- printk("INIT: end\n");
- return;
- } // instance value check
- else {
- printk("nas_init(): ERROR, Device is NULL!!\n");
- return;
- }
-}
-//---------------------------------------------------------------------------
-int init_module (void)
-{
- //---------------------------------------------------------------------------
- int err,inst;
- struct nas_priv *priv;
- char devicename[100];
-
-
- // Initialize parameters shared with RRC
-
- printk("Starting NASMESH, number of IMEI paramters %d, IMEI %X%X\n",m_arg,nas_IMEI[0],nas_IMEI[1]);
-
- for (inst=0; instdev_addr,&nas_IMEI[0],8);
- nas_TOOL_imei2iid((uint8_t *)nas_IMEI, nasdev[inst]->dev_addr);// IMEI to device address (for stateless autoconfiguration address)
- nas_TOOL_imei2iid((uint8_t *)nas_IMEI, (uint8_t *)priv->cx[0].iid6);
- // TO HAVE DIFFERENT HW @
- ((unsigned char*)nasdev[inst]->dev_addr)[7] = ((unsigned char*)nasdev[inst]->dev_addr)[7] + (unsigned char)inst + 1;
- printk("Setting HW addr for INST %d to : %X%X\n",inst,*((unsigned int *)&nasdev[inst]->dev_addr[0]),*((unsigned int *)&nasdev[inst]->dev_addr[4]));
-
- }
-
-
-
- err= register_netdev(nasdev[inst]);
-
- if (err) {
- printk("[NAS][INIT] nasmesh_init_module (inst %d): error %i registering device %s\n", inst,err, nasdev[inst]->name);
- } else {
- printk("nasmesh_init_module: registering device %s, ifindex = %d\n\n",nasdev[inst]->name, nasdev[inst]->ifindex);
- }
- }
-
- if ((err=nas_netlink_init()) == -1)
- printk("[NAS][INIT] NETLINK failed\n");
-
- printk("[NAS][INIT] NETLINK INIT\n");
-
- return err;
-
-}
-
-//---------------------------------------------------------------------------
-void cleanup_module(void)
-{
- //---------------------------------------------------------------------------
-
- int inst;
-
-
- printk("[NAS][CLEANUP]nasmesh_cleanup_module: begin\n");
-
- for (inst=0; inst= KERNEL_VERSION(3,2,0)
-
-#define DRV_NAME "NASMESH"
-#define DRV_VERSION "3.0.2"DRV_NAME
-#define DRV_DESCRIPTION "OPENAIR MESH Device Driver"
-#define DRV_COPYRIGHT "-Copyright(c) GNU GPL Eurecom 2009"
-#define DRV_AUTHOR "Raymond Knopp, and Navid Nikaein: "DRV_COPYRIGHT
-
-module_param_array(nas_IMEI,uint,&m_arg,0444);
-MODULE_PARM_DESC(nas_IMEI,"The IMEI Hardware address (64-bit, decimal nibbles)");
-
-module_param(nas_is_clusterhead,uint,0444);
-MODULE_PARM_DESC(nas_is_clusterhead,"The Clusterhead Indicator");
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,1)
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION(DRV_DESCRIPTION);
-MODULE_AUTHOR(DRV_AUTHOR);
-#endif
-#endif
-
-
-
-/*
-//---------------------------------------------------------------------------
-//module_init(init_nasmesh);
-//module_exit(exit_nasmesh);
-//---------------------------------------------------------------------------
-
-*/
diff --git a/openair2/NETWORK_DRIVER/MESH/ioctl.c b/openair2/NETWORK_DRIVER/MESH/ioctl.c
deleted file mode 100644
index 56dfb1cfe8..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/ioctl.c
+++ /dev/null
@@ -1,860 +0,0 @@
-/*
- * 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 "local.h"
-#include "ioctl.h"
-#include "proto_extern.h"
-
-//#include
-#include
-#include
-#include
-
-
-// Statistic
-//---------------------------------------------------------------------------
-void nas_set_msg_statistic_reply(struct nas_msg_statistic_reply *msgrep,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- msgrep->rx_packets=priv->stats.rx_packets;
- msgrep->tx_packets=priv->stats.tx_packets;
- msgrep->rx_bytes=priv->stats.rx_bytes;
- msgrep->tx_bytes=priv->stats.tx_bytes;
- msgrep->rx_errors=priv->stats.rx_errors;
- msgrep->tx_errors=priv->stats.tx_errors;
- msgrep->rx_dropped=priv->stats.rx_dropped;
- msgrep->tx_dropped=priv->stats.tx_dropped;
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_statistic_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_statistic_reply msgrep;
- printk("NAS_IOCTL_STATISTIC: stat requested\n");
- nas_set_msg_statistic_reply(&msgrep,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_STATISTIC: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Connections List
-//---------------------------------------------------------------------------
-void nas_set_msg_cx_list_reply(uint8_t *msgrep,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct cx_entity *cx;
- nasLocalConnectionRef_t lcr;
- struct nas_msg_cx_list_reply *list;
- msgrep[0]=NAS_CX_MAX;
- list=(struct nas_msg_cx_list_reply *)(msgrep+1);
-
- for(lcr=0; lcrstate;
- list[lcr].cellid=cx->cellid;
- list[lcr].iid4=cx->iid4;
- list[lcr].iid6[0]=cx->iid6[0];
- list[lcr].iid6[1]=cx->iid6[1];
- list[lcr].num_rb=cx->num_rb;
- list[lcr].nsclassifier=cx->nsclassifier;
- printk("NAS_SET_MSG_CX_LIST_REPLY: nsc=%u\n",cx->nsclassifier);
- }
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_cx_list_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- uint8_t msgrep[NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1];
- printk("NAS_IOCTL_CX_LIST: connection list requested\n");
- nas_set_msg_cx_list_reply(msgrep,priv);
-
- if (copy_to_user(gifr->msg, msgrep, NAS_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1)) {
- printk("NAS_IOCTL_CX_LIST: copy_to_user failure\n");
- return -EFAULT;
- }
-
- printk("NAS_IOCTL_CX_LIST: end\n");
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Connection Establishment
-//---------------------------------------------------------------------------
-void nas_set_msg_cx_establishment_reply(struct nas_msg_cx_establishment_reply *msgrep,
- struct nas_msg_cx_establishment_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
-
- struct cx_entity *cx;
- cx=nas_COMMON_search_cx(msgreq->lcr,priv);
-
- if (cx!=NULL) {
- cx->cellid=msgreq->cellid;
- msgrep->status=nas_mesh_DC_send_cx_establish_request(cx,priv);
- } else
- msgrep->status=-NAS_ERROR_NOTCORRECTLCR;
-
-}
-//---------------------------------------------------------------------------
-int nas_ioCTL_cx_establishment_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_cx_establishment_request msgreq;
- struct nas_msg_cx_establishment_reply msgrep;
- printk("NAS_IOCTL_ESTABLISHMENT: connection establishment requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_CX_ESTABLISHMENT: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_cx_establishment_reply(&msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_CX_ESTABLISHMENT: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Connection Release
-//---------------------------------------------------------------------------
-void nas_set_msg_cx_release_reply(struct nas_msg_cx_release_reply *msgrep,
- struct nas_msg_cx_release_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct cx_entity *cx;
- cx=nas_COMMON_search_cx(msgreq->lcr,priv);
-
- if (cx!=NULL)
- msgrep->status=nas_mesh_DC_send_cx_release_request(cx,priv);
- else
- msgrep->status=-NAS_ERROR_NOTCORRECTLCR;
-}
-
-//---------------------------------------------------------------------------
-// Request the release of a connection
-int nas_ioCTL_cx_release_request(struct nas_ioctl *gifr,struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_cx_release_request msgreq;
- struct nas_msg_cx_release_reply msgrep;
-
- printk("NAS_IOCTL_CX_RELEASE: connection release requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_CX_RELEASE: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_cx_release_reply(&msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_CX_RELEASE: copy_to_user failure\n");
- return -EFAULT;
- }
-
- printk("NAS_IOCTL_CX_RELEASE: end\n");
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Radio Bearer List
-//---------------------------------------------------------------------------
-void nas_set_msg_rb_list_reply(uint8_t *msgrep,
- struct nas_msg_rb_list_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct cx_entity *cx;
- cx=nas_COMMON_search_cx(msgreq->lcr,priv);
-
- if (cx!=NULL) {
- uint8_t rbi;
- struct rb_entity *rb;
- struct nas_msg_rb_list_reply *list;
-
- if (cx->num_rb > NAS_LIST_RB_MAX)
- msgrep[0] = NAS_LIST_RB_MAX;
- else
- msgrep[0] = cx->num_rb;
-
- list=(struct nas_msg_rb_list_reply *)(msgrep+1);
-
- for (rb=cx->rb, rbi=0; (rb!=NULL)&&(rbinext, ++rbi) {
- list[rbi].state=rb->state;
- list[rbi].rab_id=rb->rab_id;
- list[rbi].sapi=rb->sapi;
- list[rbi].qos=rb->qos;
- }
- } else
- msgrep[0]=0;
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_rb_list_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- uint8_t msgrep[NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1];
- struct nas_msg_rb_list_request msgreq;
- printk("NAS_IOCTL_RB_LIST: Radio Bearer list requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_RB_LIST: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_rb_list_reply(msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, msgrep, NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1)) {
- printk("NAS_IOCTL_RB_LIST: copy_to_user failure\n");
- return -EFAULT;
- }
-
- printk("NAS_IOCTL_CX_LIST: end\n");
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Radio Bearer Establishment
-//---------------------------------------------------------------------------
-void nas_set_msg_rb_establishment_reply(struct nas_msg_rb_establishment_reply *msgrep,
- struct nas_msg_rb_establishment_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- // if ((msgreq->rab_id<3)||(msgreq->rab_id>127))
- if ((msgreq->rab_id<1)||(msgreq->rab_id>MAX_RABS)) // navid : increase the number
- msgrep->status=-NAS_ERROR_NOTCORRECTRABI;
- else {
- struct cx_entity *cx;
- cx=nas_COMMON_search_cx(msgreq->lcr,priv);
-
- if (cx==NULL)
- msgrep->status=-NAS_ERROR_NOTCORRECTLCR;
- else {
- struct rb_entity *rb;
- rb=nas_COMMON_add_rb(cx, msgreq->rab_id, msgreq->qos);
-
- if (rb!=NULL) {
- // rb->cnxid = msgreq->cnxid;
- // msgrep->status=nas_rg_DC_send_rb_establish_request(cx, rb);
- } else
- msgrep->status=-NAS_ERROR_NOMEMORY;
-
- // msgrep->cnxid = msgreq->cnxid;
- }
- }
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_rb_establishment_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_rb_establishment_request msgreq;
- struct nas_msg_rb_establishment_reply msgrep;
- printk("NAS_IOCTL_RB_ESTABLISHMENT: Radio bearer establishment requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_RB_ESTABLISHMENT: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_rb_establishment_reply(&msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_RB_ESTABLISHMENT: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Radio Bearer Release
-//---------------------------------------------------------------------------
-void nas_set_msg_rb_release_reply(struct nas_msg_rb_release_reply *msgrep,
- struct nas_msg_rb_release_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- if (msgreq->lcrlcr,priv);
- rb=nas_COMMON_search_rb(cx, msgreq->rab_id);
-
- if (rb!=NULL) {
- //msgrep->status=nas_rg_DC_send_rb_release_request(cx, rb);
- } else
- msgrep->status=-NAS_ERROR_NOTCONNECTED;
-
- // msgrep->cnxid = msgreq->cnxid;
- } else
- msgrep->status=-NAS_ERROR_NOTCORRECTLCR;
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_rb_release_request(
- struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_rb_release_request msgreq;
- struct nas_msg_rb_release_reply msgrep;
- printk("NAS_IOCTL_RB_RELEASE: Radio bearer release requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_RB_RELEASE: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_rb_release_reply(&msgrep, &msgreq, priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_RB_RELEASE: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Classifier List
-//---------------------------------------------------------------------------
-void nas_set_msg_class_list_reply(
- uint8_t *msgrep,
- struct nas_msg_class_list_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct cx_entity *cx;
- struct classifier_entity *gc;
- struct nas_msg_class_list_reply *list;
- uint8_t cli;
- list=(struct nas_msg_class_list_reply *)(msgrep+1);
-
- switch(msgreq->dir) {
- case NAS_DIRECTION_SEND:
- cx=nas_COMMON_search_cx(msgreq->lcr,priv);
-
- if (cx==NULL) {
- msgrep[0]=0;
- return;
- }
-
- gc=cx->sclassifier[msgreq->dscp];
- break;
-
- case NAS_DIRECTION_RECEIVE:
- cx=NULL;
- gc=priv->rclassifier[msgreq->dscp];
- break;
-
- default:
- cx=NULL;
- msgrep[0]=0;
- return;
- }
-
- for (cli=0; (gc!=NULL)&&(clinext, ++cli) {
- list[cli].classref=gc->classref;
- list[cli].lcr=msgreq->lcr;
- list[cli].dir=msgreq->dir;
- list[cli].dscp=msgreq->dscp;
- list[cli].rab_id=gc->rab_id;
- list[cli].version=gc->version;
-
- switch(gc->version) {
- case 4:
- list[cli].saddr.ipv4 = gc->saddr.ipv4;
- list[cli].daddr.ipv4 = gc->daddr.ipv4;
- break;
-
- case 6:
- list[cli].saddr.ipv6 = gc->saddr.ipv6;
- list[cli].daddr.ipv6 = gc->daddr.ipv6;
- break;
- }
-
- list[cli].protocol=gc->protocol;
- list[cli].sport=ntohs(gc->sport);
- list[cli].dport=ntohs(gc->dport);
- list[cli].splen=gc->splen;
- list[cli].dplen=gc->dplen;
- list[cli].fct=nas_TOOL_invfct(gc);
- }
-
- msgrep[0]=cli;
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_class_list_request(
- struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- uint8_t msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
- struct nas_msg_class_list_request msgreq;
- printk("NAS_IOCTL_CLASS_LIST: classifier list requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_CLASS_LIST: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_class_list_reply(msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, msgrep, NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1)) {
- printk("NAS_IOCTL_CLASS_LIST: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Request the addition of a classifier rule
-//---------------------------------------------------------------------------
-void nas_set_msg_class_add_reply(
- struct nas_msg_class_add_reply *msgrep,
- struct nas_msg_class_add_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct classifier_entity *gc,*gc2;
- unsigned char *saddr,*daddr;
- unsigned int *saddr32,*daddr32;
-
- printk("[NAS][CLASS] nas_set_msg_class_add_reply\n");
-
-
- if (msgreq->dscp>NAS_DSCP_MAX) {
- printk("NAS_SET_MSG_CLASS_ADD_REPLY: Incoherent parameter value\n");
- msgrep->status=-NAS_ERROR_NOTCORRECTDSCP;
- return;
- }
-
- if (msgreq->dir==NAS_DIRECTION_SEND) {
-
-
- struct cx_entity *cx;
- cx=nas_COMMON_search_cx(msgreq->lcr,priv);
-
- if (cx!=NULL) {
- printk("NAS_SET_MSG_CLASS_ADD_REPLY: DSCP/EXP %d, Classref %d, RB %u\n", msgreq->dscp, msgreq->classref,msgreq->rab_id );
- gc=nas_CLASS_add_sclassifier(cx, msgreq->dscp, msgreq->classref);
-
- printk("NAS_SET_MSG_CLASS_ADD_REPLY: %p %p\n" , msgreq, gc);
-
- if (gc==NULL) {
- msgrep->status=-NAS_ERROR_NOMEMORY;
- return;
- }
- } else {
- msgrep->status=-NAS_ERROR_NOTCORRECTLCR;
- return;
- }
-
- gc->rab_id=msgreq->rab_id;
-
- gc->rb=nas_COMMON_search_rb(cx, gc->rab_id);
- printk("NAS_SET_MSG_CLASS_ADD_REPLY: gc_rb %p %u \n", gc->rb, gc->rab_id);
- } else {
- if (msgreq->dir==NAS_DIRECTION_RECEIVE) {
- gc=nas_CLASS_add_rclassifier(msgreq->dscp,
- msgreq->classref,
- priv);
-
- if (gc==NULL) {
- msgrep->status=-NAS_ERROR_NOMEMORY;
- return;
- }
-
- gc->rab_id=msgreq->rab_id;
-
- } else {
- msgrep->status=-NAS_ERROR_NOTCORRECTDIR;
- return;
- }
-
- for (gc2 = priv->rclassifier[msgreq->dscp]; gc2!=NULL ; gc2 = gc2->next)
- printk("[NAS][CLASS] Add Receive Classifier dscp %d: rab_id %d (%p,next %p)\n",msgreq->dscp,gc2->rab_id,gc2,gc2->next);
- }
-
- printk("[NAS][CLASS] Getting addresses ...\n");
-
- nas_TOOL_fct(gc, msgreq->fct);
- gc->version=msgreq->version;
-
- switch(gc->version) {
- case 4:
- gc->saddr.ipv4=msgreq->saddr.ipv4;
- gc->daddr.ipv4=msgreq->daddr.ipv4;
-
-
-
- // #ifdef NAS_CLASS_DEBUG
- saddr = (unsigned char *)&gc->saddr.ipv4;
- daddr = (unsigned char *)&gc->daddr.ipv4;
-
- printk("[NAS][CLASS] Adding IPv4 %d.%d.%d.%d -> %d.%d.%d.%d\n",
- saddr[0],saddr[1],saddr[2],saddr[3],
- daddr[0],daddr[1],daddr[2],daddr[3]);
-
-
-
- //#endif
- gc->splen=msgreq->splen;
- gc->dplen=msgreq->dplen;
- break;
-
- case 6:
- memcpy(&gc->saddr.ipv6,&msgreq->saddr.ipv6,16);
- memcpy(&gc->daddr.ipv6,&msgreq->daddr.ipv6,16);
-
- saddr32 = (unsigned int *)&gc->saddr.ipv6;
- daddr32 = (unsigned int *)&gc->daddr.ipv6;
-
- printk("[NAS][CLASS] Adding IPv6 %X:%X:%X:%X -> %X.%X.%X.%X\n",
- saddr32[0],saddr32[1],saddr32[2],saddr32[3],
- daddr32[0],daddr32[1],daddr32[2],daddr32[3]);
- gc->splen=msgreq->splen;
- gc->dplen=msgreq->dplen;
- break;
-
- case NAS_MPLS_VERSION_CODE:
-
- printk("[NAS][CLASS] Adding MPLS label %d with exp %d\n",
- msgreq->daddr.mpls_label,msgreq->dscp);
- gc->daddr.mpls_label = msgreq->daddr.mpls_label;
-
- break;
-
- case 0:
- gc->saddr.ipv6.s6_addr32[0]=0;
- gc->daddr.ipv6.s6_addr32[1]=0;
- gc->saddr.ipv6.s6_addr32[2]=0;
- gc->daddr.ipv6.s6_addr32[3]=0;
- gc->splen=0;
- gc->dplen=0;
- break;
-
- default:
- msgrep->status=-NAS_ERROR_NOTCORRECTVERSION;
- kfree(gc);
- return;
- }
-
- gc->protocol=msgreq->protocol;
- gc->protocol_message_type=msgreq->protocol_message_type;
- gc->sport=htons(msgreq->sport);
- gc->dport=htons(msgreq->dport);
- msgrep->status=0;
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_class_add_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_class_add_request msgreq;
- struct nas_msg_class_add_reply msgrep;
-
-
- printk("NAS_IOCTL_CLASS_ADD: Add classifier components requested\n");
- printk("NAS_IOCTL_CLASS_ADD: size of gifr msg %zd\n", sizeof(gifr->msg));
-
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_CLASS_ADD: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_class_add_reply(&msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_CLASS_ADD: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Request the deletion of a classifier rule
-//---------------------------------------------------------------------------
-void nas_set_msg_class_del_reply(struct nas_msg_class_del_reply *msgrep,
- struct nas_msg_class_del_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- if (msgreq->dscp>NAS_DSCP_DEFAULT) {
- printk("NAS_SET_MSG_CLASS_DEL_REPLY: Incoherent parameter value\n");
- msgrep->status=-NAS_ERROR_NOTCORRECTDSCP;
- return;
- }
-
- if (msgreq->dir==NAS_DIRECTION_SEND) {
- struct cx_entity *cx;
- cx=nas_COMMON_search_cx(msgreq->lcr,priv);
-
- if (cx!=NULL)
- nas_CLASS_del_sclassifier(cx, msgreq->dscp, msgreq->classref);
- else {
- msgrep->status=-NAS_ERROR_NOTCORRECTLCR;
- return;
- }
- } else {
- if (msgreq->dir==NAS_DIRECTION_RECEIVE)
- nas_CLASS_del_rclassifier(msgreq->dscp, msgreq->classref,priv);
- else {
- msgrep->status=-NAS_ERROR_NOTCORRECTDIR;
- return;
- }
- }
-
- msgrep->status=0;
-}
-
-//---------------------------------------------------------------------------
-int nas_ioCTL_class_del_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_class_del_request msgreq;
- struct nas_msg_class_del_reply msgrep;
- printk("NAS_IOCTL_CLASS_DEL: Del classifier components requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_CLASS_DEL: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_class_del_reply(&msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_CLASS_DEL: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Measurement
-// Messages for Measurement transfer
-
-//---------------------------------------------------------------------------
-void nas_set_msg_measure_reply(struct nas_msg_measure_reply *msgrep, struct nas_msg_measure_request *msgreq,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct cx_entity *cx;
- int lcr=0; // Temp lcr->mt =0
- int i;
-
- cx=nas_COMMON_search_cx(lcr,priv);
-
- if (cx!=NULL) {
- msgrep->num_cells = cx->num_measures;
-
- for (i=0; inum_measures; i++) {
- msgrep-> measures[i].cell_id = cx->meas_cell_id[i];
- msgrep-> measures[i].level = cx->meas_level[i];
- msgrep-> measures[i].provider_id = cx->provider_id[i];
- }
-
- msgrep->signal_lost_flag = 0;
- }
-}
-//---------------------------------------------------------------------------
-int nas_ioCTL_measure_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_measure_request msgreq;
- struct nas_msg_measure_reply msgrep;
- printk("NAS_IOCTL_MEASURE: Measurement requested\n");
-
- if (copy_from_user(&msgreq, gifr->msg, sizeof(msgreq))) {
- printk("NAS_IOCTL_MEASURE: copy_from_user failure\n");
- return -EFAULT;
- }
-
- nas_set_msg_measure_reply(&msgrep, &msgreq,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_MEASURE: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// IMEI
-// Messages for IMEI transfer
-//---------------------------------------------------------------------------
-void nas_set_msg_imei_reply(struct nas_msg_l2id_reply *msgrep,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct cx_entity *cx;
- int lcr=0; // Temp lcr->mt =0
-
- cx=nas_COMMON_search_cx(lcr,priv);
-
- if (cx!=NULL) {
- msgrep->l2id[0] = cx->iid6[0];
- msgrep->l2id[1] = cx->iid6[1];
- }
-}
-//---------------------------------------------------------------------------
-int nas_ioCTL_imei_request(struct nas_ioctl *gifr,
- struct nas_priv *priv)
-{
- //---------------------------------------------------------------------------
- struct nas_msg_l2id_reply msgrep;
- printk("NAS_IOCTL_IMEI: IMEI requested\n");
- nas_set_msg_imei_reply(&msgrep,priv);
-
- if (copy_to_user(gifr->msg, &msgrep, sizeof(msgrep))) {
- printk("NAS_IOCTL_IMEI: copy_to_user failure\n");
- return -EFAULT;
- }
-
- return 0;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// IOCTL command
-//---------------------------------------------------------------------------
-int nas_CTL_ioctl(struct net_device *dev,
- struct ifreq *ifr,
- int cmd)
-{
- //---------------------------------------------------------------------------
- struct nas_ioctl *gifr;
- struct nas_priv *priv=netdev_priv(dev);
-
- int r;
-
- // printk("NAS_CTL_IOCTL: begin ioctl for instance %d\n",find_inst(dev));
-
- switch(cmd) {
- case NAS_IOCTL_RRM:
- gifr=(struct nas_ioctl *)ifr;
-
- switch(gifr->type) {
- case NAS_MSG_STATISTIC_REQUEST:
- r=nas_ioCTL_statistic_request(gifr,priv);
- break;
-
- case NAS_MSG_CX_ESTABLISHMENT_REQUEST:
- r=nas_ioCTL_cx_establishment_request(gifr,priv);
- break;
-
- case NAS_MSG_CX_RELEASE_REQUEST:
- r=nas_ioCTL_cx_release_request(gifr,priv);
- break;
-
- case NAS_MSG_CX_LIST_REQUEST:
- r=nas_ioCTL_cx_list_request(gifr,priv);
- break;
-
- case NAS_MSG_RB_ESTABLISHMENT_REQUEST:
- r=nas_ioCTL_rb_establishment_request(gifr,priv);
- break;
-
- case NAS_MSG_RB_RELEASE_REQUEST:
- r= nas_ioCTL_rb_release_request(gifr,priv);
- break;
-
- case NAS_MSG_RB_LIST_REQUEST:
- r=nas_ioCTL_rb_list_request(gifr,priv);
- break;
-
- case NAS_MSG_CLASS_ADD_REQUEST:
- r=nas_ioCTL_class_add_request(gifr,priv);
- break;
-
- case NAS_MSG_CLASS_LIST_REQUEST:
- r=nas_ioCTL_class_list_request(gifr,priv);
- break;
-
- case NAS_MSG_CLASS_DEL_REQUEST:
- r=nas_ioCTL_class_del_request(gifr,priv);
- break;
-
- case NAS_MSG_MEAS_REQUEST:
- r=nas_ioCTL_measure_request(gifr,priv);
- break;
-
- case NAS_MSG_IMEI_REQUEST:
- r=nas_ioCTL_imei_request(gifr,priv);
- break;
-
- default:
- // printk("NAS_IOCTL_RRM: unkwon request type, type=%x\n", gifr->type);
- r=-EFAULT;
- }
-
- break;
-
- default:
- // printk("NAS_CTL_IOCTL: Unknown ioctl command, cmd=%x\n", cmd);
- r=-EFAULT;
- }
-
- // printk("NAS_CTL_IOCTL: end\n");
- return r;
-}
-
-//---------------------------------------------------------------------------
-void nas_CTL_send(struct sk_buff *skb,
- struct cx_entity *cx,
- struct classifier_entity *gc, int inst, struct nas_priv *gpriv)
-{
- //---------------------------------------------------------------------------
- printk("NAS_CTL_SEND - void \n");
-}
-
diff --git a/openair2/NETWORK_DRIVER/MESH/ioctl.h b/openair2/NETWORK_DRIVER/MESH/ioctl.h
deleted file mode 100644
index 904105b1d1..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/ioctl.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * 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
- */
-
-#ifndef NAS_CTL_H
-#define NAS_CTL_H
-
-#include
-#include
-#include
-#include
-#include
-
-
-//#include
-
-#define NAS_MSG_MAXLEN 1100/// change???
-
-// type of CTL message
-#define NAS_MSG_STATISTIC_REQUEST 1
-#define NAS_MSG_STATISTIC_REPLY 2
-#define NAS_MSG_ECHO_REQUEST 3
-#define NAS_MSG_ECHO_REPLY 4
-#define NAS_MSG_CX_ESTABLISHMENT_REQUEST 5
-#define NAS_MSG_CX_ESTABLISHMENT_REPLY 6
-#define NAS_MSG_CX_RELEASE_REQUEST 7
-#define NAS_MSG_CX_RELEASE_REPLY 8
-#define NAS_MSG_CX_LIST_REQUEST 9
-#define NAS_MSG_CX_LIST_REPLY 10
-#define NAS_MSG_RB_ESTABLISHMENT_REQUEST 11
-#define NAS_MSG_RB_ESTABLISHMENT_REPLY 12
-#define NAS_MSG_RB_RELEASE_REQUEST 13
-#define NAS_MSG_RB_RELEASE_REPLY 14
-#define NAS_MSG_RB_LIST_REQUEST 15
-#define NAS_MSG_RB_LIST_REPLY 16
-#define NAS_MSG_CLASS_ADD_REQUEST 17
-#define NAS_MSG_CLASS_ADD_REPLY 18
-#define NAS_MSG_CLASS_DEL_REQUEST 19
-#define NAS_MSG_CLASS_DEL_REPLY 20
-#define NAS_MSG_CLASS_LIST_REQUEST 21
-#define NAS_MSG_CLASS_LIST_REPLY 22
-#define NAS_MSG_MEAS_REQUEST 23
-#define NAS_MSG_MEAS_REPLY 24
-#define NAS_MSG_IMEI_REQUEST 25
-#define NAS_MSG_IMEI_REPLY 26
-
-// Max number of entry of a message list
-#define NAS_LIST_CX_MAX 32
-#define NAS_LIST_RB_MAX 32
-#define NAS_LIST_CLASS_MAX 16 // 32 is too high!!:
-/* risk of stack problems: KEEP ATTENTION TO COMPILATION WARNINGS */
-
-typedef unsigned short nasMsgType_t;
-
-struct nas_ioctl {
- char name[IFNAMSIZ];
- nasMsgType_t type;
- char *msg;
-};
-
-struct nas_msg_statistic_reply {
- unsigned int rx_packets;
- unsigned int tx_packets;
- unsigned int rx_bytes;
- unsigned int tx_bytes;
- unsigned int rx_errors;
- unsigned int tx_errors;
- unsigned int rx_dropped;
- unsigned int tx_dropped;
-};
-
-struct nas_msg_cx_list_reply {
- nasLocalConnectionRef_t lcr; // Local Connection reference
- unsigned char state;
- nasCellID_t cellid; // cell identification
- unsigned int iid6[2]; // IPv6 interface identification
- unsigned char iid4; // IPv4 interface identification
- unsigned short num_rb;
- unsigned short nsclassifier;
-};
-struct nas_msg_cx_establishment_reply {
- int status;
-};
-struct nas_msg_cx_establishment_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
- nasCellID_t cellid; // Cell identification
-};
-struct nas_msg_cx_release_reply {
- int status;
-};
-struct nas_msg_cx_release_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
-};
-
-struct nas_msg_rb_list_reply {
- nasRadioBearerId_t rab_id;
- nasSapId_t sapi;
- nasQoSTrafficClass_t qos;
- unsigned char state;
-};
-struct nas_msg_rb_list_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
-};
-struct nas_msg_rb_establishment_reply {
- int status;
-};
-struct nas_msg_rb_establishment_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
- nasRadioBearerId_t rab_id;
- nasQoSTrafficClass_t qos;
-};
-
-struct nas_msg_rb_release_reply {
- int status;
-};
-struct nas_msg_rb_release_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
- nasRadioBearerId_t rab_id;
-};
-/*
-struct saddr {
-
- struct in6_addr ipv6;
- unsigned int ipv4;
-};
-
-struct daddr {
-
- struct in6_addr ipv6;
- unsigned int ipv4;
- unsigned int mpls_label;
-};
-*/
-struct nas_msg_class_add_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
- nasRadioBearerId_t rab_id;
- nasRadioBearerId_t rab_id_rx;
- unsigned char dir; // direction (send or receive, forward)
- unsigned char dscp; // codepoint
- unsigned char fct;
- unsigned short classref;
- unsigned char version;
-
- //struct daddr daddr;
- //struct saddr saddr;
-
- unsigned char splen; // prefix length
-
- union {
- struct in6_addr ipv6;
-
- // begin navid
- //in_addr_t ipv4;
- unsigned int ipv4;
- //end navid
-
- unsigned int mpls_label;
- } daddr; // IP destination address
-
- union {
- struct in6_addr ipv6;
-
- // begin navid
- //in_addr_t ipv4;
- unsigned int ipv4;
- //end navid
-
- } saddr; // IP source address
-
-
- unsigned char dplen; // prefix length
-
- unsigned char protocol; //!< transport layer protocol type (ANY,TCP,UDP,ICMPv4,ICMPv6)
- unsigned char protocol_message_type; //!< transport layer protocol message (ROUTER_ADV, ROUTER_SOLL, etc.)
- unsigned short sport; //!< source port
- unsigned short dport; //!< destination port
-};
-
-struct nas_msg_class_add_reply {
- int status;
-};
-struct nas_msg_class_del_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
- unsigned char dir; // direction (send or receive)
- unsigned char dscp; // codepoint
- unsigned short classref;
-};
-struct nas_msg_class_del_reply {
- int status;
-};
-#define nas_msg_class_list_reply nas_msg_class_add_request
-struct nas_msg_class_list_request {
- nasLocalConnectionRef_t lcr; // Local Connection reference
- unsigned char dir;
- unsigned char dscp;
-};
-
-
-// Messages for Measurement transfer - MW 01/04/2005
-typedef unsigned int nioctlProviderId_t;
-typedef unsigned short nioctlSignalLoss_t;
-typedef struct nioctlMeasures {
- nasCellID_t cell_id;
- nasSigLevel_t level;
- nioctlProviderId_t provider_id;
-} nioctlMeasures_t;
-
-struct nas_msg_measure_request {
- nasNumRGsMeas_t num_cells;
- nasCellID_t cellid[MAX_MEASURE_NB]; // Cell identification
- unsigned short num_providers;
- nioctlProviderId_t provider_id[MAX_MEASURE_NB]; // Provider identification
-};
-struct nas_msg_measure_reply {
- nasNumRGsMeas_t num_cells;
- nioctlMeasures_t measures[MAX_MEASURE_NB];
- nioctlSignalLoss_t signal_lost_flag;
-};
-
-// Messages for Measurement transfer - MW 01/04/2005
-typedef unsigned int nioctlL2Id_t[2];
-
-struct nas_msg_l2id_reply {
- nioctlL2Id_t l2id;
-};
-
-
-#endif
diff --git a/openair2/NETWORK_DRIVER/MESH/local.h b/openair2/NETWORK_DRIVER/MESH/local.h
deleted file mode 100644
index ef4cfde8ac..0000000000
--- a/openair2/NETWORK_DRIVER/MESH/local.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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
- */
-
-/***************************************************************************
- local.h - description
- -------------------
- copyright : (C) 2002 by Eurecom
- email : navid.nikaein@eurecom.fr
- lionel.gauthier@eurecom.fr
- knopp@eurecom.fr
- ***************************************************************************
-
- ***************************************************************************/
-
-#ifndef LOCAL_H
-#define LOCAL_H
-
-#include
-#include