" >> ./build_results.html
fi
@@ -218,25 +226,89 @@ function sca_summary_table_header {
echo "
$2
" >> ./build_results.html
NB_ERRORS=`egrep -c "severity=\"error\"" $1`
NB_WARNINGS=`egrep -c "severity=\"warning\"" $1`
+ ADDED_ERRORS="0"
+ ADDED_WARNINGS="0"
+ FINAL_LOG=`echo $1 | sed -e "s#cppcheck\.xml#build_final_status.log#"`
+ if [ `grep -c COMMAND $FINAL_LOG` -eq 1 ]
+ then
+ COMMAND=`grep COMMAND $FINAL_LOG | sed -e "s#COMMAND: ##"`
+ else
+ COMMAND="Unknown"
+ fi
+ if [ $MR_TRIG -eq 1 ]
+ then
+ if [ -d ../../cppcheck_archives ]
+ then
+ if [ -d ../../cppcheck_archives/$JOB_NAME ]
+ then
+ ADDED_ERRORS=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep -c "severity=\"error"`
+ ADDED_WARNINGS=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep -c "severity=\"warning"`
+ fi
+ fi
+ local TOTAL_NUMBER=$[$ADDED_ERRORS+$ADDED_WARNINGS]
+ if [ -f $JENKINS_WKSP/oai_cppcheck_added_errors.txt ]; then rm -f $JENKINS_WKSP/oai_cppcheck_added_errors.txt; fi
+ echo "$TOTAL_NUMBER" > $JENKINS_WKSP/oai_cppcheck_added_errors.txt
+ fi
if [ $NB_ERRORS -eq 0 ] && [ $NB_WARNINGS -eq 0 ]
then
echo "
" >> ./build_results.html
+ echo " $COMMAND
" >> ./build_results.html
echo " CPPCHECK found NO error and NO warning " >> ./build_results.html
echo "
" >> ./build_results.html
else
if [ $NB_ERRORS -eq 0 ]
then
echo "
" >> ./build_results.html
- echo " CPPCHECK found NO error and $NB_WARNINGS warnings " >> ./build_results.html
+ echo " $COMMAND
" >> ./build_results.html
+ if [ $PU_TRIG -eq 1 ]
+ then
+ echo " CPPCHECK found NO error and $NB_WARNINGS warnings " >> ./build_results.html
+ fi
+ if [ $MR_TRIG -eq 1 ]
+ then
+ if [ $ADDED_WARNINGS -eq 0 ]
+ then
+ echo " CPPCHECK found NO error and $NB_WARNINGS warnings " >> ./build_results.html
+ else
+ echo " CPPCHECK found NO error and $NB_WARNINGS warnings " >> ./build_results.html
+ fi
+ fi
echo "
" >> ./build_results.html
else
echo "
" >> ./build_results.html
- echo " CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings " >> ./build_results.html
+ echo " $COMMAND
" >> ./build_results.html
+ if [ $PU_TRIG -eq 1 ]
+ then
+ echo " CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings " >> ./build_results.html
+ fi
+ if [ $MR_TRIG -eq 1 ]
+ then
+ if [ $ADDED_ERRORS -eq 0 ] && [ $ADDED_WARNINGS -eq 0 ]
+ then
+ echo " CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings " >> ./build_results.html
+ else
+ echo " CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings " >> ./build_results.html
+ echo " " >> ./build_results.html
+ echo " " >> ./build_results.html
+ echo " This Merge Request may have introduced up to $ADDED_ERRORS errors and $ADDED_WARNINGS warnings. " >> ./build_results.html
+ fi
+ fi
echo "
" >> ./build_results.html
fi
fi
+ if [ $PU_TRIG -eq 1 ]
+ then
+ if [ -d ../../cppcheck_archives ]
+ then
+ if [ -d ../../cppcheck_archives/$JOB_NAME ]
+ then
+ cp $1 ../../cppcheck_archives/$JOB_NAME
+ fi
+ fi
+ fi
echo " " >> ./build_results.html
echo "
" >> ./test_simulator_results.html
@@ -361,7 +377,7 @@ function report_test {
fi
PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'`
PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'`
- if [[ $PERF_INT -lt 90 ]]
+ if [[ $PERF_INT -lt 70 ]]
then
echo "
KO
" >> ./test_simulator_results.html
else
diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh
index 7ff04e23f8..8d2c5cda06 100755
--- a/ci-scripts/runTestOnVM.sh
+++ b/ci-scripts/runTestOnVM.sh
@@ -112,7 +112,7 @@ function start_basic_sim_ue {
rm $1
local i="0"
- echo "ifconfig oip1 | egrep -c \"inet addr\"" > $1
+ echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
while [ $i -lt 10 ]
do
sleep 5
@@ -134,7 +134,7 @@ function start_basic_sim_ue {
}
function get_ue_ip_addr {
- echo "ifconfig oip1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1
+ echo "ifconfig oaitun_ue1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1
UE_IP_ADDR=`ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1`
echo "UE IP Address for EPC is : $UE_IP_ADDR"
rm $1
@@ -149,9 +149,9 @@ function ping_ue_ip_addr {
}
function ping_epc_ip_addr {
- echo "echo \"COMMAND IS: ping -I oip1 -c 20 $3\" > $4" > $1
+ echo "echo \"COMMAND IS: ping -I oaitun_ue1 -c 20 $3\" > $4" > $1
echo "rm -f $4" >> $1
- echo "ping -I oip1 -c 20 $3 | tee -a $4" >> $1
+ echo "ping -I oaitun_ue1 -c 20 $3 | tee -a $4" >> $1
cat $1
ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1
rm -f $1
@@ -227,6 +227,10 @@ function check_iperf {
local LOC_BASE_LOG=$1
local LOC_REQ_BW=$2
local LOC_REQ_BW_MINUS_ONE=`echo "$LOC_REQ_BW - 1" | bc -l`
+ local LOC_REQ_BW_MINUS_TWO=`echo "$LOC_REQ_BW - 2" | bc -l`
+ local LOC_REQ_BW_MINUS_THREE=`echo "$LOC_REQ_BW - 3" | bc -l`
+ local LOC_IS_DL=`echo $LOC_BASE_LOG | grep -c _dl`
+ local LOC_IS_BASIC_SIM=`echo $LOC_BASE_LOG | grep -c basic_sim`
if [ -f ${LOC_BASE_LOG}_client.txt ]
then
local FILE_COMPLETE=`egrep -c "Server Report" ${LOC_BASE_LOG}_client.txt`
@@ -235,11 +239,26 @@ function check_iperf {
IPERF_STATUS=-1
else
local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
- if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*Mbits.* ]]
+ if [ $LOC_IS_DL -eq 1 ] && [ $LOC_IS_BASIC_SIM -eq 1 ]
then
- echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
+ if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_TWO}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_THREE}.*Mbits.* ]]
+ then
+ echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
+ else
+ IPERF_STATUS=-1
+ fi
else
- IPERF_STATUS=-1
+ if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*Mbits.* ]]
+ then
+ if [ $LOC_IS_DL -eq 1 ]
+ then
+ echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
+ else
+ echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH"
+ fi
+ else
+ IPERF_STATUS=-1
+ fi
fi
fi
else
@@ -299,7 +318,7 @@ function install_epc_on_vm {
if [ -d /opt/ltebox-archives/ ]
then
# Checking if all ltebox archives are available to run ltebx epc on a brand new VM
- if [ -f /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ] && [ -f /opt/ltebox-archives/etc-conf.zip ] && [ -f /opt/ltebox-archives/hss-sim.zip ]
+ if [ -f /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ] && [ -f /opt/ltebox-archives/etc-conf.zip ] && [ -f /opt/ltebox-archives/hss-sim-develop.zip ]
then
echo "############################################################"
echo "Test EPC on VM ($EPC_VM_NAME) will be using ltebox"
@@ -317,11 +336,18 @@ function install_epc_on_vm {
echo "############################################################"
echo "Creating test EPC VM ($LOC_EPC_VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################"
+ acquire_vm_create_lock
uvt-kvm create $LOC_EPC_VM_NAME release=xenial --unsafe-caching
+ echo "Waiting for VM to be started"
+ uvt-kvm wait $LOC_EPC_VM_NAME --insecure
+ release_vm_create_lock
+ else
+ echo "Waiting for VM to be started"
+ uvt-kvm wait $LOC_EPC_VM_NAME --insecure
fi
- uvt-kvm wait $LOC_EPC_VM_NAME --insecure
local LOC_EPC_VM_IP_ADDR=`uvt-kvm ip $LOC_EPC_VM_NAME`
+
echo "$LOC_EPC_VM_NAME has for IP addr = $LOC_EPC_VM_IP_ADDR"
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
@@ -342,7 +368,7 @@ function install_epc_on_vm {
echo "############################################################"
scp -o StrictHostKeyChecking=no /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
scp -o StrictHostKeyChecking=no /opt/ltebox-archives/etc-conf.zip ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
- scp -o StrictHostKeyChecking=no /opt/ltebox-archives/hss-sim.zip ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
+ scp -o StrictHostKeyChecking=no /opt/ltebox-archives/hss-sim-develop.zip ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
echo "############################################################"
echo "Install EPC on EPC VM ($LOC_EPC_VM_NAME)"
@@ -356,8 +382,8 @@ function install_epc_on_vm {
# Installing HSS
echo "echo \"cd /opt\"" >> $LOC_EPC_VM_CMDS
echo "cd /opt" >> $LOC_EPC_VM_CMDS
- echo "echo \"sudo unzip -qq /home/ubuntu/hss-sim.zip\"" >> $LOC_EPC_VM_CMDS
- echo "sudo unzip -qq /home/ubuntu/hss-sim.zip" >> $LOC_EPC_VM_CMDS
+ echo "echo \"sudo unzip -qq /home/ubuntu/hss-sim-develop.zip\"" >> $LOC_EPC_VM_CMDS
+ echo "sudo unzip -qq /home/ubuntu/hss-sim-develop.zip" >> $LOC_EPC_VM_CMDS
echo "echo \"cd /opt/hss_sim0609\"" >> $LOC_EPC_VM_CMDS
echo "cd /opt/hss_sim0609" >> $LOC_EPC_VM_CMDS
@@ -493,16 +519,6 @@ function build_ue_on_separate_folder {
echo "cd tmp-ue" >> $1
echo "echo \"unzip -qq -DD ../localZip.zip\"" >> $1
echo "unzip -qq -DD ../localZip.zip" >> $1
-
- # We may have some adaptation to do
- if [ -f /opt/ltebox-archives/adapt_ue_l2_sim.txt ]
- then
- echo "############################################################"
- echo "Doing some adaptation on UE side"
- echo "############################################################"
- cat /opt/ltebox-archives/adapt_ue_l2_sim.txt >> $1
- fi
-
echo "echo \"source oaienv\"" >> $1
echo "source oaienv" >> $1
echo "cd cmake_targets/" >> $1
@@ -569,6 +585,7 @@ function start_l2_sim_enb {
ENB_SYNC=1
echo "L2-SIM eNB is sync'ed: waiting for UE(s) to connect"
fi
+ sleep 10
}
function start_l2_sim_ue {
@@ -604,10 +621,34 @@ function start_l2_sim_ue {
if [ $i -lt 50 ]
then
UE_SYNC=0
- echo "L2-SIM UE is NOT sync'ed w/eNB"
+ echo "L2-SIM UE is NOT sync'ed w/ eNB"
+ return
else
UE_SYNC=1
- echo "L2-SIM UE is sync'ed w/eNB"
+ echo "L2-SIM UE is sync'ed w/ eNB"
+ fi
+ # Checking oaitun_ue1 interface has now an IP address
+ i="0"
+ echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
+ while [ $i -lt 10 ]
+ do
+ sleep 5
+ CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1`
+ if [ $CONNECTED -eq 1 ]
+ then
+ i="100"
+ else
+ i=$[$i+1]
+ fi
+ done
+ rm $1
+ if [ $i -lt 50 ]
+ then
+ UE_SYNC=0
+ echo "L2-SIM UE oaitun_ue1 is NOT sync'ed w/ EPC"
+ else
+ UE_SYNC=1
+ echo "L2-SIM UE oaitun_ue1 is sync'ed w/ EPC"
fi
sleep 10
}
@@ -632,7 +673,7 @@ function run_test_on_vm {
if [ "$RUN_OPTIONS" == "none" ]
then
echo "No run on VM testing for this variant currently"
- exit $STATUS
+ return
fi
if [[ $RUN_OPTIONS =~ .*run_exec_autotests.* ]]
@@ -762,15 +803,6 @@ function run_test_on_vm {
# Retrieve EPC real IP address
retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
- # We may have some adaptation to do
- if [ -f /opt/ltebox-archives/adapt_ue_sim.txt ]
- then
- echo "############################################################"
- echo "Doing some adaptation on UE side"
- echo "############################################################"
- ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < /opt/ltebox-archives/adapt_ue_sim.txt
- fi
-
echo "############################################################"
echo "Starting the eNB in FDD-5MHz mode"
echo "############################################################"
@@ -791,7 +823,8 @@ function run_test_on_vm {
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
@@ -807,10 +840,10 @@ function run_test_on_vm {
echo "Iperf DL"
echo "############################################################"
CURR_IPERF_LOG_BASE=fdd_05MHz_iperf_dl
- iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE
+ iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 10 $CURR_IPERF_LOG_BASE
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
- check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15
+ check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 10
echo "############################################################"
echo "Iperf UL"
@@ -850,7 +883,8 @@ function run_test_on_vm {
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
@@ -866,10 +900,10 @@ function run_test_on_vm {
echo "Iperf DL"
echo "############################################################"
CURR_IPERF_LOG_BASE=fdd_10MHz_iperf_dl
- iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE
+ iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 10 $CURR_IPERF_LOG_BASE
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
- check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15
+ check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 10
echo "############################################################"
echo "Iperf UL"
@@ -909,7 +943,8 @@ function run_test_on_vm {
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
@@ -925,10 +960,10 @@ function run_test_on_vm {
echo "Iperf DL"
echo "############################################################"
CURR_IPERF_LOG_BASE=fdd_20MHz_iperf_dl
- iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 15 $CURR_IPERF_LOG_BASE
+ iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 12 $CURR_IPERF_LOG_BASE
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
- check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 15
+ check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 12
echo "############################################################"
echo "Terminate enb/ue simulators"
@@ -961,7 +996,8 @@ function run_test_on_vm {
echo "ERROR: compiling flexran controller on vm went wrong"
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
FLEXRAN_CTL_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#flexran-rtc#"`
FLEXRAN_CTL_VM_CMDS=`echo $VM_CMDS | sed -e "s#cmds#flexran-rtc-cmds#"`
@@ -971,7 +1007,8 @@ function run_test_on_vm {
echo "ERROR: Flexran Ctl VM is not alive"
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
uvt-kvm wait $FLEXRAN_CTL_VM_NAME --insecure
FLEXRAN_CTL_VM_IP_ADDR=`uvt-kvm ip $FLEXRAN_CTL_VM_NAME`
@@ -1006,7 +1043,8 @@ function run_test_on_vm {
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 03_enb_ue_connected
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
@@ -1048,7 +1086,8 @@ function run_test_on_vm {
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
@@ -1085,50 +1124,52 @@ function run_test_on_vm {
CURRENT_ENB_LOG_FILE=tdd_10MHz_enb.log
start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 50 lte-tdd-basic-sim.conf none
- echo "############################################################"
- echo "Starting the UE in TDD-10MHz mode"
- echo "############################################################"
- CURRENT_UE_LOG_FILE=tdd_10MHz_ue.log
- start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 2350
- if [ $UE_SYNC -eq 0 ]
- then
- echo "Problem w/ eNB and UE not syncing"
- terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
- scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
- scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
- recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
- terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
- echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
- fi
- get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
-
- echo "############################################################"
- echo "Pinging the UE"
- echo "############################################################"
- PING_LOG_FILE=tdd_10MHz_ping_ue.txt
- ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE
- scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
- check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
-
- echo "############################################################"
- echo "Iperf DL"
- echo "############################################################"
- CURR_IPERF_LOG_BASE=tdd_10MHz_iperf_dl
- iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE
- scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
- scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
- check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6
-
- echo "############################################################"
- echo "Terminate enb/ue simulators"
- echo "############################################################"
- terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
- scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
- scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
- recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
- sleep 10
-
+# Disabling TDD-10MHz in order to stop getting false negatives
+# echo "############################################################"
+# echo "Starting the UE in TDD-10MHz mode"
+# echo "############################################################"
+# CURRENT_UE_LOG_FILE=tdd_10MHz_ue.log
+# start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 2350
+# if [ $UE_SYNC -eq 0 ]
+# then
+# echo "Problem w/ eNB and UE not syncing"
+# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
+# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
+# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
+# recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
+# terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
+# echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
+# STATUS=-1
+# return
+# fi
+# get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
+#
+# echo "############################################################"
+# echo "Pinging the UE"
+# echo "############################################################"
+# PING_LOG_FILE=tdd_10MHz_ping_ue.txt
+# ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE
+# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
+# check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
+#
+# echo "############################################################"
+# echo "Iperf DL"
+# echo "############################################################"
+# CURR_IPERF_LOG_BASE=tdd_10MHz_iperf_dl
+# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE
+# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
+# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
+# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6
+#
+# echo "############################################################"
+# echo "Terminate enb/ue simulators"
+# echo "############################################################"
+# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
+# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
+# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
+# recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
+# sleep 10
+#
# Disabling TDD-20MHz in order to stop getting false negatives
# echo "############################################################"
# echo "Starting the eNB in TDD-20MHz mode"
@@ -1150,7 +1191,8 @@ function run_test_on_vm {
# recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
# terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
# echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
-# exit -1
+# STATUS=-1
+# return
# fi
# get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
#
@@ -1262,7 +1304,8 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
- exit -1
+ STATUS=-1
+ return
fi
echo "############################################################"
diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh
index 2820b88647..7e4504944f 100755
--- a/ci-scripts/waitBuildOnVM.sh
+++ b/ci-scripts/waitBuildOnVM.sh
@@ -185,10 +185,16 @@ function check_on_vm_build {
fi
fi
+ if [[ "$VM_NAME" == *"-cppcheck"* ]]
+ then
+ echo "COMMAND: cppcheck $BUILD_OPTIONS . 2> cppcheck.xml" > $ARCHIVES_LOC/build_final_status.log
+ else
+ echo "COMMAND: build_oai -I $BUILD_OPTIONS" > $ARCHIVES_LOC/build_final_status.log
+ fi
if [[ $STATUS -eq 0 ]]
then
- echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log
+ echo "BUILD_OK" >> $ARCHIVES_LOC/build_final_status.log
else
- echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log
+ echo "BUILD_KO" >> $ARCHIVES_LOC/build_final_status.log
fi
}
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_build.xml b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
new file mode 100644
index 0000000000..24283a52d0
--- /dev/null
+++ b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
@@ -0,0 +1,55 @@
+
+
+ build-tab
+ Build
+ wrench
+
+ 010101
+ 050101 060101 070101
+
+
+
+
+
+ Build_eNB
+ Build eNB (USRP)
+ -w USRP -c --eNB
+
+
+
+ Initialize_HSS
+ Initialize HSS
+
+
+
+ Initialize_MME
+ Initialize MME
+
+
+
+ Initialize_SPGW
+ Initialize SPGW
+
+
+
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_epc_closure.xml b/ci-scripts/xml_files/enb_usrp210_band13_epc_closure.xml
new file mode 100644
index 0000000000..07fb6951f8
--- /dev/null
+++ b/ci-scripts/xml_files/enb_usrp210_band13_epc_closure.xml
@@ -0,0 +1,47 @@
+
+
+ epc-closure
+ EPC-Closure
+ log-out
+
+ 050201 060201 070201
+
+
+
+
+ Terminate_HSS
+ Terminate HSS
+
+
+
+ Terminate_MME
+ Terminate MME
+
+
+
+ Terminate_SPGW
+ Terminate SPGW
+
+
+
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
new file mode 100644
index 0000000000..ad543403d6
--- /dev/null
+++ b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
@@ -0,0 +1,78 @@
+
+
+ test-10-tm1
+ Test-10MHz-TM1
+ tasks
+
+ 040102
+ 030121 000001 040302 000001 040502 000001 040402 040202 000001 030201
+
+
+
+
+
+ IdleSleep
+ Waiting for a moment...
+ 15
+
+
+
+ Initialize_eNB
+ Initialize eNB (FDD/Band13/10MHz)
+ -O ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf
+
+
+
+ Terminate_eNB
+ Terminate eNB
+
+
+
+ Initialize_CatM_module
+ Initialize CAT-M Module
+
+
+
+ Terminate_CatM_module
+ Terminate CAT-M Module
+
+
+
+ Attach_CatM_module
+ Attach CAT-M Module
+
+
+
+ Detach_CatM_module
+ Detach CAT-M Module
+
+
+
+ Ping_CatM_module
+ ping (10MHz - 20 sec)
+ -c 20
+ 5
+
+
+
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
index 1de23d05d6..5e7f4e48c8 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
@@ -34,7 +34,7 @@
Initialize_eNBInitialize RRU (TDD/Band40)
- -O ci-scripts/conf_files/rru.tdd.band40.conf
+ -O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 1250
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
index 6bc37db17a..7ff1493d1c 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
@@ -34,7 +34,7 @@
Initialize_eNBInitialize RRU (TDD/Band40)
- -O ci-scripts/conf_files/rru.tdd.band40.conf
+ -O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 1200
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
index 512c958105..cd732294ec 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
@@ -37,7 +37,7 @@
-O ci-scripts/conf_files/rru.tdd.band40.conf0
-
+
Initialize_eNBInitialize RCC (TDD/Band40/20MHz/info)
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
index b0501e9875..1db56d10d2 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
@@ -34,7 +34,7 @@
Initialize_eNBInitialize RRU (FDD/Band7)
- -O ci-scripts/conf_files/rru.fdd.band7.conf
+ -O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 1251
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
index 88fb30b840..d60427c988 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
@@ -34,7 +34,7 @@
Initialize_eNBInitialize RRU (FDD/Band7)
- -O ci-scripts/conf_files/rru.fdd.band7.conf
+ -O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 1201
diff --git a/ci-scripts/xml_files/ue_band20_build.xml b/ci-scripts/xml_files/ue_band20_build.xml
new file mode 100644
index 0000000000..9ca1a2b234
--- /dev/null
+++ b/ci-scripts/xml_files/ue_band20_build.xml
@@ -0,0 +1,38 @@
+
+
+ build-tab
+ Build
+ wrench
+
+090101
+
+
+
+
+ Build_OAI_UE
+ Build OAI UE
+ -w USRP --UE
+
+
+
diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
new file mode 100644
index 0000000000..8353dca160
--- /dev/null
+++ b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
@@ -0,0 +1,49 @@
+
+
+ test-10mhz-orange
+ Test-10Mhz-Orange
+ tasks
+
+090102 000001 090109
+
+
+
+
+ Initialize_OAI_UE
+ Initialize OAI UE -- sniffing Orange frequency
+ -C 816000000 -r 50 --ue-rxgain 130 --ue-scan-carrier --no-L2-connect
+
+
+
+ IdleSleep
+ Sleep
+ 30
+
+
+
+ Terminate_OAI_UE
+ Terminate OAI UE
+
+
+
diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
new file mode 100644
index 0000000000..197d2fdbf9
--- /dev/null
+++ b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
@@ -0,0 +1,49 @@
+
+
+ test-10mHz-sfr
+ Test-10MHz-SFR
+ tasks
+
+090104 000001 090109
+
+
+
+
+ Initialize_OAI_UE
+ Initialize OAI UE -- sniffing SFR frequency
+ -C 806000000 -r 50 --ue-rxgain 130 --ue-scan-carrier --no-L2-connect
+
+
+
+ IdleSleep
+ Sleep
+ 30
+
+
+
+ Terminate_OAI_UE
+ Terminate OAI UE
+
+
+
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 1592c98e8e..3286857015 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -21,7 +21,7 @@
# Author: laurent THOMAS, Lionel GAUTHIER
-cmake_minimum_required (VERSION 2.8)
+cmake_minimum_required (VERSION 3.0)
#############################################
# Base directories, compatible with legacy OAI building
@@ -169,13 +169,13 @@ endif()
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC ")
# add autotools definitions that were maybe used!
+set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'")
set(CMAKE_C_FLAGS
- "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
+ "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER}"
)
set(CMAKE_CXX_FLAGS
- "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
+ "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D${MKVER}"
)
-add_definitions("-DASN_DISABLE_OER_SUPPORT")
#########################
@@ -227,7 +227,6 @@ add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_CO
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
-
# Debug related options
#########################################
add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
@@ -250,7 +249,7 @@ add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros")
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode")
-add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
+#add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
@@ -382,7 +381,7 @@ file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
add_custom_target (
s1ap_flag ALL
${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps
- DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
+ DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
)
add_library(S1AP_LIB
@@ -469,15 +468,62 @@ add_library(X2AP_ENB
${X2AP_DIR}/x2ap_eNB_itti_messaging.c
${X2AP_DIR}/x2ap_eNB_management_procedures.c
${X2AP_DIR}/x2ap_eNB_generate_messages.c
+ ${X2AP_DIR}/x2ap_ids.c
+ ${X2AP_DIR}/x2ap_timers.c
)
add_dependencies(X2AP_ENB rrc_flag x2_flag)
+# F1AP
+##############
+add_list1_option(F1AP_RELEASE R15 "F1AP ASN.1 grammar version" R15)
+set(F1AP_DIR ${OPENAIR2_DIR}/F1AP)
+if (${F1AP_RELEASE} STREQUAL "R15")
+ make_version(F1AP_VERSION 15 2 1)
+ set (ASN1RELDIR R15.2.1)
+endif(${F1AP_RELEASE} STREQUAL "R15")
+add_definitions(-DF1AP_VERSION=${F1AP_VERSION})
+set(F1AP_ASN_DIR ${F1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
+set(F1AP_ASN_FILES
+ ${F1AP_ASN_DIR}/F1AP-CommonDataTypes.asn
+ ${F1AP_ASN_DIR}/F1AP-Constants.asn
+ ${F1AP_ASN_DIR}/F1AP-PDU-Descriptions.asn
+ ${F1AP_ASN_DIR}/F1AP-PDU-Contents.asn
+ ${F1AP_ASN_DIR}/F1AP-IEs.asn
+ ${F1AP_ASN_DIR}/F1AP-Containers.asn
+ )
+
+set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
+message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
+execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR}
+ COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
+ RESULT_VARIABLE ret
+ OUTPUT_QUIET
+ ERROR_QUIET)
+
+if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "asn1c: error")
+endif (NOT ${ret} STREQUAL 0)
+
+file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c)
+add_library(F1AP_LIB
+ ${F1AP_ASN_GENERATED_C_FILES}
+)
+
+include_directories ("${F1AP_ASN_GENERATED_C_DIR}")
+include_directories ("${F1AP_DIR}")
+
+file(GLOB F1AP_C_FILES ${F1AP_DIR}/*.c)
+add_library(F1AP
+ ${F1AP_C_FILES}
+)
+
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
-add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
+add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR" "OAI_SIMU")
+
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement
@@ -585,6 +631,8 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE
add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} )
set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
+add_library(rfsimulator MODULE ${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c)
+
##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
@@ -595,7 +643,6 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
##############################################################
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
##############################################################
-add_boolean_option(ENABLE_SECURITY True "Enable LTE integrity and ciphering between RRC UE and eNB")
add_boolean_option(ENABLE_USE_MME True "eNB connected to MME (INTERFACE S1-C), not standalone eNB")
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer")
@@ -617,7 +664,12 @@ add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION w
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
-########################
+#############################################################################
+# Flag for UE compilation to avoid issues in common eNB/UE PDCP/RLC functions
+#############################################################################
+
+add_boolean_option(UETARGET False "set UE as target for compiler")
+
# Include order
##########################
add_boolean_option(ENB_MODE True "Swap the include directories between openair2 and openair3" )
@@ -693,10 +745,10 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
# PDCP LAYER OPTIONS
##########################
-add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
-add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
-add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
-add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
+#add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
+#add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
+#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
+#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
##########################
# RRC LAYER OPTIONS
@@ -743,6 +795,8 @@ include_directories("${NFAPI_DIR}/sim_common/inc")
include_directories("${NFAPI_DIR}/pnf_sim/inc")
include_directories("${OPENAIR1_DIR}")
include_directories("${OPENAIR2_DIR}")
+include_directories("${OPENAIR3_DIR}/NAS/TOOLS")
+include_directories("${OPENAIR2_DIR}/ENB_APP")
include_directories("${OPENAIR2_DIR}/LAYER2/RLC")
include_directories("${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0")
include_directories("${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0")
@@ -765,19 +819,21 @@ include_directories("${OPENAIR3_DIR}/SECU")
include_directories("${OPENAIR3_DIR}/SCTP")
include_directories("${OPENAIR3_DIR}/S1AP")
include_directories("${OPENAIR2_DIR}/X2AP")
+include_directories("${OPENAIR2_DIR}/F1AP")
include_directories("${OPENAIR3_DIR}/UDP")
include_directories("${OPENAIR3_DIR}/GTPV1-U")
include_directories("${OPENAIR_DIR}/targets/COMMON")
include_directories("${OPENAIR_DIR}/targets/ARCH/COMMON")
include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/USERSPACE/LIB/")
include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/DEFS")
-include_directories("${OPENAIR2_DIR}/ENB_APP")
+include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PHY")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP")
include_directories("${OPENAIR2_DIR}/UTIL/OSA")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
+include_directories("${OPENAIR2_DIR}/LAYER2/PROTO_AGENT")
include_directories("${OPENAIR2_DIR}/UTIL/MEM")
include_directories("${OPENAIR2_DIR}/UTIL/LISTS")
include_directories("${OPENAIR2_DIR}/UTIL/FIFO")
@@ -819,7 +875,7 @@ set(FLPT_MSG_FILES
${FLPT_MSG_DIR}/control_delegation.proto
)
-set(FLPT_C_DIR ${protobuf_generated_dir}/${FLPTDIR})
+set(FLPT_C_DIR ${protobuf_generated_dir}/FLPT_${FLPTDIR})
#message("calling protoc_call=${protoc_call} FLPT_C_DIR=${FLPT_C_DIR} FLPT_MSG_FILES=${FLPT_MSG_FILES}")
execute_process(COMMAND ${protoc_call} ${FLPT_C_DIR} ${FLPT_MSG_DIR} ${FLPT_MSG_FILES})
file(GLOB FLPT_source ${FLPT_C_DIR}/*.c)
@@ -862,6 +918,7 @@ add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_timer.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_common_internal.c
+ ${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PHY/flexran_agent_phy.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP/flexran_agent_pdcp.c
@@ -887,6 +944,63 @@ MARK_AS_ADVANCED(LIBYAML_INCLUDE_DIR LIBYAML_LIBRARIES)
#set(PROTOBUF_LIB "protobuf") #for Cpp
+# set the version of protobuf messages, V3 not supported yet
+add_list1_option(FSPT_VERSION V2 "FSPT MSG protobuf grammar version" V2 V3)
+
+if (${FSPT_VERSION} STREQUAL "V2")
+ set (FSPTDIR V2)
+elseif (${FSPT_VERSION} STREQUAL "V3")
+ set (FSPTDIR V3)
+endif(${FSPT_VERSION} STREQUAL "V2")
+
+set(FSPT_MSG_DIR ${OPENAIR_DIR}/targets/COMMON/MESSAGES/${FSPTDIR} )
+set(FSPT_MSG_FILES
+ ${FSPT_MSG_DIR}/flexsplit.proto
+ )
+
+set(FSPT_C_DIR ${protobuf_generated_dir}/FSPT_${FSPTDIR})
+message("calling protoc_call=${protoc_call} FSPT_C_DIR=${FSPT_C_DIR} FSPT_MSG_DIR=${FSPT_MSG_DIR} FSPT_MSG_FILES=${FSPT_MSG_FILES}")
+execute_process(COMMAND ${protoc_call} ${FSPT_C_DIR} ${FSPT_MSG_DIR} ${FSPT_MSG_FILES})
+file(GLOB FSPT_source ${FSPT_C_DIR}/*.c)
+set(FSPT_OAI_generated
+ ${FSPT_C_DIR}/flexsplit.pb-c.c
+ )
+
+file(GLOB fspt_h ${FSPT_C_DIR}/*.h)
+set(fspt_h ${fspt_h} )
+
+add_library(FSPT_MSG
+ ${FSPT_OAI_generated}
+ ${FSPT_source}
+ )
+set(FSPT_MSG_LIB FSPT_MSG)
+message("fspt c dir is : ${FSPT_C_DIR}")
+include_directories (${FSPT_C_DIR})
+
+# add_library(ASYNC_IF
+# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/socket_link.c
+# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/link_manager.c
+# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/message_queue.c
+# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c
+# )
+# set(ASYNC_IF_LIB ASYNC_IF)
+# include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF)
+
+add_library(PROTO_AGENT
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c
+ )
+set(PROTO_AGENT_LIB PROTO_AGENT)
+include_directories(${OPENAIR2_DIR}/LAYER2/PROTO_AGENT)
+
+
+
+set(PROTOBUF_LIB "protobuf-c")
+
+#set(PROTOBUF_LIB "protobuf") #for Cpp
add_library(HASHTABLE
${OPENAIR_DIR}/common/utils/hashtable/hashtable.c
@@ -909,7 +1023,7 @@ set(UTIL_SRC
${OPENAIR_DIR}/common/utils/LOG/log.c
# ${OPENAIR2_DIR}/UTIL/LOG/vcd_signal_dumper.c
${OPENAIR2_DIR}/UTIL/MATH/oml.c
- ${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
+ #${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
# ${OPENAIR2_DIR}/UTIL/OCG/OCG.c
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_create_dir.c
# ${OPENAIR2_DIR}/UTIL/OCG/OCG_detect_file.c
@@ -1286,7 +1400,7 @@ set(L2_SRC
${RLC_DIR}/rlc.c
${RLC_DIR}/rlc_rrc.c
${RLC_DIR}/rlc_mpls.c
- ${RRC_DIR}/rrc_UE.c
+# ${RRC_DIR}/rrc_UE.c
${RRC_DIR}/rrc_eNB.c
${RRC_DIR}/rrc_eNB_S1AP.c
${RRC_DIR}/rrc_eNB_UE_context.c
@@ -1374,6 +1488,8 @@ set (MAC_SRC_UE
set (ENB_APP_SRC
${OPENAIR2_DIR}/ENB_APP/enb_app.c
${OPENAIR2_DIR}/ENB_APP/enb_config.c
+ ${OPENAIR2_DIR}/ENB_APP/enb_config_SL.c
+ ${OPENAIR2_DIR}/ENB_APP/enb_config_eMTC.c
${OPENAIR2_DIR}/ENB_APP/RRC_config_tools.c
)
@@ -1951,6 +2067,8 @@ add_executable(lte-softmodem
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
+ ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
+ ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
@@ -1968,11 +2086,39 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-softmodem
-Wl,--start-group
- RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
+ RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
+ ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl)
+add_executable(cu_test
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/cu_test.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c
+ ${T_SOURCE}
+)
+target_link_libraries(cu_test
+ ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB}
+ ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ${ITTI_LIB}
+)
+
+add_executable(du_test
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/du_test.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
+ ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c
+ ${T_SOURCE}
+)
+target_link_libraries(du_test
+ ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB}
+ ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ${ITTI_LIB}
+)
+
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
@@ -1996,26 +2142,29 @@ add_executable(lte-softmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
+ ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
+ ${GTPU_need_ITTI}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
+
add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag)
+
target_link_libraries (lte-softmodem-nos1
-Wl,--start-group
- RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${RAL_LIB} ${ITTI_LIB}
- ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
+ RRC_LIB F1AP F1AP_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
+ ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
- -Wl,--end-group z dl )
+ -Wl,--end-group z dl)
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
-
# lte-uesoftmodem is UE implementation
#######################################
@@ -2030,6 +2179,8 @@ add_executable(lte-uesoftmodem
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
+ ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
+ ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
@@ -2046,7 +2197,7 @@ add_executable(lte-uesoftmodem
add_dependencies(lte-uesoftmodem rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-uesoftmodem
-Wl,--start-group
- RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
+ RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl)
@@ -2074,6 +2225,7 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
+ ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${XFORMS_SOURCE}
@@ -2084,18 +2236,18 @@ add_executable(lte-uesoftmodem-nos1
)
add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag)
+
target_link_libraries (lte-uesoftmodem-nos1
-Wl,--start-group
- RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${RAL_LIB} ${ITTI_LIB}
- ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
+ RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
+ ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
- -Wl,--end-group z dl )
+ -Wl,--end-group z dl)
target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
-
# USIM process
#################
#add_executable(usim
@@ -2150,7 +2302,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
target_link_libraries (${myExe}
-Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY PHY_UE PHY_RU LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group
- pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
+ pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
)
endforeach(myExe)
@@ -2163,7 +2315,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
+ -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
)
add_executable(test_epc_play_scenario
@@ -2182,7 +2334,7 @@ add_executable(test_epc_play_scenario
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
+ -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
)
@@ -2216,15 +2368,15 @@ if (${T_TRACER})
#all "add_executable" definitions (except tests, rb_tool, updatefw)
lte-softmodem lte-softmodem-nos1 lte-uesoftmodem lte-uesoftmodem-nos1
dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
- pdcchsim pucchsim prachsim syncsim ulsim
+ pdcchsim pucchsim prachsim syncsim ulsim cu_test du_test
#all "add_library" definitions
- ITTI RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB
+ ITTI RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP_LIB F1AP
oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif
oai_eth_transpro
FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO SECU_OSA
- SECU_CN SCHED_LIB PHY L2 default_sched remote_sched RAL CN_UTILS
- GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS LFDS7 SIMU OPENAIR0_LIB PHY_MEX
- coding)
+ SECU_CN SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY L2 default_sched
+ remote_sched RAL CN_UTILS GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS
+ LFDS7 SIMU OPENAIR0_LIB PHY_MEX coding)
if (TARGET ${i})
add_dependencies(${i} generate_T)
endif()
diff --git a/cmake_targets/at_commands/CMakeLists.txt b/cmake_targets/at_commands/CMakeLists.txt
old mode 100755
new mode 100644
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
index fc4567269e..bf3d57af0d 100644
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -990,11 +990,11 @@
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/targets/bin/ulsim.Rel14
- -BnbRBs=25 -mcs=5 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=6 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
- -BnbRBs=25 -mcs=16 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=12 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
- -BnbRBs=50 -mcs=5 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=6 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
- -BnbRBs=50 -mcs=16 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=12 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
- -BnbRBs=100 -mcs=5 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=6 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
+ -BnbRBs=25 -mcs=5 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=6 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
+ -BnbRBs=25 -mcs=16 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=12 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
+ -BnbRBs=50 -mcs=5 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=6 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
+ -BnbRBs=50 -mcs=16 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=12 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
+ -BnbRBs=100 -mcs=5 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=6 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70
-BnbRBs=100 -mcs=16 -yN_rx=1 -gchannel=N -xTransmission=1 -snr=12 -wsnrInterrupt=1.0 -e_snr_step=.1 -P -nb_frame=500 -Operf=70 ulsim.test1 ulsim.test2 ulsim.test3 ulsim.test4 ulsim.test5 ulsim.test6"passed"
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf
index 398b763888..d99ca88807 100644
--- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf
+++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf
index 46b6484737..86c54a82f7 100644
--- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf
+++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf
index 93b82773e6..dad0ab5a23 100644
--- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf
+++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf
index b412b00e52..369b6184fd 100644
--- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf
+++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf
index f0d688903a..14ae99c80c 100644
--- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf
+++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf
index 929c91fffb..9302ac7c58 100644
--- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf
+++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf
index 98358eb269..0ae9e659b4 100644
--- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf
+++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf
index bc31e051e5..1d22c19ec8 100644
--- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf
+++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf
index 2cfc227e67..3f35175ff4 100644
--- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf
+++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf
@@ -141,6 +141,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf
index 9b135a9498..0a6a8cccc6 100644
--- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf
+++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf
@@ -143,6 +143,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf
index 9f84057299..7ffdd063a6 100644
--- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf
+++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf
@@ -143,6 +143,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf
index 7197e93322..409fa49910 100644
--- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf
+++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf
@@ -143,6 +143,11 @@ eNBs =
}
);
+ ///X2
+ enable_x2 = "no";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 99eb5d83b2..887b3ebe2f 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -70,13 +70,14 @@ DISABLE_LOG_X="False"
USRP_REC_PLAY="False"
BUILD_ECLIPSE=0
UE_NAS_USE_TUN="False"
+UETARGET="False"
BASIC_SIMULATOR=0
trap handle_ctrl_c INT
function print_help() {
echo_info "
This program installs OpenAirInterface Software
-You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14
+You should have ubuntu 16.xx or 18.04 updated
Options
-h
This help
@@ -103,6 +104,8 @@ Options
Specify conf_nvram_path (default \"$conf_nvram_path\")
--UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\")
+-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
@@ -167,6 +170,9 @@ Options
--basic-simulator
Generates a basic [1 UE + 1 eNB + no channel] simulator.
See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation.
+--rfsimulator
+ Generate virtual RF driver
+ to use it, set the environement variable RFSIMULATOR to \"enb\" in the eNB and to the eNB IP address in the UEs
Usage (first build):
NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB -x --install-system-files -w USRP
Usage (Regular):
@@ -213,6 +219,7 @@ function main() {
shift;;
--UE)
UE=1
+ UETARGET="True"
echo_info "Will compile UE"
shift;;
--mu)
@@ -234,25 +241,21 @@ function main() {
echo_info "Setting release to: $REL"
shift 2;;
-w | --hardware)
- HW="$2" #"${i#*=}"
# Use OAI_USRP as the key word USRP is used inside UHD driver
- if [ "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "LMSSDR" -a "$HW" != "None" -a "$HW" != "EXMIMO" -a "$HW" != "IRIS" ] ; then
- echo_fatal "Unknown HW type $HW will exit..."
- else
- if [ "$HW" == "USRP" ] ; then
- HW="OAI_USRP"
- fi
- if [ "$HW" == "BLADERF" ] ; then
- HW="OAI_BLADERF"
- fi
- if [ "$HW" == "LMSSDR" ] ; then
- HW="OAI_LMSSDR"
- fi
- if [ "$HW" == "IRIS" ] ; then
- HW="OAI_IRIS"
- fi
+ case "$2" in
+ "EXMIMO")
+ HW="EXMIMO"
+ ;;
+ "USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "SIMU")
+ HW="OAI_"$2
+ ;;
+ "None")
+ HW="None"
+ ;;
+ *)
+ echo_fatal "Unknown HW type $HW: exit..."
+ esac
echo_info "Setting hardware to: $HW"
- fi
shift 2;;
-t | --transport_protocol)
TP="$2" #"${i#*=}"
@@ -374,6 +377,10 @@ function main() {
BASIC_SIMULATOR=1
echo_info "Compiling the basic simulator"
shift 1;;
+ --rfsimulator)
+ RFSIMULATOR=true
+ echo_info "Compiling the RF simulator"
+ shift 1;;
-h | --help)
print_help
exit 1;;
@@ -386,11 +393,6 @@ 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 eNB
#########################################################
@@ -409,33 +411,17 @@ function main() {
fi
echo_info "RF HW set to $HW"
- #Now we set flags to enable deadline scheduler settings
- #By default: USRP: disable,
- #By default: BLADERF: enable,
- #By default: EXMIMO: enable
- if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
- if [ "$HW" = "EXMIMO" ] ; then
+ # If the user doesn't specify the Linux scheduler to use, we set a value
+ if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
+ case "$HW" in
+ "EXMIMO")
DEADLINE_SCHEDULER_FLAG_USER="True"
- elif [ "$HW" = "ETHERNET" ] ; then
+ ;;
+ *)
DEADLINE_SCHEDULER_FLAG_USER="False"
- elif [ "$HW" = "OAI_USRP" ] ; then
- DEADLINE_SCHEDULER_FLAG_USER="False"
- elif [ "$HW" = "OAI_BLADERF" ] ; then
- DEADLINE_SCHEDULER_FLAG_USER="False"
- elif [ "$HW" = "OAI_LMSSDR" ] ; then
- DEADLINE_SCHEDULER_FLAG_USER="False"
- elif [ "$HW" = "OAI_IRIS" ] ; then
- DEADLINE_SCHEDULER_FLAG_USER="False"
- elif [ "$HW" = "None" ] ; then
- DEADLINE_SCHEDULER_FLAG_USER="False"
- else
- echo_error "Unknown HW type $HW. Exiting now..."
- exit
- fi
- else
- DEADLINE_SCHEDULER_FLAG_USER=$FORCE_DEADLINE_SCHEDULER_FLAG_USER
+ ;;
+ esac
fi
-
#Disable CPU Affinity for deadline scheduler
if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then
CPU_AFFINITY_FLAG_USER="False"
@@ -516,26 +502,19 @@ function main() {
echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets
- if [ "$NOS1" = "1" ] ; then
- lte_build_dir=lte_noS1_build_oai
- if [ "$eNB" = "1" ] ; then
- lte_exec=lte-softmodem-nos1
- fi
- if [ "$UE" = "1" ] ; then
- lte_exec=lte-uesoftmodem-nos1
+
+ if [ "$T_TRACER" = "False" ] ; then
+ noLOGDirsuffix="_noLOG"
fi
+ if [ "$NOS1" = "1" ] ; then
+ noS1Dir="_noS1"
+ bin_suffix="-nos1"
else
lte_build_dir=lte_build_oai
- if [ "$eNB" = "1" ] ; then
- lte_exec=lte-softmodem
- fi
- if [ "$UE" = "1" ] ; then
- lte_exec=lte-uesoftmodem
- fi
- fi
- if [ "$T_TRACER" = "False" ] ; then
- lte_build_dir=${lte_build_dir}_noLOG
+ bin_suffix=""
fi
+
+ lte_build_dir="lte${noS1Dir}_build_oai${noLOGDirsuffix}"
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib=params_libconfig
@@ -547,9 +526,9 @@ function main() {
mkdir -p $DIR/$lte_build_dir/build
cmake_file=$DIR/$lte_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
- if [ "$NOS1" = "1" ] ; then
- cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
- fi
+# if [ "$NOS1" = "1" ] ; then
+# cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
+# fi
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
@@ -570,6 +549,9 @@ function main() {
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 ] ; then
+ echo "set (UETARGET $UETARGET )" >> $cmake_file
+ fi
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
echo_info "Compiling UE S1 build : enabling Linux and NETLINK"
echo "set (LINUX True )" >> $cmake_file
@@ -580,8 +562,8 @@ function main() {
eval $CMAKE_CMD
fi
- if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
- echo_info "Compiling $lte_exec"
+ if [ "$eNB" = "1" ] ; then
+ lte_exec=lte-softmodem${bin_suffix}
compilations \
$lte_build_dir $lte_exec \
$lte_exec $dbin/$lte_exec.$REL
@@ -605,7 +587,29 @@ function main() {
fi
fi
- if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
+ if [ "$UE" = 1 ] ; then
+ lte_exec=lte-uesoftmodem${bin_suffix}
+ compilations \
+ $lte_build_dir $lte_exec \
+ $lte_exec $dbin/$lte_exec.$REL
+
+ # mandatory shared lib
+ 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 \
+ $lte_build_dir nasmesh \
+ CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
+ compilations \
+ $lte_build_dir rb_tool \
+ rb_tool $dbin/rb_tool
+ cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
+ else
# ue_ip driver compilation
echo_info "Compiling UE specific part"
compilations \
@@ -645,6 +649,7 @@ function main() {
echo_warning "not generated UE NAS files: binaries not found"
fi
fi
+ fi
if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then
cd $OPENAIR_DIR/cmake_targets/lte-simulators
@@ -709,22 +714,19 @@ function main() {
cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
fi
-
# Telnet server compilation
#####################
if [ "$BUILD_TELNETSRV" = "1" ] ; then
- build_dir=$lte_build_dir
compilations \
- $build_dir telnetsrv \
+ $lte_build_dir telnetsrv \
libtelnetsrv.so $dbin/libtelnetsrv.so
fi
- # Telnet server compilation
+ # msc library compilation
#####################
if [ "$MSC_GEN" = "1" ] ; then
- build_dir=$lte_build_dir
compilations \
- $build_dir msc \
+ $lte_build_dir msc \
libmsc.so $dbin/libmsc.so
fi
@@ -732,8 +734,6 @@ function main() {
#####################################
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
- build_dir=$lte_build_dir
-
# build RF device libraries
if [ "$HW" != "None" ] ; then
rm -f liboai_device.so
@@ -742,7 +742,7 @@ function main() {
# link liboai_device.so with the selected RF device library
if [ "$HW" == "EXMIMO" ] ; then
compilations \
- $build_dir oai_exmimodevif \
+ $lte_build_dir oai_exmimodevif \
liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
ln -sf liboai_exmimodevif.so liboai_device.so
@@ -750,7 +750,7 @@ function main() {
echo_info "liboai_device.so is linked to EXMIMO device library"
elif [ "$HW" == "OAI_USRP" ] ; then
compilations \
- $build_dir oai_usrpdevif \
+ $lte_build_dir oai_usrpdevif \
liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
ln -sf liboai_usrpdevif.so liboai_device.so
@@ -759,7 +759,7 @@ function main() {
elif [ "$HW" == "OAI_BLADERF" ] ; then
if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations \
- $build_dir oai_bladerfdevif \
+ $lte_build_dir oai_bladerfdevif \
liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL
fi
@@ -767,18 +767,18 @@ function main() {
ln -sf $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to BLADERF device library"
elif [ "$HW" == "OAI_LMSSDR" ] ; then
-# if [ -f "/usr/include/libbladeRF.h" ] ; then
+ # if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations \
- $build_dir oai_lmssdrdevif \
+ $lte_build_dir oai_lmssdrdevif \
liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL
-# fi
+ # fi
ln -sf liboai_lmssdrdevif.so liboai_device.so
ln -sf $dbin/liboai_lmssdrdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to LMSSDR device library"
elif [ "$HW" == "OAI_IRIS" ] ; then
compilations \
- $build_dir oai_irisdevif \
+ $lte_build_dir oai_irisdevif \
liboai_irisdevif.so $dbin/liboai_irisdevif.so.$REL
ln -s liboai_irisdevif.so liboai_device.so
@@ -789,22 +789,33 @@ function main() {
fi
fi
- # build trasport protocol libraries (currently only ETHERNET is available)
- if [ "$TP" != "None" ] ; then
+ # build simulators devices
+ echo_info "Compiling rfsimulator"
+ compilations \
+ $lte_build_dir rfsimulator \
+ librfsimulator.so $dbin/librfsimulator.so.$REL
+ echo_info "Compiling basicsimulator"
+ compilations \
+ $lte_build_dir tcp_bridge_oai \
+ libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL
+ # build transport protocol libraries (currently only ETHERNET is available)
+
rm -f liboai_transpro.so
rm -f $dbin/liboai_transpro.so
-
- if [ "$TP" == "ETHERNET" ] ; then
compilations \
- $build_dir oai_eth_transpro \
+ $lte_build_dir oai_eth_transpro \
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
ln -sf liboai_eth_transpro.so liboai_transpro.so
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
- echo_info "liboai_transpro.so is linked with ETHERNET library"
- fi
+ echo_info "liboai_transpro.so is linked to ETHERNET transport"
fi
-fi
+ if [ "$RFSIMULATOR" == "true" -o "$HW" == "OAI_SIMU" ] ; then
+ echo_info "Compiling rfsimulator"
+ compilations \
+ $lte_build_dir rfsimulator \
+ librfsimulator.so $dbin/librfsimulator.so.$REL
+ fi
# Doxygen Support
#####################
@@ -934,8 +945,9 @@ fi
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
echo "set (LINUX True )" >> $cmake_file
echo "set (PDCP_USE_NETLINK True )" >> $cmake_file
+ echo "set (UETARGET True )" >> $cmake_file
echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file
- echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
+# echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file
echo_info "Build UE"
diff --git a/cmake_targets/build_ue b/cmake_targets/build_ue
old mode 100644
new mode 100755
diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template
index e046bb7539..7a097fffb0 100644
--- a/cmake_targets/epc_test/CMakeLists.template
+++ b/cmake_targets/epc_test/CMakeLists.template
@@ -9,7 +9,6 @@ set ( EMIT_ASN_DEBUG False )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
-set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
set ( ENABLE_USE_MME True )
diff --git a/cmake_targets/oaisim_build_oai/CMakeLists.template b/cmake_targets/oaisim_build_oai/CMakeLists.template
new file mode 100644
index 0000000000..cffbddc93c
--- /dev/null
+++ b/cmake_targets/oaisim_build_oai/CMakeLists.template
@@ -0,0 +1,59 @@
+cmake_minimum_required(VERSION 2.8)
+
+set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
+set ( DEBUG_OMG False )
+set ( DISABLE_XER_PRINT False )
+set ( DRIVER2013 True )
+set ( ENABLE_ITTI True )
+set ( ENABLE_NAS_UE_LOGGING True )
+set ( ENABLE_NEW_MULTICAST True )
+set ( ENABLE_RAL False )
+set ( ENABLE_STANDALONE_EPC False)
+set ( ENABLE_USE_CPU_EXECUTION_TIME True )
+set ( ENABLE_USE_MME True )
+set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
+set ( ENABLE_VCD_FIFO False )
+set ( ENB_MODE True )
+set ( EXMIMO_IOT True )
+set ( JUMBO_FRAME True )
+set ( LARGE_SCALE False )
+set ( LINK_ENB_PDCP_TO_GTPV1U True)
+set ( LINUX_LIST False )
+set ( LINUX True )
+set ( LOCALIZATION False )
+set ( LOG_NO_THREAD True )
+set ( DEADLINE_SCHEDULER False )
+set ( MAC_CONTEXT 1 )
+set ( MAX_NUM_CCs 1 )
+set ( MESSAGE_CHART_GENERATOR False)
+set ( MSG_PRINT False )
+set ( MU_RECEIVER False )
+set ( NAS_ADDRESS_FIX False )
+set ( NAS_BUILT_IN_UE True)
+set ( NAS_MME False )
+set ( NAS_UE True )
+set ( NB_ANTENNAS_RX "2" )
+set ( NB_ANTENNAS_TX "2" )
+set ( NO_RRM True )
+set ( OAISIM True )
+set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
+set ( OAI_NW_DRIVER_USE_NETLINK True )
+set ( OPENAIR2 True )
+set ( OPENAIR_LTE True )
+set ( PACKAGE_NAME "oaisim" )
+set ( PDCP_USE_NETLINK True )
+set ( PDCP_MSG_PRINT False )
+set ( PHY_CONTEXT False )
+set ( PHY_EMUL False )
+set ( PHYSIM True )
+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 ( SECU False )
+set ( SMBV False )
+set ( TEST_OMG False )
+set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
+set ( USE_MME "R10" )
+set ( XER_PRINT False )
diff --git a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template
new file mode 100644
index 0000000000..eac29006da
--- /dev/null
+++ b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template
@@ -0,0 +1,61 @@
+cmake_minimum_required(VERSION 2.8)
+
+set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
+set ( DEBUG_OMG False )
+set ( DISABLE_XER_PRINT False )
+set ( DRIVER2013 False )
+set ( ENABLE_ITTI True )
+set ( ENABLE_NAS_UE_LOGGING False )
+set ( ENABLE_NEW_MULTICAST False )
+set ( ENABLE_RAL False )
+set ( ENABLE_STANDALONE_EPC False )
+set ( ENABLE_USE_CPU_EXECUTION_TIME False )
+set ( ENABLE_USE_MME False )
+set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
+set ( ENABLE_VCD_FIFO False )
+set ( ENB_MODE False )
+set ( EPC_BUILD True )
+set ( EXMIMO_IOT False )
+set ( JUMBO_FRAME False )
+set ( LARGE_SCALE False )
+set ( LINK_ENB_PDCP_TO_GTPV1U True)
+set ( LINUX_LIST False )
+set ( LINUX False )
+set ( LOCALIZATION False )
+set ( LOG_NO_THREAD False )
+set ( DEADLINE_SCHEDULER False )
+set ( MAC_CONTEXT 1 )
+set ( MAX_NUM_CCs 1 )
+set ( MSG_PRINT False )
+set ( MU_RECEIVER False )
+set ( NAS_ADDRESS_FIX False )
+set ( NAS_BUILT_IN_EPC True )
+set ( NAS_MME True )
+set ( NAS_NETLINK False )
+set ( NAS_UE False )
+set ( NB_ANTENNAS_RX "2" )
+set ( NB_ANTENNAS_TX "2" )
+set ( NO_RRM False )
+set ( OAISIM False )
+set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
+set ( OAI_NW_DRIVER_USE_NETLINK False )
+set ( OPENAIR2 False )
+set ( OPENAIR_LTE False )
+set ( PACKAGE_NAME "EPC" )
+set ( PDCP_MSG_PRINT False )
+set ( PHY_CONTEXT False )
+set ( PHY_EMUL False )
+set ( PHYSIM False )
+set ( RF_BOARD "False" )
+set ( RRC_ASN1_VERSION "Rel10" )
+set ( RLC_STOP_ON_LOST_PDU False )
+set ( RRC_MSG_PRINT False )
+set ( SECU False )
+set ( SMBV 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 ( XER_PRINT False )
+set ( XFORMS False )
diff --git a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template
new file mode 100644
index 0000000000..343e928090
--- /dev/null
+++ b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template
@@ -0,0 +1,62 @@
+cmake_minimum_required(VERSION 2.8)
+
+set ( DEBUG_OMG False )
+set ( DISABLE_XER_PRINT False )
+set ( DRIVER2013 True )
+set ( ENABLE_ITTI True )
+set ( ENABLE_NAS_UE_LOGGING False )
+set ( ENABLE_NEW_MULTICAST True )
+set ( ENABLE_RAL False )
+set ( ENABLE_STANDALONE_EPC False)
+set ( ENABLE_USE_CPU_EXECUTION_TIME True )
+set ( ENABLE_USE_MME False )
+set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
+set ( ENABLE_VCD_FIFO False )
+set ( ENB_MODE True )
+set ( EXMIMO_IOT True )
+set ( JUMBO_FRAME True )
+set ( LARGE_SCALE False )
+set ( LINK_ENB_PDCP_TO_GTPV1U False)
+set ( LINUX_LIST False )
+set ( LINUX True )
+set ( LOCALIZATION False )
+set ( LOG_NO_THREAD 1 )
+set ( DEADLINE_SCHEDULER False )
+set ( MAC_CONTEXT 1 )
+set ( MAX_NUM_CCs 1 )
+set ( MESSAGE_CHART_GENERATOR False )
+set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
+set ( MESSAGE_CHART_GENERATOR_PHY False )
+set ( MSG_PRINT False )
+set ( MU_RECEIVER False )
+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 ( NO_RRM True )
+set ( OAISIM True )
+set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
+set ( OAI_NW_DRIVER_USE_NETLINK True )
+set ( OPENAIR2 True )
+set ( OPENAIR_LTE True )
+set ( PACKAGE_NAME "oaisim" )
+set ( PDCP_USE_NETLINK True )
+set ( PDCP_MSG_PRINT False )
+set ( PHY_CONTEXT False )
+set ( PHY_EMUL False )
+set ( PHYSIM True )
+set ( RF_BOARD "False" )
+set ( RRC_ASN1_VERSION "Rel10" )
+set ( RLC_STOP_ON_LOST_PDU False )
+set ( RRC_MSG_PRINT False )
+set ( SECU False )
+set ( SMBV False )
+set ( TEST_OMG False )
+set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
+set ( USE_MME "R10" )
+set ( XER_PRINT False )
+set ( DEBUG_PHY False )
+set ( DEBUG_PHY_PROC False)
+set ( DEBUG_DLSCH False)
diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template
index 9f1ff3e360..e62df04bc6 100644
--- a/cmake_targets/s1c_mme_test/CMakeLists.template
+++ b/cmake_targets/s1c_mme_test/CMakeLists.template
@@ -9,7 +9,6 @@ set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
set ( ENABLE_USE_MME True )
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 18f59c8653..0021b673f2 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -32,8 +32,8 @@ OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
case "$OS_DISTRO" in
fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;;
- rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
- centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
+ rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum --skip-broken"; CMAKE="cmake3" ;;
+ centos) OS_BASEDISTRO="fedora"; INSTALLER="yum --skip-broken"; CMAKE="cmake3" ;;
debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac
@@ -102,6 +102,7 @@ check_supported_distribution() {
"ubuntu14.04") return 0 ;;
"fedora24") return 0 ;;
"rhel7") return 0 ;;
+ "rhel7.6") return 0 ;;
"centos7") return 0 ;;
esac
return 1
@@ -310,10 +311,20 @@ install_usrp_uhd_driver() {
# On newer kernels, it fails to install
$SUDO apt-get -y install uhd-host
fi
+ # quick workaround for RHE7.6
+ local distribution=$(get_distribution_release)
if [ -z $1 ]; then
- $SUDO uhd_images_downloader
+ if [[ "$distribution" == "rhel7.6" ]]; then
+ $SUDO /usr/local/bin/uhd_images_downloader
+ else
+ $SUDO uhd_images_downloader
+ fi
else
- $SUDO uhd_images_downloader -i $1
+ if [[ "$distribution" == "rhel7.6" ]]; then
+ $SUDO /usr/local/bin/uhd_images_downloader -i $1
+ else
+ $SUDO uhd_images_downloader -i $1
+ fi
fi
}
@@ -628,8 +639,6 @@ check_install_oai_software() {
libidn2-0-dev \
libidn11-dev \
libmysqlclient-dev \
- liboctave-dev \
- libpgm-dev \
libpython2.7-dev \
libsctp1 \
libsctp-dev \
@@ -640,7 +649,6 @@ check_install_oai_software() {
libxml2-dev \
libxslt1-dev \
mscgen \
- octave \
octave-signal \
openssh-client \
openssh-server \
@@ -652,7 +660,8 @@ check_install_oai_software() {
pydb \
libyaml-dev \
wget \
- libxpm-dev
+ libxpm-dev \
+ libboost-all-dev
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
@@ -700,8 +709,6 @@ check_install_oai_software() {
libidn2-devel \
libidn-devel \
mariadb-devel \
- octave-devel \
- openpgm-devel \
lksctp-tools \
lksctp-tools-devel \
openssl-devel \
@@ -711,8 +718,6 @@ check_install_oai_software() {
libxml2 \
libxml2-devel \
libxslt-devel \
- octave \
- octave-signal \
openssh-clients \
openssh-server \
openssl \
@@ -735,7 +740,7 @@ check_install_oai_software() {
libyaml-devel
fi
- install_asn1c_from_source
+ install_asn1c_from_source $1
$SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
}
diff --git a/cmake_targets/tools/exmimo2_2brxg.lime b/cmake_targets/tools/exmimo2_2brxg.lime
old mode 100755
new mode 100644
diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1
index fe819c2716..1486589a0c 100755
--- a/cmake_targets/tools/fix_asn1
+++ b/cmake_targets/tools/fix_asn1
@@ -23,7 +23,7 @@ reset_color="$(tput sgr0)"
function error()
{
echo -e "$red_color"ERROR: "$@""$reset_color"
- exit 1
+# exit 1
}
function check_sha1()
@@ -56,11 +56,11 @@ function patch_file()
echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color"
- patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
- if [ $? -ne 0 ]
- then
- error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
- fi
+# patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
+# if [ $? -ne 0 ]
+# then
+# error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
+# fi
}
function apply_patches()
@@ -140,6 +140,22 @@ function patch_s1ap()
esac
}
+function patch_f1ap()
+{
+ local directory="$1"
+ local version="$2"
+
+ case "$version" in
+ R15 )
+ #nothing to do anymore (fixes went to asn1c)
+ ;;
+ * )
+ error unknwon/unhandled F1AP version \'"$version"\'
+ ;;
+ esac
+}
+
+
function main()
{
if [ $# -ne 3 ]
@@ -167,6 +183,9 @@ function main()
S1AP )
patch_s1ap "$directory" "$version"
;;
+ F1AP )
+ patch_f1ap "$directory" "$version"
+ ;;
* )
error unknown module "$module"
;;
diff --git a/cmake_targets/tools/generate_asn1 b/cmake_targets/tools/generate_asn1
index 79becbf288..b382730c6a 100755
--- a/cmake_targets/tools/generate_asn1
+++ b/cmake_targets/tools/generate_asn1
@@ -2,23 +2,29 @@
function main()
{
-mkdir -p $1
-cd $1
+PROTOCOL_DIR=$1
+mkdir -p ${PROTOCOL_DIR}
+cd ${PROTOCOL_DIR}
+
+# Because use $* also include directory, so we need shift
shift
-#if this script is called with only 2 arguments (so 1 here after the shift), it's for RRC
-#(there may be a better way...)
-if [ $# -eq 1 ]; then
+# There are three types parameter for asn1c
+# One is for RRC
+# and one is for F1AP
+# another is for other protocols
-#asn1c does not work well with extension groups, we need the following fix:
-# replace [[ by ' SEQUENCE {'
-# and ]] by '} OPTIONAL'
-# is ext with N starting from 1 and incremented at each new [[ ]] just
-#following another [[ ]]
-#
-#this is what the following C program does
+if echo ${PROTOCOL_DIR} | grep -q "RRC"; then
-echo generate asnfix.c
+ #asn1c does not work well with extension groups, we need the following fix:
+ # replace [[ by ' SEQUENCE {'
+ # and ]] by '} OPTIONAL'
+ # is ext with N starting from 1 and incremented at each new [[ ]] just
+ #following another [[ ]]
+ #
+ #this is what the following C program does
+
+ echo generate asnfix.c
cat << EOF > asnfix.c
/* transforms:
@@ -85,30 +91,34 @@ int main(void)
}
EOF
-echo compile asnfix.c
+ echo compile asnfix.c
-gcc -Wall -o asnfix asnfix.c
+ gcc -Wall -o asnfix asnfix.c
-echo run asnfix on $1
+ echo run asnfix on $1
-./asnfix < $1 > fixed_grammar.asn
+ ./asnfix < $1 > fixed_grammar.asn
-rm -f asnfix asnfix.c
+ rm -f asnfix asnfix.c
-echo done with asnfix
+ echo done with asnfix
-echo running asn1c
+ echo running asn1c
-asn1c -gen-PER -fcompound-names fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
+ asn1c -gen-PER -fcompound-names -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
-rm -f fixed_grammar.asn
+ rm -f fixed_grammar.asn
-echo asn1c done
+ echo asn1c done
+elif echo ${PROTOCOL_DIR} | grep -q "F1AP"; then
+
+ asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
+
else
-
-asn1c -gen-PER -fcompound-names $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
-
+
+ asn1c -gen-PER -fcompound-names -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
+
fi
awk '
diff --git a/cmake_targets/tools/make_asn1c_includes.sh b/cmake_targets/tools/make_asn1c_includes.sh
index bd4254c938..a7f480f90f 100755
--- a/cmake_targets/tools/make_asn1c_includes.sh
+++ b/cmake_targets/tools/make_asn1c_includes.sh
@@ -3,11 +3,11 @@ GENERATED_FULL_DIR=$1
shift
ASN1_SOURCE_DIR=$1
shift
-export ASN1C_PREFIX=$1
+export ASN1C_PREFIX=$1
shift
options=$*
done_flag="$GENERATED_FULL_DIR"/done
-if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
+if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h
mkdir -p "$GENERATED_FULL_DIR"
asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u
diff --git a/cmake_targets/tools/run_ue_s1 b/cmake_targets/tools/run_ue_s1
old mode 100644
new mode 100755
diff --git a/common/config/DOC/config.md b/common/config/DOC/config.md
index 580ac5476f..1c2ef25594 100644
--- a/common/config/DOC/config.md
+++ b/common/config/DOC/config.md
@@ -1,6 +1,6 @@
# OAI configuration module
-The configuration module provides an api that other oai components can use to get parameters at init time. It defines a parameter structure, used to describe parameters attributes (for example name and type). The same structure includes a pointer to the variable where the configuration module writes the parameter value, at run time, when calling config_get or config_getlist functions. For each parameter a function to check the value can be specified and pre-defined functions are provided for some common parameter validations (integer in a range or in a list, string in a list). The module also include a mechanism to check that no unknown options have been entered on the command line
+The configuration module provides an api that other oai components can use to get parameters at init time. It defines a parameter structure, used to describe parameters attributes (for example name and type). The same structure includes a pointer to the variable where the configuration module writes the parameter value, at run time, when calling config_get or config_getlist functions. For each parameter a function to check the value can be specified and pre-defined functions are provided for some common parameter validations (integer in a range or in a list, string in a list). The module also include an api to check that no unknown options have been entered on the command line and a a mechanism to display a help text for suppoted parameters.
## Documentation
diff --git a/common/config/DOC/config/arch.md b/common/config/DOC/config/arch.md
index 170241500b..f888724c41 100644
--- a/common/config/DOC/config/arch.md
+++ b/common/config/DOC/config/arch.md
@@ -1,7 +1,7 @@
# config module source files
-
+
# config module components

-[Configuration module home](../config.md)
\ No newline at end of file
+[Configuration module home](../config.md)
diff --git a/common/config/DOC/config/devusage.md b/common/config/DOC/config/devusage.md
index bfc1180ab8..151ffeafa8 100644
--- a/common/config/DOC/config/devusage.md
+++ b/common/config/DOC/config/devusage.md
@@ -1,17 +1,17 @@
-The configuration module objectives are
+The configuration module objectives are
1. Allow easy parameters management in oai, helping the development of a flexible, modularized and fully configurable softmodem.
1. Use a common configuration API in all oai modules
-1. Allow development of alternative configuration sources without modifying the oai code. Today the only delivered configuration source is the libconfig format configuration file.
+1. Allow development of alternative configuration sources without modifying the oai code. Today the only delivered configuration source is the libconfig format configuration file.
As a developer you may need to look at these sections:
* [add parameters in an existing section](devusage/addaparam.md)
* [add a parameter set, in a new section](devusage/addparamset.md)
-* [configuration module API](devusage/api.md)
-* [configuration module public structures](devusage/struct.md)
+* [configuration module API](devusage/api.md)
+* [configuration module public structures](devusage/struct.md)
-Whatever your need is, configuration module usage examples can be found in oai sources:
-* complex example, using all the configuration module functionalities, including parameter checking:
+Whatever your need is, configuration module usage examples can be found in oai sources:
+* complex example, using all the configuration module functionalities, including parameter checking:
[NB-IoT configuration code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair2/ENB_APP/NB_IoT_config.c) and [NB-IoT configuration include file](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair2/ENB_APP/NB_IoT_paramdef.h)
* very simple example, just reading a parameter set corresponding to a dedicated section: the telnetsrv_autoinit function in [common/utils/telnetsrv/telnetsrv.c, around line 726](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/telnetsrv/telnetsrv.c#L726)
* an example with run-time definition of parameters, in the logging sub-system: the log_getconfig function at the top of [openair2/UTIL/LOG/log.c](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair2/UTIL/LOG/log.c)
diff --git a/common/config/DOC/config/devusage/addaparam.md b/common/config/DOC/config/devusage/addaparam.md
index b7bb8a73b9..246c494526 100644
--- a/common/config/DOC/config/devusage/addaparam.md
+++ b/common/config/DOC/config/devusage/addaparam.md
@@ -1,6 +1,6 @@
-To add a new parameter in an existing section you insert an item in a `paramdef_t` array, which describes the parameters to be read in the existing `config_get` call. You also need to increment the numparams argument.
+To add a new parameter in an existing section you insert an item in a `paramdef_t` array, which describes the parameters to be read in the existing `config_get` call. You also need to increment the numparams argument.
-existing code:
+existing code:
```c
unsigned int varopt1;
paramdef_t someoptions[] = {
@@ -11,10 +11,10 @@ paramdef_t someoptions[] = {
{"opt1", "", 0, uptr:&varopt1, defuintval:0, TYPE_UINT, 0 },
};
-config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
+config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
```
-new code:
+new code:
```c
unsigned int varopt1;
@@ -31,7 +31,7 @@ paramdef_t someoptions[] = {
{"opt2", "", 0, strptr:&varopt2,defstrval:"",TYPE_STRING,0 },
};
-config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
+config_get( someoptions,sizeof(someoptions)/sizeof(paramdef_t),"somesection");
```
@@ -57,10 +57,10 @@ The configuration module provides a mechanism to check the parameter value read
A `checkedparam_t` structure array provides the parameter verification procedures:
```c
-/*
+/*
definition of the verification to be done on param opt1 and opt2.
opt1 is an integer option we must be set to 0,2,3,4 or 7 in the
- config source.
+ config source.
if opt1 is set to 0 in the config file, it will be set to 1, etc
opt2 is C string option with the authorize values "zero","oneThird","twoThird","one"
*/
@@ -82,5 +82,5 @@ for(int i=0 ; i < sizeof(someoptions)/sizeof(paramdesc_t) ; i ++) {
```
When you need a specific verification algorithm, you can provide your own verification function and use it in place of the available ones, in the `checkedparam_t` union. If no existing structure definition match your need, you can enhance the configuration module. You then have to add a new verification function in https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_userapi.c and add a new structure definition in the `checkedparam_t` type defined in https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h
-[Configuration module developer main page](../../config/devusage.md)
+[Configuration module developer main page](../../config/devusage.md)
[Configuration module home](../../config.md)
diff --git a/common/config/DOC/config/devusage/addparamset.md b/common/config/DOC/config/devusage/addparamset.md
index 130a7eda74..49448e11da 100644
--- a/common/config/DOC/config/devusage/addparamset.md
+++ b/common/config/DOC/config/devusage/addparamset.md
@@ -1,7 +1,7 @@
The configuration module maps a configuration file section to a `paramdef_t` structure array. One `config_get` call can be used to return the values of all the parameters described in the `paramdef_t` array.
Retrieving a single occurence of a parameter set ( a group in the libconfig terminology) is just a two steps task:
1. describe the parameters in a `paramdef_t` array
-1. call the `config_get` function
+1. call the `config_get` function
[config_get example](../../config/devusage/addaparam.md)
@@ -30,19 +30,19 @@ NB-IoT_MACRLCs =
);
```
-The configuration module provides the `config_getlist` call to support lists of group of parameters. Below is a commented code example, using the config_getlist call.
+The configuration module provides the `config_getlist` call to support lists of group of parameters. Below is a commented code example, using the config_getlist call.
```c
/* name of section containing the list */
#define NBIOT_MACRLCLIST_CONFIG_STRING "NB-IoT_MACRLCs"
-/*
+/*
The following macro define the parameters names, as used in the
configuration file
-*/
-#define CONFIG_STRING_MACRLC_CC "num_cc"
+*/
+#define CONFIG_STRING_MACRLC_CC "num_cc"
.....
-#define CONFIG_MACRLC_S_PORTD "remote_s_portd"
+#define CONFIG_MACRLC_S_PORTD "remote_s_portd"
/*
now define a macro which will be used to initialize the NbIoT_MacRLC_Params
@@ -51,16 +51,16 @@ configuration file
module allocate the memory for the parameters values.
*/
/*------------------------------------------------------------------------------------------------------------*/
-/* optname helpstr paramflags XXXptr defXXXval type numelt */
+/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------*/
#define MACRLCPARAMS_DESC { \
{CONFIG_STRING_MACRLC_CC, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \
............. \
{CONFIG_MACRLC_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
-}
+}
-/*
+/*
the following macros define the indexes used to access the NbIoT_MacRLC_Params array
items. They must be maintained consistent with the previous MACRLCPARAMS_DESC macro
which is used to initialize the NbIoT_MacRLC_Params variable
@@ -72,60 +72,60 @@ which is used to initialize the NbIoT_MacRLC_Params variable
void RCconfig_NbIoTmacrlc(void) {
-
+
/*
define and initialize the array of paramdef_t structures describing the groups of
- parameters we want to read. It will be passed as the second argument of the
+ parameters we want to read. It will be passed as the second argument of the
config_getlist call, which will use it as an input only argument.
*/
paramdef_t NbIoT_MacRLC_Params[] = MACRLCPARAMS_DESC;
-/*
+/*
now define and initialize a paramlist_def_t structure which will be passed
to the config_getlist call. The first field is the only one to be initialized
- it contains the name of the section to be read.
+ it contains the name of the section to be read.
that section contains the list of group of parameters.
The two other fields are output parameters used to return respectively
- a pointer to a two dimensional array of paramdef_t structures pointers, and the
+ a pointer to a two dimensional array of paramdef_t structures pointers, and the
number of items in the list of groups (size of first dimension, the second one
being the number of parameters in each group.
-*/
+*/
paramlist_def_t NbIoT_MacRLC_ParamList = {NBIOT_MACRLCLIST_CONFIG_STRING,NULL,0};
- /*
- the config_getlist will allocate the second field of the paramlist_def_t structure, a
-two dimensional array of paramdef_t pointers. In each param_def item it will allocate
+ /*
+ the config_getlist will allocate the second field of the paramlist_def_t structure, a
+two dimensional array of paramdef_t pointers. In each param_def item it will allocate
the value pointer and set the value to what it will get from the config source. The
numelt field of the paramlist_def_t structure will be set to the number of groups of
parameters in the list.
in this example the last argument of config_getlist is unused, it may contain a
character string, used as a prefix for the section name. It has to be specified when the
list to be read is under another section.
-*/
+*/
config_getlist( &NbIoT_MacRLC_ParamList,NbIoT_MacRLC_Params,
- sizeof(NbIoT_MacRLC_Params)/sizeof(paramdef_t),
+ sizeof(NbIoT_MacRLC_Params)/sizeof(paramdef_t),
NULL);
-
-/*
+
+/*
start a loop in the nuber of groups in the list, the numelt field of the
paramlist_def_t structure has been set in the config_getlist call
*/
for (j=0 ; jeth_params_s.remote_portd =
+ RC.nb_iot_mac[j]->eth_params_s.remote_portd =
*(NbIoT_MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr);
............
-
+
} // MacRLC_ParamList.numelt > 0
}
-```
+```
-[Configuration module developer main page](../../config/devusage.md)
+[Configuration module developer main page](../../config/devusage.md)
[Configuration module home](../../config.md)
diff --git a/common/config/DOC/config/devusage/api.md b/common/config/DOC/config/devusage/api.md
index 56b444a447..06c22dba6f 100644
--- a/common/config/DOC/config/devusage/api.md
+++ b/common/config/DOC/config/devusage/api.md
@@ -1,11 +1,12 @@
```c
-configmodule_interface_t *load_configmodule(int argc, char **argv)
+configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags)
```
* Parses the command line options, looking for the –O argument
* Loads the `libparams_.so` (today `libparams_libconfig.so`) shared library
* Looks for `config__init` symbol and calls it , passing it an array of string corresponding to the « : » separated strings used in the –O option
* Looks for `config__get`, `config__getlist` and `config__end` symbols which are the three functions a configuration library should implement. Get and getlist are mandatory, end is optional.
-* Stores all the necessary information in a `configmodule_interface_t structure`, which is of no use for caller as long as we only use one configuration source.
+* Stores all the necessary information in a `configmodule_interface_t structure`, which is of no use for caller as long as we only use one configuration source.
+* if the bit CONFIG_ENABLECMDLINEONLY is set in `initflags` then the module allows parameters to be set only via the command line. This is used for the oai UE.
```c
void End_configmodule(void)
@@ -24,14 +25,14 @@ int config_get(paramdef_t *params,int numparams, char *prefix)
- `PARAMFLAG_DISABLECMDLINE`: parameter cannot be modified via the command line
- `PARAMFLAG_DONOTREAD`: ignore the parameter, can be used at run-time, to alter a pre-defined `paramdef_t` array which is used in several `config_get` or/and `config_getlist` calls.
- `PARAMFLAG_NOFREE`: do not free the memory possibly allocated by the config module to store the value of the parameter. Default behavior is for the config module to free the memory it has allocated when the `config_end` function is called.
- - `PARAMFLAG_BOOL`: Only relevant for integer types. tell the config module that when processing the command line, the corresponding option can be specified without any arggument and that in this case it must set the value to 1.
+ - `PARAMFLAG_BOOL`: Only relevant for integer types. tell the config module that when processing the command line, the corresponding option can be specified without any arggument and that in this case it must set the value to 1.
* `params` is also used as an output parameter, `< XXX >ptr >` field is used by the config module to store the value it has read. The following bits can possibly be set in the `paramflags` mask after the call:
- `PARAMFLAG_MALLOCINCONFIG`: memory has been allocated for the ` < XXX >ptr > ` field
- `PARAMFLAG_PARAMSET`: parameter has been found in the config source, it is not set to default value.
- `PARAMFLAG_PARAMSET`: parameter has been set to its default value
* `numparams` is the number of entries in the params array
-* `prefix` is a character string to be appended to the parameters name, it defines the parameters position in the configuration file hierarchy (the section name in libconfig terminology).
+* `prefix` is a character string to be appended to the parameters name, it defines the parameters position in the configuration file hierarchy (the section name in libconfig terminology).
* The returned value is the number of parameters which have been assigned a value or -1 if a severe error occured
```c
@@ -41,8 +42,8 @@ int config_libconfig_getlist(paramlist_def_t *ParamList, paramdef_t *params, int
* Calls the `config__get` function for each list occurrence
* `params` points to an array of `paramdef_t` structures which describes the parameters in each occurrence of the list
* `ParamList` points to a structure, where `paramarray` field points to an array of `paramdef_t` structure, allocated by the function. It is used to return the values of the parameters.
-* The returned value is the number of occurrences in the list or -1 in case of severe error
+* The returned value is the number of occurrences in the list or -1 in case of severe error
-[Configuration module developer main page](../../config/devusage.md)
+[Configuration module developer main page](../../config/devusage.md)
[Configuration module home](../../config.md)
diff --git a/common/config/DOC/config/devusage/struct.md b/common/config/DOC/config/devusage/struct.md
index 236c1b4e03..e8b15fc0f1 100644
--- a/common/config/DOC/config/devusage/struct.md
+++ b/common/config/DOC/config/devusage/struct.md
@@ -10,11 +10,11 @@ It is defined in include file [ common/config/config_paramdesc.h ](https://gitla
| `type` | Supported parameter types are defined as integer macros. Supported simple types are `TYPE_STRING`, parameter value is returned in `strptr` field, `TYPE_INT8` `TYPE_UINT8` `TYPE_INT16` `TYPE_UINT16` `TYPE_INT32` `TYPE_UINT32` `TYPE_INT64` `TYPE_UINT64`, parameter value is returned in the corresponding uXptr or iXptr, `TYPE_MASK`, value is returned in `u32ptr`, `TYPE_DOUBLE` value is returned in `dblptr`, `TYPE_IPV4ADDR` value is returned in binary, network bytes order in `u32ptr` field. `TYPE_STRINGLIST`, `TYPE_INTARRAY` and `TYPE_UINTARRAY` are multiple values types. Multiple values are returned in respectively, `strlistptr`, `iptr` and `uptr` fields which then point to arrays. The `numelt` field gives the number of item in the array. | I |
| `numelt` | For `TYPE_STRING` where `strptr` points to a preallocated string, this field must contain the size in bytes of the available memory. For all multiple values types, this field contains the number of values in the value field.| I/O |
| `chkPptr` | possible pointer to the structure containing the info used to check parameter values | I |
-| `processedvalue` | When `chkPptr` is not `ǸULL`, is used to return a value, computed from the original parameter, as read from the configuration source. | O |
-
+| `processedvalue` | When `chkPptr` is not `ǸULL`, is used to return a value, computed from the original parameter, as read from the configuration source. | O |
+
# `paramlist_def_t`structure
-It is defined in include file [ common/config/config_paramdesc.h ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h#L160).
-It is used as an argument to `config_getlist` calls, to get values of multiple occurrences of group of parameters.
+It is defined in include file [ common/config/config_paramdesc.h ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h#L160).
+It is used as an argument to `config_getlist` calls, to get values of multiple occurrences of group of parameters.
| Fields | Description | I/O |
|:-----------|:------------------------------------------------------------------|----:|
@@ -23,11 +23,11 @@ It is used as an argument to `config_getlist` calls, to get values of multiple o
| `numelt` | Number of items in the `paramarray` field | O |
# `checkedparam_t` union
-It is defined in include file [ common/config/config_paramdesc.h ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h#L62).
+It is defined in include file [ common/config/config_paramdesc.h ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h#L62).
This union of structures is used to provide a parameter checking mechanism. Each `paramdef_t` instance may include a pointer to a `checkedparam_t`structure which is then used by the configuration module to check the value it got from the config source.
Each structure in the union provides one parameter verification method, which returns `-1` when the verification fails. Currently the following structures are defined in the `checkedparam_t` union:
-| structure name | Description |
+| structure name | Description |
|:-----------|:------------------------------------------------------------------|----:|
| `s1` | check an integer against a list of authorized values |
| `s1a` | check an integer against a list of authorized values and set the parameter value to another integer depending on the read value|
@@ -40,14 +40,14 @@ each of these structures provide the required fields to perform the specified pa
The configuration module provides an implementation of the functions to be used to check parameters, qs described below.
## `s1` structure
-| field | Description |
+| field | Description |
|:-----------|:------------------------------------------------------------------|
| `f1` | pointer to the checking function. Initialize to `config_check_intval` to use the config module implementation |
| `okintval` | array of `CONFIG_MAX_NUMCHECKVAL` integers containing the authorized values |
| `num_okintval` | number of used values in `okintval` |
## `s1a` structure
-| field | Description |
+| field | Description |
|:-----------|:------------------------------------------------------------------|
| `f1a` | pointer to the checking function. Initialize to `config_check_modify_integer` to use the config module implementation |
| `okintval` | array of `CONFIG_MAX_NUMCHECKVAL` integers containing the authorized values |
@@ -55,13 +55,13 @@ The configuration module provides an implementation of the functions to be used
| `num_okintval` | number of used values in `okintval` and `setintval` |
## `s2` structure
-| field | Description |
+| field | Description |
|:-----------|:------------------------------------------------------------------|
| `f2` | pointer to the checking function. Initialize to `config_check_intrange` to use the config module implementation |
| `okintrange` | array of 2 integers containing the min and max values for the parameter |
## `s3` structure
-| field | Description |
+| field | Description |
|:-----------|:------------------------------------------------------------------|
| `f3` | pointer to the checking function. Initialize to `config_check_strval` to use the config module implementation |
| `okstrval` | array of `CONFIG_MAX_NUMCHECKVAL` C string pointers containing the authorized values |
@@ -69,7 +69,7 @@ The configuration module provides an implementation of the functions to be used
## `s3a` structure
-| field | Description |
+| field | Description |
|:-----------|:------------------------------------------------------------------|
| `f3a` | pointer to the checking function. Initialize to `config_checkstr_assign_integer` to use the config module implementation |
| `okstrval` | array of `CONFIG_MAX_NUMCHECKVAL` C string pointers containing the authorized values |
@@ -77,9 +77,9 @@ The configuration module provides an implementation of the functions to be used
| `num_okstrval` | number of used values in `okintval` and `setintval` |
## `s4` and `s5` structures
-| field | Description |
+| field | Description |
|:-----------|:------------------------------------------------------------------|
| `f4` or `f5` | pointer to the checking function. they are generic structures to be used when no existing structure provides the required parameter verification. `f4` takes one argument, the `paramdef_t` structure corresponding to the parameter to be checked (`int (*f4)(paramdef_t *param)`), `f5` taxes no argument (`void (*checkfunc)(void)`) |
-[Configuration module developer main page](../../config/devusage.md)
+[Configuration module developer main page](../../config/devusage.md)
[Configuration module home](../../config.md)
diff --git a/common/config/DOC/config/rtusage.md b/common/config/DOC/config/rtusage.md
index 19519ef058..10cbee2495 100644
--- a/common/config/DOC/config/rtusage.md
+++ b/common/config/DOC/config/rtusage.md
@@ -1,39 +1,96 @@
-
- -O is the only mandatory command line option to start the eNodeb softmodem (lte-softmodem executable), it is used to specify the configuration source with the associated parameters:
+
+ -O is the only mandatory command line option to start the eNodeb softmodem (lte-softmodem executable), it is used to specify the configuration source with the associated parameters:
```bash
$ ./lte-softmodem -O :::...
```
- The configuration module can also be used without a configuration source, ie to only parse the command line. In this case the -O switch is optional. This mode is used in the ue-softmodem executable and by the phy_simulators executables (ulsim, dlsim)
+ The configuration module can also be used without a configuration source, ie to only parse the command line. In this case the -O switch is optional. This mode is used in the ue-softmodem executable and by the phy_simulators executables (ulsim, dlsim)
Currently the available config sources are:
-- **libconfig**: libconfig file. [libconfig file format](http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files) Parameter1 is the file path and parameter 2 can be used to specify the level of console messages printed by the configuration module.
+- **libconfig**: libconfig file. [libconfig file format](http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files) Parameter1 is the file path and parameter 2 can be used to specify the level of console messages printed by the configuration module.
```bash
$ ./lte-softmodem -O libconfig::dbgl
```
- **cmdlineonly**: command line only, the default mode for lte-uesoftmodem and the phy simiulators. In this case -O may be used to specify the config module debug level.
-The debug level is a mask:
-* bit 1: print parameters values
+The debug level is a mask:
+* bit 1: print parameters values
* bit 2: print memory allocation/free performed by the config module
* bit 3: print command line processing messages
* bit 4: disable execution abort when parameters checking fails
-As a oai user, you may have to use bit 1 (dbgl1) , to check your configuration and get the full name of a parameter you would like to modify on the command line. Other bits are for developers usage, (dbgl7 will print all debug messages).
+As a oai user, you may have to use bit 1 (dbgl1) , to check your configuration and get the full name of a parameter you would like to modify on the command line. Other bits are for developers usage, (dbgl7 will print all debug messages).
```bash
-$ ./lte-softmodem -O libconfig::dbgl1
+$ ./lte-softmodem -O libconfig::dbgl1
```
```bash
$ ./lte-uesoftmodem -O cmdlineonly:dbgl1
```
-For the lte-softmodem (the eNodeB) The config source parameter defaults to libconfig, preserving the initial -O option format. In this case you cannot specify the debug level.
+To get help on supported parameters you can use specific options:
+* ---help: print help for command line only parameters and for parameters not defined in a specific section
+ * ---help_< prefix > : print help for parameters defined under the section < prefix >
+
+```
+./lte-softmodem -O libconfig:/usr/local/oai/conf/enb.nbiot.band7.tm1.50PRB.usrpb210.conf --help
+[CONFIG] get parameters from libconfig /usr/local/oai/conf/enb.nbiot.band7.tm1.50PRB.usrpb210.conf , debug flags: 0x00000000
+.............................................
+[LIBCONFIG] (root): 19/19 parameters successfully set, (16 to default value)
+
+-----Help for section (root section) : 019 entries------
+ --rf-config-file: Configuration file for front-end (e.g. LMS7002M)
+ --ulsch-max-errors: set the eNodeB max ULSCH erros
+ --phy-test: test UE phy layer, mac disabled
+ --usim-test: use XOR autentication algo in case of test usim mode
+ --emulate-rf: Emulated RF enabled(disable by defult)
+ --clock: tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)
+ --wait-for-sync: Help string not specified
+ --single-thread-enable: Disables single-thread mode in lte-softmodem
+ -C: Set the downlink frequency for all component carriers
+ -a: Channel id offset
+ -d: Enable soft scope and L1 and L2 stats (Xforms)
+ -q: Enable processing timing measurement of lte softmodem on per subframe basis
+ -S: Skip the missed slots/subframes
+ --numerology: adding numerology for 5G
+ --parallel-config: three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'
+ --worker-config: two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'
+ --nbiot-disable: disable nb-iot, even if defined in config
+ --noS1: Disable s1 interface
+ --nokrnmod: (noS1 only): Use tun instead of namesh module
+--------------------------------------------------------------------
+
+[LIBCONFIG] (root): 4/4 parameters successfully set, (4 to default value)
+
+-----Help for section (root section) : 004 entries------
+ -R: Enable online log
+ -g: Set the global log level, valide options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))
+ --telnetsrv: Start embedded telnet server
+ --msc: Enable the MSC tracing utility
+--------------------------------------------------------------------
+
+[LIBCONFIG] loader: 2/2 parameters successfully set, (2 to default value)
+[LIBCONFIG] loader.telnetsrv: 2/2 parameters successfully set, (1 to default value)
+[LOADER] library libtelnetsrv.so is not loaded: libtelnetsrv.so: cannot open shared object file: No such file or directory
+Getting ENBSParams
+[LIBCONFIG] (root): 3/3 parameters successfully set, (1 to default value)
+
+-----Help for section (root section) : 003 entries------
+ --Asn1_verbosity: Help string not specified
+ --Active_eNBs: Help string not specified
+ --noS1: Help string not specified
+--------------------------------------------------------------------
+
+/usr/local/oai/issue390_configmodule_cmdlinebug/openairinterface5g/common/config/config_cmdline.c:224 config_process_cmdline() Exiting OAI softmodem: [CONFIG] Exiting after displaying help
+
+```
+
+For the lte-softmodem (the eNodeB) The config source parameter defaults to libconfig, preserving the initial -O option format. In this case you cannot specify the debug level.
```bash
$ ./lte-softmodem -O
```
-Configuration file parameters, except for the configuration file path, can be specified in a **config** section in the configuration file:
+Configuration file parameters, except for the configuration file path, can be specified in a **config** section in the configuration file:
```
config:
@@ -45,8 +102,8 @@ Configuration files examples can be found in the targets/PROJECTS/GENERIC-LTE-EP
```bash
$ ./lte-softmodem -O --eNBs.[0].component_carriers.[0].N_RB_DL 100
-```
+```
As specified earlier, use the dbgl1 debug level to get the full name of a parameter you would like to modify on the command line.
-[Configuration module home](../config.md)
\ No newline at end of file
+[Configuration module home](../config.md)
diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c
index 635287afb4..0083c2e66b 100644
--- a/common/config/config_cmdline.c
+++ b/common/config/config_cmdline.c
@@ -37,7 +37,7 @@
#include
#include
#include "config_userapi.h"
-
+#include "../utils/LOG/log.h"
int parse_stringlist(paramdef_t *cfgoptions, char *val) {
char *atoken;
@@ -74,15 +74,15 @@ int processoption(paramdef_t *cfgoptions, char *value) {
if ( value == NULL) {
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
- fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
- exit_fun("[CONFIG] command line parsing fatal error");
- return 0;
+ CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
} else { /* boolean value option without argument, set value to true*/
tmpval = defbool;
}
}
switch(cfgoptions->type) {
+ char *charptr;
+
case TYPE_STRING:
if (cfgoptions->numelt == 0 ) {
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
@@ -106,14 +106,24 @@ int processoption(paramdef_t *cfgoptions, char *value) {
case TYPE_UINT8:
case TYPE_INT8:
config_check_valptr(cfgoptions, (char **)&(cfgoptions->iptr),sizeof(int32_t));
- config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0));
+ config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,&charptr,0));
+
+ if( *charptr != 0) {
+ CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
+ }
+
optisset=1;
break;
case TYPE_UINT64:
case TYPE_INT64:
config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t));
- *(cfgoptions->i64ptr)=strtoll(tmpval,NULL,0);
+ *(cfgoptions->i64ptr)=strtoll(tmpval,&charptr,0);
+
+ if( *charptr != 0) {
+ CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an integer argument\n",cfgoptions->optname);
+ }
+
printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr));
optisset=1;
break;
@@ -124,7 +134,12 @@ int processoption(paramdef_t *cfgoptions, char *value) {
case TYPE_DOUBLE:
config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double));
- *(cfgoptions->dblptr) = strtof(tmpval,NULL);
+ *(cfgoptions->dblptr) = strtof(tmpval,&charptr);
+
+ if( *charptr != 0) {
+ CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires a double argument\n",cfgoptions->optname);
+ }
+
printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr));
optisset=1;
break;
@@ -133,7 +148,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
break;
default:
- fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type);
+ CONFIG_PRINTF_ERROR("[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type);
break;
} /* switch on param type */
@@ -149,14 +164,16 @@ int processoption(paramdef_t *cfgoptions, char *value) {
*/
int config_check_unknown_cmdlineopt(char *prefix) {
int unknowndetected=0;
- char testprefix[CONFIG_MAXOPTLENGTH]="";
+ char testprefix[CONFIG_MAXOPTLENGTH];
int finalcheck = 0;
+ memset(testprefix,0,sizeof(testprefix));
+ memset(testprefix,0,sizeof(testprefix));
if (prefix != NULL) {
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
finalcheck = 1;
else if (strlen(prefix) > 0) {
- sprintf(testprefix,"--%s.",prefix);
+ sprintf(testprefix,"--%.*s.",CONFIG_MAXOPTLENGTH-4,prefix);
}
}
@@ -176,8 +193,11 @@ int config_check_unknown_cmdlineopt(char *prefix) {
}
}
- printf_cmdl("[CONFIG] %i unknown option(s) in command line starting with %s (section %s)\n",
- unknowndetected,testprefix,((prefix==NULL)?"":prefix));
+ if (unknowndetected > 0) {
+ CONFIG_PRINTF_ERROR("[CONFIG] %i unknown option(s) in command line starting with %s (section %s)\n",
+ unknowndetected,testprefix,((prefix==NULL)?"":prefix));
+ }
+
return unknowndetected;
} /* config_check_unknown_cmdlineopt */
@@ -200,7 +220,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
if( prefix == NULL) {
- config_printhelp(cfgoptions,numoptions);
+ config_printhelp(cfgoptions,numoptions,"(root section)");
if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP)))
exit_fun("[CONFIG] Exiting after displaying help\n");
@@ -209,8 +229,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
pp=strtok_r(NULL, " ",&tokctx);
if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) {
- printf ("Help for %s section:\n",prefix);
- config_printhelp(cfgoptions,numoptions);
+ config_printhelp(cfgoptions,numoptions,prefix);
if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) {
fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix);
@@ -273,16 +292,5 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
} /* fin du while */
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
-
- if ( !(CONFIG_ISFLAGSET( CONFIG_NOCHECKUNKOPT )) ) {
- i=config_check_unknown_cmdlineopt(prefix);
-
- if (i > 0) {
- fprintf(stderr,"[CONFIG] %i unknown options for section %s detected in command line\n",
- i,((prefix==NULL)?"\"root section\"":prefix));
- exit_fun(" Exiting after detecting errors in command line \n");
- }
- }
-
return j;
} /* parse_cmdline*/
diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c
index e20672aa02..a6316d6c3f 100644
--- a/common/config/config_load_configmodule.c
+++ b/common/config/config_load_configmodule.c
@@ -36,12 +36,15 @@
#include
#include
#include
+#include
#define CONFIG_LOADCONFIG_MAIN
#include "config_load_configmodule.h"
#include "config_userapi.h"
+#include "../utils/LOG/log.h"
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
+
int load_config_sharedlib(configmodule_interface_t *cfgptr) {
void *lib_handle;
char fname[128];
@@ -198,7 +201,7 @@ configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t init
}
if ( strstr(argv[i], "help_config") != NULL ) {
- config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
+ config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
exit(0);
}
@@ -304,7 +307,7 @@ configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t init
if (cfgmode != NULL) free(cfgmode);
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
- config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
+ config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME );
// exit(-1);
}
@@ -342,7 +345,7 @@ void free_configmodule(void) {
if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode);
- printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP);
+ printf ("[CONFIG] free %i config parameter pointers\n",cfgptr->num_cfgP);
for (int i=0; inum_cfgP; i++) {
if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]);
diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h
index 2f5c055a00..d0309c62c3 100644
--- a/common/config/config_load_configmodule.h
+++ b/common/config/config_load_configmodule.h
@@ -51,7 +51,6 @@
#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_NOCHECKUNKOPT (1<<3) // disable check unprocessed (so invalid) command line options
#define CONFIG_NOABORTONCHKF (1<<4) // disable abort execution when parameter checking function fails
#define CONFIG_NOEXITONHELP (1<<19) // do not exit after printing help
#define CONFIG_HELP (1<<20) // print help message
@@ -109,5 +108,7 @@ extern configmodule_interface_t *cfgptr;
#define CONFIG_ENABLECMDLINEONLY (1<<1)
extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags);
extern void end_configmodule(void);
+#define CONFIG_PRINTF_ERROR(f, x... ) if (isLogInitDone ()) { LOG_E(ENB_APP,f,x);} else {printf(f,x);}; if ( !CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF) ) exit_fun("exit because configuration failed\n");
+
#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c
index b149bfd636..66d3078d33 100644
--- a/common/config/config_userapi.c
+++ b/common/config/config_userapi.c
@@ -39,15 +39,13 @@
#include
#include
#include
-
#include
#include "config_userapi.h"
-
+#include "../utils/LOG/log.h"
configmodule_interface_t *config_get_if(void) {
if (cfgptr == NULL) {
- fprintf(stderr,"[CONFIG] %s %d config module not initialized\n",__FILE__, __LINE__);
- exit(-1);
+ CONFIG_PRINTF_ERROR("[CONFIG] %s %d config module not initialized\n",__FILE__,__LINE__);
}
return cfgptr;
@@ -66,9 +64,8 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
config_get_if()->numptrs++;
}
} else {
- fprintf(stderr, "[CONFIG] %s %d option %s, cannot allocate pointer: %s \n",
- __FILE__, __LINE__, cfgoptions->optname, strerror(errno));
- exit(-1);
+ CONFIG_PRINTF_ERROR("[CONFIG] %s %d option %s, cannot allocate pointer: %s \n",
+ __FILE__, __LINE__, cfgoptions->optname, strerror(errno));
}
}
@@ -78,9 +75,8 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
if (*ptr != NULL) {
return *ptr;
} else {
- fprintf(stderr,"[CONFIG] %s %d option %s, definition error: value pointer is NULL, declared as %i bytes allocated\n",
- __FILE__, __LINE__,cfgoptions->optname, cfgoptions->numelt);
- exit(-1);
+ CONFIG_PRINTF_ERROR("[CONFIG] %s %d option %s, definition error: value pointer is NULL, declared as %i bytes allocated\n",
+ __FILE__, __LINE__,cfgoptions->optname, cfgoptions->numelt);
}
}
@@ -95,8 +91,7 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
config_get_if()->numptrs++;
}
} else {
- fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
- exit(-1);
+ CONFIG_PRINTF_ERROR("[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
}
}
@@ -157,8 +152,7 @@ void config_assign_processedint(paramdef_t *cfgoption, int val) {
if ( cfgoption->processedvalue != NULL) {
*(cfgoption->processedvalue) = val;
} else {
- fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
- exit(-1);
+ CONFIG_PRINTF_ERROR("[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
}
}
@@ -177,15 +171,17 @@ int config_get_processedint(paramdef_t *cfgoption) {
return ret;
}
-void config_printhelp(paramdef_t *params,int numparams) {
+void config_printhelp(paramdef_t *params,int numparams, char *prefix) {
+ printf("\n-----Help for section %-26s: %03i entries------\n",(prefix==NULL)?"(root section)":prefix ,numparams);
+
for (int i=0 ; inumelt; ++i) {
// TODO config_process_cmdline?
sprintf(cfgpath, "%s.[%i]", newprefix, i);
+ config_process_cmdline(ParamList->paramarray[i],numparams,cfgpath);
config_execcheck(ParamList->paramarray[i], numparams, cfgpath);
}
diff --git a/common/config/config_userapi.h b/common/config/config_userapi.h
index d0508ffbeb..cc07b1af5f 100644
--- a/common/config/config_userapi.h
+++ b/common/config/config_userapi.h
@@ -49,7 +49,7 @@ extern "C"
/* 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 void config_printhelp(paramdef_t *,int numparams, char *prefix);
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
diff --git a/common/ngran_types.h b/common/ngran_types.h
new file mode 100644
index 0000000000..224a85def5
--- /dev/null
+++ b/common/ngran_types.h
@@ -0,0 +1,51 @@
+/*
+ * 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/ngran_types.h
+* \brief Definitions for NGRAN node types
+* \author R. Knopp
+* \date 2018
+* \version 0.1
+* \company Eurecom
+* \email: knopp@eurecom.fr
+* \note
+* \warning
+*/
+
+#ifndef __NGRAN_TYPES_H__
+#define __NGRAN_TYPES_H__
+
+typedef enum {
+ ngran_eNB = 0,
+ ngran_ng_eNB = 1,
+ ngran_gNB = 2,
+ ngran_eNB_CU = 3,
+ ngran_ng_eNB_CU = 4,
+ ngran_gNB_CU = 5,
+ ngran_eNB_DU = 6,
+ ngran_gNB_DU = 7
+} ngran_node_t;
+
+#define NODE_IS_MONOLITHIC(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB || (nOdE_TyPe) == ngran_ng_eNB || (nOdE_TyPe) == ngran_gNB)
+#define NODE_IS_CU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_CU || (nOdE_TyPe) == ngran_ng_eNB_CU || (nOdE_TyPe) == ngran_gNB_CU)
+#define NODE_IS_DU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_DU || (nOdE_TyPe) == ngran_gNB_DU)
+
+#endif
diff --git a/common/ran_context.h b/common/ran_context.h
index 08c05411c9..c0b58d2af2 100644
--- a/common/ran_context.h
+++ b/common/ran_context.h
@@ -39,6 +39,8 @@
#include "PHY/types.h"
#include "PHY/impl_defs_top.h"
#include "PHY/impl_defs_lte.h"
+
+#include "ENB_APP/enb_config.h"
#include "RRC/LTE/rrc_defs.h"
#include "flexran_agent_defs.h"
@@ -49,7 +51,11 @@
#include "gtpv1u_eNB_defs.h"
#include "PHY/defs_L1_NB_IoT.h"
+
#include "RRC/LTE/defs_NB_IoT.h"
+
+
+
typedef struct {
/// RAN context config file name
char *config_file_name;
diff --git a/common/utils/DOC/loader/arch.md b/common/utils/DOC/loader/arch.md
index 6fd1f47e7b..52ffd428dd 100644
--- a/common/utils/DOC/loader/arch.md
+++ b/common/utils/DOC/loader/arch.md
@@ -2,6 +2,6 @@
The oai shared library loader is implemented in two source files, located in [common/utils](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils)
1. [load_module_shlib.c](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/load_module_shlib.c) contains the loader implementation
-1. [load_module_shlib.h](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/load_module_shlib.h) is the loader include file containing both private and public data type definitions. It also contain API prototypes.
+1. [load_module_shlib.h](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/load_module_shlib.h) is the loader include file containing both private and public data type definitions. It also contain API prototypes.
-[loader home page](../loader.md)
\ No newline at end of file
+[loader home page](../loader.md)
diff --git a/common/utils/DOC/loader/devusage.md b/common/utils/DOC/loader/devusage.md
index 915075c361..bd45c88a85 100644
--- a/common/utils/DOC/loader/devusage.md
+++ b/common/utils/DOC/loader/devusage.md
@@ -1,16 +1,16 @@
-The loader objectives are
+The loader objectives are
1. provides a common mechanism to prevent an executable to include code that is only used under specific configurations, without rebuilding the code
1. Provide a common mechanism to allow to choose between different implementations of a given set of functions, without rebuilding the code
As a developer you may need to look at these sections:
* [loading a shared library](devusage/loading.md)
-* [loader API](devusage/api.md)
-* [loader public structures](devusage/struct.md)
+* [loader API](devusage/api.md)
+* [loader public structures](devusage/struct.md)
-Loader usage examples can be found in oai sources:
+Loader usage examples can be found in oai sources:
-* device and transport initialization code: [function `load_lib` in *targets/ARCH/COMMON/__common_lib.c__* ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/targets/ARCH/COMMON/common_lib.c#L91)
+* device and transport initialization code: [function `load_lib` in *targets/ARCH/COMMON/__common_lib.c__* ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/targets/ARCH/COMMON/common_lib.c#L91)
* turbo encoder and decoder initialization: [function `load_codinglib`in *openair1/PHY/CODING/__coding_load.c__*](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/CODING/coding_load.c#L113)
[loader home page](../loader.md)
diff --git a/common/utils/DOC/loader/devusage/api.md b/common/utils/DOC/loader/devusage/api.md
index 21c2a1d253..a6e59c5938 100644
--- a/common/utils/DOC/loader/devusage/api.md
+++ b/common/utils/DOC/loader/devusage/api.md
@@ -1,12 +1,12 @@
- Loader API is defined in the [common/utils/load_module_shlib.h](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/load_module_shlib.h) include file.
+ Loader API is defined in the [common/utils/load_module_shlib.h](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/load_module_shlib.h) include file.
```c
int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
```
-* possibly initializes the loader, if it has not been already initialized
-* Formats the full shared library path, using the `modname` argument and the loader `shlibpath` and `shlibversion`configuration parameters.
+* possibly initializes the loader, if it has not been already initialized
+* Formats the full shared library path, using the `modname` argument and the loader `shlibpath` and `shlibversion`configuration parameters.
* loads the shared library, using the dlopen system call
* looks for `< modname >_autoinit` symbol, using the `dlsym` system call and possibly call the corresponding function.
-* looks for `< modname >_checkbuildver` symbol, using the `dlsym` system call and possibly calls the corresponding function. If the return value of this call is `-1`, program execution is stopped. It is the responsibility of the shared library developer to implement or not a `< modname >_checkbuildver` function and to decide if a version mismatch is a fatal condition. The `< modname >_checkbuildver` function must match the `checkverfunc_t` function type. The first argument is the main executable version, as set in the `PACKAGE_VERSION` macro defined in the [oai CMakeLists](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/cmake_targets/CMakeLists.txt#L218), around line 218. The second argument points to the shared library version which should be set by the `< modname >_checkbuildver` function.
+* looks for `< modname >_checkbuildver` symbol, using the `dlsym` system call and possibly calls the corresponding function. If the return value of this call is `-1`, program execution is stopped. It is the responsibility of the shared library developer to implement or not a `< modname >_checkbuildver` function and to decide if a version mismatch is a fatal condition. The `< modname >_checkbuildver` function must match the `checkverfunc_t` function type. The first argument is the main executable version, as set in the `PACKAGE_VERSION` macro defined in the [oai CMakeLists](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/cmake_targets/CMakeLists.txt#L218), around line 218. The second argument points to the shared library version which should be set by the `< modname >_checkbuildver` function.
* If the farray pointer is null, looks for `< modname >_getfarray` symbol, calls the corresponding function when the symbol is found. `< modname >_getfarray` takes one argument, a pointer to a `loader_shlibfunc_t` array, and returns the number of items in this array, as defined by the `getfarrayfunc_t` type. The `loader_shlibfunc_t` array returned by the shared library must be fully filled (both `fname` and `fptr` fields).
* looks for the `numf` function symbols listed in the `farray[i].fname` arguments and set the corresponding `farray[i].fptr`function pointers
@@ -14,7 +14,7 @@ int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
```c
void * get_shlibmodule_fptr(char *modname, char *fname)
```
-Returns a pointer to the symbol `fname`, defined in module `modname`, or `NULL` if the symbol is not found.
+Returns a pointer to the symbol `fname`, defined in module `modname`, or `NULL` if the symbol is not found.
-[loader home page](../../loader.md)
-[loader developer home page](../devusage.md)
\ No newline at end of file
+[loader home page](../../loader.md)
+[loader developer home page](../devusage.md)
diff --git a/common/utils/DOC/loader/devusage/loading.md b/common/utils/DOC/loader/devusage/loading.md
index 766bf85462..b34782ecd3 100644
--- a/common/utils/DOC/loader/devusage/loading.md
+++ b/common/utils/DOC/loader/devusage/loading.md
@@ -10,16 +10,16 @@ Typical loader usage looks like:
/* shared library loader include file */
#include "common/utils/load_module_shlib.h"
.............
-/*
- define and initialize the array, describing the list of functions
+/*
+ define and initialize the array, describing the list of functions
implemented in "mymodule"
*/
loader_shlibfunc_t mymodule_fdesc[2];
- mymodule_fdesc[0].fname="mymodule_f1";
- mymodule_fdesc[1].fname="mymodule_f2";
+ mymodule_fdesc[0].fname="mymodule_f1";
+ mymodule_fdesc[1].fname="mymodule_f2";
/*
- load the library, it's name must be libmymod.so. Configuration can be
+ load the library, it's name must be libmymod.so. Configuration can be
used to specify a specific path to look for libmymod.so. Configuration
can also specify a version, for example "V1", in this case the loader
will look for libmymodV1.so
@@ -28,13 +28,13 @@ Typical loader usage looks like:
if (ret < 0) {
fprintf(stderr,"Library couldn't be loaded\n");
} else {
-/*
+/*
library has been loaded, we probably want to call some functions...
*/
ret=((funcf1_t)mymodule_fdesc[0].fptr)();
..................
-/*
+/*
later and/or somewhere else in the code you may want to call function "mymodule_f2"
You can use the loader get_shlibmodule_fptr(char *modname, char *fname) function
to retrieve the pointer to that function
@@ -50,7 +50,7 @@ if (f2 != NULL) {
}
...............
```
-When loading a shared library the loader looks for a symbol named `< module name > _autoinit` and, if it finds it, calls it. The `autoinit` function is called without any argument and the returned value, if any, is not tested.
+When loading a shared library the loader looks for a symbol named `< module name > _autoinit` and, if it finds it, calls it. The `autoinit` function is called without any argument and the returned value, if any, is not tested.
-[loader home page](../loader.md)
-[loader developer home page](../../loader/devusage.md)
\ No newline at end of file
+[loader home page](../loader.md)
+[loader developer home page](../../loader/devusage.md)
diff --git a/common/utils/DOC/loader/devusage/struct.md b/common/utils/DOC/loader/devusage/struct.md
index 17504f3866..08d4ce9558 100644
--- a/common/utils/DOC/loader/devusage/struct.md
+++ b/common/utils/DOC/loader/devusage/struct.md
@@ -6,5 +6,5 @@ It is defined in include file [ common/util/load_module_shlib.h ](https://gitlab
| `fname` | symbol name, is passed to the [`dlsym`](http://man7.org/linux/man-pages/man3/dlsym.3.html) system call performed by the loader to get a pointer to the symbol | I |
| `fptr` | pointer to the symbol name, set by the loader. `fptr` is defined as a `int (*fptr)(void)` function type | O |
-[loader home page](../../loader.md)
-[loader developer home page](../devusage.md)
\ No newline at end of file
+[loader home page](../../loader.md)
+[loader developer home page](../devusage.md)
diff --git a/common/utils/DOC/loader/rtusage.md b/common/utils/DOC/loader/rtusage.md
index bf87316e13..0bcdf6429f 100644
--- a/common/utils/DOC/loader/rtusage.md
+++ b/common/utils/DOC/loader/rtusage.md
@@ -6,7 +6,7 @@ Shared library full names are built by the loader using the format:
1. the < *module version* > and < *path* > optional parameters, are defined at run-time, depending on the configuration.
## loader parameters
-The loader is using the [configuration module](../../../config/DOC/config.md), and defines global and per library parameters. Global parameters must be specified under the **loader** section and library specific parameters under a **loader.<*module name*>** section. Module specific parameters override the global parameters.
+The loader is using the [configuration module](../../../config/DOC/config.md), and defines global and per library parameters. Global parameters must be specified under the **loader** section and library specific parameters under a **loader.<*module name*>** section. Module specific parameters override the global parameters.
### Global loader parameters
| name | type | default | description |
|:---:|:---:|:---:|:----|
@@ -39,7 +39,7 @@ If you want to load a device called *liboai_device_USRP.so* without writting a s
With this latest example, nn the softmodem logs, you can check that the right device library has been loaded:
```bash
-[LIBCONFIG] loader.oai_device.shlibpath not found in /usr/local/oai/develop-nb-iot-merge/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.nbiot.band7.tm1.50PRB.usrpb210.conf
+[LIBCONFIG] loader.oai_device.shlibpath not found in /usr/local/oai/develop-nb-iot-merge/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.nbiot.band7.tm1.50PRB.usrpb210.conf
[LIBCONFIG] loader.oai_device.shlibversion set to default value ""
[LIBCONFIG] loader.oai_device: 1/2 parameters successfully set, (1 to default value)
[CONFIG] shlibversion set to _USRP from command line
@@ -47,4 +47,4 @@ With this latest example, nn the softmodem logs, you can check that the right de
```
-[loader home page](../loader.md)
\ No newline at end of file
+[loader home page](../loader.md)
diff --git a/common/utils/LOG/DOC/addconsoletrace.md b/common/utils/LOG/DOC/addconsoletrace.md
index d850ac1036..9ab90cf120 100644
--- a/common/utils/LOG/DOC/addconsoletrace.md
+++ b/common/utils/LOG/DOC/addconsoletrace.md
@@ -12,11 +12,11 @@ these macros are used in place of the printf C function. The additionnal ***comp
| macro | level letter | level value | level name |
|:---------|:---------------|:---------------|----------------:|
-| LOG_E | E | 0 | error |
+| LOG_E | E | 0 | error |
| LOG_W | W | 1 | warning |
| LOG_I | I | 2 | informational |
| LOG_D | D | 3 | debug |
-| LOG_T | T | 4 | trace |
+| LOG_T | T | 4 | trace |
component list is defined as an `enum` in [log.h](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.h). A new component can be defined by adding an item in this type, it must also be defined in the T tracer [T_messages.txt ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/T/T_messages.txt).
@@ -27,18 +27,18 @@ Most oai sources are including LOG macros.
```C
LOG_DEBUGFLAG()
```
-this macro is to be used in if statements. The condition is true if the flag has been set, as described in the [run time usage page](rtusage.md)
+this macro is to be used in if statements. The condition is true if the flag has been set, as described in the [run time usage page](rtusage.md)
```C
if ( LOG_DEBUGFLAG() {
-/*
+/*
the code below is only executed if the corresponding
_debug option is set.
- */
+ */
......................
......................
}
```
-[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c#L396)
+[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c#L396)
#### memory dump macros
```C
@@ -47,16 +47,16 @@ LOG_DUMPFLAG()
this macro is to be used in if statements. The condition is true if the flag has been set, as described in the [run time usage page](rtusage.md). It is mainly provided to surround LOG_M macros or direct calls to `log_dump`which otherwise would be unconditionals.
```C
if ( LOG_DUMPFLAG() {
-/*
+/*
the code below is only executed if the corresponding
_dump option is set.
- */
+ */
LOG_M(.............
LOG_M(.............
log_dump(...
}
-[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/prach.c#L205)
+[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/prach.c#L205)
#### matlab format dump
```C
LOG_M(file, vector, data, len, dec, format)
@@ -71,13 +71,13 @@ LOG_M(file, vector, data, len, dec, format)
|format| int | defines the type of data to be dumped|
This macro can be used to dump a buffer in a format that can be used for analyze via tools like matlab or octave. **It must be surrounded by LOG_DEBUGFLAG or LOG_DUMPFLAG macros, to prevent the dump to be built unconditionally.** The LOG_M macro points to the `write_file_matlab` function implemented in [log.c](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.c). **This function should be revisited for more understandable implementation and ease of use (format parameter ???)**
-[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/prach.c#L205)
+[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/LTE_TRANSPORT/prach.c#L205)
#### hexadecimal format dump
```C
LOG_DUMPMSG(c, f, b, s, x...)
```
-dumps a memory region if the corresponding debug flag `f` is set as explained here [run time usage page](rtusage.md)
+dumps a memory region if the corresponding debug flag `f` is set as explained here [run time usage page](rtusage.md)
|argument| type| description |
|:-----------|:-------|-----------------:|
@@ -88,12 +88,12 @@ dumps a memory region if the corresponding debug flag `f` is set as explained he
| x...| printf format and arguments| text string to be printed at the top of the dump|
This macro can be used to conditionaly dump a buffer, bytes by bytes, giving the integer value of each byte in hexadecimal form.
-[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair2/RRC/LTE/rrc_eNB.c#L1181)
+[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair2/RRC/LTE/rrc_eNB.c#L1181)
This macro points to the `log_dump` function, implemented in [log.c](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.c). This function can also dump buffers containing `double` data via the LOG_UDUMPMSG macro
```C
-LOG_UDUMPMSG(c, b, s, f, x...)
+LOG_UDUMPMSG(c, b, s, f, x...)
```
|argument| type| description |
|:-----------|:-------|-----------------:|
@@ -103,8 +103,8 @@ LOG_UDUMPMSG(c, b, s, f, x...)
|f| int | format of dumped data LOG_DUMP_CHAR or LOG_DUMP_DOUBLE|
| x...| printf format and arguments| text string to be printed at the top of the dump|
-[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/SIMULATION/LTE_PHY/dlsim.c#L1974)
+[example in oai code](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/SIMULATION/LTE_PHY/dlsim.c#L1974)
-[logging facility developer main page](devusage.md)
-[logging facility main page](log.md)
-[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
+[logging facility developer main page](devusage.md)
+[logging facility main page](log.md)
+[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/common/utils/LOG/DOC/arch.md b/common/utils/LOG/DOC/arch.md
index b9302927be..1d6aeae6aa 100644
--- a/common/utils/LOG/DOC/arch.md
+++ b/common/utils/LOG/DOC/arch.md
@@ -2,11 +2,11 @@
The oai logging facility is implemented in two source files, located in [common/utils/LOG](LOG)
1. [log.c](../log.c) contains logging implementation
-1. [log.h](../log.h) is the logging facility include file containing both private and public data type definitions. It also contain API prototypes.
+1. [log.h](../log.h) is the logging facility include file containing both private and public data type definitions. It also contain API prototypes.
The logging facility doesn't create any thread, all api's are executed in the context of the caller. The tracing macro's `LOG_` are all using the logRecord_mt function to output the messages. To keep this function thread safe it must perform a single system call to the output stream. The buffer used to build the message must be specific to the calling thread, which is today enforced by using a variable in the logRecord_mt stack.
Data used by the logging utility are defined by the `log_t` structure which is allocated at init time, when calling the `logInit` function.
-[logging facility main page](log.md)
-[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
+[logging facility main page](log.md)
+[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/common/utils/LOG/DOC/configurelog.md b/common/utils/LOG/DOC/configurelog.md
index c671c043bd..862c02162b 100644
--- a/common/utils/LOG/DOC/configurelog.md
+++ b/common/utils/LOG/DOC/configurelog.md
@@ -4,7 +4,7 @@
```C
int logInit (void);
```
-Allocate the internal data used by the logging utility, set the configuration, using the [configuration module](../../../config/DOC/config.md)
+Allocate the internal data used by the logging utility, set the configuration, using the [configuration module](../../../config/DOC/config.md)
```C
void logClean (void)
@@ -30,9 +30,9 @@ void close_component_filelog(int comp)
Redirect or reset to stdout the output stream used by the logging facility. When the output stream is redirected to a file, it is created under /tmp with a hard-coded filename including the componemt name.
```C
-SET_LOG_DEBUG(flag)
+SET_LOG_DEBUG(flag)
CLEAR_LOG_DEBUG(flag)
-SET_LOG_DUMP(flag)
+SET_LOG_DUMP(flag)
CLEAR_LOG_DUMP(flag)
```
These macros are used to set or clear the corresponding bit flag, trigerring the activation or un-activation of conditional code or memory dumps generation.
@@ -42,8 +42,8 @@ Example of using the logging utility APIs can be found, for initialization and c
#### components and debug flags definitions
Adding a new component is just adding an item in the `comp_name_t` enum defined in [log.h](../log.h) . You must also declare it in the T Tracer facility [message fefinitions](../../T/T_messages.txt).
-To add a flag than can then be used for adding conditional code or memory dumps you have to add the flag definition in the `LOG_MASKMAP_INIT` macro, in [log.h](../log.h).
+To add a flag than can then be used for adding conditional code or memory dumps you have to add the flag definition in the `LOG_MASKMAP_INIT` macro, in [log.h](../log.h).
-[logging facility developer main page](devusage.md)
-[logging facility main page](log.md)
-[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
\ No newline at end of file
+[logging facility developer main page](devusage.md)
+[logging facility main page](log.md)
+[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/common/utils/LOG/DOC/devusage.md b/common/utils/LOG/DOC/devusage.md
index d7790917fc..61d25734e0 100644
--- a/common/utils/LOG/DOC/devusage.md
+++ b/common/utils/LOG/DOC/devusage.md
@@ -1,14 +1,14 @@
### logging facility developer usage
-The logging facility objectives are
-1. provide a common console tracing mechanism
+The logging facility objectives are
+1. provide a common console tracing mechanism
1. Allow a flexible activation of console traces, by configuration or dynamically at any time while code is running.
-Most developpers will only use the log macros to add console messages to the code. The logging facility also provides an api that is used for initialization and configuration.
+Most developpers will only use the log macros to add console messages to the code. The logging facility also provides an api that is used for initialization and configuration.
-[Adding console traces in oaicode](addconsoletrace.md)
+[Adding console traces in oaicode](addconsoletrace.md)
-[Configuring the logging facility](configurelog.md)
+[Configuring the logging facility](configurelog.md)
-[logging facility main page](log.md)
+[logging facility main page](log.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/common/utils/LOG/DOC/log.md b/common/utils/LOG/DOC/log.md
index 121e227f3d..4b3e5981e1 100644
--- a/common/utils/LOG/DOC/log.md
+++ b/common/utils/LOG/DOC/log.md
@@ -1,6 +1,6 @@
# OAI console logging facility
-oai includes a console logging facility that any component should use when writting informational or debugging messages to the softmodem or uesoftmodem stdout stream.
+oai includes a console logging facility that any component should use when writting informational or debugging messages to the softmodem or uesoftmodem stdout stream.
By default, this facility is included at build-time and activated at run-time. The T Tracer and the Logging facility share common options for activation:
- To disable the logging facility (and T Tracer) at build-time use the *--disable-T-Tracer* switch:
diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md
index 60835bafaf..445f335725 100644
--- a/common/utils/LOG/DOC/rtusage.md
+++ b/common/utils/LOG/DOC/rtusage.md
@@ -1,5 +1,5 @@
## configuring the logging facility
-The logging facility is fully configurable and it uses the [config module](../../../config/config.md) to get its parameters at init time. The [telnet server](../../telnetsrv/DOC/telnetsrv.md) includes a set of commands which can be used to dynamically modify the logging facility behavior
+The logging facility is fully configurable and it uses the [config module](../../../config/config.md) to get its parameters at init time. The [telnet server](../../telnetsrv/DOC/telnetsrv.md) includes a set of commands which can be used to dynamically modify the logging facility behavior
All logging facility parameters are defined in the log_config section. Some parameters are global to the logging facility, they modify the way messages are printed to stdout. Conversely, some parameters are specific to a component and only modify the behavior for messages issued by a given component. A third type of parameters can be used to activate conditional debug code or dump messages or buffers.
@@ -14,7 +14,7 @@ All logging facility parameters are defined in the log_config section. Some para
### Component specific parameters
| name | type | default | description |
|:---:|:---:|:---:|:----|
-| `_log_level` | `boolean` | global log level, as defined by the `global_log_level ` parameter) |
+| `_log_level` | `boolean` | global log level, as defined by the `global_log_level ` parameter) |
| `_log_infile` | `boolean` | 0 = false| Triggers the redirection of log messages printed by the specified component in a file. The file path and name is /tmp/.[extension] the extension is optional and component dependant, it can be `log `, `dat `, `txt `|
The list of components defined within oai can be retrieved from the [config module](../../../config/config.md) traces, when asking for config module debugging info on the command line:
@@ -215,7 +215,7 @@ The list of components defined within oai can be retrieved from the [config mod
log init done
```
-It can also be retrieved when using the telnet server, as explained [below](### Using the telnet server to configure the logging facility)
+It can also be retrieved when using the telnet server, as explained [below](### Using the telnet server to configure the logging facility)
### parameters to activate conditional code
| name | type | default | description |
@@ -238,15 +238,15 @@ The following example sets all components log level to info, exept for hw,phy,ma
};
```
### Using the command line to configure the logging facility
-Command line parameter values supersedes values specified in the configuration file.
+Command line parameter values supersedes values specified in the configuration file.
```bash
-./lte-softmodem -O --log_config.global_log_options nocolor,level,thread --log_config.prach_log_level debug --log_config.PRACH_debug
+./lte-softmodem -O --log_config.global_log_options nocolor,level,thread --log_config.prach_log_level debug --log_config.PRACH_debug
```
In this example to get all the debug PRACH messages it is necessary to also set the PRACH_debug flag. This is a choice from the developper.
The log messages will be printed whithout color and the header will include the lmessage evel and the thread name:
```bash
-[PHY]I ru thread Time in secs now: 104652566
-[PHY]I ru thread Time in secs last pps: 91827117
+[PHY]I ru thread Time in secs now: 104652566
+[PHY]I ru thread Time in secs last pps: 91827117
[PHY]I ru thread RU 0 rf device ready
[PHY]I ru thread RU 0 no asynch_south interface
[MAC]E rxtx processing SCHED_MODE=0
@@ -256,10 +256,10 @@ The log messages will be printed whithout color and the header will include the
[PHY]I lte-softmodem PRACH (eNB) : running rx_prach for subframe 1, prach_FreqOffset 2, prach_ConfigIndex 0 , rootSequenceIndex 0
[PHY]I lte-softmodem PRACH (eNB) : running rx_prach for subframe 1, prach_FreqOffset 2, prach_ConfigIndex 0 , rootSequenceIndex 0
```
-
+
### Using the telnet server to configure the logging facility
The telnet server includes a `log` command which can be used to dymically modify the logging facility configuration parameters.
-[telnet server ***softmodem log*** commands](../../telnetsrv/DOC/telnetlog.md)
+[telnet server ***softmodem log*** commands](../../telnetsrv/DOC/telnetlog.md)
-[logging facility main page](log.md)
+[logging facility main page](log.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c
index e2dbac43ef..87150650db 100644
--- a/common/utils/LOG/log.c
+++ b/common/utils/LOG/log.c
@@ -219,7 +219,6 @@ void log_getconfig(log_t *g_log) {
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
paramdef_t logparams_dump[sizeof(log_maskmap)/sizeof(mapping)];
- CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
if (ret <0) {
@@ -304,9 +303,9 @@ void log_getconfig(log_t *g_log) {
logparams_dump[i].numelt = 0;
}
- config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
- CONFIG_CLEARRTFLAG(CONFIG_NOCHECKUNKOPT);
- config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
+ config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
+ config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
+ config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
/* set the debug mask according to the debug parameters values */
for (int i=0; log_maskmap[i].name != NULL ; i++) {
@@ -386,7 +385,6 @@ int logInit (void) {
register_log_component("OCG","",OCG);
register_log_component("PERF","",PERF);
register_log_component("OIP","",OIP);
- register_log_component("CLI","",CLI);
register_log_component("MSC","log",MSC);
register_log_component("OCM","log",OCM);
register_log_component("HW","",HW);
@@ -395,20 +393,25 @@ int logInit (void) {
register_log_component("mRAL","",RAL_UE);
register_log_component("ENB_APP","log",ENB_APP);
register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT);
+ register_log_component("PROTO_AGENT","log",PROTO_AGENT);
register_log_component("TMR","",TMR);
register_log_component("USIM","txt",USIM);
register_log_component("SIM","txt",SIM);
/* following log component are used for the localization*/
+ /* following log component are used for the localization*/
register_log_component("LOCALIZE","log",LOCALIZE);
register_log_component("NAS","log",NAS);
register_log_component("UDP","",UDP_);
register_log_component("GTPV1U","",GTPU);
register_log_component("S1AP","",S1AP);
+ register_log_component("F1AP","",F1AP);
register_log_component("X2AP","",X2AP);
register_log_component("SCTP","",SCTP);
register_log_component("X2AP","",X2AP);
register_log_component("LOADER","log",LOADER);
register_log_component("ASN","log",ASN);
+ register_log_component("NFAPI_PNF","log",NFAPI_PNF);
+ register_log_component("NFAPI_VNF","log",NFAPI_VNF);
for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
@@ -439,7 +442,7 @@ char *log_getthreadname(char *threadname, int bufsize) {
static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
char threadname[PR_SET_NAME];
- return snprintf(log_buffer, buffsize , "%s%s[%s]%c %s %s%s",
+ return snprintf(log_buffer, buffsize, "%s%s[%s]%c %s %s%s",
log_level_highlight_end[level],
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name,
@@ -453,11 +456,17 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
char log_buffer[MAX_LOG_TOTAL];
va_list args;
va_start(args, format);
- log_header(log_buffer,MAX_LOG_TOTAL ,comp, level,format);
+ log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
va_end(args);
}
+void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ) {
+ char log_buffer[MAX_LOG_TOTAL];
+ log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
+ g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
+}
+
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ) {
va_list args;
char *wbuf;
@@ -475,7 +484,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
if (wbuf != NULL) {
va_start(args, format);
- int pos=log_header(wbuf,MAX_LOG_TOTAL ,component, OAILOG_INFO,"");
+ int pos=log_header(wbuf,MAX_LOG_TOTAL,component, OAILOG_INFO,"");
int pos2=vsprintf(wbuf+pos,format, args);
pos=pos+pos2;
va_end(args);
diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h
index d0aa4a47c8..dea756a3ac 100644
--- a/common/utils/LOG/log.h
+++ b/common/utils/LOG/log.h
@@ -145,6 +145,7 @@ extern "C" {
#define DEBUG_CTRLSOCKET (1<<10)
#define DEBUG_SECURITY (1<<11)
#define DEBUG_NAS (1<<12)
+#define DEBUG_RLC (1<<13)
#define UE_TIMING (1<<20)
@@ -162,6 +163,7 @@ extern "C" {
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\
{"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\
+ {"RLC", DEBUG_RLC},\
{"UE_TIMING", UE_TIMING},\
{NULL,-1}\
}
@@ -196,13 +198,13 @@ typedef enum {
NAS,
PERF,
OIP,
- CLI,
MSC,
OCM,
UDP_,
GTPU,
SPGW,
S1AP,
+ F1AP,
SCTP,
HW,
OSA,
@@ -213,9 +215,13 @@ typedef enum {
TMR,
USIM,
LOCALIZE,
+ PROTO_AGENT,
+ F1U,
X2AP,
LOADER,
ASN,
+ NFAPI_VNF,
+ NFAPI_PNF,
MAX_LOG_PREDEF_COMPONENTS,
}
comp_name_t;
@@ -284,6 +290,7 @@ extern "C" {
int logInit (void);
int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
+void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
int set_log(int component, int level);
void set_glog(int level);
@@ -345,6 +352,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
}
#define LOG_OPTIONS_IDX 2
+
+
/*----------------------------------------------------------------------------------*/
/** @defgroup _debugging debugging macros
* @ingroup _macro
@@ -361,9 +370,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
+# define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0)
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
-# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
/* bitmask dependant macros, to isolate debugging code */
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
diff --git a/common/utils/T/T.c b/common/utils/T/T.c
index 140da30688..8ee359b77f 100644
--- a/common/utils/T/T.c
+++ b/common/utils/T/T.c
@@ -12,15 +12,17 @@
#include "common/config/config_userapi.h"
#define QUIT(x) do { \
- printf("T tracer: QUIT: %s\n", x); \
- exit(1); \
-} while (0)
+ printf("T tracer: QUIT: %s\n", x); \
+ exit(1); \
+ } while (0)
/* array used to activate/disactivate a log */
static int T_IDs[T_NUMBER_OF_IDS];
int *T_active = T_IDs;
+
int T_stdout = 1;
+
static int T_socket;
/* T_cache
@@ -32,125 +34,159 @@ volatile int *T_freelist_head = &_T_freelist_head;
T_cache_t *T_cache;
#if BASIC_SIMULATOR
-/* global variables used by T_GET_SLOT, see in T.h */
-volatile uint64_t T_next_id;
-volatile uint64_t T_active_id;
+ /* global variables used by T_GET_SLOT, see in T.h */
+ volatile uint64_t T_next_id;
+ volatile uint64_t T_active_id;
#endif
-static void get_message(int s)
-{
+static void get_message(int s) {
char t;
int l;
int id;
int is_on;
if (read(s, &t, 1) != 1) QUIT("get_message fails");
-printf("T tracer: got mess %d\n", t);
+
+ printf("T tracer: got mess %d\n", t);
+
switch (t) {
- case 0:
- /* toggle all those IDs */
- /* optimze? (too much syscalls) */
- if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
- while (l) {
- if (read(s, &id, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
- T_IDs[id] = 1 - T_IDs[id];
- l--;
- }
- break;
- case 1:
- /* set IDs as given */
- /* optimize? */
- if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
- id = 0;
- while (l) {
- if (read(s, &is_on, sizeof(int)) != sizeof(int))
- QUIT("get_message fails");
- T_IDs[id] = is_on;
- id++;
- l--;
- }
- break;
- case 2: break; /* do nothing, this message is to wait for local tracer */
+ case 0:
+
+ /* toggle all those IDs */
+ /* optimze? (too much syscalls) */
+ if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+
+ while (l) {
+ if (read(s, &id, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+
+ T_IDs[id] = 1 - T_IDs[id];
+ l--;
+ }
+
+ break;
+
+ case 1:
+
+ /* set IDs as given */
+ /* optimize? */
+ if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+
+ id = 0;
+
+ while (l) {
+ if (read(s, &is_on, sizeof(int)) != sizeof(int))
+ QUIT("get_message fails");
+
+ T_IDs[id] = is_on;
+ id++;
+ l--;
+ }
+
+ break;
+
+ case 2:
+ break; /* do nothing, this message is to wait for local tracer */
}
}
-static void *T_receive_thread(void *_)
-{
+static void *T_receive_thread(void *_) {
while (1) get_message(T_socket);
+
return NULL;
}
-static void new_thread(void *(*f)(void *), void *data)
-{
+static void new_thread(void *(*f)(void *), void *data) {
pthread_t t;
pthread_attr_t att;
- if (pthread_attr_init(&att))
- { fprintf(stderr, "pthread_attr_init err\n"); exit(1); }
- if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED))
- { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); }
- if (pthread_create(&t, &att, f, data))
- { fprintf(stderr, "pthread_create err\n"); exit(1); }
- if (pthread_attr_destroy(&att))
- { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); }
+ if (pthread_attr_init(&att)) {
+ fprintf(stderr, "pthread_attr_init err\n");
+ exit(1);
+ }
+
+ if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) {
+ fprintf(stderr, "pthread_attr_setdetachstate err\n");
+ exit(1);
+ }
+
+ if (pthread_create(&t, &att, f, data)) {
+ fprintf(stderr, "pthread_create err\n");
+ exit(1);
+ }
+
+ if (pthread_attr_destroy(&att)) {
+ fprintf(stderr, "pthread_attr_destroy err\n");
+ exit(1);
+ }
}
/* defined in local_tracer.c */
void T_local_tracer_main(int remote_port, int wait_for_tracer,
- int local_socket, void *shm_array);
+ int local_socket, void *shm_array);
/* We monitor the tracee and the local tracer processes.
* When one dies we forcefully kill the other.
*/
#include
#include
-static void monitor_and_kill(int child1, int child2)
-{
+static void monitor_and_kill(int child1, int child2) {
int child;
int status;
-
child = wait(&status);
+
if (child == -1) perror("wait");
+
kill(child1, SIGKILL);
kill(child2, SIGKILL);
exit(0);
}
-void T_init(int remote_port, int wait_for_tracer, int dont_fork)
-{
+void T_init(int remote_port, int wait_for_tracer, int dont_fork) {
int socket_pair[2];
int s;
int child1, child2;
int i;
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair))
- { perror("socketpair"); abort(); }
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair)) {
+ perror("socketpair");
+ abort();
+ }
/* setup shared memory */
T_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t),
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
- if (T_cache == MAP_FAILED)
- { perror("mmap"); abort(); }
+
+ if (T_cache == MAP_FAILED) {
+ perror("mmap");
+ abort();
+ }
/* let's garbage the memory to catch some potential problems
* (think multiprocessor sync issues, barriers, etc.)
*/
memset(T_cache, 0x55, T_CACHE_SIZE * sizeof(T_cache_t));
+
for (i = 0; i < T_CACHE_SIZE; i++) T_cache[i].busy = 0;
/* child1 runs the local tracer and child2 (or main) runs the tracee */
+ child1 = fork();
+
+ if (child1 == -1) abort();
- child1 = fork(); if (child1 == -1) abort();
if (child1 == 0) {
close(socket_pair[1]);
T_local_tracer_main(remote_port, wait_for_tracer, socket_pair[0],
T_cache);
exit(0);
}
+
close(socket_pair[0]);
if (dont_fork == 0) {
- child2 = fork(); if (child2 == -1) abort();
+ child2 = fork();
+
+ if (child2 == -1) abort();
+
if (child2 != 0) {
close(socket_pair[1]);
munmap(T_cache, T_CACHE_SIZE * sizeof(T_cache_t));
@@ -161,27 +197,21 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork)
s = socket_pair[1];
/* wait for first message - initial list of active T events */
get_message(s);
-
T_socket = s;
-
new_thread(T_receive_thread, NULL);
}
-void T_Config_Init(void)
-{
- int T_port; /* by default we wait for the tracer */
- int T_nowait; /* default port to listen to to wait for the tracer */
- int T_dont_fork; /* default is to fork, see 'T_init' to understand */
-
+void T_Config_Init(void) {
+ int T_port=TTRACER_DEFAULT_PORTNUM; /* by default we wait for the tracer */
+ int T_nowait=0; /* default port to listen to to wait for the tracer */
+ int T_dont_fork=0; /* default is to fork, see 'T_init' to understand */
paramdef_t ttraceparams[] = CMDLINE_TTRACEPARAMS_DESC;
-
/* for a cleaner config file, TTracer params should be defined in a
* specific section...
*/
config_get(ttraceparams,
sizeof(ttraceparams) / sizeof(paramdef_t),
TTRACER_CONFIG_PREFIX);
-
/* compatibility: look for TTracer command line options in root section */
config_process_cmdline(ttraceparams,
sizeof(ttraceparams) / sizeof(paramdef_t),
diff --git a/common/utils/T/T.h b/common/utils/T/T.h
index 18e4a590d9..626dbafd25 100644
--- a/common/utils/T/T.h
+++ b/common/utils/T/T.h
@@ -8,7 +8,7 @@
#include "T_defs.h"
#ifdef T_SEND_TIME
-#include
+ #include
#endif
/* T message IDs */
@@ -76,13 +76,13 @@
T_BUFFER_MAX - T_LOCAL_size, T_PUT_printf_deref x); \
if (T_PUT_len < 0) { \
printf("%s:%d:%s: you can't read this, or can you?", \
- __FILE__, __LINE__, __FUNCTION__); \
+ __FILE__, __LINE__, __FUNCTION__); \
abort(); \
} \
if (T_PUT_len >= T_BUFFER_MAX - T_LOCAL_size) { \
printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
- ", consider increasing T_BUFFER_MAX (%d)\n", \
- __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
+ ", consider increasing T_BUFFER_MAX (%d)\n", \
+ __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
abort(); \
} \
T_LOCAL_size += T_PUT_len + 1; \
@@ -97,9 +97,9 @@ struct T_header;
/* T macro tricks */
extern int T_stdout;
#define TN(...) TN_N(__VA_ARGS__,33,32,31,30,29,28,27,26,25,24,23,22,21,\
- 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
+ 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\
- n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
+ n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
#define T(...) do { if (T_stdout == 0) TN(__VA_ARGS__); } while (0)
/* type used to send arbitrary buffer data */
@@ -119,30 +119,30 @@ extern int *T_active;
*/
#if BASIC_SIMULATOR
# define T_GET_SLOT \
- do { \
- extern volatile uint64_t T_next_id; \
- extern volatile uint64_t T_active_id; \
- uint64_t id; \
- /* get a ticket */ \
- id = __sync_fetch_and_add(&T_next_id, 1); \
- /* wait for our turn */ \
- while (id != __sync_fetch_and_add(&T_active_id, 0)) /* busy wait */; \
- /* this is our turn, try to acquire the slot until it's free */ \
- do { \
- T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); \
- if (T_LOCAL_busy & 0x01) usleep(100); \
- } while (T_LOCAL_busy & 0x01); \
- /* check that there are still some tickets */ \
- if (__sync_fetch_and_add(&T_active_id, 0) == 0xffffffffffffffff) { \
- printf("T: reached the end of times, bye...\n"); \
- abort(); \
- } \
- /* free our ticket, which signals the next waiter that it's its turn */ \
- (void)__sync_fetch_and_add(&T_active_id, 1); \
- } while (0)
+ do { \
+ extern volatile uint64_t T_next_id; \
+ extern volatile uint64_t T_active_id; \
+ uint64_t id; \
+ /* get a ticket */ \
+ id = __sync_fetch_and_add(&T_next_id, 1); \
+ /* wait for our turn */ \
+ while (id != __sync_fetch_and_add(&T_active_id, 0)) /* busy wait */; \
+ /* this is our turn, try to acquire the slot until it's free */ \
+ do { \
+ T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); \
+ if (T_LOCAL_busy & 0x01) usleep(100); \
+ } while (T_LOCAL_busy & 0x01); \
+ /* check that there are still some tickets */ \
+ if (__sync_fetch_and_add(&T_active_id, 0) == 0xffffffffffffffff) { \
+ printf("T: reached the end of times, bye...\n"); \
+ abort(); \
+ } \
+ /* free our ticket, which signals the next waiter that it's its turn */ \
+ (void)__sync_fetch_and_add(&T_active_id, 1); \
+ } while (0)
#else
# define T_GET_SLOT \
- T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01);
+ T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01);
#endif
/* used at header of Tn, allocates buffer */
@@ -172,8 +172,8 @@ extern int *T_active;
#define T_CHECK_SIZE(len, argnum) \
if (T_LOCAL_size + (len) > T_BUFFER_MAX) { \
printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
- ", consider increasing T_BUFFER_MAX (%d)\n", \
- __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
+ ", consider increasing T_BUFFER_MAX (%d)\n", \
+ __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
abort(); \
}
@@ -598,20 +598,21 @@ extern int *T_active;
#define TTRACER_CONFIG_PREFIX "TTracer"
-/*------------------------------------------------------------------------------------------------------------------------------------------*/
-/* configuration parameters for TTRACE utility */
-/* optname helpstr paramflags XXXptr defXXXval type numelt */
-/*------------------------------------------------------------------------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
+/* configuration parameters for TTRACE utility */
+/* optname helpstr paramflags XXXptr defXXXval type numelt */
+/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
+#define TTRACER_DEFAULT_PORTNUM 2021
#define CMDLINE_TTRACEPARAMS_DESC { \
-{"T_port", CONFIG_HLP_TPORT, 0, iptr:&T_port, defintval:2021, TYPE_INT, 0}, \
-{"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, iptr:&T_nowait, defintval:0, TYPE_INT, 0}, \
-{"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, iptr:&T_dont_fork, defintval:0, TYPE_INT, 0}, \
-{"T_stdout", CONFIG_HLP_STDOUT, PARAMFLAG_BOOL, iptr:&T_stdout, defintval:1, TYPE_INT, 0}, \
-}
+ {"T_port", CONFIG_HLP_TPORT, 0, iptr:&T_port, defintval:TTRACER_DEFAULT_PORTNUM, TYPE_INT, 0},\
+ {"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, iptr:&T_nowait, defintval:0, TYPE_INT, 0},\
+ {"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, iptr:&T_dont_fork, defintval:0, TYPE_INT, 0},\
+ {"T_stdout", CONFIG_HLP_STDOUT, PARAMFLAG_BOOL, iptr:&T_stdout, defintval:1, TYPE_INT, 0},\
+ }
- /* log on stdout */
+/* log on stdout */
void T_init(int remote_port, int wait_for_tracer, int dont_fork);
void T_Config_Init(void);
#else /* T_TRACER */
diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt
index 0f85ad6099..147c7a6134 100644
--- a/common/utils/T/T_messages.txt
+++ b/common/utils/T/T_messages.txt
@@ -629,7 +629,7 @@ ID = LEGACY_OCM_DEBUG
FORMAT = string,log
ID = LEGACY_OCM_TRACE
DESC = OCM legacy logs - trace level
- GROUP = ALL:LEGACY_OCM:LEGACY_GROUP_TRACE:LEGACY
+ OGROUP = ALL:LEGACY_OCM:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_OIP_INFO
@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
+ID = LEGACY_NFAPI_VNF_INFO
+ DESC = NFAPI_VNF legacy logs - info level
+ GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_INFO:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_VNF_ERROR
+ DESC = NFAPI_VNF legacy logs - error level
+ GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_ERROR:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_VNF_WARNING
+ DESC = NFAPI_VNF legacy logs - warning level
+ GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_WARNING:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_VNF_DEBUG
+ DESC = NFAPI_VNF legacy logs - debug level
+ GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_DEBUG:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_VNF_TRACE
+ DESC = NFAPI_VNF legacy logs - trace level
+ GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_TRACE:LEGACY
+ FORMAT = string,log
+
+ID = LEGACY_NFAPI_PNF_INFO
+ DESC = NFAPI_PNF legacy logs - info level
+ GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_INFO:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_PNF_ERROR
+ DESC = NFAPI_PNF legacy logs - error level
+ GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_ERROR:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_PNF_WARNING
+ DESC = NFAPI_PNF legacy logs - warning level
+ GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_WARNING:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_PNF_DEBUG
+ DESC = NFAPI_PNF legacy logs - debug level
+ GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_DEBUG:LEGACY
+ FORMAT = string,log
+ID = LEGACY_NFAPI_PNF_TRACE
+ DESC = NFAPI_PNF legacy logs - trace level
+ GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_TRACE:LEGACY
+ FORMAT = string,log
# this is a bad hack but I won't fix (function util_print_hex_octets
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
# does funky things with the LOG_x macros but we work on the C pre-processor
@@ -845,26 +886,62 @@ ID = LEGACY_componentP_TRACE
GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
-#needed?
-ID = LEGACY_CLI_INFO
- DESC = CLI legacy logs - info level
- GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_INFO:LEGACY
+
+
+ID = LEGACY_PROTO_AGENT_DEBUG
+ DESC = PROTO AGENT DEBUG LEVEL
+ GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
-ID = LEGACY_CLI_ERROR
- DESC = CLI legacy logs - error level
- GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_ERROR:LEGACY
+
+ID = LEGACY_PROTO_AGENT_INFO
+ DESC = PROTO AGENT INFO LEVEL
+ GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
-ID = LEGACY_CLI_WARNING
- DESC = CLI legacy logs - warning level
- GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_WARNING:LEGACY
+
+ID = LEGACY_PROTO_AGENT_WARNING
+ DESC = PROTO AGENT WARNING LEVEL
+ GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
-ID = LEGACY_CLI_DEBUG
- DESC = CLI legacy logs - debug level
- GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_DEBUG:LEGACY
+
+ID = LEGACY_PROTO_AGENT_ERROR
+ DESC = PROTO AGENT ERROR LEVEL
+ GROUP = ALL:LEGACY_PROTO:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
-ID = LEGACY_CLI_TRACE
- DESC = CLI legacy logs - trace level
- GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_TRACE:LEGACY
+
+ID = LEGACY_F1U_DEBUG
+ DESC = F1U DEBUG LEVEL
+ GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_DEBUG:LEGACY
+ FORMAT = string,log
+
+ID = LEGACY_F1U_INFO
+ DESC = F1U INFO LEVEL
+ GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_INFO:LEGACY
+ FORMAT = string,log
+
+ID = LEGACY_F1U_ERROR
+ DESC = F1U ERROR LEVEL
+ GROUP = ALL:LEGACY_F1U:LEGACY_GROUP_ERROR:LEGACY
+ FORMAT = string,log
+
+ID = LEGACY_F1AP_TRACE
+ DESC = F1AP TRACE LEVEL
+ GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_TRACE:LEGACY
+ FORMAT = string,log
+ID = LEGACY_F1AP_DEBUG
+ DESC = F1AP DEBUG LEVEL
+ GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_DEBUG:LEGACY
+ FORMAT = string,log
+ID = LEGACY_F1AP_INFO
+ DESC = F1AP INFO LEVEL
+ GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_INFO:LEGACY
+ FORMAT = string,log
+ID = LEGACY_F1AP_WARNING
+ DESC = F1AP WARNING LEVEL
+ GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_WARNING:LEGACY
+ FORMAT = string,log
+ID = LEGACY_F1AP_ERROR
+ DESC = F1AP ERROR LEVEL
+ GROUP = ALL:LEGACY_F1AP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
#################
diff --git a/common/utils/T/local_tracer.c b/common/utils/T/local_tracer.c
index f8e92881a9..4be0b35d16 100644
--- a/common/utils/T/local_tracer.c
+++ b/common/utils/T/local_tracer.c
@@ -31,7 +31,7 @@ typedef struct {
int remote_port;
pthread_mutex_t lock;
pthread_cond_t cond;
- databuf * volatile head, *tail;
+ databuf *volatile head, *tail;
uint64_t memusage;
uint64_t last_warning_memusage;
} forward_data;
@@ -40,80 +40,115 @@ typedef struct {
/* utility functions */
/****************************************************************************/
-static void new_thread(void *(*f)(void *), void *data)
-{
+static void new_thread(void *(*f)(void *), void *data) {
pthread_t t;
pthread_attr_t att;
- if (pthread_attr_init(&att))
- { fprintf(stderr, "pthread_attr_init err\n"); exit(1); }
- if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED))
- { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); }
- if (pthread_attr_setstacksize(&att, 10000000))
- { fprintf(stderr, "pthread_attr_setstacksize err\n"); exit(1); }
- if (pthread_create(&t, &att, f, data))
- { fprintf(stderr, "pthread_create err\n"); exit(1); }
- if (pthread_attr_destroy(&att))
- { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); }
+ if (pthread_attr_init(&att)) {
+ fprintf(stderr, "pthread_attr_init err\n");
+ exit(1);
+ }
+
+ if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) {
+ fprintf(stderr, "pthread_attr_setdetachstate err\n");
+ exit(1);
+ }
+
+ if (pthread_attr_setstacksize(&att, 10000000)) {
+ fprintf(stderr, "pthread_attr_setstacksize err\n");
+ exit(1);
+ }
+
+ if (pthread_create(&t, &att, f, data)) {
+ fprintf(stderr, "pthread_create err\n");
+ exit(1);
+ }
+
+ if (pthread_attr_destroy(&att)) {
+ fprintf(stderr, "pthread_attr_destroy err\n");
+ exit(1);
+ }
}
-static int get_connection(char *addr, int port)
-{
+static int get_connection(char *addr, int port) {
struct sockaddr_in a;
socklen_t alen;
int s, t;
-
printf("T tracer: waiting for connection on %s:%d\n", addr, port);
-
s = socket(AF_INET, SOCK_STREAM, 0);
- if (s == -1) { perror("socket"); exit(1); }
+
+ if (s == -1) {
+ perror("socket");
+ exit(1);
+ }
+
t = 1;
- if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int)))
- { perror("setsockopt"); exit(1); }
+
+ if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int))) {
+ perror("setsockopt");
+ exit(1);
+ }
a.sin_family = AF_INET;
a.sin_port = htons(port);
a.sin_addr.s_addr = inet_addr(addr);
- if (bind(s, (struct sockaddr *)&a, sizeof(a))) { perror("bind"); exit(1); }
- if (listen(s, 5)) { perror("bind"); exit(1); }
+ if (bind(s, (struct sockaddr *)&a, sizeof(a))) {
+ perror("bind");
+ exit(1);
+ }
+
+ if (listen(s, 5)) {
+ perror("bind");
+ exit(1);
+ }
+
alen = sizeof(a);
t = accept(s, (struct sockaddr *)&a, &alen);
- if (t == -1) { perror("accept"); exit(1); }
+
+ if (t == -1) {
+ perror("accept");
+ exit(1);
+ }
+
close(s);
-
printf("T tracer: connected\n");
-
return t;
}
static void forward(void *_forwarder, char *buf, int size);
-void send_T_messages_txt(void *forwarder)
-{
+void send_T_messages_txt(void *forwarder) {
char buf[T_BUFFER_MAX];
char *T_LOCAL_buf = buf;
int T_LOCAL_size;
unsigned char *src;
int src_len;
-
/* trace T_message.txt
* Send several messages -1 with content followed by message -2.
*/
src = T_messages_txt;
src_len = T_messages_txt_len;
+
while (src_len) {
int send_size = src_len;
+
if (send_size > T_PAYLOAD_MAXSIZE - sizeof(int))
send_size = T_PAYLOAD_MAXSIZE - sizeof(int);
+
/* TODO: be careful, we use internal T stuff, to rewrite? */
T_LOCAL_size = 0;
T_HEADER(T_ID(-1));
- T_PUT_buffer(1, ((T_buffer){addr:(src), length:(send_size)}));
+ T_PUT_buffer(1, ((T_buffer) {
+addr:
+(src), length:
+ (send_size)
+ }));
forward(forwarder, buf, T_LOCAL_size);
src += send_size;
src_len -= send_size;
}
+
T_LOCAL_size = 0;
T_HEADER(T_ID(-2));
forward(forwarder, buf, T_LOCAL_size);
@@ -123,49 +158,54 @@ void send_T_messages_txt(void *forwarder)
/* forward functions */
/****************************************************************************/
-static void *data_sender(void *_f)
-{
+static void *data_sender(void *_f) {
forward_data *f = _f;
databuf *cur;
char *buf, *b;
int size;
-
wait:
+
if (pthread_mutex_lock(&f->lock)) abort();
+
while (f->head == NULL)
if (pthread_cond_wait(&f->cond, &f->lock)) abort();
+
cur = f->head;
buf = cur->d;
size = cur->l;
f->head = cur->next;
f->memusage -= size;
+
if (f->head == NULL) f->tail = NULL;
+
if (pthread_mutex_unlock(&f->lock)) abort();
+
free(cur);
goto process;
-
process:
b = buf;
+
if (f->socket_remote != -1)
- while (size) {
- int l = write(f->socket_remote, b, size);
- if (l <= 0) {
- printf("T tracer: forward error\n");
- close(f->socket_remote);
- f->socket_remote = -1;
- break;
+ while (size) {
+ int l = write(f->socket_remote, b, size);
+
+ if (l <= 0) {
+ printf("T tracer: forward error\n");
+ close(f->socket_remote);
+ f->socket_remote = -1;
+ break;
+ }
+
+ size -= l;
+ b += l;
}
- size -= l;
- b += l;
- }
free(buf);
-
goto wait;
}
-static void *forward_remote_messages(void *_f)
-{
+
+static void *forward_remote_messages(void *_f) {
#define PUT(x) do { \
if (bufsize == bufmaxsize) { \
bufmaxsize += 4096; \
@@ -180,7 +220,6 @@ static void *forward_remote_messages(void *_f)
int len = l; \
while (len) { PUT(*zz); zz++; len--; } \
} while (0)
-
forward_data *f = _f;
int from;
int to;
@@ -190,43 +229,53 @@ static void *forward_remote_messages(void *_f)
int bufsize = 0;
int bufmaxsize = 0;
char t;
-
again:
while (1) {
from = f->socket_remote;
to = f->socket_local;
-
bufsize = 0;
-
/* let's read and process messages */
- len = read(from, &t, 1); if (len <= 0) goto dead;
+ len = read(from, &t, 1);
+
+ if (len <= 0) goto dead;
+
PUT(t);
switch (t) {
- case 0:
- case 1:
- /* message 0 and 1: get a length and then 'length' numbers */
- if (read(from, &len, sizeof(int)) != sizeof(int)) goto dead;
- PUT_BUF(&len, 4);
- while (len) {
- if (read(from, &l, sizeof(int)) != sizeof(int)) goto dead;
- PUT_BUF(&l, 4);
- len--;
- }
- break;
+ case 0:
+ case 1:
- case 2: break;
- default:
- printf("%s:%d:%s: unhandled message type %d\n",
- __FILE__, __LINE__, __FUNCTION__, t);
- abort();
+ /* message 0 and 1: get a length and then 'length' numbers */
+ if (read(from, &len, sizeof(int)) != sizeof(int)) goto dead;
+
+ PUT_BUF(&len, 4);
+
+ while (len) {
+ if (read(from, &l, sizeof(int)) != sizeof(int)) goto dead;
+
+ PUT_BUF(&l, 4);
+ len--;
+ }
+
+ break;
+
+ case 2:
+ break;
+
+ default:
+ printf("%s:%d:%s: unhandled message type %d\n",
+ __FILE__, __LINE__, __FUNCTION__, t);
+ abort();
}
b = buf;
+
while (bufsize) {
l = write(to, b, bufsize);
+
if (l <= 0) abort();
+
bufsize -= l;
b += l;
}
@@ -236,71 +285,80 @@ dead:
/* socket died, let's stop all traces and wait for another tracer */
/* TODO: be careful with those write, they might write less than wanted */
buf[0] = 1;
+
if (write(to, buf, 1) != 1) abort();
+
len = T_NUMBER_OF_IDS;
+
if (write(to, &len, sizeof(int)) != sizeof(int)) abort();
+
l = 0;
+
while (len) {
if (write(to, &l, sizeof(int)) != sizeof(int)) abort();
+
len--;
};
close(f->socket_remote);
+
f->socket_remote = get_connection("0.0.0.0", f->remote_port);
+
send_T_messages_txt(f);
+
goto again;
return NULL;
}
-static void *forwarder(int port, int s)
-{
+static void *forwarder(int port, int s) {
forward_data *f;
+ f = malloc(sizeof(*f));
- f = malloc(sizeof(*f)); if (f == NULL) abort();
+ if (f == NULL) abort();
pthread_mutex_init(&f->lock, NULL);
pthread_cond_init(&f->cond, NULL);
-
f->socket_local = s;
f->head = f->tail = NULL;
-
f->memusage = 0;
f->last_warning_memusage = 0;
-
printf("T tracer: waiting for remote tracer on port %d\n", port);
-
f->remote_port = port;
f->socket_remote = get_connection("0.0.0.0", port);
send_T_messages_txt(f);
-
new_thread(data_sender, f);
new_thread(forward_remote_messages, f);
-
return f;
}
-static void forward(void *_forwarder, char *buf, int size)
-{
+static void forward(void *_forwarder, char *buf, int size) {
forward_data *f = _forwarder;
int32_t ssize = size;
databuf *new;
+ new = malloc(sizeof(*new));
- new = malloc(sizeof(*new)); if (new == NULL) abort();
+ if (new == NULL) abort();
if (pthread_mutex_lock(&f->lock)) abort();
- new->d = malloc(size + 4); if (new->d == NULL) abort();
+ new->d = malloc(size + 4);
+
+ if (new->d == NULL) abort();
+
/* put the size of the message at the head */
memcpy(new->d, &ssize, 4);
memcpy(new->d+4, buf, size);
new->l = size+4;
new->next = NULL;
- if (f->head == NULL) f->head = new;
- if (f->tail != NULL) f->tail->next = new;
- f->tail = new;
+ if (f->head == NULL) f->head = new;
+
+ if (f->tail != NULL) f->tail->next = new;
+
+ f->tail = new;
#if BASIC_SIMULATOR
+
/* When runnng the basic simulator, the tracer may be too slow.
* Let's not take too much memory in the tracee and
* wait if there is too much data to send. 200MB is
@@ -308,26 +366,30 @@ static void forward(void *_forwarder, char *buf, int size)
*/
while (f->memusage > 200 * 1024 * 1024) {
if (pthread_cond_signal(&f->cond)) abort();
+
if (pthread_mutex_unlock(&f->lock)) abort();
+
usleep(1000);
+
if (pthread_mutex_lock(&f->lock)) abort();
}
-#endif /* BASIC_SIMULATOR */
+#endif /* BASIC_SIMULATOR */
f->memusage += size+4;
+
/* warn every 100MB */
if (f->memusage > f->last_warning_memusage &&
f->memusage - f->last_warning_memusage > 100000000) {
f->last_warning_memusage += 100000000;
printf("T tracer: WARNING: memory usage is over %"PRIu64"MB\n",
f->last_warning_memusage / 1000000);
- } else
- if (f->memusage < f->last_warning_memusage &&
- f->last_warning_memusage - f->memusage > 100000000) {
+ } else if (f->memusage < f->last_warning_memusage &&
+ f->last_warning_memusage - f->memusage > 100000000) {
f->last_warning_memusage = (f->memusage/100000000) * 100000000;
}
if (pthread_cond_signal(&f->cond)) abort();
+
if (pthread_mutex_unlock(&f->lock)) abort();
}
@@ -335,14 +397,12 @@ static void forward(void *_forwarder, char *buf, int size)
/* local functions */
/****************************************************************************/
-static void wait_message(void)
-{
+static void wait_message(void) {
while ((T_local_cache[T_busylist_head].busy & 0x02) == 0) usleep(1000);
}
void T_local_tracer_main(int remote_port, int wait_for_tracer,
- int local_socket, void *shm_array)
-{
+ int local_socket, void *shm_array) {
int s;
int port = remote_port;
int dont_wait = wait_for_tracer ? 0 : 1;
@@ -350,16 +410,16 @@ void T_local_tracer_main(int remote_port, int wait_for_tracer,
/* write on a socket fails if the other end is closed and we get SIGPIPE */
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
- printf("local tracer received SIGPIPE\n");
- abort();
+ printf("local tracer received SIGPIPE\n");
+ abort();
}
T_local_cache = shm_array;
-
s = local_socket;
if (dont_wait) {
char t = 2;
+
if (write(s, &t, 1) != 1) abort();
}
diff --git a/common/utils/T/tracer/gui/notify.c b/common/utils/T/tracer/gui/notify.c
index 7ff4006941..5798a01219 100644
--- a/common/utils/T/tracer/gui/notify.c
+++ b/common/utils/T/tracer/gui/notify.c
@@ -5,62 +5,56 @@
#include
unsigned long register_notifier(gui *_g, char *notification, widget *w,
- notifier handler, void *private)
-{
+ notifier handler, void *private) {
struct gui *g = _g;
unsigned long ret;
-
glock(g);
if (g->next_notifier_id == 2UL * 1024 * 1024 * 1024)
ERR("%s:%d: report a bug\n", __FILE__, __LINE__);
g->notifiers = realloc(g->notifiers,
- (g->notifiers_count+1) * sizeof(struct notifier));
+ (g->notifiers_count+1) * sizeof(struct notifier));
+
if (g->notifiers == NULL) abort();
ret = g->next_notifier_id;
-
g->notifiers[g->notifiers_count].handler = handler;
g->notifiers[g->notifiers_count].id = g->next_notifier_id;
g->next_notifier_id++;
g->notifiers[g->notifiers_count].notification = strdup(notification);
+
if (g->notifiers[g->notifiers_count].notification == NULL) abort();
+
g->notifiers[g->notifiers_count].w = w;
g->notifiers[g->notifiers_count].private = private;
/* initialize done to 1 so as not to call the handler if it's created
* by the call of another one that is in progress
*/
g->notifiers[g->notifiers_count].done = 1;
-
g->notifiers_count++;
-
gunlock(g);
-
return ret;
}
-void unregister_notifier(gui *_g, unsigned long notifier_id)
-{
+void unregister_notifier(gui *_g, unsigned long notifier_id) {
struct gui *g = _g;
int i;
-
glock(g);
for (i = 0; i < g->notifiers_count; i++)
if (g->notifiers[i].id == notifier_id) break;
if (i == g->notifiers_count)
- ERR("%s:%d: notifier_id %ld not found\n", __FILE__,__LINE__,notifier_id);
+ ERR("%s:%d: notifier_id %lu not found\n", __FILE__,__LINE__,notifier_id);
free(g->notifiers[i].notification);
-
memmove(g->notifiers + i, g->notifiers + i + 1,
- (g->notifiers_count-1 - i) * sizeof(struct notifier));
-
+ (g->notifiers_count-1 - i) * sizeof(struct notifier));
g->notifiers_count--;
g->notifiers = realloc(g->notifiers,
- g->notifiers_count * sizeof(struct notifier));
+ g->notifiers_count * sizeof(struct notifier));
+
if (g->notifiers == NULL) abort();
gunlock(g);
@@ -68,19 +62,19 @@ void unregister_notifier(gui *_g, unsigned long notifier_id)
/* called with lock ON */
void gui_notify(struct gui *g, char *notification, widget *w,
- void *notification_data)
-{
+ void *notification_data) {
void *private;
notifier handler;
int i;
-
/* this function is not re-entrant, for the moment keep as is
* and if the need is there, we'll make a new thread to handle
* notifications (or something)
* for now let's crash in case of recursive call
*/
static int inside = 0;
+
if (inside) ERR("%s:%d: BUG! contact the authors\n", __FILE__, __LINE__);
+
inside = 1;
/* clear all handlers */
@@ -91,26 +85,25 @@ void gui_notify(struct gui *g, char *notification, widget *w,
* need to be careful here
*/
loop:
+
for (i = 0; i < g->notifiers_count; i++) {
if (g->notifiers[i].done == 1 ||
g->notifiers[i].w != w ||
strcmp(g->notifiers[i].notification, notification) != 0)
continue;
+
break;
}
+
if (i == g->notifiers_count) goto done;
g->notifiers[i].done = 1;
-
handler = g->notifiers[i].handler;
private = g->notifiers[i].private;
-
gunlock(g);
handler(private, g, notification, w, notification_data);
glock(g);
-
goto loop;
-
done:
inside = 0;
}
diff --git a/common/utils/T/tracer/hacks/Makefile b/common/utils/T/tracer/hacks/Makefile
index f49e437bf5..af2663e48f 100644
--- a/common/utils/T/tracer/hacks/Makefile
+++ b/common/utils/T/tracer/hacks/Makefile
@@ -3,7 +3,7 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I..
LIBS=-lX11 -lm -lpng -lXft
-all: dump_nack_signal time_meas timeplot
+all: dump_nack_signal time_meas timeplot multi-rru-clean
dump_nack_signal: ../utils.o ../database.o ../config.o ../event.o \
dump_nack_signal.o
@@ -16,6 +16,9 @@ time_meas: ../utils.o ../database.o ../config.o ../event.o \
timplot: timeplot.o
$(CC) $(CFLAGS) -o timeplot $^ $(LIBS)
+multi-rru-clean: ../utils.o ../database.o ../event.o ../config.o multi-rru-clean.o
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+
.PHONY: all
%.o: %.c
diff --git a/common/utils/T/tracer/hacks/dump_nack_signal.c b/common/utils/T/tracer/hacks/dump_nack_signal.c
index bb8f1a9477..02825202fb 100644
--- a/common/utils/T/tracer/hacks/dump_nack_signal.c
+++ b/common/utils/T/tracer/hacks/dump_nack_signal.c
@@ -7,21 +7,19 @@
#include "config.h"
#include "../T_defs.h"
-void usage(void)
-{
+void usage(void) {
printf(
-"options:\n"
-" -d this option is mandatory\n"
-" -ip connect to given IP address (default %s)\n"
-" -p connect to given port (default %d)\n",
- DEFAULT_REMOTE_IP,
- DEFAULT_REMOTE_PORT
+ "options:\n"
+ " -d this option is mandatory\n"
+ " -ip connect to given IP address (default %s)\n"
+ " -p connect to given port (default %d)\n",
+ DEFAULT_REMOTE_IP,
+ DEFAULT_REMOTE_PORT
);
exit(1);
}
-int main(int n, char **v)
-{
+int main(int n, char **v) {
char *database_filename = NULL;
void *database;
char *ip = DEFAULT_REMOTE_IP;
@@ -36,11 +34,28 @@ int main(int n, char **v)
for (i = 1; i < n; i++) {
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
- if (!strcmp(v[i], "-d"))
- { if (i > n-2) usage(); database_filename = v[++i]; continue; }
- if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
- if (!strcmp(v[i], "-p"))
- { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
+
+ if (!strcmp(v[i], "-d")) {
+ if (i > n-2) usage();
+
+ database_filename = v[++i];
+ continue;
+ }
+
+ if (!strcmp(v[i], "-ip")) {
+ if (i > n-2) usage();
+
+ ip = v[++i];
+ continue;
+ }
+
+ if (!strcmp(v[i], "-p")) {
+ if (i > n-2) usage();
+
+ port = atoi(v[++i]);
+ continue;
+ }
+
usage();
}
@@ -50,71 +65,92 @@ int main(int n, char **v)
}
database = parse_database(database_filename);
-
load_config_file(database_filename);
-
number_of_events = number_of_ids(database);
is_on = calloc(number_of_events, sizeof(int));
+
if (is_on == NULL) abort();
on_off(database, "ENB_PHY_INPUT_SIGNAL", is_on, 1);
on_off(database, "ENB_PHY_ULSCH_UE_NACK", is_on, 1);
on_off(database, "ENB_PHY_ULSCH_UE_ACK", is_on, 1);
-
ev_input = event_id_from_name(database, "ENB_PHY_INPUT_SIGNAL");
ev_nack = event_id_from_name(database, "ENB_PHY_ULSCH_UE_NACK");
ev_ack = event_id_from_name(database, "ENB_PHY_ULSCH_UE_ACK");
-
socket = connect_to(ip, port);
-
t = 1;
+
if (socket_send(socket, &t, 1) == -1 ||
socket_send(socket, &number_of_events, sizeof(int)) == -1 ||
socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
abort();
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
-
char dump[10][T_BUFFER_MAX];
event dump_ev[10];
-FILE *z = fopen("/tmp/dd", "w"); if (z == NULL) abort();
+ FILE *z = fopen("/tmp/dd", "w");
+
+ if (z == NULL) abort();
+
while (1) {
char *v;
event e;
e = get_event(socket, &ebuf, database);
v = ebuf.obuf;
+
if (e.type == -1) break;
+
if (e.type == ev_input) {
int sf = e.e[2].i;
- if (ebuf.osize > T_BUFFER_MAX)
- { printf("event size too big\n"); exit(1); }
+
+ if (ebuf.osize > T_BUFFER_MAX) {
+ printf("event size too big\n");
+ exit(1);
+ }
+
memcpy(dump[sf], ebuf.obuf, ebuf.osize);
dump_ev[sf] = e;
printf("input %d/%d\n", e.e[1].i, sf);
-if (fwrite(dump_ev[sf].e[4].b, dump_ev[sf].e[4].bsize, 1, z) != 1) abort();
-fflush(z);
+
+ if (fwrite(dump_ev[sf].e[4].b, dump_ev[sf].e[4].bsize, 1, z) != 1) abort();
+
+ fflush(z);
}
+
if (e.type == ev_nack) {
int sf = e.e[2].i;
printf("nack %d/%d\n", e.e[1].i, sf);
- FILE *f = fopen("/tmp/dump.raw", "w"); if (f == NULL) abort();
+ FILE *f = fopen("/tmp/dump.raw", "w");
+
+ if (f == NULL) abort();
+
if (fwrite(dump[sf] + ((char *)dump_ev[sf].e[4].b - v),
- dump_ev[sf].e[4].bsize, 1, f) != 1) abort();
+ dump_ev[sf].e[4].bsize, 1, f) != 1) abort();
+
if (fclose(f)) abort();
+
printf("dumped... press enter (delta %d)\n", (int)((char *)dump_ev[sf].e[4].b - v));
-// getchar();
+ // getchar();
}
+
if (e.type == ev_ack) {
int sf = e.e[2].i;
printf("ack %d/%d\n", e.e[1].i, sf);
- FILE *f = fopen("/tmp/dump.raw", "w"); if (f == NULL) abort();
+ FILE *f = fopen("/tmp/dump.raw", "w");
+
+ if (f == NULL) abort();
+
if (fwrite(dump[sf] + ((char *)dump_ev[sf].e[4].b - v),
- dump_ev[sf].e[4].bsize, 1, f) != 1) abort();
+ dump_ev[sf].e[4].bsize, 1, f) != 1) abort();
+
if (fclose(f)) abort();
+
printf("dumped... press enter (delta %d)\n", (int)((char *)dump_ev[sf].e[4].b - v));
-// getchar();
+ // getchar();
}
}
+ if (z)
+ fclose(z);
return 0;
}
diff --git a/common/utils/T/tracer/hacks/multi-rru-clean.c b/common/utils/T/tracer/hacks/multi-rru-clean.c
new file mode 100644
index 0000000000..c85dc0de7f
--- /dev/null
+++ b/common/utils/T/tracer/hacks/multi-rru-clean.c
@@ -0,0 +1,230 @@
+#include
+#include
+#include
+#include "database.h"
+#include "utils.h"
+#include "event.h"
+#include "../T_defs.h"
+
+void usage(void)
+{
+ printf(
+ "usage: