Commit 7cdabedc authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'develop' of https://gitlab.eurecom.fr/oai/openairinterface5g into l1-sidelink

Conflicts:
	cmake_targets/CMakeLists.txt
	cmake_targets/build_oai
	common/config/config_cmdline.c
	open-nfapi.oai.patch
	openair1/PHY/INIT/lte_init.c
	openair1/PHY/LTE_TRANSPORT/dci.c
	openair1/PHY/LTE_TRANSPORT/dci_tools.c
	openair1/PHY/LTE_TRANSPORT/drs_modulation.c
	openair1/SCHED/fapi_l1.c
	openair1/SCHED/phy_procedures_lte_eNb.c
	openair1/SCHED/phy_procedures_lte_ue.c
	openair1/SCHED/ru_procedures.c
	openair2/ENB_APP/enb_app.c
	openair2/ENB_APP/enb_config.c
	openair2/ENB_APP/enb_paramdef.h
	openair2/ENB_APP/flexran_agent_common.c
	openair2/LAYER2/MAC/config.c
	openair2/LAYER2/MAC/defs.h
	openair2/LAYER2/MAC/eNB_scheduler.c
	openair2/LAYER2/MAC/eNB_scheduler_RA.c
	openair2/LAYER2/MAC/eNB_scheduler_bch.c
	openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
	openair2/LAYER2/MAC/eNB_scheduler_mch.c
	openair2/LAYER2/MAC/eNB_scheduler_primitives.c
	openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
	openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c
	openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c
	openair2/LAYER2/MAC/main.c
	openair2/LAYER2/MAC/pre_processor.c
	openair2/LAYER2/MAC/proto.h
	openair2/LAYER2/MAC/ra_procedures.c
	openair2/LAYER2/MAC/ue_procedures.c
	openair2/LAYER2/PDCP_v10.1.0/pdcp.c
	openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
	openair2/LAYER2/RLC/rlc_rrc.c
	openair2/PHY_INTERFACE/IF_Module.c
	openair2/RRC/LITE/L2_interface.c
	openair2/RRC/LITE/defs.h
	openair2/RRC/LITE/proto.h
	openair2/RRC/LITE/rrc_UE.c
	openair2/RRC/LITE/rrc_common.c
	openair2/RRC/LITE/rrc_eNB.c
	openair2/UTIL/LOG/log.c
	openair2/UTIL/LOG/log.h
	openair3/GTPV1-U/gtpv1u_eNB.c
	targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
	targets/COMMON/create_tasks.c
	targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf
	targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf
	targets/RT/USER/lte-enb.c
	targets/RT/USER/lte-ru.c
	targets/RT/USER/lte-softmodem.c
	targets/RT/USER/lte-softmodem.h
	targets/RT/USER/lte-ue.c
	targets/SIMU/USER/channel_sim.c
parents 2e75c751 3fe90157
This diff is collapsed.
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB-Eurecom-LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB-Eurecom-LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......
......@@ -13,7 +13,7 @@ class connection:
try:
(pid, fd) = os.forkpty()
except BaseException, e:
log("ERROR: forkpty for '" + description + "': " + e)
log("ERROR: forkpty for '" + description + "': " + str(e))
(pid, fd) = (-1, -1)
if pid == -1:
......@@ -26,7 +26,7 @@ class connection:
os.execvp('sshpass', ['sshpass', '-p', password,
'ssh', user + '@' + host])
except BaseException, e:
log("ERROR: execvp for '" + description + "': " + e)
log("ERROR: execvp for '" + description + "': " + str(e))
log("ERROR: execvp failed for '" + description + "'")
os._exit(1)
......
......@@ -42,7 +42,6 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
MSC_GEN="False"
XFORMS="True"
FLEXRAN_AGENT_SB_IF="True"
PRINT_STATS="False"
VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER="False"
......@@ -66,6 +65,7 @@ UE_AUTOTEST_TRACE="False"
UE_DEBUG_TRACE="False"
UE_TIMING_TRACE="False"
DISABLE_LOG_X="False"
USRP_REC_PLAY="False"
BUILD_ECLIPSE=0
trap handle_ctrl_c INT
......@@ -99,10 +99,6 @@ Options
Specify conf_nvram_path (default \"$conf_nvram_path\")
--UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\")
--RRH
Makes the RRH
-a | --agent
Enables agent for software-defined control of the eNB
-r | --3gpp-release
default is Rel14,
Rel8 limits the implementation to 3GPP Release 8 version
......@@ -158,6 +154,8 @@ Options
Disable all LOG_* macros
--build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh
--usrp-recplay
Build for I/Q record-playback modes
Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
......@@ -203,8 +201,7 @@ function main() {
echo_info "Will compile eNB"
shift;;
-a | --agent)
FLEXRAN_AGENT=1
echo_info "Will compile eNB with agent support"
echo_info "FlexRAN support is always compiled into the eNB"
shift;;
--UE)
UE=1
......@@ -216,10 +213,6 @@ function main() {
--UE-gen-nvram)
gen_nvram_path=$(readlink -f $2)
shift 2;;
--RRH)
RRH=1
echo_info "Will compile RRH"
shift;;
-r | --3gpp-release)
REL=$2
echo_info "Setting release to: $REL"
......@@ -350,6 +343,10 @@ function main() {
BUILD_TELNETSRV=1
echo_info "Build embedded telnet server"
shift ;;
--usrp-recplay)
USRP_REC_PLAY="True"
echo_info "Enabling USRP record playback mode"
shift 1;;
-h | --help)
print_help
exit 1;;
......@@ -362,9 +359,13 @@ function main() {
CMAKE_CMD="$CMAKE_CMD .."
echo_info "CMAKE_CMD=$CMAKE_CMD"
if [ "$eNB" = "1" ] && [ "$UE" = "1" ]; then
echo_error "Cannot build UE and eNB on one build_oai execution"
echo_error "use 2 build_oai invocations"
exit
fi
#########################################################
# check validity of HW and TP parameters for RRH and eNB
# check validity of HW and TP parameters for eNB
#########################################################
# to be discussed
......@@ -380,15 +381,6 @@ function main() {
fi
fi
if [ "$RRH" = "1" ] ; then
if [ "$TP" = "None" ] ; then
echo_fatal "A transport protocol (e.g. -t ETHERNET) must be defined!"
fi
if [ "$HW" = "None" ] ; then
echo_info "No radio head has been selected (HW set to $HW)"
fi
fi
echo_info "RF HW set to $HW"
#Now we set flags to enable deadline scheduler settings
#By default: USRP: disable,
......@@ -473,11 +465,9 @@ function main() {
flash_firmware_bladerf
fi
fi
if [ "$FLEXRAN_AGENT" == "1" ] ; then
echo_info "installing protobuf/protobuf-c for flexran agent support"
install_protobuf_from_source
install_protobuf_c_from_source
fi
echo_info "installing protobuf/protobuf-c for flexran agent support"
install_protobuf_from_source
install_protobuf_c_from_source
fi
if [ "$INSTALL_OPTIONAL" = "1" ] ; then
......@@ -502,12 +492,20 @@ function main() {
DIR=$OPENAIR_DIR/cmake_targets
if [ "$NOS1" = "1" ] ; then
lte_build_dir=lte_noS1_build_oai
#lte_exec=lte-softmodem-nos1
lte_exec=lte-softmodem-stub-nos1
if [ "$eNB" = "1" ] ; then
lte_exec=lte-softmodem-nos1
fi
if [ "$UE" = "1" ] ; then
lte_exec=lte-uesoftmodem-nos1
fi
else
lte_build_dir=lte_build_oai
#lte_exec=lte-softmodem
lte_exec=lte-softmodem-stub
if [ "$eNB" = "1" ] ; then
lte_exec=lte-softmodem
fi
if [ "$UE" = "1" ] ; then
lte_exec=lte-uesoftmodem
fi
fi
# configuration module libraries, one currently available, using libconfig
......@@ -527,9 +525,6 @@ function main() {
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
if [ "$FLEXRAN_AGENT" = "1" ] ; then
echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file
fi
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
......@@ -542,6 +537,7 @@ function main() {
echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
echo_info "Compiling UE S1 build : enabling Linux and NETLINK"
echo "set (LINUX True )" >> $cmake_file
......@@ -562,6 +558,9 @@ function main() {
compilations \
$lte_build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
compilations \
$lte_build_dir coding \
libcoding.so $dbin/libcoding.so
if [ "$NOS1" = "1" ] ; then
compilations \
......@@ -688,9 +687,6 @@ function main() {
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
if [ "$FLEXRAN_AGENT" = "1" ] ; then
echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file
fi
echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
......@@ -771,9 +767,6 @@ function main() {
cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
if [ "$FLEXRAN_AGENT" = "1" ] ; then
echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file
fi
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
......@@ -787,61 +780,20 @@ function main() {
# oaisim_mme $dbin/oaisim_mme.$REL
fi
# RRH compilation
#####################
if [ "$RRH" = "1" ] ; then
rrh_exec=rrh_gw
rrh_build_dir=rrh_gw
echo_info "Compiling $rrh_exec ..."
[ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build
mkdir -p $DIR/$rrh_build_dir/build
cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( ENABLE_ITTI False )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
echo 'set ( PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build
eval $CMAKE_CMD
compilations \
rrh_gw rrh_gw \
rrh_gw $dbin/rrh_gw
fi
# Telnet server compilation
#####################
if [ "$BUILD_TELNETSRV" = "1" ] ; then
telnetsrv_build_dir=telnetsrv
mkdir -p $DIR/$telnetsrv_build_dir/build
cd $DIR/$telnetsrv_build_dir/build
echo_info "Compiling telnet server library ..."
[ "$CLEAN" = "1" ] && rm -rf $DIR/$telnetsrv_build_dir
cmake_file=$OPENAIR_DIR/common/utils/$telnetsrv_build_dir/CMakeLists.txt
cd $DIR/$telnetsrv_build_dir/build
eval "$CMAKE_CMD $OPENAIR_DIR/common/utils/$telnetsrv_build_dir/"
make
build_dir=$lte_build_dir
compilations \
$build_dir telnetsrv \
libtelnetsrv.so $dbin/libtelnetsrv.so
fi
# build RF device and transport protocol libraries
#####################################
if [ "$eNB" = "1" -o "$UE" = "1" -o "$RRH" = "1" ] ; then
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
build_dir=$lte_build_dir
else
build_dir=$rrh_build_dir
fi
build_dir=$lte_build_dir
# build RF device libraries
if [ "$HW" != "None" ] ; then
......
......@@ -2,17 +2,13 @@ cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ASN_DEBUG False)
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( EMIT_ASN_DEBUG False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
......@@ -21,7 +17,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
......@@ -33,7 +28,6 @@ set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
......@@ -42,38 +36,25 @@ set ( NAS_MME False )
set ( NAS_UE True )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "epc_test" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( TEST_OMG False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT True )
......@@ -7,9 +7,6 @@ set(XFORMS True)
set(ENABLE_ITTI False)
set(DEBUG_PHY False)
set(MU_RECIEVER False)
set(RANDOM_BF False)
set(PBS_SIM False)
set(PERFECT_CE True)
set(NAS_UE False)
set(MESSAGE_CHART_GENERATOR False)
......
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
......@@ -20,7 +16,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
......@@ -32,7 +27,6 @@ set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
......@@ -41,40 +35,26 @@ set ( NAS_MME False )
set ( NAS_UE True )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "oaisim" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 False )
set ( EMOS False )
set ( ENABLE_FXP False )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST False )
set ( ENABLE_PGM_TRANSPORT False )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False )
set ( ENABLE_STANDALONE_EPC False )
......@@ -21,7 +17,6 @@ set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE False )
set ( EPC_BUILD True )
set ( EXMIMO_IOT False )
set ( HARD_RT False )
set ( JUMBO_FRAME False )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
......@@ -32,7 +27,6 @@ set ( LOG_NO_THREAD False )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
......@@ -42,42 +36,27 @@ set ( NAS_NETLINK False )
set ( NAS_UE False )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT False )
set ( NO_RRM False )
set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK False )
set ( OPENAIR1 False )
set ( OPENAIR2 False )
set ( OPENAIR_EMU False )
set ( OPENAIR_LTE False )
set ( PACKAGE_NAME "EPC" )
set ( PBS_SIM False )
set ( PC_DSP False )
set ( PC_TARGET False )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION False )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM False )
set ( PUCCH False )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( UPDATE_RELEASE_9 True)
set ( UPDATE_RELEASE_10 True)
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( XFORMS False )
cmake_minimum_required(VERSION 2.8)
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False )
set ( ENABLE_STANDALONE_EPC False)
......@@ -19,7 +15,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U False)
......@@ -33,51 +28,35 @@ set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False )
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
set ( MESSAGE_CHART_GENERATOR_PHY False )
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX True )
set ( NAS_ADDRESS_FIX False )
set ( NAS_BUILT_IN_UE False)
set ( NAS_MME False )
set ( NAS_UE False )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_EMU False )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "oaisim" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( DEBUG_PHY False )
set ( DEBUG_PHY_PROC False)
......
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
......@@ -21,7 +17,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
......@@ -33,7 +28,6 @@ set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
......@@ -42,44 +36,30 @@ set ( NAS_MME False )
set ( NAS_UE True )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "oaisim" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( TEST_S1C_MME True )
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( XFORMS False )
......@@ -95,6 +95,8 @@ get_distribution_release() {
check_supported_distribution() {
local distribution=$(get_distribution_release)
case "$distribution" in
"ubuntu17.10") return 0 ;;
"ubuntu17.04") return 0 ;;
"ubuntu16.04") return 0 ;;
"ubuntu14.04") return 0 ;;
"fedora24") return 0 ;;
......@@ -208,7 +210,7 @@ install_protobuf_from_source(){
#cd protobuf-2.6.1/
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
wget https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $USER --no-same-owner
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $(groups | cut -d" " -f1) --no-same-owner
cd protobuf-3.3.0/
./configure
echo "Compiling protobuf"
......@@ -247,14 +249,14 @@ install_usrp_uhd_driver_from_source(){
cd /tmp
echo "Downloading UHD driver"
rm -rf /tmp/uhd
git clone git://github.com/EttusResearch/uhd.git
git clone https://github.com/EttusResearch/uhd.git
cd uhd
git checkout tags/release_003_010_001_001
mkdir -p host/build
cd host/build
$CMAKE ../
echo "Compiling UHD"
make
make -j`nproc`
make test
$SUDO make install
$SUDO ldconfig
......@@ -275,10 +277,11 @@ check_install_usrp_uhd_driver(){
$SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
$SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake
$SUDO pip install requests
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
# until EPEL repo hasn't bumped UHD driver to >=3.10 in EPEL, build driver from source
$SUDO $INSTALLER -y remove uhd uhd-devel uhd-firmware
install_ursp_uhd_driver_from_source
install_usrp_uhd_driver_from_source
else
$SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware
fi
......@@ -480,16 +483,26 @@ check_install_oai_software() {
fi
$SUDO $INSTALLER update -y
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
local LAPACK_LIBNAME="liblapack.so"
local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so"
$SUDO apt install -y software-properties-common
case "$(get_distribution_release)" in
"ubuntu14.04")
specific_packages="libtasn1-3-dev"
specific_packages="libtasn1-3-dev gccxml libgnutls-dev libatlas-dev"
# For iperf3
$SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe"
$SUDO apt-get update
;;
"ubuntu16.04")
specific_packages="libtasn1-6-dev"
specific_packages="libtasn1-6-dev gccxml libgnutls-dev libatlas-dev"
;;
"ubuntu17.04")
specific_packages="libtasn1-6-dev castxml libgnutls28-dev libatlas-dev"
;;
"ubuntu17.10")
specific_packages="libtasn1-6-dev castxml libgnutls28-dev"
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
;;
esac
$SUDO apt-get install -y \
......@@ -505,7 +518,6 @@ check_install_oai_software() {
texlive-latex-base \
ethtool \
flex \
gccxml \
gdb \
git \
graphviz \
......@@ -516,7 +528,6 @@ check_install_oai_software() {
iptables \
iptables-dev \
libatlas-base-dev \
libatlas-dev \
libblas-dev \
libconfig8-dev \
libffi-dev \
......@@ -554,11 +565,9 @@ check_install_oai_software() {
wget \
libxpm-dev
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
$SUDO apt-get install -y nettle-dev nettle-bin
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
$SUDO apt-get install -y libgnutls-dev
$SUDO apt-get install -y nettle-dev nettle-bin
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
if rpm -q epel-release > /dev/null; then
......@@ -636,7 +645,8 @@ check_install_oai_software() {
lapack \
lapack-devel \
blas \
blas-devel
blas-devel \
libyaml-devel
fi
install_asn1c_from_source
......
......@@ -5,6 +5,7 @@
RRC_Rel14=(
"SystemInformation-r8-IEs.h" 4df485c5ddf2540eca271876cdc512caa19b0890 "fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff"
"SystemInformation-NB-r13-IEs.h" 6d91332d5c39205819b06e5e36efe62ff8e5b33b "fix_asn1.data/RRC.rel14/SystemInformation-NB-r13-IEs.h.diff"
)
RRC_Rel10=(
......
48a49,70
> struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member {
> SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_PR present;
> union SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_u {
> SystemInformationBlockType2_NB_r13_t sib2_r13;
> SystemInformationBlockType3_NB_r13_t sib3_r13;
> SystemInformationBlockType4_NB_r13_t sib4_r13;
> SystemInformationBlockType5_NB_r13_t sib5_r13;
> SystemInformationBlockType14_NB_r13_t sib14_r13;
> SystemInformationBlockType16_NB_r13_t sib16_r13;
> /*
> * This type is extensible,
> * possible extensions are below.
> */
> SystemInformationBlockType15_NB_r14_t sib15_v1430;
> SystemInformationBlockType20_NB_r14_t sib20_v1430;
> SystemInformationBlockType22_NB_r14_t sib22_v1430;
> } choice;
>
> /* Context for parsing across buffer boundaries */
> asn_struct_ctx_t _asn_ctx;
> };
>
52,72c74
< A_SEQUENCE_OF(struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member {
< SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_PR present;
< union SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_u {
< SystemInformationBlockType2_NB_r13_t sib2_r13;
< SystemInformationBlockType3_NB_r13_t sib3_r13;
< SystemInformationBlockType4_NB_r13_t sib4_r13;
< SystemInformationBlockType5_NB_r13_t sib5_r13;
< SystemInformationBlockType14_NB_r13_t sib14_r13;
< SystemInformationBlockType16_NB_r13_t sib16_r13;
< /*
< * This type is extensible,
< * possible extensions are below.
< */
< SystemInformationBlockType15_NB_r14_t sib15_v1430;
< SystemInformationBlockType20_NB_r14_t sib20_v1430;
< SystemInformationBlockType22_NB_r14_t sib22_v1430;
< } choice;
<
< /* Context for parsing across buffer boundaries */
< asn_struct_ctx_t _asn_ctx;
< } ) list;
---
> A_SEQUENCE_OF(struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member) list;
......@@ -44,11 +44,11 @@ load_module $OPENAIR_DIR/targets/bin/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/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.9 -r 1
$OPENAIR_DIR/targets/bin/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.9 netmask 255.255.255.0 broadcast 10.0.1.255
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.9 -t 10.0.1.1 -r 1
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.2 -t 10.0.1.1 -r 1
fi
fi
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -54,11 +54,13 @@ char defbool[2]="1";
switch(cfgoptions->type)
{
case TYPE_STRING:
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1));
printf("cfgoptions->strptr %p (&emul_iface %p, emul_iface %p)\n",cfgoptions->strptr,&emul_iface,emul_iface);
sprintf(*(cfgoptions->strptr), "%s",tmpval);
printf("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
if (cfgoptions->numelt == 0 ) {
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
sprintf(*(cfgoptions->strptr), "%s",tmpval);
} else {
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
}
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
optisset=1;
break;
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -129,20 +129,21 @@ int i;
/* default */
if (cfgparam == NULL) {
cfgparam = "libconfig:oaisoftmodem.conf";
tmpflags = tmpflags | CONFIG_NOOOPT;
cfgparam = DEFAULT_CFGMODE ":" DEFAULT_CFGFILENAME;
}
/* parse the config parameters to set the config source */
i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams);
if (i< 0) {
fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno));
cfgmode=strdup("libconfig");
modeparams = strdup("oaisoftmodem.conf");
cfgmode=strdup(DEFAULT_CFGMODE);
modeparams = strdup(DEFAULT_CFGFILENAME);
}
else if ( i == 1 ) {
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
with one parameter, the path to the configuration file */
modeparams=cfgmode;
cfgmode=strdup("libconfig");
cfgmode=strdup(DEFAULT_CFGMODE);
}
cfgptr = malloc(sizeof(configmodule_interface_t));
......@@ -196,25 +197,40 @@ int i;
return cfgptr;
}
void end_configmodule()
/* free memory allocated when reading parameters */
/* config module could be initialized again after this call */
void end_configmodule(void)
{
if (cfgptr != NULL) {
if (cfgptr->end != NULL) {
printf ("[CONFIG] calling config module end function...\n");
cfgptr->end();
}
if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode);
printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP);
for (int i=0; i<cfgptr->num_cfgP; i++) {
if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]);
}
printf ("[CONFIG] free %u config value pointers\n",cfgptr->numptrs);
for(int i=0; i<cfgptr->numptrs ; i++) {
if (cfgptr->ptrs[i] != NULL) {
free(cfgptr->ptrs[i]);
cfgptr->ptrs[i]=NULL;
}
cfgptr->ptrs[i]=NULL;
}
cfgptr->numptrs=0;
}
}
/* free all memory used by config module */
/* should be called only at program exit */
void free_configmodule(void)
{
if (cfgptr != NULL) {
end_configmodule();
if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode);
printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP);
for (int i=0; i<cfgptr->num_cfgP; i++) {
if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]);
}
free(cfgptr);
cfgptr=NULL;
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -40,14 +40,18 @@
#define CONFIG_MAX_OOPT_PARAMS 10 // maximum number of parameters in the -O option (-O <cfgmode>:P1:P2...
#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly allocated in the config module
/* rtflags bit position definitions */
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
#define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
#define CONFIG_HELP 8 // print help message
#define CONFIG_ABORT 16 // config failed,abort execution
/* default values for configuration module parameters */
#define DEFAULT_CFGMODE "libconfig" // use libconfig file
#define DEFAULT_CFGFILENAME "oai.conf" // default config file
/* rtflags bit position definitions */
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
#define CONFIG_DEBUGPTR 1<<1 // print memory allocation/free debug messages
#define CONFIG_DEBUGCMDLINE 1<<2 // print command line processing messages
#define CONFIG_NOABORTONCHKF 1<<3 // disable abort execution when parameter checking function fails
#define CONFIG_HELP 1<<20 // print help message
#define CONFIG_ABORT 1<<21 // config failed,abort execution
#define CONFIG_NOOOPT 1<<22 // no -O option found when parsing command line
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -55,16 +55,61 @@
#define PARAMFLAG_PARAMSET (1 << 16) // parameter has been explicitely set in get functions
#define PARAMFLAG_PARAMSETDEF (1 << 17) // parameter has been set to default value in get functions
/* checkedparam_t is possibly used in paramdef_t for specific parameter value validation */
#define CONFIG_MAX_NUMCHECKVAL 20
typedef struct paramdef paramdef_t;
typedef union checkedparam {
struct {
int (*f1)(paramdef_t *param); /* check an integer against a list of authorized values */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values */
int num_okintval; /* number of valid values in the checkingval array */
} s1;
struct {
int (*f1a)(paramdef_t *param); /* check an integer against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values in config file */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okintval; /* number of valid values in the checkingval array */
} s1a;
struct {
int (*f2)(paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
int okintrange[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store min and max values */
} s2;
struct {
int (*f3)(paramdef_t *param); /* check a string against a list of authorized values */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int num_okstrval; /* number of valid values in the checkingval array */
} s3;
struct {
int (*f3a)(paramdef_t *param); /* check a string against a list of authorized values and set param value */
/* to the corresponding item in setintval array (mainly for RRC params) */
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
int num_okstrval; /* number of valid values in the checkingval array */
} s3a;
struct {
int (*f4)(paramdef_t *param); /* generic check function, no arguments but the param description */
} s4;
struct {
void (*checkfunc)(void) ;
} s5;
} checkedparam_t;
/* paramdef is used to describe a parameter, array of paramdef_t strustures is used as the main parameter in */
/* config apis used to retrieve parameters values */
typedef struct paramdef
{
char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */
char *helpstr; /* help string */
unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */
union { /* pointer to the parameter value, completed by the config module */
char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */
char *helpstr; /* help string */
unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */
union { /* pointer to the parameter value, completed by the config module */
char **strptr;
char **strlistptr;
uint8_t *u8ptr;
char *i8ptr;
int8_t *i8ptr;
uint16_t *u16ptr;
int16_t *i16ptr;
uint32_t *uptr;
......@@ -72,18 +117,21 @@ typedef struct paramdef
uint64_t *u64ptr;
int64_t *i64ptr;
double *dblptr;
void *voidptr;
} ;
union { /* default parameter value, to be used when PARAMFLAG_MANDATORY is not specified */
char *defstrval;
char **defstrlistval;
uint32_t defuintval;
int defintval;
uint64_t defint64val;
int *defintarrayval;
double defdblval;
char *defstrval;
char **defstrlistval;
uint32_t defuintval;
int defintval;
uint64_t defint64val;
int *defintarrayval;
double defdblval;
} ;
char type; /* parameter value type, as listed below as TYPE_XXXX macro */
int numelt; /* number of elements in a list or array parameters or max size of string value */
checkedparam_t *chkPptr; /* possible pointer to the structure containing the info used to check parameter values */
int *processedvalue; /* used to store integer values computed from string original value */
} paramdef_t;
#define TYPE_INT TYPE_INT32
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -36,6 +36,7 @@
#include <errno.h>
#include <dlfcn.h>
#include "config_userapi.h"
extern void exit_fun(const char* s); // lte-softmodem clean exit function
configmodule_interface_t *config_get_if(void)
......@@ -50,12 +51,16 @@ configmodule_interface_t *config_get_if(void)
char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
{
printf_ptrs("-- %s 0x%08lx %i\n",cfgoptions->optname,(uintptr_t)(*ptr),length);
printf_ptrs("[CONFIG] %s ptr: 0x%08lx requested size: %i\n",cfgoptions->optname,(uintptr_t)(ptr),length);
if(cfgoptions->numelt > 0) { /* already allocated */
return *ptr;
}
if (*ptr == NULL) {
*ptr = malloc(length);
if ( *ptr != NULL) {
memset(*ptr,0,length);
if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) != 0) {
if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) == 0) {
config_get_if()->ptrs[config_get_if()->numptrs] = *ptr;
config_get_if()->numptrs++;
}
......@@ -107,7 +112,29 @@ int tmpval=val;
break;
}
}
void config_assign_processedint(paramdef_t *cfgoption, int val) {
cfgoption->processedvalue = malloc(sizeof(int));
if ( cfgoption->processedvalue != NULL) {
*(cfgoption->processedvalue) = val;
} else {
fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
exit(-1);
}
}
int config_get_processedint(paramdef_t *cfgoption) {
int ret;
if ( cfgoption->processedvalue != NULL) {
ret=*(cfgoption->processedvalue);
free( cfgoption->processedvalue);
cfgoption->processedvalue=NULL;
printf_params("[CONFIG] %s: set from %s to %i\n",cfgoption->optname, *(cfgoption->strptr), ret);
} else {
fprintf (stderr,"[CONFIG] %s %d %s has no processed integer availablle\n",__FILE__, __LINE__, cfgoption->optname);
ret=0;
}
return ret;
}
void config_printhelp(paramdef_t *params,int numparams)
{
for (int i=0 ; i<numparams ; i++) {
......@@ -120,6 +147,27 @@ void config_printhelp(paramdef_t *params,int numparams)
}
}
int config_execcheck(paramdef_t *params,int numparams, char *prefix)
{
int st=0;
for (int i=0 ; i<numparams ; i++) {
if ( params[i].chkPptr == NULL) {
continue;
}
if (params[i].chkPptr->s4.f4 != NULL) {
st += params[i].chkPptr->s4.f4(&(params[i]));
}
}
if (st != 0) {
fprintf(stderr,"[CONFIG] config_execcheck: %i parameters with wrong value\n", -st);
if ( CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF) == 0) {
exit_fun("exit because configuration failed\n");
}
}
return st;
}
int config_get(paramdef_t *params,int numparams, char *prefix)
{
int ret= -1;
......@@ -134,6 +182,7 @@ configmodule_interface_t *cfgif = config_get_if();
ret = config_get_if()->get(params, numparams,prefix);
if (ret >= 0) {
config_process_cmdline(params,numparams,prefix);
config_execcheck(params,numparams,prefix);
}
return ret;
}
......@@ -148,3 +197,90 @@ int config_isparamset(paramdef_t *params,int paramidx)
return 0;
}
}
void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokval) {
fprintf(stderr,"[CONFIG] %s: %s: %i invalid value, authorized values:\n ",
fname,param->optname, (int)*(param->uptr));
for ( int i=0; i<numokval ; i++) {
fprintf(stderr, " %i",okval[i]);
}
fprintf(stderr, " \n");
}
int config_check_intval(paramdef_t *param)
{
if ( param == NULL ){
fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n");
return -1;
}
for ( int i=0; i<param->chkPptr->s1.num_okintval ; i++) {
if( *(param->uptr) == param->chkPptr->s1.okintval[i] ) {
return 0;
}
}
print_intvalueerror(param,"config_check_intval", param->chkPptr->s1.okintval,param->chkPptr->s1.num_okintval);
return -1;
}
int config_check_modify_integer(paramdef_t *param)
{
for (int i=0; i < param->chkPptr->s1a.num_okintval ; i++) {
if (*(param->uptr) == param->chkPptr->s1a.okintval[i] ) {
printf_params("[CONFIG] %s: read value %i, set to %i\n",param->optname,*(param->uptr),param->chkPptr->s1a.setintval [i]);
*(param->uptr) = param->chkPptr->s1a.setintval [i];
return 0;
}
}
print_intvalueerror(param,"config_check_modify_integer", param->chkPptr->s1a.okintval,param->chkPptr->s1a.num_okintval);
return -1;
}
int config_check_intrange(paramdef_t *param)
{
if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) {
return 0;
}
fprintf(stderr,"[CONFIG] config_check_intrange: %s: %i invalid value, authorized range: %i %i\n",
param->optname, (int)*(param->uptr), param->chkPptr->s2.okintrange[0], param->chkPptr->s2.okintrange[1]);
return -1;
}
void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numokval) {
fprintf(stderr,"[CONFIG] %s: %s: %s invalid value, authorized values:\n ",
fname,param->optname, *(param->strptr));
for ( int i=0; i<numokval ; i++) {
fprintf(stderr, " %s",okval[i]);
}
fprintf(stderr, " \n");
}
int config_check_strval(paramdef_t *param)
{
if ( param == NULL ){
fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n");
return -1;
}
for ( int i=0; i<param->chkPptr->s3.num_okstrval ; i++) {
if( strcasecmp(*(param->strptr),param->chkPptr->s3.okstrval[i] ) == 0) {
return 0;
}
}
print_strvalueerror(param, "config_check_strval", param->chkPptr->s3.okstrval, param->chkPptr->s3.num_okstrval);
return -1;
}
int config_checkstr_assign_integer(paramdef_t *param)
{
for (int i=0; i < param->chkPptr->s3a.num_okstrval ; i++) {
if (strcasecmp(*(param->strptr),param->chkPptr->s3a.okstrval[i] ) == 0) {
config_assign_processedint(param, param->chkPptr->s3a.setintval[i]);
return 0;
}
}
print_strvalueerror(param, "config_check_strval", param->chkPptr->s3a.okstrval, param->chkPptr->s3a.num_okstrval);
return -1;
}
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -42,16 +42,30 @@ extern "C"
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
#define CONFIG_ISFLAGSET(P) ( (config_get_if()==NULL) ? 0 : !!(config_get_if()->rtflags & P))
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
/* utility functions, to be used by configuration module and/or configuration libraries */
extern configmodule_interface_t *config_get_if(void);
extern char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
extern void config_printhelp(paramdef_t *,int numparams);
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
extern int config_get(paramdef_t *params,int numparams, char *prefix);
extern int config_isparamset(paramdef_t *params,int paramidx);
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix);
/* apis to get parameters, to be used by oai modules, at configuration time */
extern int config_get(paramdef_t *params,int numparams, char *prefix);
#define config_getlist config_get_if()->getlist
/* apis to retrieve parameters info after calling get or getlist functions */
extern int config_isparamset(paramdef_t *params,int paramidx);
extern int config_get_processedint(paramdef_t *cfgoption);
/* functions to be used in parameters definition, to check parameters values */
extern int config_check_intval(paramdef_t *param);
extern int config_check_modify_integer(paramdef_t *param);
extern int config_check_intrange(paramdef_t *param);
extern int config_check_strval(paramdef_t *param);
extern int config_checkstr_assign_integer(paramdef_t *param);
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
#ifdef __cplusplus
......
/*
* 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/config/libconfig/config_libconfig.c
* \brief: implementation libconfig configuration library
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define _GNU_SOURCE
#include <libconfig.h>
......@@ -21,21 +51,23 @@ int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath
{
const char *str;
int st;
int numelt;
cfgoptions->numelt=config_setting_length(setting);
cfgoptions->strlistptr=malloc(sizeof(char *) * (cfgoptions->numelt));
numelt=config_setting_length(setting);
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
st=0;
for (int i=0; i< cfgoptions->numelt && cfgoptions->strlistptr != NULL; i++) {
for (int i=0; i< numelt ; i++) {
str=config_setting_get_string_elem(setting,i);
if (str==NULL) {
printf("[LIBCONFIG] %s%i not found in config file\n", cfgoptions->optname,i);
} else {
cfgoptions->strlistptr[i]=malloc(strlen(str)+1);
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(str)+1);
sprintf(cfgoptions->strlistptr[i],"%s",str);
st++;
printf_params("[LIBCONFIG] %s%i: %s\n", cfgpath,i,cfgoptions->strlistptr[i]);
}
}
cfgoptions->numelt=numelt;
return st;
}
......@@ -104,17 +136,28 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
cfgpath,str,cfgoptions[i].numelt);
str[strlen(str)-1] = 0;
}
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
sprintf( *(cfgoptions[i].strptr) , "%s", str);
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) );
if (cfgoptions[i].numelt == 0 ) {
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
sprintf( *(cfgoptions[i].strptr) , "%s", str);
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,*(cfgoptions[i].strptr) );
} else {
sprintf( (char *)(cfgoptions[i].strptr) , "%s", str);
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,(char *)cfgoptions[i].strptr );
}
} else {
if( cfgoptions[i].defstrval != NULL) {
defval=1;
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1);
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr));
if (cfgoptions[i].numelt == 0 ) {
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1);
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
printf_params("[LIBCONFIG] %s set to default value \"%s\"\n", cfgpath, *(cfgoptions[i].strptr));
} else {
sprintf((char *)*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
printf_params("[LIBCONFIG] %s set to default value \"%s\"\n", cfgpath, (char *)*(cfgoptions[i].strptr));
}
} else {
notfound=1;
}
......@@ -183,7 +226,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
read_intarray(&cfgoptions[i],setting,cfgpath);
} else {
if( cfgoptions[i].defintarrayval != NULL) {
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t));
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t*));
cfgoptions[i].iptr=cfgoptions[i].defintarrayval;
defval=1;
for (int j=0; j<cfgoptions[i].numelt ; j++) {
......@@ -363,6 +406,7 @@ void config_libconfig_end(void )
config_destroy(&(libconfig_privdata.cfg));
if ( libconfig_privdata.configfile != NULL ) {
free(libconfig_privdata.configfile);
libconfig_privdata.configfile=NULL;
}
}
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -40,6 +40,7 @@
#include "PHY/impl_defs_top.h"
#include "PHY/impl_defs_lte.h"
#include "RRC/LITE/defs.h"
#include "flexran_agent_defs.h"
#include "gtpv1u.h"
#include "NwGtpv1u.h"
......@@ -47,6 +48,8 @@
#include "NwGtpv1uPrivate.h"
#include "gtpv1u_eNB_defs.h"
#include "PHY/defs_L1_NB_IoT.h"
#include "RRC/LITE/defs_NB_IoT.h"
typedef struct {
/// RAN context config file name
char *config_file_name;
......@@ -54,22 +57,36 @@ typedef struct {
int nb_inst;
/// Number of Component Carriers per instance in this node
int *nb_CC;
/// Number of NB_IoT instances in this node
int nb_nb_iot_rrc_inst;
/// Number of MACRLC instances in this node
int nb_macrlc_inst;
/// Number of NB_IoT MACRLC instances in this node
int nb_nb_iot_macrlc_inst;
/// Number of component carriers per instance in this node
int *nb_mac_CC;
/// Number of L1 instances in this node
int nb_L1_inst;
/// Number of NB_IoT L1 instances in this node
int nb_nb_iot_L1_inst;
/// Number of Component Carriers per instance in this node
int *nb_L1_CC;
/// Number of RU instances in this node
int nb_RU;
/// FlexRAN context variables
flexran_agent_info_t **flexran;
/// eNB context variables
struct PHY_VARS_eNB_s ***eNB;
/// NB_IoT L1 context variables
struct PHY_VARS_eNB_NB_IoT_s **L1_NB_IoT;
/// RRC context variables
struct eNB_RRC_INST_s **rrc;
/// RRC context variables
/// NB_IoT RRC context variables
//struct eNB_RRC_INST_NB_IoT_s **nb_iot_rrc;
/// MAC context variables
struct eNB_MAC_INST_s **mac;
/// NB_IoT MAC context variables
struct eNB_MAC_INST_NB_IoT_s **nb_iot_mac;
/// GTPu descriptor
gtpv1u_data_t *gtpv1u_data_g;
/// RU descriptors. These describe what each radio unit is supposed to do and contain the necessary functions for fronthaul interfaces
......
......@@ -29,7 +29,7 @@ typedef struct {
#define T_SHM_FILENAME "/T_shm_segment"
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_FUNCTIONS 178
#define VCD_NUM_FUNCTIONS 187
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES 128
......
......@@ -185,6 +185,10 @@ ID = ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST
DESC = RRC connection reestablishment request
GROUP = ALL:RRC:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
ID = ENB_RRC_CONNECTION_REESTABLISHMENT
DESC = RRC connection reestablishment
GROUP = ALL:RRC:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
ID = ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE
DESC = RRC connection reestablishment complete
GROUP = ALL:RRC:ENB
......@@ -2157,3 +2161,39 @@ ID = VCD_FUNCTION_TRX_DECOMPR_IF
DESC = VCD function TRX_DECOMPR_IF
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_NFAPI
DESC = VCD function NFAPI
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_GENERATE_PCFICH
DESC = VCD function GENERATE_PCFICH
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_GENERATE_DCI0
DESC = VCD function GENERATE_DCI0
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_GENERATE_DLSCH
DESC = VCD function GENERATE_DLSCH
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_GENERATE_PHICH
DESC = VCD function GENERATE_PHICH
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_PDCCH_SCRAMBLING
DESC = VCD function PDCCH_SCRAMBLING
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_PDCCH_MODULATION
DESC = VCD function PDCCH_MODULATION
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_PDCCH_INTERLEAVING
DESC = VCD function PDCCH_INTERLEAVING
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_PDCCH_TX
DESC = VCD function PDCCH_TX
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
This diff is collapsed.
......@@ -27,10 +27,6 @@
#include <sys/epoll.h>
#ifdef RTAI
# include <rtai_sem.h>
#endif
#ifndef INTERTASK_INTERFACE_H_
#define INTERTASK_INTERFACE_H_
......@@ -112,6 +108,18 @@ int itti_send_broadcast_message(MessageDef *message_p);
**/
int itti_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message);
/* TODO: this is a hack. Almost no caller of itti_send_msg_to_task checks
* the return value so it has been changed to crash the program in case
* of failure instead of returning -1 as the documentation above says.
* The RLC UM code may receive too much data when doing UDP at a higher
* throughput than the link allows and so for this specific case we need
* a version that actually returns -1 on failure.
*
* This needs to be cleaned at some point.
*/
/* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */
int itti_try_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message);
/** \brief Add a new fd to monitor.
* NOTE: it is up to the user to read data associated with the fd
* \param task_id Task ID of the receiving task
......@@ -155,12 +163,10 @@ int itti_create_task(task_id_t task_id,
void *(*start_routine) (void *),
void *args_p);
//#ifdef RTAI
/** \brief Mark the task as a real time task
* \param task_id task to mark as real time
**/
void itti_set_task_real_time(task_id_t task_id);
//#endif
/** \brief Indicates to ITTI if newly created tasks should wait for all tasks to be ready
* \param wait_tasks non 0 to make new created tasks to wait, 0 to let created tasks to run
......
......@@ -51,23 +51,14 @@
#include "intertask_interface.h"
#include "intertask_interface_dump.h"
#if defined(OAI_EMU) || defined(RTAI)
#include "vcd_signal_dumper.h"
#endif
#if T_TRACER
#include "T.h"
#endif
static const int itti_dump_debug = 0; // 0x8 | 0x4 | 0x2;
#ifdef RTAI
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) rt_printk("[ITTI_DUMP][D]"x, ##args); } \
while(0)
#else
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) fprintf(stdout, "[ITTI_DUMP][D]"x, ##args); } \
while(0)
#endif
#define ITTI_DUMP_ERROR(x, args...) do { fprintf(stdout, "[ITTI_DUMP][E]"x, ##args); } \
while(0)
......@@ -99,13 +90,8 @@ typedef struct itti_desc_s {
int nb_connected;
#ifndef RTAI
/* Event fd used to notify new messages (semaphore) */
int event_fd;
#else
unsigned long messages_in_queue __attribute__((aligned(8)));
#endif
int itti_listen_socket;
itti_client_desc_t itti_clients[ITTI_DUMP_MAX_CON];
......@@ -194,9 +180,7 @@ static int itti_dump_fwrite_message(itti_dump_queue_item_t *message)
fwrite (&new_message_header, sizeof(itti_dump_message_t), 1, dump_file);
fwrite (message->data, message->data_size, 1, dump_file);
fwrite (&itti_dump_message_type_end, sizeof(itti_message_types_t), 1, dump_file);
// #if !defined(RTAI)
fflush (dump_file);
// #endif
return (1);
}
......@@ -280,10 +264,6 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
int overwrite_flag;
AssertFatal (new != NULL, "Message to queue is NULL!\n");
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
#endif
new->message_type = message_type;
new->message_size = message_size;
......@@ -303,9 +283,6 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
lfds611_ringbuffer_put_write_element(itti_dump_queue.itti_message_queue, new_queue_element);
if (overwrite_flag == 0) {
#ifdef RTAI
__sync_fetch_and_add (&itti_dump_queue.messages_in_queue, 1);
#else
{
ssize_t write_ret;
eventfd_t sem_counter = 1;
......@@ -314,25 +291,18 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
AssertFatal (write_ret == sizeof(sem_counter), "Write to dump event failed (%d/%d)!\n", (int) write_ret, (int) sizeof(sem_counter));
}
#endif
// add one to pending_messages, atomically
__sync_fetch_and_add (&pending_messages, 1);
}
ITTI_DUMP_DEBUG (0x2, " Added element to queue %p %p, pending %u, type %u\n", new_queue_element, new, pending_messages, message_type);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
#endif
return 0;
}
static void itti_dump_socket_exit(void)
{
#ifndef RTAI
close(itti_dump_queue.event_fd);
#endif
close(itti_dump_queue.itti_listen_socket);
/* Leave the thread as we detected end signal */
......@@ -346,10 +316,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
int j;
int consumer;
#ifdef RTAI
unsigned long number_of_messages;
#endif
/* Check if there is a least one consumer */
consumer = 0;
......@@ -365,18 +331,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
}
if (consumer > 0) {
#ifdef RTAI
number_of_messages = itti_dump_queue.messages_in_queue;
ITTI_DUMP_DEBUG(0x4, "%lu elements in queue\n", number_of_messages);
if (number_of_messages == 0) {
return (consumer);
}
__sync_sub_and_fetch(&itti_dump_queue.messages_in_queue, number_of_messages);
#endif
do {
/* Acquire the ring element */
lfds611_ringbuffer_get_read_element(itti_dump_queue.itti_message_queue, &element);
......@@ -419,9 +373,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
}
} while(flush_all
#ifdef RTAI
&& --number_of_messages
#endif
);
}
......@@ -478,9 +429,6 @@ static void *itti_dump_socket(void *arg_p)
struct sockaddr_in servaddr; /* socket address structure */
struct timeval *timeout_p = NULL;
#ifdef RTAI
struct timeval timeout;
#endif
ITTI_DUMP_DEBUG(0x2, " Creating TCP dump socket on port %u\n", ITTI_PORT);
......@@ -536,15 +484,11 @@ static void *itti_dump_socket(void *arg_p)
/* Add the listener */
FD_SET(itti_listen_socket, &read_set);
#ifndef RTAI
/* Add the event fd */
FD_SET(itti_dump_queue.event_fd, &read_set);
/* Max of both sd */
max_sd = itti_listen_socket > itti_dump_queue.event_fd ? itti_listen_socket : itti_dump_queue.event_fd;
#else
max_sd = itti_listen_socket;
#endif
itti_dump_queue.itti_listen_socket = itti_listen_socket;
......@@ -557,14 +501,7 @@ static void *itti_dump_socket(void *arg_p)
int i;
memcpy(&working_set, &read_set, sizeof(read_set));
#ifdef RTAI
timeout.tv_sec = 0;
timeout.tv_usec = 100000;
timeout_p = &timeout;
#else
timeout_p = NULL;
#endif
/* No timeout: select blocks till a new event has to be handled
* on sd's.
......@@ -592,8 +529,6 @@ static void *itti_dump_socket(void *arg_p)
if (FD_ISSET(i, &working_set)) {
desc_ready -= 1;
#ifndef RTAI
if (i == itti_dump_queue.event_fd) {
/* Notification of new element to dump from other tasks */
eventfd_t sem_counter;
......@@ -613,7 +548,6 @@ static void *itti_dump_socket(void *arg_p)
if (itti_dump_running) {
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
usleep(100 * 1000);
#ifndef RTAI
{
ssize_t write_ret;
......@@ -622,7 +556,6 @@ static void *itti_dump_socket(void *arg_p)
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
AssertFatal (write_ret == sizeof(sem_counter), "Failed to write to dump event FD (%d/%d)!\n", (int) write_ret, (int) sem_counter);
}
#endif
} else {
itti_dump_socket_exit();
}
......@@ -630,7 +563,6 @@ static void *itti_dump_socket(void *arg_p)
ITTI_DUMP_DEBUG(0x1, " Write element to file\n");
}
} else
#endif
if (i == itti_listen_socket) {
do {
client_socket = accept(itti_listen_socket, NULL, NULL);
......@@ -719,21 +651,9 @@ int itti_dump_queue_message(task_id_t sender_task,
AssertFatal (message_name != NULL, "Message name is NULL!\n");
AssertFatal (message_p != NULL, "Message is NULL!\n");
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
#endif
new = itti_malloc(sender_task, TASK_MAX, sizeof(itti_dump_queue_item_t));
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
#endif
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
#endif
new->data = itti_malloc(sender_task, TASK_MAX, message_size);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
#endif
memcpy(new->data, message_p, message_size);
new->data_size = message_size;
......@@ -791,9 +711,6 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
AssertFatal (0, " Failed to create ring buffer!\n");
}
#ifdef RTAI
itti_dump_queue.messages_in_queue = 0;
#else
itti_dump_queue.event_fd = eventfd(0, EFD_SEMAPHORE);
if (itti_dump_queue.event_fd == -1) {
......@@ -801,8 +718,6 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
AssertFatal (0, "eventfd failed: %s!\n", strerror(errno));
}
#endif
itti_dump_queue.nb_connected = 0;
for(i = 0; i < ITTI_DUMP_MAX_CON; i++) {
......
......@@ -27,10 +27,17 @@
#ifndef _ITTI_TYPES_H_
#define _ITTI_TYPES_H_
#ifdef USER_MODE
#include <stdint.h>
/* The current file is included in the ue_ip.ko compilation.
* For it to work we need to include linux/types.h and
* not stdint.h.
* A solution to this problem is to use #ifndef __KERNEL__.
* Maybe a better solution would be to clean things up
* so that ue_ip.ko does not include the current file.
*/
#ifndef __KERNEL__
# include <stdint.h>
#else
#include <linux/types.h>
# include <linux/types.h>
#endif
#define CHARS_TO_UINT32(c1, c2, c3, c4) (((c4) << 24) | ((c3) << 16) | ((c2) << 8) | (c1))
......
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
#ifdef RTAI
# include <rtai_shm.h>
#endif
#include "assertions.h"
#include "memory_pools.h"
#if defined(OAI_EMU) || defined(RTAI)
# include "vcd_signal_dumper.h"
#endif
#if T_TRACER
#include <string.h>
......@@ -37,18 +30,8 @@
/*------------------------------------------------------------------------------*/
const static int mp_debug = 0;
#ifdef RTAI
# define MP_DEBUG(x, args...) do { if (mp_debug) rt_printk("[MP][D]"x, ##args); } \
while(0)
#else
# define MP_DEBUG(x, args...) do { if (mp_debug) fprintf(stdout, "[MP][D]"x, ##args); fflush (stdout); } \
while(0)
#endif
#if defined(OAI_EMU) || defined(RTAI)
uint64_t vcd_mp_alloc;
uint64_t vcd_mp_free;
#endif
/*------------------------------------------------------------------------------*/
#ifndef CHARS_TO_UINT32
......@@ -414,11 +397,6 @@ memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_po
pool_id_t pool;
items_group_index_t item_index = ITEMS_GROUP_INDEX_INVALID;
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_ALLOC,
__sync_or_and_fetch (&vcd_mp_alloc, 1L << info_0));
#endif
/* Recover memory_pools */
memory_pools = memory_pools_from_handler (memory_pools_handle);
AssertError (memory_pools != NULL, {}, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
......@@ -464,11 +442,6 @@ memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_po
MP_DEBUG(" Alloc [--][------]{------}, %3u %3u, %6u, failed!\n", info_0, info_1, item_size);
}
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_ALLOC,
__sync_and_and_fetch (&vcd_mp_alloc, ~(1L << info_0)));
#endif
return memory_pool_item_handle;
}
......@@ -493,11 +466,6 @@ int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_it
info_1 = memory_pool_item->start.info[1];
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE,
__sync_or_and_fetch (&vcd_mp_free, 1L << info_1));
#endif
/* Recover pool index */
pool = memory_pool_item->start.pool_id;
AssertFatal (pool < memory_pools->pools_defined, "Pool index is invalid (%u/%u)!\n", pool, memory_pools->pools_defined);
......@@ -531,11 +499,6 @@ int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_it
AssertError (result == EXIT_SUCCESS, {}, "Failed to free memory pool item (pool %u, item %d)!\n", pool, item_index);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE,
__sync_and_and_fetch (&vcd_mp_free, ~(1L << info_1)));
#endif
return (result);
}
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <dlfcn.h>
#include "openair1/PHY/defs.h"
......@@ -44,68 +45,162 @@
void loader_init(void) {
paramdef_t LoaderParams[] = LOADER_PARAMS_DESC;
loader_data.mainexec_buildversion = PACKAGE_VERSION;
int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),LOADER_CONFIG_PREFIX);
if (ret <0) {
fprintf(stderr,"[LOADER] configuration couldn't be performed");
printf("[LOADER] configuration couldn't be performed via config module, parameters set to default values\n");
if (loader_data.shlibpath == NULL) {
loader_data.shlibpath=DEFAULT_PATH;
}
return;
}
loader_data.maxshlibs = DEFAULT_MAXSHLIBS;
}
loader_data.shlibs = malloc(loader_data.maxshlibs * sizeof(loader_shlibdesc_t));
if(loader_data.shlibs == NULL) {
fprintf(stderr,"[LOADER] %s %d memory allocation error %s\n",__FILE__, __LINE__,strerror(errno));
exit_fun("[LOADER] unrecoverable error");
}
memset(loader_data.shlibs,0,loader_data.maxshlibs * sizeof(loader_shlibdesc_t));
}
/* build the full shared lib name from the module name */
char *loader_format_shlibpath(char *modname)
{
char *tmpstr;
char *shlibpath =NULL;
char *shlibversion=NULL;
char *cfgprefix;
paramdef_t LoaderParams[] ={{"shlibpath", NULL, 0, strptr:&shlibpath, defstrval:NULL, TYPE_STRING, 0},
{"shlibversion", NULL, 0, strptr:&shlibversion, defstrval:"", TYPE_STRING, 0}};
int ret;
/* looks for specific path for this module in the config file */
/* specific value for a module path and version is located in a modname subsection of the loader section */
/* shared lib name is formatted as lib<module name><module version>.so */
cfgprefix = malloc(sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16);
if (cfgprefix == NULL) {
fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
exit_fun("[LOADER] unrecoverable error");
} else {
sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname);
int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix);
if (ret <0) {
fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix);
}
}
/* no specific path, use loader default shared lib path */
if (shlibpath == NULL) {
shlibpath = loader_data.shlibpath ;
}
/* no specific shared lib version */
if (shlibversion == NULL) {
shlibversion = "" ;
}
/* alloc memory for full module shared lib file name */
tmpstr = malloc(strlen(shlibpath)+strlen(modname)+strlen(shlibversion)+16);
if (tmpstr == NULL) {
fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
exit_fun("[LOADER] unrecoverable error");
}
if(shlibpath[0] != 0) {
ret=sprintf(tmpstr,"%s/",shlibpath);
} else {
ret = 0;
}
sprintf(tmpstr+ret,"lib%s%s.so",modname,shlibversion);
return tmpstr;
}
int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
{
void *lib_handle;
initfunc_t fpi;
char *tmpstr;
checkverfunc_t fpc;
getfarrayfunc_t fpg;
char *shlib_path;
char *afname=NULL;
int ret=0;
if (loader_data.shlibpath == NULL) {
loader_init();
}
tmpstr = malloc(strlen(loader_data.shlibpath)+strlen(modname)+16);
if (tmpstr == NULL) {
fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
return -1;
}
if(loader_data.shlibpath[0] != 0) {
ret=sprintf(tmpstr,"%s/",loader_data.shlibpath);
}
if(strstr(modname,".so") == NULL) {
sprintf(tmpstr+ret,"lib%s.so",modname);
} else {
sprintf(tmpstr+ret,"%s",modname);
}
shlib_path = loader_format_shlibpath(modname);
ret = 0;
lib_handle = dlopen(tmpstr, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL);
lib_handle = dlopen(shlib_path, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL);
if (!lib_handle) {
fprintf(stderr,"[LOADER] library %s is not loaded: %s\n", tmpstr,dlerror());
fprintf(stderr,"[LOADER] library %s is not loaded: %s\n", shlib_path,dlerror());
ret = -1;
} else {
printf("[LOADER] library %s uccessfully loaded loaded\n", tmpstr);
sprintf(tmpstr,"%s_autoinit",modname);
fpi = dlsym(lib_handle,tmpstr);
printf("[LOADER] library %s successfully loaded\n", shlib_path);
afname=malloc(strlen(modname)+15);
sprintf(afname,"%s_checkbuildver",modname);
fpc = dlsym(lib_handle,afname);
if (fpc != NULL ){
int chkver_ret = fpc(loader_data.mainexec_buildversion, &(loader_data.shlibs[loader_data.numshlibs].shlib_buildversion));
if (chkver_ret < 0) {
fprintf(stderr,"[LOADER] %s %d lib %s, version mismatch",__FILE__, __LINE__, modname);
exit_fun("[LOADER] unrecoverable error");
}
}
sprintf(afname,"%s_autoinit",modname);
fpi = dlsym(lib_handle,afname);
if (fpi != NULL )
{
if (fpi != NULL ) {
fpi();
}
}
if (farray != NULL) {
loader_data.shlibs[loader_data.numshlibs].funcarray=malloc(numf*sizeof(loader_shlibfunc_t));
loader_data.shlibs[loader_data.numshlibs].numfunc=0;
for (int i=0; i<numf; i++) {
farray[i].fptr = dlsym(lib_handle,farray[i].fname);
if (farray[i].fptr == NULL ) {
fprintf(stderr,"[LOADER] %s %d %s function not found %s\n",__FILE__, __LINE__, dlerror(),farray[i].fname);
ret= -1;
}
ret= -1;
} else { /* farray[i].fptr == NULL */
loader_data.shlibs[loader_data.numshlibs].funcarray[i].fname=strdup(farray[i].fname);
loader_data.shlibs[loader_data.numshlibs].funcarray[i].fptr = farray[i].fptr;
loader_data.shlibs[loader_data.numshlibs].numfunc++;
}/* farray[i].fptr != NULL */
} /* for int i... */
} /* farray ! NULL */
}
} else { /* farray ! NULL */
sprintf(afname,"%s_getfarray",modname);
fpg = dlsym(lib_handle,afname);
if (fpg != NULL ) {
loader_data.shlibs[loader_data.numshlibs].numfunc = fpg(&(loader_data.shlibs[loader_data.numshlibs].funcarray));
}
} /* farray ! NULL */
loader_data.shlibs[loader_data.numshlibs].name=strdup(modname);
loader_data.shlibs[loader_data.numshlibs].thisshlib_path=strdup(shlib_path);
(loader_data.numshlibs)++;
} /* lib_handle != NULL */
if (tmpstr != NULL) free(tmpstr);
if ( shlib_path!= NULL) free(shlib_path);
if ( afname!= NULL) free(afname);
if (lib_handle != NULL) dlclose(lib_handle);
return ret;
}
void * get_shlibmodule_fptr(char *modname, char *fname)
{
for (int i=0; i<loader_data.numshlibs && loader_data.shlibs[i].name != NULL; i++) {
if ( strcmp(loader_data.shlibs[i].name, modname) == 0) {
for (int j =0; j<loader_data.shlibs[i].numfunc ; j++) {
if (strcmp(loader_data.shlibs[i].funcarray[j].fname, fname) == 0) {
return loader_data.shlibs[i].funcarray[j].fptr;
}
} /* for j loop on module functions*/
}
} /* for i loop on modules */
return NULL;
}
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -33,33 +33,60 @@
#define LOAD_SHLIB_H
typedef int(*initfunc_t)(void);
typedef struct {
char *shlibpath;
}loader_data_t;
typedef struct {
char *fname;
int (*fptr)(void);
}loader_shlibfunc_t;
typedef struct {
char *name;
char *shlib_version; //
char *shlib_buildversion;
char *thisshlib_path;
uint32_t numfunc;
loader_shlibfunc_t *funcarray;
}loader_shlibdesc_t;
typedef struct {
char *mainexec_buildversion;
char *shlibpath;
uint32_t maxshlibs;
uint32_t numshlibs;
loader_shlibdesc_t *shlibs;
}loader_data_t;
/* function type of functions which may be implemented by a module */
/* 1: init function, called when loading, if found in the shared lib */
typedef int(*initfunc_t)(void);
/* 2: version checking function, called when loading, if it returns -1, trigger main exec abort */
typedef int(*checkverfunc_t)(char * mainexec_version, char ** shlib_version);
/* 3: get function array function, called when loading when a module doesn't provide */
/* the function array when calling load_module_shlib (farray param NULL) */
typedef int(*getfarrayfunc_t)(loader_shlibfunc_t **funcarray);
#ifdef LOAD_MODULE_SHLIB_MAIN
#define LOADER_CONFIG_PREFIX "loader"
#define DEFAULT_PATH ""
#define DEFAULT_PATH ""
#define DEFAULT_MAXSHLIBS 10
loader_data_t loader_data;
/*--------------------------------------------------------------------------------------------------------------------------------------*/
/* LOADER parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
/* LOADER parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
#define LOADER_PARAMS_DESC { \
{"shlibpath", NULL, 0, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0} \
{"shlibpath", NULL, PARAMFLAG_NOFREE, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0}, \
{"maxshlibs", NULL, 0, uptr:&(loader_data.maxshlibs), defintval:DEFAULT_MAXSHLIBS, TYPE_UINT32, 0}, \
}
/*-------------------------------------------------------------------------------------------------------------*/
#else
#else /* LOAD_MODULE_SHLIB_MAIN */
extern int load_module_shlib(char *modname, loader_shlibfunc_t *farray, int numf);
#endif
extern void * get_shlibmodule_fptr(char *modname, char *fname);
extern loader_data_t loader_data;
#endif /* LOAD_MODULE_SHLIB_MAIN */
#endif
......@@ -99,6 +99,7 @@ void *msc_task(void *args_p)
break;
case TERMINATE_MESSAGE: {
fprintf(stderr, " *** Exiting MSC thread\n");
timer_remove(timer_id);
msc_end();
itti_exit_task();
......
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
IF(DEFINED ENV{OPENAIR_DIR})
message("...using oai source files in $ENV{OPENAIR_DIR}")
ELSE()
message("OPENAIR_DIR is not defined. You must run \"source oaienv\" from the oai root dir")
# exit early
return()
ENDIF()
set(OPENAIR_DIR $ENV{OPENAIR_DIR})
set(APPROOT ${OPENAIR_DIR}/common/utils/telnetsrv )
set(OPENAIR_BUILD_DIR $ENV{OPENAIR_DIR}/cmake_targets)
set(OPENAIR1_DIR $ENV{OPENAIR1_DIR})
set(OPENAIR2_DIR $ENV{OPENAIR2_DIR})
set(OPENAIR3_DIR $ENV{OPENAIR3_DIR})
set(OPENAIR_PHY_DIR $ENV{OPENAIR1_DIR}/PHY)
set(OPENAIR_TARGET_DIR $ENV{OPENAIR_DIR}/targets)
set(OPENAIR_COMMONUTILS_DIR $ENV{OPENAIR_DIR}/common/utils)
set(OPENAIR2_COMMON_DIR $ENV{OPENAIR_DIR}/openair2/COMMON)
set(OPENAIR_ASN1INC ${OPENAIR_BUILD_DIR}/lte_build_oai/build/CMakeFiles/Rel14)
set(OPENAIR_NFAPIINC $ENV{NFAPI_DIR} )
set(CMAKE_INSTALL_PREFIX $ENV{OPENAIR_TARGETS})
add_definitions (-DRel14 -DCMAKER -DENABLE_FXP -DENABLE_ITTI -DENABLE_NAS_UE_LOGGING -DENABLE_SECURITY -DENABLE_USE_CPU_EXECUTION_TIME -DENABLE_USE_MME -DENABLE_VCD -DENB_AGENT -DENB_MODE -DETHERNET=1 -DEXMIMO_IOT -DJUMBO_FRAME -DLINK_ENB_PDCP_TO_GTPV1U -DLOG_NO_THREAD -DMAC_CONTEXT -DMAX_NUM_CCs=1 -DNAS_BUILT_IN_UE -DNAS_UE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DNB_ANTENNAS_TXRX=2 -DNEW_FFT -DNO_RRM -DNone=1 -DOAI_NW_DRIVER_USE_NETLINK -DOPENAIR1 -DOPENAIR2 -DOPENAIR_LTE -DPC_DSP -DPC_TARGET -DPHYSIM -DPHY_CONTEXT -DPUCCH -DRel10=1 -DS1AP_VERSION=R10 -DTRACE_RLC_MUTEX -DUSER_MODE -DX2AP_VERSION=R11 -DXFORMS -mavx2 -msse4.1 -mssse3)
add_compile_options( -fPIC -march=native -Ofast)
include_directories( ./ ${OPENAIR_COMMON_DIR} ${OPENAIR_DIR} ${OPENAIR1_DIR} ${OPENAIR2_DIR} ${OPENAIR2_COMMON_DIR} ${OPENAIR2_DIR}/UTIL/LOG
${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_COMMONUTILS_DIR}/hashtable ${OPENAIR_COMMONUTILS_DIR} ${OPENAIR_ASN1INC}
${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0 ${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_COMMONUTILS_DIR}/hashtable ${OPENAIR_COMMONUTILS_DIR} ${OPENAIR_ASN1INC}
${OPENAIR2_DIR}/LAYER2/RLC ${OPENAIR2_DIR}/UTIL/LISTS ${OPENAIR2_DIR}/UTIL/MEM ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0
${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0 ${OPENAIR2_DIR}/RRC/LITE ${OPENAIR_TARGET_DIR}/COMMON ${OPENAIR_TARGET_DIR}/ARCH/COMMON
${OPENAIR3_DIR}/NAS/COMMON/API/NETWORK ${OPENAIR3_DIR}/NAS/COMMON/EMM/MSG/ ${OPENAIR3_DIR}/NAS/COMMON/IES/ ${OPENAIR3_DIR}/NAS/COMMON/UTIL
${OPENAIR3_DIR}/NAS/COMMON/ESM/MSG/ ${OPENAIR3_DIR}/GTPV1-U ${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/shared ${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/include
${OPENAIR3_DIR}/UTILS ${OPENAIR_NFAPIINC})
set(TELNETSRV_SOURCE
${APPROOT}/telnetsrv.c
${APPROOT}/telnetsrv_phycmd.c
${APPROOT}/telnetsrv_proccmd.c
)
#set(TELNETSRV_ETHDEVCMD_SOURCE
# ${APPROOT}/telnetsrv/telnetsrv_ethdevcmd.c
# )
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
#add_library(telnetsrv_ethdevcmd MODULE ${TELNETSRV_ETHDEVCMD_SOURCE} )
install(TARGETS telnetsrv DESTINATION bin)
if (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/lte_build_oai/build)
endif (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
This diff is collapsed.
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -18,7 +18,6 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/telnetsrv/telnetsrv.h
* \brief: include file for telnet server implementation
* \author Francois TABURET
......@@ -38,7 +37,7 @@
#define TELNET_MAX_MSGLENGTH 2048
#define TELNET_PROMPT "softmodem> "
#define TELNET_MAXCMD 20
#define TELNET_CMD_MAXSIZE 10
#define TELNET_CMD_MAXSIZE 20
#define TELNET_HELPSTR_SIZE 80
/* status return by the command parser after it analysed user input */
......@@ -70,7 +69,7 @@ typedef struct cmddef {
#define TELNET_VARTYPE_INT64 3
#define TELNET_VARTYPE_STRING 4
#define TELNET_VARTYPE_DOUBLE 5
#define TELNET_VARTYPE_PTR 6
//#define TELNET_VARTYPE_PTR 6
typedef struct variabledef {
char varname[TELNET_CMD_MAXSIZE];
char vartype;
......@@ -96,6 +95,8 @@ typedef struct {
pthread_t telnet_pthread; // thread id of the telnet server
int telnetdbg; // debug level of the server
int priority; // server running priority
char *histfile; // command history
int histsize; // command history length
int new_socket; // socket of the client connection
int logfilefd; // file id of the log file when log output is redirected to a file
int saved_stdout; // file id of the previous stdout, used to be able to restore original stdout
......@@ -130,10 +131,12 @@ VT escape sequence definition, for smarter display....
#define STDFMT "\x1b[0m"
/*---------------------------------------------------------------------------------------------*/
#define TELNET_ADDCMD_FNAME "add_telnetcmd"
typedef int(*add_telnetcmd_func_t)(char *, telnetshell_vardef_t *, telnetshell_cmddef_t *);
#ifdef TELNETSERVERCODE
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd);
void set_sched(pthread_t tid, int pid,int priority);
void set_affinity(pthread_t tid, int pid, int coreid);
extern int get_phybsize();
extern int get_phybsize(void);
#endif
#endif
set(TELNETROOT ${OPENAIR_DIR}/common/utils/telnetsrv )
set(TELNETSRV_SOURCE
${TELNETROOT}/telnetsrv.c
${TELNETROOT}/telnetsrv_phycmd.c
${TELNETROOT}/telnetsrv_proccmd.c
${TELNETROOT}/telnetsrv_loader.c
)
#set(TELNETSRV_ETHDEVCMD_SOURCE
# ${APPROOT}/telnetsrv/telnetsrv_ethdevcmd.c
# )
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
#add_library(telnetsrv_ethdevcmd MODULE ${TELNETSRV_ETHDEVCMD_SOURCE} )
target_link_libraries(telnetsrv PRIVATE history)
install(TARGETS telnetsrv DESTINATION bin)
if (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/lte_build_oai/build)
endif (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
......@@ -19,86 +19,66 @@
* contact@openairinterface.org
*/
/*! \file rrh_gw.h
* \brief header file for remote radio head gateway (RRH_gw) module
* \author Navid Nikaein, Katerina Trilyraki, Raymond Knopp
* \date 2015
/*! \file common/utils/telnetsrv/telnetsrv_loader.c
* \brief: implementation of telnet commands related to softmodem linux process
* \author Francois TABURET
* \date 2018
* \version 0.1
* \company Eurecom
* \maintainer: navid.nikaein@eurecom.fr
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning very experimental
* \warning
*/
#define _GNU_SOURCE
#include <string.h>
#include <pthread.h>
#ifndef RRH_GW_H_
#define RRH_GW_H_
#include "ethernet_lib.h"
#include "vcd_signal_dumper.h"
#include "assertions.h"
#define TELNETSERVERCODE
#include "telnetsrv.h"
#define TELNETSRV_LOADER_MAIN
#include "telnetsrv_loader.h"
#define DEFAULT_PERIOD_NS 200000 /* default value is calculated for 25 PRB */
#define RRH_UE_PORT 51000
#define RRH_UE_DEST_IP "127.0.0.1"
/*! \brief RRH supports two types of modules: eNB and UE
each module is associated with an ethernet device (device of ETH_IF)
and optionally with a RF device (device type can be USRP_B200/USRP_X300/BLADERF_IF/EXMIMO_IF/NONE_IF)
UE modules will always have RF device type NONE_IF */
typedef struct {
/*! \brief module id */
uint8_t id;
/*! \brief! loopback flag */
uint8_t loopback;
/*! \brief measurement flag */
uint8_t measurements;
/*! \brief module's ethernet device */
openair0_device eth_dev;
/*! \brief pointer to RF module's device (pointer->since it's optional) */
openair0_device *devs;
}rrh_module_t;
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt);
telnetshell_cmddef_t loader_cmdarray[] = {
{"show","[params,modules]",loader_show_cmd},
{"","",NULL},
};
/*! \fn void timer_signal_handler(int sig)
* \brief this function
* \param[in] signal type
* \return none
* \note
* @ingroup _oai
*/
void timer_signal_handler(int);
/*! \fn void *timer_proc(void *arg)
* \brief this function
* \param[in]
* \param[out]
* \return
* \note
* @ingroup _oai
*/
void *timer_proc(void *);
/*! \fn void config_BBU_mod( rrh_module_t *mod_enb, uint8_t RT_flag,uint8_t NRT_flag)
* \brief receive and apply configuration to modules' optional device
* \param[in] *mod_enb pointer to module
* \param[in] RT_flag real time flag
* \return none
* \note
* @ingroup _oai
*/
void config_BBU_mod( rrh_module_t *mod_enb, uint8_t RT_flag, uint8_t NRT_flag);
/*! \fn void config_UE_mod( rrh_module_t *dev_ue, uint8_t RT_flag,uint8_t NRT_flag)
* \brief this function
* \param[in] *mod_ue pointer to module
* \param[in]
* \return none
* \note
* @ingroup _oai
*/
void config_UE_mod( rrh_module_t *dev_ue, uint8_t RT_flag, uint8_t NRT_flag);
/*-------------------------------------------------------------------------------------*/
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
{
if (debug > 0)
prnt( "loader_show_cmd received %s\n",buff);
if (strcasestr(buff,"params") != NULL) {
prnt( "loader parameters:\n");
prnt( " Main executable build version: \"%s\"\n", loader_data.mainexec_buildversion);
prnt( " Default shared lib path: \"%s\"\n", loader_data.shlibpath);
prnt( " Max number of shared lib : %i\n", loader_data.maxshlibs);
}
else if (strcasestr(buff,"modules") != NULL) {
prnt( "%i shared lib have been dynamicaly loaded by the oai loader\n", loader_data.numshlibs);
for (int i=0 ; i<loader_data.numshlibs ; i++) {
prnt( " Module %i: %s\n", i,loader_data.shlibs[i].name);
prnt( " Shared library build version: \"%s\"\n",((loader_data.shlibs[i].shlib_buildversion == NULL )?"":loader_data.shlibs[i].shlib_buildversion));
prnt( " Shared library path: \"%s\"\n", loader_data.shlibs[i].thisshlib_path);
prnt( " %i function pointers registered:\n", loader_data.shlibs[i].numfunc);
for(int j=0 ; j<loader_data.shlibs[i].numfunc;j++) {
prnt( " function %i %s at %p\n",j,
loader_data.shlibs[i].funcarray[j].fname, loader_data.shlibs[i].funcarray[j].fptr);
}
}
} else {
prnt("%s: wrong loader command...\n",buff);
}
return 0;
}
void signal_handler(int sig);
void add_loader_cmds(void)
{
#endif
add_telnetcmd("loader", loader_globalvardef, loader_cmdarray);
}
......@@ -19,30 +19,37 @@
* contact@openairinterface.org
*/
/*! \file rrh_gw_extern.h
* \brief rrh gatewy external vars
* \author Navid Nikaein, Katerina Trilyraki, Raymond Knopp
* \date 2015
/*! \file common/utils/telnetsrv_proccmd.h
* \brief: Include file defining telnet commands related to softmodem linux process
* \author Francois TABURET
* \date 2018
* \version 0.1
* \company Eurecom
* \maintainer: navid.nikaein@eurecom.fr
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning very experimental
* \warning
*/
#ifndef RRH_GW_EXTERNS_H_
#define RRH_GW_EXTERNS_H_
extern char rf_config_file[1024];
#ifdef TELNETSRV_LOADER_MAIN
extern openair0_timestamp timestamp_UE_tx[4] ,timestamp_UE_rx[4] ,timestamp_eNB_rx[4],timestamp_eNB_tx[4];
extern openair0_vtimestamp hw_counter;
extern int32_t UE_tx_started,UE_rx_started,eNB_rx_started ,eNB_tx_started;
extern int32_t nsamps_UE[4],nsamps_eNB[4];
extern int32_t overflow_rx_buffer_eNB[4],overflow_rx_buffer_UE[4];
extern uint8_t rrh_exit;
extern int32_t **rx_buffer_eNB, **rx_buffer_UE;
extern unsigned int rt_period;
extern pthread_mutex_t timer_mutex;
#include "UTIL/LOG/log.h"
#endif
#include "common/utils/load_module_shlib.h"
telnetshell_vardef_t loader_globalvardef[] = {
{"mainversion",TELNET_VARTYPE_STRING,&(loader_data.mainexec_buildversion)},
{"defpath",TELNET_VARTYPE_STRING,&(loader_data.shlibpath)},
{"maxshlibs",TELNET_VARTYPE_INT32,&(loader_data.maxshlibs)},
{"numshlibs",TELNET_VARTYPE_INT32,&(loader_data.numshlibs)},
{"",0,NULL}
};
telnetshell_vardef_t *loader_modulesvardef;
extern void add_loader_cmds(void);
#endif
/*-------------------------------------------------------------------------------------*/
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -41,7 +41,7 @@
char *prnbuff;
extern int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length);
void init_phytelnet()
void init_phytelnet(void)
{
prnbuff=malloc(get_phybsize() );
if (prnbuff == NULL)
......@@ -134,7 +134,7 @@ telnetshell_cmddef_t phy_cmdarray[] = {
/*-------------------------------------------------------------------------------------*/
void add_phy_cmds()
void add_phy_cmds(void)
{
init_phytelnet();
......
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -42,8 +42,6 @@
#define TELNETVAR_PHYCC1 1
telnetshell_vardef_t phy_vardef[] = {
{"phycc1",TELNET_VARTYPE_PTR,NULL},
{"phycc2",TELNET_VARTYPE_PTR,NULL},
//{"iqmax",TELNET_VARTYPE_INT16,NULL},
//{"iqmin",TELNET_VARTYPE_INT16,NULL},
//{"loglvl",TELNET_VARTYPE_INT32,NULL},
......@@ -57,7 +55,7 @@ telnetshell_vardef_t phy_vardef[] = {
#else
extern void add_phy_cmds();
extern void add_phy_cmds(void);
#endif
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
* 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.0 (the "License"); you may not use this file
* 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
*
......@@ -19,6 +19,7 @@
* contact@openairinterface.org
*/
/*! \file common/utils/telnetsrv/telnetsrv_proccmd.h
* \brief: Include file defining telnet commands related to this linux process
* \author Francois TABURET
......@@ -43,15 +44,33 @@ extern int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt);
telnetshell_vardef_t proc_vardef[] = {
{"",0,NULL}
};
#define PROCCMD_LOG_HELP_STRING " log sub commands: \n\
show: display current log configuration \n\
online, noonline: enable or disable console logs \n\
enable, disable id1-id2: enable or disable logs for components index id1 to id2 \n\
level_<level> id1-id2: set log level to <level> for components index id1 to id2 \n\
level_<verbosity> id1-id2: set log verbosity to <verbosity> for components index id1 to id2 \n\
use the show command to get the values for <level>, <verbosity> and the list of component indexes \
that can be used for id1 and id2 \n"
#define PROCCMD_THREAD_HELP_STRING " thread sub commands: \n\
<thread id> aff <core> : set affinity of thread <thread id> to core <core> \n\
<thread id> prio <prio> : set scheduling parameters for thread <thread id> \n\
if prio < -20: linux scheduling policy set to FIFO, \n\
with priority = -20 - prio \n\
if prio > 19: linux scheduling policy set to OTHER, \n\
with priority (nice value) = prio \n\
use \"softmodem show thread\" to get <thread id> \n"
telnetshell_cmddef_t proc_cmdarray[] = {
{"show","loglvl|thread", proccmd_show},
{"log","[enable,disable]", proccmd_log},
{"thread","<id> aff|prio <aff|prio>", proccmd_thread},
{"show","loglvl|thread|config", proccmd_show},
{"log","(enter help for details)", proccmd_log},
{"thread","(enter help for details)", proccmd_thread},
{"exit","", proccmd_exit},
{"","",NULL},
};
#else
extern void add_proccmd_cmds();
extern void add_proccmd_cmds(void);
#endif /* TELNETSRV_PROCCMD_MAIN */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment