Commit e1d40791 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'develop_integration_2019_w10' into 'develop'

Develop integration 2019 week 10

See merge request oai/openairinterface5g!534
parents ea0e313f a299d6e2
...@@ -329,10 +329,11 @@ pipeline { ...@@ -329,10 +329,11 @@ pipeline {
stage ("Test physical simulators") { stage ("Test physical simulators") {
steps { steps {
script { script {
gitlabCommitStatus(name: "Test phy-sim") {
timeout (time: 20, unit: 'MINUTES') { timeout (time: 20, unit: 'MINUTES') {
try { try {
gitlabCommitStatus(name: "Test phy-sim") {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
} catch (Exception e) { } catch (Exception e) {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
} }
...@@ -340,7 +341,6 @@ pipeline { ...@@ -340,7 +341,6 @@ pipeline {
} }
} }
} }
}
stage ("Build Flexran Controller") { stage ("Build Flexran Controller") {
when { when {
expression {doFlexranCtrlTest} expression {doFlexranCtrlTest}
...@@ -360,10 +360,11 @@ pipeline { ...@@ -360,10 +360,11 @@ pipeline {
stage ("Test basic simulator") { stage ("Test basic simulator") {
steps { steps {
script { script {
gitlabCommitStatus(name: "Test basic-sim") {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
gitlabCommitStatus(name: "Test basic-sim") {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
} catch (Exception e) { } catch (Exception e) {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
} }
...@@ -371,14 +372,14 @@ pipeline { ...@@ -371,14 +372,14 @@ pipeline {
} }
} }
} }
}
stage ("Test L2 simulator") { stage ("Test L2 simulator") {
steps { steps {
script { script {
gitlabCommitStatus(name: "Test L2-sim") {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
gitlabCommitStatus(name: "Test L2-sim") {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
} catch (Exception e) { } catch (Exception e) {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
} }
...@@ -388,7 +389,6 @@ pipeline { ...@@ -388,7 +389,6 @@ pipeline {
} }
} }
} }
}
stage ("Test FDD - Band 7 - B210") { stage ("Test FDD - Band 7 - B210") {
steps { steps {
script { script {
......
...@@ -180,7 +180,7 @@ echo "Checking build status" ...@@ -180,7 +180,7 @@ echo "Checking build status"
echo "############################################################" echo "############################################################"
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=4 NB_PATTERN_FILES=7
LOG_FILES=`ls $ARCHIVES_LOC/*.txt` LOG_FILES=`ls $ARCHIVES_LOC/*.txt`
STATUS=0 STATUS=0
......
...@@ -408,6 +408,11 @@ class SSHConnection(): ...@@ -408,6 +408,11 @@ class SSHConnection():
self.command('echo $USER; nohup sudo tshark -f "host ' + self.eNBIPAddress +'" -i ' + eth_interface + ' -w /tmp/enb_' + self.testCase_id + '_s1log.pcap > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5) self.command('echo $USER; nohup sudo tshark -f "host ' + self.eNBIPAddress +'" -i ' + eth_interface + ' -w /tmp/enb_' + self.testCase_id + '_s1log.pcap > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5)
self.close() self.close()
self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 5)
result = re.search('type: b200', str(self.ssh.before))
if result is not None:
logging.debug('Found a B2xx device --> resetting it')
self.command('echo ' + self.eNBPassword + ' | sudo -S sudo b2xx_fx3_utils --reset-device', '\$', 5)
self.command('cd ' + self.eNBSourceCodePath, '\$', 5) self.command('cd ' + self.eNBSourceCodePath, '\$', 5)
# Initialize_eNB_args usually start with -O and followed by the location in repository # Initialize_eNB_args usually start with -O and followed by the location in repository
full_config_file = self.Initialize_eNB_args.replace('-O ','') full_config_file = self.Initialize_eNB_args.replace('-O ','')
......
...@@ -69,7 +69,7 @@ VM_MEMORY=2048 ...@@ -69,7 +69,7 @@ VM_MEMORY=2048
VM_CPU=4 VM_CPU=4
ARCHIVES_LOC=enb_usrp ARCHIVES_LOC=enb_usrp
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=4 NB_PATTERN_FILES=7
BUILD_OPTIONS="--eNB -w USRP" BUILD_OPTIONS="--eNB -w USRP"
KEEP_VM_ALIVE=0 KEEP_VM_ALIVE=0
RUN_OPTIONS="none" RUN_OPTIONS="none"
...@@ -231,7 +231,7 @@ case $key in ...@@ -231,7 +231,7 @@ case $key in
VM_NAME=ci-enb-usrp VM_NAME=ci-enb-usrp
ARCHIVES_LOC=enb_usrp ARCHIVES_LOC=enb_usrp
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=4 NB_PATTERN_FILES=7
BUILD_OPTIONS="--eNB -w USRP --mu" BUILD_OPTIONS="--eNB -w USRP --mu"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
shift shift
...@@ -272,7 +272,7 @@ case $key in ...@@ -272,7 +272,7 @@ case $key in
VM_NAME=ci-enb-ethernet VM_NAME=ci-enb-ethernet
ARCHIVES_LOC=enb_eth ARCHIVES_LOC=enb_eth
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=6 NB_PATTERN_FILES=8
BUILD_OPTIONS="--eNB -t ETHERNET --noS1" BUILD_OPTIONS="--eNB -t ETHERNET --noS1"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
shift shift
...@@ -281,7 +281,7 @@ case $key in ...@@ -281,7 +281,7 @@ case $key in
VM_NAME=ci-ue-ethernet VM_NAME=ci-ue-ethernet
ARCHIVES_LOC=ue_eth ARCHIVES_LOC=ue_eth
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=6 NB_PATTERN_FILES=8
BUILD_OPTIONS="--UE -t ETHERNET --noS1" BUILD_OPTIONS="--UE -t ETHERNET --noS1"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
shift shift
...@@ -292,7 +292,7 @@ case $key in ...@@ -292,7 +292,7 @@ case $key in
VM_CPU=8 VM_CPU=8
ARCHIVES_LOC=l2_sim ARCHIVES_LOC=l2_sim
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=4 NB_PATTERN_FILES=6
BUILD_OPTIONS="--eNB -t ETHERNET" BUILD_OPTIONS="--eNB -t ETHERNET"
RUN_OPTIONS="complex" RUN_OPTIONS="complex"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
...@@ -314,7 +314,7 @@ case $key in ...@@ -314,7 +314,7 @@ case $key in
VM_NAME=ci-enb-usrp VM_NAME=ci-enb-usrp
ARCHIVES_LOC=enb_usrp ARCHIVES_LOC=enb_usrp
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=4 NB_PATTERN_FILES=7
BUILD_OPTIONS="--eNB -w USRP --mu" BUILD_OPTIONS="--eNB -w USRP --mu"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
;; ;;
...@@ -351,7 +351,7 @@ case $key in ...@@ -351,7 +351,7 @@ case $key in
VM_NAME=ci-enb-ethernet VM_NAME=ci-enb-ethernet
ARCHIVES_LOC=enb_eth ARCHIVES_LOC=enb_eth
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=6 NB_PATTERN_FILES=8
BUILD_OPTIONS="--eNB -t ETHERNET --noS1" BUILD_OPTIONS="--eNB -t ETHERNET --noS1"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
;; ;;
...@@ -359,7 +359,7 @@ case $key in ...@@ -359,7 +359,7 @@ case $key in
VM_NAME=ci-ue-ethernet VM_NAME=ci-ue-ethernet
ARCHIVES_LOC=ue_eth ARCHIVES_LOC=ue_eth
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=6 NB_PATTERN_FILES=8
BUILD_OPTIONS="--UE -t ETHERNET --noS1" BUILD_OPTIONS="--UE -t ETHERNET --noS1"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
;; ;;
...@@ -369,7 +369,7 @@ case $key in ...@@ -369,7 +369,7 @@ case $key in
VM_CPU=8 VM_CPU=8
ARCHIVES_LOC=l2_sim ARCHIVES_LOC=l2_sim
LOG_PATTERN=.Rel14.txt LOG_PATTERN=.Rel14.txt
NB_PATTERN_FILES=4 NB_PATTERN_FILES=6
BUILD_OPTIONS="--eNB -t ETHERNET" BUILD_OPTIONS="--eNB -t ETHERNET"
RUN_OPTIONS="complex" RUN_OPTIONS="complex"
NBARGS=$[$NBARGS+256] NBARGS=$[$NBARGS+256]
...@@ -510,13 +510,16 @@ else ...@@ -510,13 +510,16 @@ else
fi fi
fi fi
# Checking uvt-kvm is installed if [ $REPORT_BUILD_CMD -ne 1 ] && [ $REPORT_TEST_CMD -ne 1 ]
UVT_KVM_PATH=`which uvt-kvm | grep -c uvt-kvm`
if [ $UVT_KVM_PATH -eq 0 ]
then then
# Checking uvt-kvm is installed
UVT_KVM_PATH=`which uvt-kvm | grep -c uvt-kvm`
if [ $UVT_KVM_PATH -eq 0 ]
then
echo "Error: uvt-kvm is not installed" echo "Error: uvt-kvm is not installed"
top_usage top_usage
exit 1 exit 1
fi
fi fi
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ]
......
...@@ -561,7 +561,8 @@ function report_build { ...@@ -561,7 +561,8 @@ function report_build {
summary_table_row "LTE SoftModem - Release 14" ./archives/enb_usrp/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_row1.html summary_table_row "LTE SoftModem - Release 14" ./archives/enb_usrp/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_row1.html
summary_table_row "Coding - Release 14" ./archives/enb_usrp/coding.Rel14.txt "Built target coding" ./enb_usrp_row2.html summary_table_row "Coding - Release 14" ./archives/enb_usrp/coding.Rel14.txt "Built target coding" ./enb_usrp_row2.html
summary_table_row "OAI USRP device if - Release 14" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html summary_table_row "OAI USRP device if - Release 14" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html
summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_row4.html summary_table_row "OAI ETHERNET transport - Release 14" ./archives/enb_usrp/oai_eth_transpro.Rel14.txt "Built target oai_eth_transpro" ./enb_usrp_row4.html
summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_row5.html
summary_table_footer summary_table_footer
summary_table_header "OAI Build basic simulator option" ./archives/basic_sim summary_table_header "OAI Build basic simulator option" ./archives/basic_sim
...@@ -604,6 +605,8 @@ function report_build { ...@@ -604,6 +605,8 @@ function report_build {
summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_eth/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_eth_row4.html summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_eth/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_eth_row4.html
summary_table_row "RB Tools - Release 14" ./archives/enb_eth/rb_tool.Rel14.txt "Built target rb_tool" ./enb_eth_row5.html summary_table_row "RB Tools - Release 14" ./archives/enb_eth/rb_tool.Rel14.txt "Built target rb_tool" ./enb_eth_row5.html
summary_table_row "NAS Mesh - Release 14" ./archives/enb_eth/nasmesh.Rel14.txt "Built target nasmesh" ./enb_eth_row6.html summary_table_row "NAS Mesh - Release 14" ./archives/enb_eth/nasmesh.Rel14.txt "Built target nasmesh" ./enb_eth_row6.html
summary_table_row "RF Simulator - Release 14" ./archives/enb_eth/rfsimulator.Rel14.txt "Built target rfsimulator" ./enb_eth_row7.html
summary_table_row "TCP OAI Bridge - Release 14" ./archives/enb_eth/tcp_bridge_oai.Rel14.txt "Built target tcp_bridge_oai" ./enb_eth_row8.html
summary_table_footer summary_table_footer
summary_table_header "OAI Build UE -- ETHERNET transport option" ./archives/ue_eth summary_table_header "OAI Build UE -- ETHERNET transport option" ./archives/ue_eth
...@@ -613,6 +616,8 @@ function report_build { ...@@ -613,6 +616,8 @@ function report_build {
summary_table_row "Parameters Lib Config - Release 14" ./archives/ue_eth/params_libconfig.Rel14.txt "Built target params_libconfig" ./ue_eth_row4.html summary_table_row "Parameters Lib Config - Release 14" ./archives/ue_eth/params_libconfig.Rel14.txt "Built target params_libconfig" ./ue_eth_row4.html
summary_table_row "RB Tools - Release 14" ./archives/ue_eth/rb_tool.Rel14.txt "Built target rb_tool" ./ue_eth_row5.html summary_table_row "RB Tools - Release 14" ./archives/ue_eth/rb_tool.Rel14.txt "Built target rb_tool" ./ue_eth_row5.html
summary_table_row "NAS Mesh - Release 14" ./archives/ue_eth/nasmesh.Rel14.txt "Built target nasmesh" ./ue_eth_row6.html summary_table_row "NAS Mesh - Release 14" ./archives/ue_eth/nasmesh.Rel14.txt "Built target nasmesh" ./ue_eth_row6.html
summary_table_row "RF Simulator - Release 14" ./archives/ue_eth/rfsimulator.Rel14.txt "Built target rfsimulator" ./ue_eth_row7.html
summary_table_row "TCP OAI Bridge - Release 14" ./archives/ue_eth/tcp_bridge_oai.Rel14.txt "Built target tcp_bridge_oai" ./ue_eth_row8.html
summary_table_footer summary_table_footer
if [ -e ./archives/red_hat ] if [ -e ./archives/red_hat ]
...@@ -623,7 +628,8 @@ function report_build { ...@@ -623,7 +628,8 @@ function report_build {
summary_table_row "LTE SoftModem - Release 14" ./archives/red_hat/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_rh_row1.html summary_table_row "LTE SoftModem - Release 14" ./archives/red_hat/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_rh_row1.html
summary_table_row "Coding - Release 14" ./archives/red_hat/coding.Rel14.txt "Built target coding" ./enb_usrp_rh_row2.html summary_table_row "Coding - Release 14" ./archives/red_hat/coding.Rel14.txt "Built target coding" ./enb_usrp_rh_row2.html
summary_table_row "OAI USRP device if - Release 14" ./archives/red_hat/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_rh_row3.html summary_table_row "OAI USRP device if - Release 14" ./archives/red_hat/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_rh_row3.html
summary_table_row "Parameters Lib Config - Release 14" ./archives/red_hat/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_rh_row4.html summary_table_row "OAI ETHERNET transport - Release 14" ./archives/red_hat/oai_eth_transpro.Rel14.txt "Built target oai_eth_transpro" ./enb_usrp_rh_row4.html
summary_table_row "Parameters Lib Config - Release 14" ./archives/red_hat/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_rh_row5.html
summary_table_footer summary_table_footer
fi fi
......
...@@ -377,7 +377,7 @@ function report_test { ...@@ -377,7 +377,7 @@ function report_test {
fi fi
PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` 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}'` 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 then
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
else else
......
This diff is collapsed.
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<class>Ping</class> <class>Ping</class>
<desc>ping (5MHz - 20 sec)</desc> <desc>ping (5MHz - 20 sec)</desc>
<ping_args>-c 20</ping_args> <ping_args>-c 20</ping_args>
<ping_packetloss_threshold>25</ping_packetloss_threshold> <ping_packetloss_threshold>50</ping_packetloss_threshold>
</testCase> </testCase>
<testCase id="040601"> <testCase id="040601">
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<class>Iperf</class> <class>Iperf</class>
<desc>iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced)</desc> <desc>iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced)</desc>
<iperf_args>-u -b 2M -t 30 -i 1 -R</iperf_args> <iperf_args>-u -b 2M -t 30 -i 1 -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_packetloss_threshold>80</iperf_packetloss_threshold>
<iperf_profile>unbalanced</iperf_profile> <iperf_profile>unbalanced</iperf_profile>
</testCase> </testCase>
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<class>Ping</class> <class>Ping</class>
<desc>ping (5MHz - 20 sec)</desc> <desc>ping (5MHz - 20 sec)</desc>
<ping_args>-c 20</ping_args> <ping_args>-c 20</ping_args>
<ping_packetloss_threshold>25</ping_packetloss_threshold> <ping_packetloss_threshold>50</ping_packetloss_threshold>
</testCase> </testCase>
<testCase id="040602"> <testCase id="040602">
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# Author: laurent THOMAS, Lionel GAUTHIER # Author: laurent THOMAS, Lionel GAUTHIER
cmake_minimum_required (VERSION 2.8) cmake_minimum_required (VERSION 3.0)
############################################# #############################################
# Base directories, compatible with legacy OAI building # Base directories, compatible with legacy OAI building
...@@ -169,11 +169,12 @@ endif() ...@@ -169,11 +169,12 @@ endif()
set(CMAKE_C_FLAGS 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 ") "${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! # add autotools definitions that were maybe used!
set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'")
set(CMAKE_C_FLAGS 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 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") add_definitions("-DASN_DISABLE_OER_SUPPORT")
...@@ -469,6 +470,7 @@ add_library(X2AP_ENB ...@@ -469,6 +470,7 @@ add_library(X2AP_ENB
${X2AP_DIR}/x2ap_eNB_itti_messaging.c ${X2AP_DIR}/x2ap_eNB_itti_messaging.c
${X2AP_DIR}/x2ap_eNB_management_procedures.c ${X2AP_DIR}/x2ap_eNB_management_procedures.c
${X2AP_DIR}/x2ap_eNB_generate_messages.c ${X2AP_DIR}/x2ap_eNB_generate_messages.c
${X2AP_DIR}/x2ap_ids.c
) )
add_dependencies(X2AP_ENB rrc_flag x2_flag) add_dependencies(X2AP_ENB rrc_flag x2_flag)
...@@ -477,7 +479,8 @@ add_dependencies(X2AP_ENB rrc_flag x2_flag) ...@@ -477,7 +479,8 @@ add_dependencies(X2AP_ENB rrc_flag x2_flag)
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4") 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_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") add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement #NOKIA config enhancement
...@@ -585,6 +588,8 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE ...@@ -585,6 +588,8 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE
add_library(tcp_bridge_oai MODULE ${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") 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") include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
...@@ -1283,7 +1288,7 @@ set(L2_SRC ...@@ -1283,7 +1288,7 @@ set(L2_SRC
${RLC_DIR}/rlc.c ${RLC_DIR}/rlc.c
${RLC_DIR}/rlc_rrc.c ${RLC_DIR}/rlc_rrc.c
${RLC_DIR}/rlc_mpls.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.c
${RRC_DIR}/rrc_eNB_S1AP.c ${RRC_DIR}/rrc_eNB_S1AP.c
${RRC_DIR}/rrc_eNB_UE_context.c ${RRC_DIR}/rrc_eNB_UE_context.c
...@@ -1949,6 +1954,8 @@ add_executable(lte-softmodem ...@@ -1949,6 +1954,8 @@ add_executable(lte-softmodem
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.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/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
......
This diff is collapsed.
...@@ -289,7 +289,7 @@ void usage(void) { ...@@ -289,7 +289,7 @@ void usage(void) {
" -max-sib <n> report at maximum n SIBs\n" " -max-sib <n> report at maximum n SIBs\n"
" -live run live\n" " -live run live\n"
" -live-ip <IP address> tracee's IP address (default %s)\n" " -live-ip <IP address> tracee's IP address (default %s)\n"
" -live-port <por> tracee's port (default %d)\n" " -live-port <port> tracee's port (default %d)\n"
"-i and -live are mutually exclusive options. One of them must be provided\n" "-i and -live are mutually exclusive options. One of them must be provided\n"
"but not both.\n", "but not both.\n",
DEFAULT_IP, DEFAULT_IP,
......
...@@ -77,17 +77,17 @@ paramdef_t telnetoptions[] = { ...@@ -77,17 +77,17 @@ paramdef_t telnetoptions[] = {
/* configuration parameters for telnet utility */ /* configuration parameters for telnet utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
{"listenaddr", "<listen ip address>", 0, uptr:&telnetparams.listenaddr, defstrval:"0.0.0.0", TYPE_IPV4ADDR, 0 }, {"listenaddr", "<listen ip address>\n", 0, uptr:&telnetparams.listenaddr, defstrval:"0.0.0.0", TYPE_IPV4ADDR, 0 },
{"listenport", "<local port>", 0, uptr:&(telnetparams.listenport), defuintval:9090, TYPE_UINT, 0 }, {"listenport", "<local port>\n", 0, uptr:&(telnetparams.listenport), defuintval:9090, TYPE_UINT, 0 },
{"priority", "<scheduling policy (0-99)", 0, iptr:&telnetparams.priority, defuintval:0, TYPE_INT, 0 }, {"priority", "<scheduling policy (0-99)\n", 0, iptr:&telnetparams.priority, defuintval:0, TYPE_INT, 0 },
{"debug", "<debug level>", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0 }, {"debug", "<debug level>\n", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0 },
{"loopcount", "<loop command iterations>", 0, uptr:&(telnetparams.loopcount), defuintval:10, TYPE_UINT, 0 }, {"loopcount", "<loop command iterations>\n", 0, uptr:&(telnetparams.loopcount), defuintval:10, TYPE_UINT, 0 },
{"loopdelay", "<loop command delay (ms)>", 0, uptr:&(telnetparams.loopdelay), defuintval:5000, TYPE_UINT, 0 }, {"loopdelay", "<loop command delay (ms)>\n", 0, uptr:&(telnetparams.loopdelay), defuintval:5000, TYPE_UINT, 0 },
{"histfile", "<history file name>", PARAMFLAG_NOFREE, strptr:&(telnetparams.histfile), defstrval:"oaitelnet.history", TYPE_STRING, 0 }, {"histfile", "<history file name>\n", PARAMFLAG_NOFREE, strptr:&(telnetparams.histfile), defstrval:"oaitelnet.history", TYPE_STRING, 0 },
{"histsize", "<history sizes>", 0, iptr:&(telnetparams.histsize), defuintval:50, TYPE_INT, 0 }, {"histsize", "<history sizes>\n", 0, iptr:&(telnetparams.histsize), defuintval:50, TYPE_INT, 0 },
{"phypbsize", "<phy dump buff size (bytes)>",0, uptr:&(telnetparams.phyprntbuff_size),defuintval:65000, TYPE_UINT, 0 }, {"phypbsize", "<phy dump buff size (bytes)>\n",0, uptr:&(telnetparams.phyprntbuff_size),defuintval:65000, TYPE_UINT, 0 },
{"staticmod", "<static modules selection>", 0, strlistptr:NULL, defstrlistval:telnet_defstatmod,TYPE_STRINGLIST,(sizeof(telnet_defstatmod)/sizeof(char *))}, {"staticmod", "<static modules selection>\n", 0, strlistptr:NULL, defstrlistval:telnet_defstatmod,TYPE_STRINGLIST,(sizeof(telnet_defstatmod)/sizeof(char *))},
{"shrmod", "<dynamic modules selection>", 0, strlistptr:NULL, defstrlistval:NULL,TYPE_STRINGLIST,0 } {"shrmod", "<dynamic modules selection>\n", 0, strlistptr:NULL, defstrlistval:NULL,TYPE_STRINGLIST,0 }
}; };
int get_phybsize(void) { int get_phybsize(void) {
...@@ -355,7 +355,7 @@ int setgetvar(int moduleindex,char getorset,char *params) { ...@@ -355,7 +355,7 @@ int setgetvar(int moduleindex,char getorset,char *params) {
char varname[TELNET_CMD_MAXSIZE]; char varname[TELNET_CMD_MAXSIZE];
char *varval=NULL; char *varval=NULL;
memset(varname,0,sizeof(varname)); memset(varname,0,sizeof(varname));
n = sscanf(params,"%19s %ms",varname,&varval); n = sscanf(params,"%9s %ms",varname,&varval);
for ( i=0 ; telnetparams.CmdParsers[moduleindex].var[i].varvalptr != NULL ; i++) { for ( i=0 ; telnetparams.CmdParsers[moduleindex].var[i].varvalptr != NULL ; i++) {
if ( strncasecmp(telnetparams.CmdParsers[moduleindex].var[i].varname,varname,strlen(telnetparams.CmdParsers[moduleindex].var[i].varname)) == 0) { if ( strncasecmp(telnetparams.CmdParsers[moduleindex].var[i].varname,varname,strlen(telnetparams.CmdParsers[moduleindex].var[i].varname)) == 0) {
...@@ -475,7 +475,7 @@ int process_command(char *buf) { ...@@ -475,7 +475,7 @@ int process_command(char *buf) {
memset(cmdb,0,sizeof(cmdb)); memset(cmdb,0,sizeof(cmdb));
bufbck=strdup(buf); bufbck=strdup(buf);
rt=CMDSTATUS_NOTFOUND; rt=CMDSTATUS_NOTFOUND;
j = sscanf(buf,"%9s %9s %2000[^\t\n]",modulename,cmd,cmdb); j = sscanf(buf,"%9s %9s %9[^\t\n]",modulename,cmd,cmdb);
if (telnetparams.telnetdbg > 0) if (telnetparams.telnetdbg > 0)
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb); printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb);
......
/*
* 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/utils/telnetsrv/telnetsrv_ltemeasur_def.h
* \brief: definitions of macro used to initialize the telnet_ltemeasurdef_t
* \ strucures arrays which are then used by the display functions
* \ in telnetsrv_measurements.c.
* \author Francois TABURET
* \date 2019
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define LTEMAC_MEASURE \
{ \
{"total_num_bcch_pdu", &(macstatptr->total_num_bcch_pdu),TELNET_VARTYPE_INT32,0},\
{"bcch_buffer", &(macstatptr->bcch_buffer),TELNET_VARTYPE_INT32,0},\
{"total_bcch_buffer", &(macstatptr->total_bcch_buffer),TELNET_VARTYPE_INT32,0},\
{"bcch_mcs", &(macstatptr->bcch_mcs),TELNET_VARTYPE_INT32,0},\
{"total_num_ccch_pdu", &(macstatptr->total_num_ccch_pdu),TELNET_VARTYPE_INT32,0},\
{"ccch_buffer", &(macstatptr->ccch_buffer),TELNET_VARTYPE_INT32,0},\
{"total_ccch_buffer", &(macstatptr->total_ccch_buffer),TELNET_VARTYPE_INT32,0},\
{"ccch_mcs", &(macstatptr->ccch_mcs),TELNET_VARTYPE_INT32,0},\
{"total_num_pcch_pdu", &(macstatptr->total_num_pcch_pdu),TELNET_VARTYPE_INT32,0},\
{"pcch_buffer", &(macstatptr->pcch_buffer),TELNET_VARTYPE_INT32,0},\
{"total_pcch_buffer", &(macstatptr->total_pcch_buffer),TELNET_VARTYPE_INT32,0},\
{"pcch_mcs", &(macstatptr->pcch_mcs),TELNET_VARTYPE_INT32,0},\
{"num_dlactive_UEs", &(macstatptr->num_dlactive_UEs),TELNET_VARTYPE_INT16,0},\
{"available_prbs", &(macstatptr->available_prbs),TELNET_VARTYPE_INT16,0},\
{"total_available_prbs", &(macstatptr->total_available_prbs),TELNET_VARTYPE_INT32,0},\
{"available_ncces", &(macstatptr->available_ncces),TELNET_VARTYPE_INT16,0},\
{"dlsch_bitrate", &(macstatptr->dlsch_bitrate),TELNET_VARTYPE_INT32,0},\
{"dlsch_bytes_tx", &(macstatptr->dlsch_bytes_tx),TELNET_VARTYPE_INT32,0},\
{"dlsch_pdus_tx", &(macstatptr->dlsch_pdus_tx),TELNET_VARTYPE_INT32,0},\
{"total_dlsch_bitrate", &(macstatptr->total_dlsch_bitrate),TELNET_VARTYPE_INT32,0},\
{"total_dlsch_bytes_tx", &(macstatptr->total_dlsch_bytes_tx),TELNET_VARTYPE_INT32,0},\
{"total_dlsch_pdus_tx", &(macstatptr->total_dlsch_pdus_tx),TELNET_VARTYPE_INT32,0},\
{"ulsch_bitrate", &(macstatptr->ulsch_bitrate),TELNET_VARTYPE_INT32,0},\
{"ulsch_bytes_rx", &(macstatptr->ulsch_bytes_rx),TELNET_VARTYPE_INT32,0},\
{"ulsch_pdus_rx", &(macstatptr->ulsch_pdus_rx),TELNET_VARTYPE_INT32,0},\
{"total_ulsch_bitrate", &(macstatptr->total_ulsch_bitrate),TELNET_VARTYPE_INT32,0},\
{"total_ulsch_bytes_rx", &(macstatptr->total_ulsch_bytes_rx),TELNET_VARTYPE_INT32,0},\
{"total_ulsch_pdus_rx", &(macstatptr->total_ulsch_pdus_rx),TELNET_VARTYPE_INT32,0},\
{"sched_decisions", &(macstatptr->sched_decisions),TELNET_VARTYPE_INT32,0},\
{"missed_deadlines", &(macstatptr->missed_deadlines),TELNET_VARTYPE_INT32,0},\
}
#define LTEMAC_UEMEASURE \
{ \
{"dlsch_mcs1", &(macuestatptr->dlsch_mcs1),TELNET_VARTYPE_INT8,0},\
{"dlsch_mcs2", &(macuestatptr->dlsch_mcs2),TELNET_VARTYPE_INT8,0},\
{"rbs_used", &(macuestatptr->rbs_used),TELNET_VARTYPE_INT32,0},\
{"rbs_used_retx", &(macuestatptr->rbs_used_retx),TELNET_VARTYPE_INT16,0},\
{"total_rbs_used", &(macuestatptr->total_rbs_used),TELNET_VARTYPE_INT16,0},\
{"ncce_used", &(macuestatptr->ncce_used),TELNET_VARTYPE_INT16,0},\
{"ncce_used_retx", &(macuestatptr->ncce_used_retx),TELNET_VARTYPE_INT16,0},\
{"TBS", &(macuestatptr->TBS),TELNET_VARTYPE_INT32,0},\
{"total_pdu_bytes", &(macuestatptr->total_pdu_bytes),TELNET_VARTYPE_INT64,0},\
{"total_num_pdus", &(macuestatptr->total_num_pdus),TELNET_VARTYPE_INT32,0},\
{"overhead_bytes", &(macuestatptr->overhead_bytes),TELNET_VARTYPE_INT64,0},\
{"crnti", &(macuestatptr->crnti),TELNET_VARTYPE_INT16,0},\
{"normalized_rx_power", &(macuestatptr->normalized_rx_power),TELNET_VARTYPE_INT32,0},\
{"target_rx_power", &(macuestatptr->target_rx_power),TELNET_VARTYPE_INT32,0},\
{"ulsch_mcs1", &(macuestatptr->ulsch_mcs1),TELNET_VARTYPE_INT8,0},\
{"ulsch_mcs2", &(macuestatptr->ulsch_mcs2),TELNET_VARTYPE_INT8,0},\
{"rbs_used_rx", &(macuestatptr->rbs_used_rx),TELNET_VARTYPE_INT32,0},\
{"rbs_used_retx_rx", &(macuestatptr->rbs_used_retx_rx),TELNET_VARTYPE_INT32,0},\
{"total_rbs_used_rx", &(macuestatptr->total_rbs_used_rx),TELNET_VARTYPE_INT32,0},\
{"ulsch_TBS", &(macuestatptr->ulsch_TBS),TELNET_VARTYPE_INT32,0},\
{"total_pdu_bytes_rx", &(macuestatptr->total_pdu_bytes_rx),TELNET_VARTYPE_INT64,0},\
{"total_num_pdus_rx", &(macuestatptr->total_num_pdus_rx),TELNET_VARTYPE_INT32,0},\
{"num_errors_rx", &(macuestatptr->num_errors_rx),TELNET_VARTYPE_INT32,0},\
}
#define LTE_RLCMEASURE \
{ \
{"rlc_mode", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_pdcp_sdu", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_pdcp_bytes", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_pdcp_sdu_discarded", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_pdcp_bytes_discarded", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_data_pdu", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_data_bytes", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_retransmit_pdu_by_status", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_retransmit_bytes_by_status", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_retransmit_pdu", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_retransmit_bytes", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_control_pdu", NULL, TELNET_VARTYPE_UINT, 0},\
{"tx_control_bytes", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_pdcp_sdu", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_pdcp_bytes", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_pdus_duplicate", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_bytes_duplicate", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_pdu", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_bytes", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_pdu_dropped", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_bytes_dropped", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_pdu_out_of_window", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_data_bytes_out_of_window", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_control_pdu", NULL, TELNET_VARTYPE_UINT, 0},\
{"rx_control_bytes", NULL, TELNET_VARTYPE_UINT, 0},\
{"timer_reorder_tout", NULL, TELNET_VARTYPE_UINT, 0},\
{"timer_poll_retrans_tout", NULL, TELNET_VARTYPE_UINT, 0},\
{"timer_status_prohibit_tout", NULL, TELNET_VARTYPE_UINT, 0},\
}
...@@ -39,74 +39,88 @@ ...@@ -39,74 +39,88 @@
#define TELNETSRV_PHYCMD_MAIN #define TELNETSRV_PHYCMD_MAIN
#include "telnetsrv_phycmd.h" #include "telnetsrv_phycmd.h"
char *prnbuff; char *prnbuff;
extern int dump_eNB_l2_stats(char *buffer, int length); extern int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length);
void init_phytelnet(void) { void init_phytelnet(void)
prnbuff=malloc(get_phybsize() ); {
prnbuff=malloc(get_phybsize() );
if (prnbuff == NULL) { if (prnbuff == NULL)
{
fprintf(stderr,"Error %s on malloc in init_phytelnet()\n",strerror(errno)); fprintf(stderr,"Error %s on malloc in init_phytelnet()\n",strerror(errno));
} }
} }
void display_uestatshead( telnet_printfunc_t prnt) { void display_uestatshead( telnet_printfunc_t prnt)
prnt("cc ue rnti Dmcs Umcs tao tau Dbr Dtb \n"); {
prnt("cc ue rnti Dmcs Umcs tao tau Dbr Dtb \n");
} }
void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) { void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag)
int p; {
prnbuff=malloc(20480);
p=dump_eNB_l2_stats( prnbuff, 20480); int p;
p=dump_eNB_l2_stats( prnbuff, 0);
if(prntflag>=1) if(prntflag>=1)
prnt("%s\n",prnbuff); prnt("%s\n",prnbuff);
if(debug>=1) if(debug>=1)
prnt("%i bytes printed\n",p); prnt("%i bytes printed\n",p);
free(prnbuff);
} }
void display_uestats(int debug, telnet_printfunc_t prnt, int ue) { void display_uestats(int debug, telnet_printfunc_t prnt, int ue)
for (int cc=0; cc<1 ; cc++) { {
for (int cc=0; cc<1 ; cc++)
{
} }
} }
void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) { void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt)
{
prnt(" DLSCH kb DLSCH kb/s\n"); prnt(" DLSCH kb DLSCH kb/s\n");
dump_uestats(debug, prnt,0); dump_uestats(debug, prnt,0);
} }
int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt) { int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt)
{
if (debug > 0) if (debug > 0)
prnt("phy interface module received %s\n",buf); prnt("phy interface module received %s\n",buf);
if (strcasestr(buf,"phycnt") != NULL)
if (strcasestr(buf,"phycnt") != NULL) { {
display_phycounters(buf, debug, prnt); display_phycounters(buf, debug, prnt);
} }
if (strcasestr(buf,"uestat") != NULL)
if (strcasestr(buf,"uestat") != NULL) { {
char *cptr=strcasestr(buf+sizeof("uestat"),"UE"); char *cptr=strcasestr(buf+sizeof("uestat"),"UE");
display_uestatshead(prnt); display_uestatshead(prnt);
if (cptr != NULL)
if (cptr != NULL) { {
int ueidx = strtol( cptr+sizeof("UE"), NULL, 10); int ueidx = strtol( cptr+sizeof("UE"), NULL, 10);
if (ueidx < NUMBER_OF_UE_MAX && ueidx >= 0)
if (ueidx < NUMBER_OF_UE_MAX && ueidx >= 0) { {
display_uestats(debug, prnt,ueidx); display_uestats(debug, prnt,ueidx);
} }
} /* if cptr != NULL */ } /* if cptr != NULL */
else { else
for (int ue=0; ue<NUMBER_OF_UE_MAX ; ue++) { {
for (int ue=0; ue<NUMBER_OF_UE_MAX ; ue++)
{
display_uestats(debug, prnt,ue); display_uestats(debug, prnt,ue);
} }
} /* else cptr != NULL */ } /* else cptr != NULL */
} /* uestat */ } /* uestat */
if (strcasestr(buf,"uedump") != NULL)
if (strcasestr(buf,"uedump") != NULL) { {
dump_uestats(debug, prnt,1); dump_uestats(debug, prnt,1);
} }
return 0; return 0;
} }
...@@ -120,7 +134,9 @@ telnetshell_cmddef_t phy_cmdarray[] = { ...@@ -120,7 +134,9 @@ telnetshell_cmddef_t phy_cmdarray[] = {
/*-------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------*/
void add_phy_cmds(void) { void add_phy_cmds(void)
{
init_phytelnet(); init_phytelnet();
add_telnetcmd("phy", phy_vardef, phy_cmdarray); add_telnetcmd("phy", phy_vardef, phy_cmdarray);
} }
...@@ -183,7 +183,7 @@ struct dirent *entry; ...@@ -183,7 +183,7 @@ struct dirent *entry;
{ {
if(entry->d_name[0] == '.') if(entry->d_name[0] == '.')
continue; continue;
snprintf(aname, sizeof(aname), "/proc/%d/task/%s/stat", getpid(),entry->d_name); snprintf(aname, sizeof(aname), "/proc/%d/task/%.*s/stat", getpid(),(int)(sizeof(aname)-24),entry->d_name);
read_statfile(aname,debug,prnt); read_statfile(aname,debug,prnt);
} /* while entry != NULL */ } /* while entry != NULL */
closedir(proc_dir); closedir(proc_dir);
......
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
#include "phy_init.h" #include "phy_init.h"
#include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "targets/RT/USER/lte-softmodem.h"
extern PHY_VARS_eNB *eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE; extern PHY_VARS_UE *UE;
extern RU_t *ru; extern RU_t *ru;
extern void phy_init_RU(RU_t*); extern void phy_init_RU(RU_t *);
void lte_param_init(PHY_VARS_eNB **eNBp, void lte_param_init(PHY_VARS_eNB **eNBp,
PHY_VARS_UE **UEp, PHY_VARS_UE **UEp,
...@@ -55,9 +55,7 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -55,9 +55,7 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
uint8_t pa, uint8_t pa,
uint8_t threequarter_fs, uint8_t threequarter_fs,
uint8_t osf, uint8_t osf,
uint32_t perfect_ce) uint32_t perfect_ce) {
{
LTE_DL_FRAME_PARMS *frame_parms; LTE_DL_FRAME_PARMS *frame_parms;
int i; int i;
PHY_VARS_eNB *eNB; PHY_VARS_eNB *eNB;
...@@ -71,23 +69,16 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -71,23 +69,16 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
UE = *UEp; UE = *UEp;
ru = *rup; ru = *rup;
printf("eNB %p, UE %p, ru %p\n",eNB,UE,ru); printf("eNB %p, UE %p, ru %p\n",eNB,UE,ru);
memset((void *)eNB,0,sizeof(PHY_VARS_eNB));
memset((void *)UE,0,sizeof(PHY_VARS_UE));
memset((void *)ru,0,sizeof(RU_t));
memset((void*)eNB,0,sizeof(PHY_VARS_eNB));
memset((void*)UE,0,sizeof(PHY_VARS_UE));
memset((void*)ru,0,sizeof(RU_t));
ru->eNB_list[0] = eNB; ru->eNB_list[0] = eNB;
eNB->RU_list[0] = ru; eNB->RU_list[0] = ru;
ru->num_eNB=1; ru->num_eNB=1;
srand(0); srand(0);
randominit(0); randominit(0);
set_taus_seed(0); set_taus_seed(0);
frame_parms = &(eNB->frame_parms); frame_parms = &(eNB->frame_parms);
frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
frame_parms->N_RB_UL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL;
frame_parms->threequarter_fs = threequarter_fs; frame_parms->threequarter_fs = threequarter_fs;
...@@ -106,13 +97,9 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -106,13 +97,9 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
// frame_parms->Bsrs = 0; // frame_parms->Bsrs = 0;
// frame_parms->kTC = 0;44 // frame_parms->kTC = 0;44
// frame_parms->n_RRC = 0; // frame_parms->n_RRC = 0;
init_frame_parms(frame_parms,osf); init_frame_parms(frame_parms,osf);
//copy_lte_parms_to_phy_framing(frame_parms, &(PHY_config->PHY_framing)); //copy_lte_parms_to_phy_framing(frame_parms, &(PHY_config->PHY_framing));
// phy_init_top(frame_parms); //allocation // phy_init_top(frame_parms); //allocation
UE->is_secondary_ue = 0; UE->is_secondary_ue = 0;
UE->frame_parms = *frame_parms; UE->frame_parms = *frame_parms;
UE->frame_parms.nb_antennas_rx=N_rx_ue; UE->frame_parms.nb_antennas_rx=N_rx_ue;
...@@ -121,14 +108,10 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -121,14 +108,10 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
ru->nb_tx = N_tx_phy; ru->nb_tx = N_tx_phy;
ru->nb_rx = N_rx_ru; ru->nb_rx = N_rx_ru;
ru->if_south = LOCAL_RF; ru->if_south = LOCAL_RF;
eNB->configured=1; eNB->configured=1;
eNB->transmission_mode[0] = transmission_mode; eNB->transmission_mode[0] = transmission_mode;
UE->transmission_mode[0] = transmission_mode; UE->transmission_mode[0] = transmission_mode;
dump_frame_parms(frame_parms); dump_frame_parms(frame_parms);
UE->measurements.n_adj_cells=0; UE->measurements.n_adj_cells=0;
UE->measurements.adj_cell_id[0] = Nid_cell+1; UE->measurements.adj_cell_id[0] = Nid_cell+1;
UE->measurements.adj_cell_id[1] = Nid_cell+2; UE->measurements.adj_cell_id[1] = Nid_cell+2;
...@@ -144,7 +127,6 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -144,7 +127,6 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
phy_init_RU(ru); phy_init_RU(ru);
generate_pcfich_reg_mapping(&UE->frame_parms); generate_pcfich_reg_mapping(&UE->frame_parms);
generate_phich_reg_mapping(&UE->frame_parms); generate_phich_reg_mapping(&UE->frame_parms);
// DL power control init // DL power control init
//if (transmission_mode == 1) { //if (transmission_mode == 1) {
UE->pdsch_config_dedicated->p_a = pa; UE->pdsch_config_dedicated->p_a = pa;
...@@ -166,17 +148,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -166,17 +148,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
if (eNB->frame_parms.N_RB_DL == 100) ru->N_TA_offset = 624; if (eNB->frame_parms.N_RB_DL == 100) ru->N_TA_offset = 624;
else if (eNB->frame_parms.N_RB_DL == 50) ru->N_TA_offset = 624/2; else if (eNB->frame_parms.N_RB_DL == 50) ru->N_TA_offset = 624/2;
else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4; else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4;
} } else ru->N_TA_offset=0;
else ru->N_TA_offset=0;
#if BASIC_SIMULATOR if (IS_SOFTMODEM_BASICSIM)
/* this is required for the basic simulator in TDD mode /* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution * TODO: find a proper cleaner solution
*/ */
UE->N_TA_offset = 0; UE->N_TA_offset = 0;
#endif
printf("Done lte_param_init\n"); printf("Done lte_param_init\n");
} }
This diff is collapsed.
...@@ -38,20 +38,17 @@ ...@@ -38,20 +38,17 @@
//#include "defs.h" //#include "defs.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
#include "targets/RT/USER/lte-softmodem.h"
int generate_pss(int32_t **txdataF, int generate_pss(int32_t **txdataF,
short amp, short amp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
unsigned short symbol, unsigned short symbol,
unsigned short slot_offset) unsigned short slot_offset) {
{
unsigned int Nsymb; unsigned int Nsymb;
unsigned short k,m,aa,a; unsigned short k,m,aa,a;
uint8_t Nid2; uint8_t Nid2;
short *primary_sync; short *primary_sync;
Nid2 = frame_parms->Nid_cell % 3; Nid2 = frame_parms->Nid_cell % 3;
switch (Nid2) { switch (Nid2) {
...@@ -75,35 +72,31 @@ int generate_pss(int32_t **txdataF, ...@@ -75,35 +72,31 @@ int generate_pss(int32_t **txdataF,
a = (frame_parms->nb_antenna_ports_eNB == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15; a = (frame_parms->nb_antenna_ports_eNB == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
//printf("[PSS] amp=%d, a=%d\n",amp,a); //printf("[PSS] amp=%d, a=%d\n",amp,a);
#if BASIC_SIMULATOR if (IS_SOFTMODEM_BASICSIM)
/* a hack to remove at some point (the UE doesn't synch with 100 RBs) */ /* a hack to remove at some point (the UE doesn't synch with 100 RBs) */
a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15; a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
#endif
Nsymb = (frame_parms->Ncp==NORMAL)?14:12; Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) { for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
// aa = 0; // aa = 0;
// The PSS occupies the inner 6 RBs, which start at // The PSS occupies the inner 6 RBs, which start at
k = frame_parms->ofdm_symbol_size-3*12+5; k = frame_parms->ofdm_symbol_size-3*12+5;
//printf("[PSS] k = %d\n",k); //printf("[PSS] k = %d\n",k);
for (m=5; m<67; m++) { for (m=5; m<67; m++) {
((short*)txdataF[aa])[2*(slot_offset*Nsymb/2*frame_parms->ofdm_symbol_size + ((short *)txdataF[aa])[2*(slot_offset*Nsymb/2*frame_parms->ofdm_symbol_size +
symbol*frame_parms->ofdm_symbol_size + k)] = symbol*frame_parms->ofdm_symbol_size + k)] =
(a * primary_sync[2*m]) >> 15; (a * primary_sync[2*m]) >> 15;
((short*)txdataF[aa])[2*(slot_offset*Nsymb/2*frame_parms->ofdm_symbol_size + ((short *)txdataF[aa])[2*(slot_offset*Nsymb/2*frame_parms->ofdm_symbol_size +
symbol*frame_parms->ofdm_symbol_size + k) + 1] = symbol*frame_parms->ofdm_symbol_size + k) + 1] =
(a * primary_sync[2*m+1]) >> 15; (a * primary_sync[2*m+1]) >> 15;
k+=1; k+=1;
if (k >= frame_parms->ofdm_symbol_size) { if (k >= frame_parms->ofdm_symbol_size) {
k++; //skip DC k++; //skip DC
k-=frame_parms->ofdm_symbol_size; k-=frame_parms->ofdm_symbol_size;
} }
} }
} }
......
...@@ -63,7 +63,6 @@ struct msghdr nas_msg_rx; ...@@ -63,7 +63,6 @@ struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31 #define GRAAL_NETLINK_ID 31
static int tun_alloc(char *dev) { static int tun_alloc(char *dev) {
struct ifreq ifr; struct ifreq ifr;
int fd, err; int fd, err;
...@@ -93,12 +92,12 @@ static int tun_alloc(char *dev) { ...@@ -93,12 +92,12 @@ static int tun_alloc(char *dev) {
return fd; return fd;
} }
int netlink_init_tun(void) { int netlink_init_tun(char *ifprefix) {
int ret; int ret;
char ifname[64]; char ifname[64];
for (int i = 0; i < NUMBER_OF_UE_MAX; i++) { for (int i = 0; i < NUMBER_OF_UE_MAX; i++) {
sprintf(ifname, "oaitun_ue%d",i+1); sprintf(ifname, "oaitun_%.3s%d",ifprefix,i+1);
nas_sock_fd[i] = tun_alloc(ifname); nas_sock_fd[i] = tun_alloc(ifname);
if (nas_sock_fd[i] == -1) { if (nas_sock_fd[i] == -1) {
......
...@@ -62,6 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag); ...@@ -62,6 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
void clear_eNB_transport_info(uint8_t); void clear_eNB_transport_info(uint8_t);
void clear_UE_transport_info(uint8_t); void clear_UE_transport_info(uint8_t);
int netlink_init(void); int netlink_init(void);
int netlink_init_tun(void); int netlink_init_tun(char *ifsuffix);
#endif /* EMU_PROTO_H_ */ #endif /* EMU_PROTO_H_ */
...@@ -783,12 +783,14 @@ int main(int argc, char **argv) { ...@@ -783,12 +783,14 @@ int main(int argc, char **argv) {
case 'u': case 'u':
dual_stream_UE=1; dual_stream_UE=1;
if (UE != NULL) if (UE != NULL)
UE->use_ia_receiver = 1; UE->use_ia_receiver = 1;
else { else {
printf("UE is NULL\n"); printf("UE is NULL\n");
exit(-1); exit(-1);
} }
if ((n_tx_port!=2) || (transmission_mode!=5)) { if ((n_tx_port!=2) || (transmission_mode!=5)) {
printf("IA receiver only supported for TM5!"); printf("IA receiver only supported for TM5!");
exit(-1); exit(-1);
...@@ -2139,5 +2141,7 @@ int main(int argc, char **argv) { ...@@ -2139,5 +2141,7 @@ int main(int argc, char **argv) {
else else
return(0); return(0);
} }
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
uint64_t get_softmodem_optmask(void) {
return 0;
}
...@@ -1211,9 +1211,7 @@ int main(int argc, char **argv) { ...@@ -1211,9 +1211,7 @@ int main(int argc, char **argv) {
} }
dump_ulsch(eNB,eNB->proc.frame_rx,subframe,0,round); dump_ulsch(eNB,eNB->proc.frame_rx,subframe,0,round);
round=5; round=5;
} }
if (n_frames==1) printf("round %d errors %u/%u\n",round,errs[round],trials); if (n_frames==1) printf("round %d errors %u/%u\n",round,errs[round],trials);
...@@ -1509,5 +1507,7 @@ int main(int argc, char **argv) { ...@@ -1509,5 +1507,7 @@ int main(int argc, char **argv) {
return(0); return(0);
} }
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
uint64_t get_softmodem_optmask(void) {
return 0;
}
...@@ -72,3 +72,6 @@ MESSAGE_DEF(NAS_CONN_ESTABLI_CNF, MESSAGE_PRIORITY_MED, NasConnEstab ...@@ -72,3 +72,6 @@ MESSAGE_DEF(NAS_CONN_ESTABLI_CNF, MESSAGE_PRIORITY_MED, NasConnEstab
MESSAGE_DEF(NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, NasConnReleaseInd, nas_conn_release_ind) MESSAGE_DEF(NAS_CONN_RELEASE_IND, MESSAGE_PRIORITY_MED, NasConnReleaseInd, nas_conn_release_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, NasUlDataCnf, nas_ul_data_cnf) MESSAGE_DEF(NAS_UPLINK_DATA_CNF, MESSAGE_PRIORITY_MED, NasUlDataCnf, nas_ul_data_cnf)
MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_data_ind) MESSAGE_DEF(NAS_DOWNLINK_DATA_IND, MESSAGE_PRIORITY_MED, NasDlDataInd, nas_dl_data_ind)
// eNB: realtime -> RRC messages
MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeProcess, rrc_subframe_process)
...@@ -81,6 +81,8 @@ ...@@ -81,6 +81,8 @@
#define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_cnf #define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_cnf
#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_ind #define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_ind
#define RRC_SUBFRAME_PROCESS(mSGpTR) (mSGpTR)->ittiMsg.rrc_subframe_process
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
typedef struct RrcStateInd_s { typedef struct RrcStateInd_s {
Rrc_State_t state; Rrc_State_t state;
...@@ -399,4 +401,10 @@ typedef nas_release_ind_t NasConnReleaseInd; ...@@ -399,4 +401,10 @@ typedef nas_release_ind_t NasConnReleaseInd;
typedef ul_info_transfer_cnf_t NasUlDataCnf; typedef ul_info_transfer_cnf_t NasUlDataCnf;
typedef dl_info_transfer_ind_t NasDlDataInd; typedef dl_info_transfer_ind_t NasDlDataInd;
// eNB: realtime -> RRC messages
typedef struct rrc_subframe_process_s {
protocol_ctxt_t ctxt;
int CC_id;
} RrcSubframeProcess;
#endif /* RRC_MESSAGES_TYPES_H_ */ #endif /* RRC_MESSAGES_TYPES_H_ */
...@@ -40,3 +40,6 @@ MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_der ...@@ -40,3 +40,6 @@ MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_der
/* handover messages X2AP <-> RRC */ /* handover messages X2AP <-> RRC */
MESSAGE_DEF(X2AP_HANDOVER_REQ , MESSAGE_PRIORITY_MED, x2ap_handover_req_t , x2ap_handover_req) MESSAGE_DEF(X2AP_HANDOVER_REQ , MESSAGE_PRIORITY_MED, x2ap_handover_req_t , x2ap_handover_req)
MESSAGE_DEF(X2AP_HANDOVER_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_handover_req_ack_t , x2ap_handover_req_ack) MESSAGE_DEF(X2AP_HANDOVER_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_handover_req_ack_t , x2ap_handover_req_ack)
/* handover messages X2AP <-> S1AP */
MESSAGE_DEF(X2AP_UE_CONTEXT_RELEASE , MESSAGE_PRIORITY_MED, x2ap_ue_context_release_t , x2ap_ue_context_release)
...@@ -33,11 +33,21 @@ ...@@ -33,11 +33,21 @@
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack #define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf #define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind #define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
#define X2AP_MAX_NB_ENB_IP_ADDRESS 2 #define X2AP_MAX_NB_ENB_IP_ADDRESS 2
// eNB application layer -> X2AP messages // eNB application layer -> X2AP messages
/* X2AP UE CONTEXT RELEASE */
typedef struct x2ap_ue_context_release_s {
/* used for X2AP->RRC in source and RRC->X2AP in target */
int rnti;
int source_assoc_id;
} x2ap_ue_context_release_t;
typedef struct x2ap_register_enb_req_s { typedef struct x2ap_register_enb_req_s {
/* Unique eNB_id to identify the eNB within EPC. /* Unique eNB_id to identify the eNB within EPC.
* For macro eNB ids this field should be 20 bits long. * For macro eNB ids this field should be 20 bits long.
...@@ -128,12 +138,12 @@ typedef struct x2ap_lastvisitedcell_info_s { ...@@ -128,12 +138,12 @@ typedef struct x2ap_lastvisitedcell_info_s {
uint64_t time_UE_StayedInCell; uint64_t time_UE_StayedInCell;
}x2ap_lastvisitedcell_info_t; }x2ap_lastvisitedcell_info_t;
//used for src
typedef struct x2ap_handover_req_s { typedef struct x2ap_handover_req_s {
int source_rnti; /* TODO: to be fixed/remove */ /* used for RRC->X2AP in source eNB */
int source_x2id; /* TODO: to be fixed/remove */ int rnti;
int old_eNB_ue_x2ap_id; /* used for X2AP->RRC in target eNB */
int x2_id;
LTE_PhysCellId_t target_physCellId; LTE_PhysCellId_t target_physCellId;
...@@ -167,15 +177,17 @@ typedef struct x2ap_handover_req_s { ...@@ -167,15 +177,17 @@ typedef struct x2ap_handover_req_s {
uint8_t rrc_buffer[1024 /* arbitrary, big enough */]; uint8_t rrc_buffer[1024 /* arbitrary, big enough */];
int rrc_buffer_size; int rrc_buffer_size;
/* TODO: this parameter has to be removed */ int target_assoc_id;
int target_mod_id;
} x2ap_handover_req_t; } x2ap_handover_req_t;
typedef struct x2ap_handover_req_ack_s { typedef struct x2ap_handover_req_ack_s {
int source_rnti; /* TODO: to be fixed/remove */ /* used for RRC->X2AP in target and X2AP->RRC in source */
int source_x2id; /* TODO: to be fixed/remove */ int rnti;
/* TODO: this parameter has to be removed */
int target_mod_id; /* used for RRC->X2AP in target */
int x2_id_target;
int source_assoc_id;
uint8_t nb_e_rabs_tobesetup; uint8_t nb_e_rabs_tobesetup;
......
...@@ -2043,7 +2043,9 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) { ...@@ -2043,7 +2043,9 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) { if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1; X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1;
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 0;
} else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) { } else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 0;
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 1; X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 1;
} else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "no") == 0) { } else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "no") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1; X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1;
......
...@@ -883,7 +883,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -883,7 +883,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
rntiP, -1 rntiP, -1
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
, ,
-1 0
#endif #endif
)) == -1) )) == -1)
{ {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include "targets/COMMON/openairinterface5g_limits.h" #include "targets/COMMON/openairinterface5g_limits.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h" #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "UTIL/OSA/osa_defs.h" #include "UTIL/OSA/osa_defs.h"
#include "openair2/RRC/NAS/nas_config.h"
# include "intertask_interface.h" # include "intertask_interface.h"
...@@ -440,7 +440,6 @@ pdcp_data_ind( ...@@ -440,7 +440,6 @@ pdcp_data_ind(
uint32_t rx_hfn_for_count; uint32_t rx_hfn_for_count;
int pdcp_sn_for_count; int pdcp_sn_for_count;
int security_ok; int security_ok;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_IN);
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)sdu_buffer_pP->data,sdu_buffer_sizeP, LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)sdu_buffer_pP->data,sdu_buffer_sizeP,
"[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP); "[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
...@@ -567,6 +566,7 @@ pdcp_data_ind( ...@@ -567,6 +566,7 @@ pdcp_data_ind(
} }
#if 0 #if 0
/* Removed by Cedric */ /* Removed by Cedric */
if (pdcp_is_rx_seq_number_valid(sequence_number, pdcp_p, srb_flagP) == TRUE) { if (pdcp_is_rx_seq_number_valid(sequence_number, pdcp_p, srb_flagP) == TRUE) {
LOG_T(PDCP, "Incoming PDU has a sequence number (%d) in accordance with RX window\n", sequence_number); LOG_T(PDCP, "Incoming PDU has a sequence number (%d) in accordance with RX window\n", sequence_number);
...@@ -588,6 +588,7 @@ pdcp_data_ind( ...@@ -588,6 +588,7 @@ pdcp_data_ind(
free_mem_block(sdu_buffer_pP, __func__); free_mem_block(sdu_buffer_pP, __func__);
return FALSE; return FALSE;
} }
#endif #endif
// SRB1/2: control-plane data // SRB1/2: control-plane data
...@@ -698,26 +699,23 @@ pdcp_data_ind( ...@@ -698,26 +699,23 @@ pdcp_data_ind(
free_mem_block(sdu_buffer_pP, __func__); free_mem_block(sdu_buffer_pP, __func__);
/* TODO: indicate integrity verification failure to upper layer */ /* TODO: indicate integrity verification failure to upper layer */
return FALSE; return FALSE;
} else if (pdcp_p->next_pdcp_rx_sn - sequence_number > reordering_window) { } else if (pdcp_p->next_pdcp_rx_sn - sequence_number > reordering_window) {
pdcp_p->rx_hfn++; pdcp_p->rx_hfn++;
rx_hfn_for_count = pdcp_p->rx_hfn; rx_hfn_for_count = pdcp_p->rx_hfn;
pdcp_sn_for_count = sequence_number; pdcp_sn_for_count = sequence_number;
pdcp_p->next_pdcp_rx_sn = sequence_number + 1; pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
} else if (sequence_number - pdcp_p->next_pdcp_rx_sn >= reordering_window) { } else if (sequence_number - pdcp_p->next_pdcp_rx_sn >= reordering_window) {
rx_hfn_for_count = pdcp_p->rx_hfn - 1; rx_hfn_for_count = pdcp_p->rx_hfn - 1;
pdcp_sn_for_count = sequence_number; pdcp_sn_for_count = sequence_number;
} else if (sequence_number >= pdcp_p->next_pdcp_rx_sn) { } else if (sequence_number >= pdcp_p->next_pdcp_rx_sn) {
rx_hfn_for_count = pdcp_p->rx_hfn; rx_hfn_for_count = pdcp_p->rx_hfn;
pdcp_sn_for_count = sequence_number; pdcp_sn_for_count = sequence_number;
pdcp_p->next_pdcp_rx_sn = sequence_number + 1; pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) { if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) {
pdcp_p->next_pdcp_rx_sn = 0; pdcp_p->next_pdcp_rx_sn = 0;
pdcp_p->rx_hfn++; pdcp_p->rx_hfn++;
} }
} else { /* sequence_number < pdcp_p->next_pdcp_rx_sn */ } else { /* sequence_number < pdcp_p->next_pdcp_rx_sn */
rx_hfn_for_count = pdcp_p->rx_hfn; rx_hfn_for_count = pdcp_p->rx_hfn;
pdcp_sn_for_count = sequence_number; pdcp_sn_for_count = sequence_number;
...@@ -770,20 +768,21 @@ pdcp_data_ind( ...@@ -770,20 +768,21 @@ pdcp_data_ind(
* TODO: we also have to deal with re-establishment PDU (control PDUs) * TODO: we also have to deal with re-establishment PDU (control PDUs)
* that contain no SDU. * that contain no SDU.
*/ */
pdcp_p->last_submitted_pdcp_rx_sn = sequence_number; pdcp_p->last_submitted_pdcp_rx_sn = sequence_number;
break; break;
} /* case RLC_MODE_AM */ } /* case RLC_MODE_AM */
case RLC_MODE_UM: case RLC_MODE_UM:
/* process as described in 36.323 5.1.2.1.3 */ /* process as described in 36.323 5.1.2.1.3 */
if (sequence_number < pdcp_p->next_pdcp_rx_sn) { if (sequence_number < pdcp_p->next_pdcp_rx_sn) {
pdcp_p->rx_hfn++; pdcp_p->rx_hfn++;
} }
rx_hfn_for_count = pdcp_p->rx_hfn; rx_hfn_for_count = pdcp_p->rx_hfn;
pdcp_sn_for_count = sequence_number; pdcp_sn_for_count = sequence_number;
pdcp_p->next_pdcp_rx_sn = sequence_number + 1; pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) { if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) {
pdcp_p->next_pdcp_rx_sn = 0; pdcp_p->next_pdcp_rx_sn = 0;
pdcp_p->rx_hfn++; pdcp_p->rx_hfn++;
...@@ -1145,7 +1144,8 @@ pdcp_run ( ...@@ -1145,7 +1144,8 @@ pdcp_run (
} while(msg_p != NULL); } while(msg_p != NULL);
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer // IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) { // if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) {
if (!EPC_MODE_ENABLED || ctxt_pP->enb_flag == ENB_FLAG_NO ) {
pdcp_fifo_read_input_sdus(ctxt_pP); pdcp_fifo_read_input_sdus(ctxt_pP);
} }
...@@ -2027,9 +2027,6 @@ rrc_pdcp_config_req ( ...@@ -2027,9 +2027,6 @@ rrc_pdcp_config_req (
} }
} }
//-----------------------------------------------------------------------------
uint64_t pdcp_module_init( uint64_t pdcp_optmask ) { uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
/* temporary enforce netlink when UE_NAS_USE_TUN is set, /* temporary enforce netlink when UE_NAS_USE_TUN is set,
this is while switching from noS1 as build option this is while switching from noS1 as build option
...@@ -2044,9 +2041,17 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) { ...@@ -2044,9 +2041,17 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
((PDCP_USE_NETLINK)?"usenetlink":"")); ((PDCP_USE_NETLINK)?"usenetlink":""));
if (PDCP_USE_NETLINK) { if (PDCP_USE_NETLINK) {
nas_getparams();
if(UE_NAS_USE_TUN) { if(UE_NAS_USE_TUN) {
netlink_init_tun(); netlink_init_tun("ue");
} else { LOG_I(PDCP, "UE pdcp will use tun interface\n");
} else if(ENB_NAS_USE_TUN) {
netlink_init_tun("enb");
nas_config(1, 1, 1, "enb");
LOG_I(PDCP, "ENB pdcp will use tun interface\n");
} else {
LOG_I(PDCP, "pdcp will use kernel modules\n");
netlink_init(); netlink_init();
} }
} }
...@@ -2054,6 +2059,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) { ...@@ -2054,6 +2059,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
return pdcp_params.optmask ; return pdcp_params.optmask ;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
pdcp_free ( pdcp_free (
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#define LINK_ENB_PDCP_TO_IP_DRIVER_BIT (1<< 13) #define LINK_ENB_PDCP_TO_IP_DRIVER_BIT (1<< 13)
#define LINK_ENB_PDCP_TO_GTPV1U_BIT (1<< 14) #define LINK_ENB_PDCP_TO_GTPV1U_BIT (1<< 14)
#define UE_NAS_USE_TUN_BIT (1<< 15) #define UE_NAS_USE_TUN_BIT (1<< 15)
#define ENB_NAS_USE_TUN_BIT (1<< 16)
typedef struct { typedef struct {
uint64_t optmask; uint64_t optmask;
} pdcp_params_t; } pdcp_params_t;
...@@ -63,6 +64,7 @@ typedef struct { ...@@ -63,6 +64,7 @@ typedef struct {
#define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT) #define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT)
#define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT) #define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT)
#define UE_NAS_USE_TUN ( get_pdcp_optmask() & UE_NAS_USE_TUN_BIT) #define UE_NAS_USE_TUN ( get_pdcp_optmask() & UE_NAS_USE_TUN_BIT)
#define ENB_NAS_USE_TUN ( get_pdcp_optmask() & ENB_NAS_USE_TUN_BIT)
uint64_t get_pdcp_optmask(void); uint64_t get_pdcp_optmask(void);
extern pthread_t pdcp_thread; extern pthread_t pdcp_thread;
......
...@@ -125,7 +125,9 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) { ...@@ -125,7 +125,9 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
sizeof(sidelink_pc5s_element), 0, (struct sockaddr *)&prose_pdcp_addr,sizeof(prose_pdcp_addr) ); sizeof(sidelink_pc5s_element), 0, (struct sockaddr *)&prose_pdcp_addr,sizeof(prose_pdcp_addr) );
} else if (UE_NAS_USE_TUN) { } else if (UE_NAS_USE_TUN) {
ret = write(nas_sock_fd[ctxt_pP->module_id], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite ); ret = write(nas_sock_fd[ctxt_pP->module_id], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite );
} else if (PDCP_USE_NETLINK) {//UE_NAS_USE_TUN } else if (ENB_NAS_USE_TUN) {
ret = write(nas_sock_fd[0], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite );
} else if (PDCP_USE_NETLINK) {
memcpy(NLMSG_DATA(nas_nlh_tx), (uint8_t *) sdu_p->data, sizeToWrite); memcpy(NLMSG_DATA(nas_nlh_tx), (uint8_t *) sdu_p->data, sizeToWrite);
nas_nlh_tx->nlmsg_len = sizeToWrite; nas_nlh_tx->nlmsg_len = sizeToWrite;
ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0); ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0);
...@@ -144,7 +146,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) { ...@@ -144,7 +146,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
pdcp_data_req_header_t pdcp_read_header_g; pdcp_data_req_header_t pdcp_read_header_g;
if (UE_NAS_USE_TUN) { if (UE_NAS_USE_TUN || ENB_NAS_USE_TUN) {
protocol_ctxt_t ctxt = *ctxt_pP; protocol_ctxt_t ctxt = *ctxt_pP;
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE; hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc; hashtable_rc_t h_rc;
...@@ -155,20 +157,29 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { ...@@ -155,20 +157,29 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
do { do {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 1 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 1 );
len = read(nas_sock_fd[ctxt_pP->module_id], &nl_rx_buf, NL_MAX_PAYLOAD); len = read(UE_NAS_USE_TUN?nas_sock_fd[ctxt_pP->module_id]:nas_sock_fd[0], &nl_rx_buf, NL_MAX_PAYLOAD);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 0 );
if (len<=0) continue; if (len<=0) continue;
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n", if (UE_NAS_USE_TUN) {
ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag); key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p); h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
} else {
ctxt.rnti=pdcp_eNB_UE_instance_to_rnti[0];
ctxt.enb_flag=ENB_FLAG_YES;
ctxt.module_id=0;
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
}
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %d \n", LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %d \n",
ctxt.frame, ctxt.instance, len, rab_id); ctxt.frame, ctxt.instance, len, rab_id);
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n", LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %04x][RB %u]\n",
ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id, ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id,
ctxt.rnti, rab_id); ctxt.rnti, rab_id);
MSC_LOG_RX_MESSAGE((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, MSC_LOG_RX_MESSAGE((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
...@@ -192,7 +203,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { ...@@ -192,7 +203,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
MSC_AS_TIME_ARGS(ctxt_pP), MSC_AS_TIME_ARGS(ctxt_pP),
ctxt.instance, rab_id, rab_id, len); ctxt.instance, rab_id, rab_id, len);
LOG_D(PDCP, LOG_D(PDCP,
"[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n", "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %04x][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id, ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id,
ctxt.rnti, rab_id, key); ctxt.rnti, rab_id, key);
} }
......
...@@ -584,14 +584,12 @@ void rlc_data_ind ( ...@@ -584,14 +584,12 @@ void rlc_data_ind (
const sdu_size_t sdu_sizeP, const sdu_size_t sdu_sizeP,
mem_block_t *sdu_pP) { mem_block_t *sdu_pP) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#if defined(TRACE_RLC_PAYLOAD)
LOG_D(RLC, PROTOCOL_CTXT_FMT"[%s %u] Display of rlc_data_ind: size %u\n", LOG_D(RLC, PROTOCOL_CTXT_FMT"[%s %u] Display of rlc_data_ind: size %u\n",
PROTOCOL_CTXT_ARGS(ctxt_pP), PROTOCOL_CTXT_ARGS(ctxt_pP),
(srb_flagP) ? "SRB" : "DRB", (srb_flagP) ? "SRB" : "DRB",
rb_idP, rb_idP,
sdu_sizeP); sdu_sizeP);
rlc_util_print_hex_octets(RLC, (unsigned char *)sdu_pP->data, sdu_sizeP); rlc_util_print_hex_octets(RLC, (unsigned char *)sdu_pP->data, sdu_sizeP);
#endif
#if T_TRACER #if T_TRACER
if (ctxt_pP->enb_flag) if (ctxt_pP->enb_flag)
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
#define NAS_INET6_ADDRSTRLEN 46 #define NAS_INET6_ADDRSTRLEN 46
#define NAS_INET_ADDRSTRLEN 16 #define NAS_INET_ADDRSTRLEN 16
#define NAS_CX_MAX 128 // 32 //Identical to RRC constant #define NAS_CX_MAX 32 //128 //Identical to RRC constant: no you cannot
/* increase to 128 without risking stack problems: KEEP ATTENTION TO COMPILATION WARNINGS */
//#define NAS_CX_MULTICAST_ALLNODE 2 //#define NAS_CX_MULTICAST_ALLNODE 2
#define NAS_RETRY_LIMIT_DEFAULT 5 #define NAS_RETRY_LIMIT_DEFAULT 5
......
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
// Max number of entry of a message list // Max number of entry of a message list
#define NAS_LIST_CX_MAX 32 #define NAS_LIST_CX_MAX 32
#define NAS_LIST_RB_MAX 32 #define NAS_LIST_RB_MAX 32
#define NAS_LIST_CLASS_MAX 32 #define NAS_LIST_CLASS_MAX 16 // 32 is too high!!:
/* risk of stack problems: KEEP ATTENTION TO COMPILATION WARNINGS */
typedef unsigned short nasMsgType_t; typedef unsigned short nasMsgType_t;
......
...@@ -801,7 +801,6 @@ rrc_ue_establish_drb( ...@@ -801,7 +801,6 @@ rrc_ue_establish_drb(
(void)ip_addr_offset4; (void)ip_addr_offset4;
LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n", LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity); ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity);
/* /*
rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD, rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD,
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE); (eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE);
...@@ -810,34 +809,34 @@ rrc_ue_establish_drb( ...@@ -810,34 +809,34 @@ rrc_ue_establish_drb(
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, (eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,
RADIO_ACCESS_BEARER,Rlc_info_um); RADIO_ACCESS_BEARER,Rlc_info_um);
*/ */
if(PDCP_USE_NETLINK) { // if(!EPC_MODE_ENABLED) {
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U) //# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
ip_addr_offset3 = 0; ip_addr_offset3 = 0;
ip_addr_offset4 = 1; ip_addr_offset4 = 1;
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP, LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oip%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1); ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP, // interface_id oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP+1, // interface_id
ip_addr_offset3+ue_mod_idP+1, // third_octet ip_addr_offset3+ue_mod_idP+1, // third_octet
ip_addr_offset4+ue_mod_idP+1); // fourth_octet ip_addr_offset4+ue_mod_idP+1, // fourth_octet
"oip"); // interface suffix
if (oip_ifup == 0 ) { // interface is up --> send a config the DRB if (oip_ifup == 0 && (!UE_NAS_USE_TUN)) { // interface is up --> send a config the DRB
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n", LOG_I(OIP,"[UE %d] Config the ue net interface %d to send/receive pkt on DRB %ld to/from the protocol stack\n",
ue_mod_idP, ue_mod_idP,
ip_addr_offset3+ue_mod_idP, ip_addr_offset3+ue_mod_idP,
(long int)((eNB_index * maxDRB) + DRB_config->drb_Identity)); (long int)((eNB_index * LTE_maxDRB) + DRB_config->drb_Identity));
rb_conf_ipv4(0,//add rb_conf_ipv4(0,//add
ue_mod_idP,//cx align with the UE index ue_mod_idP,//cx align with the UE index
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
(eNB_index * maxDRB) + DRB_config->drb_Identity,//rb (eNB_index * LTE_maxDRB) + DRB_config->drb_Identity,//rb
0,//dscp 0,//dscp
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index); LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
} }
# endif //# endif
} // }
return(0); return(0);
} }
...@@ -1930,7 +1929,7 @@ rrc_ue_process_rrcConnectionReconfiguration( ...@@ -1930,7 +1929,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
for (i=0; ( for (i=0; (
i<rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count) i<rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
&& (i < maxDRB); i++) { && (i < LTE_maxDRB); i++) {
// why minus 1 in RRC code for drb_identity ? // why minus 1 in RRC code for drb_identity ?
connection_reestablishment_ind.drb_id[i] = connection_reestablishment_ind.drb_id[i] =
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity; rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
...@@ -2241,7 +2240,7 @@ rrc_ue_decode_dcch( ...@@ -2241,7 +2240,7 @@ rrc_ue_decode_dcch(
for (i=0; ( for (i=0; (
i<dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count) i<dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
&& (i < maxDRB); i++) { && (i < LTE_maxDRB); i++) {
// why minus 1 in RRC code for drb_identity ? // why minus 1 in RRC code for drb_identity ?
connection_reconfiguration_ho_ind.drb_id[i] = connection_reconfiguration_ho_ind.drb_id[i] =
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity; dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
...@@ -2295,7 +2294,7 @@ rrc_ue_decode_dcch( ...@@ -2295,7 +2294,7 @@ rrc_ue_decode_dcch(
for (i=0; ( for (i=0; (
i<dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count) i<dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
&& (i < maxDRB); i++) { && (i < LTE_maxDRB); i++) {
// why minus 1 in RRC code for drb_identity ? // why minus 1 in RRC code for drb_identity ?
connection_reconfiguration_ind.drb_id[i] = connection_reconfiguration_ind.drb_id[i] =
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity; dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
......
...@@ -343,7 +343,8 @@ typedef enum HO_STATE_e { ...@@ -343,7 +343,8 @@ typedef enum HO_STATE_e {
HO_COMPLETE, // initiated by the target eNB HO_COMPLETE, // initiated by the target eNB
HO_REQUEST, HO_REQUEST,
HO_ACK, HO_ACK,
HO_CONFIGURED HO_CONFIGURED,
HO_RELEASE
} HO_STATE_t; } HO_STATE_t;
typedef enum SL_TRIGGER_e { typedef enum SL_TRIGGER_e {
...@@ -450,12 +451,14 @@ typedef struct HANDOVER_INFO_s { ...@@ -450,12 +451,14 @@ typedef struct HANDOVER_INFO_s {
HO_STATE_t state; //current state of handover HO_STATE_t state; //current state of handover
uint32_t modid_s; //module_idP of serving cell uint32_t modid_s; //module_idP of serving cell
uint32_t modid_t; //module_idP of target cell uint32_t modid_t; //module_idP of target cell
int assoc_id;
uint8_t ueid_s; //UE index in serving cell uint8_t ueid_s; //UE index in serving cell
uint8_t ueid_t; //UE index in target cell uint8_t ueid_t; //UE index in target cell
LTE_AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */ LTE_AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */
LTE_AS_Context_t as_context; /* They are mandatory for HO */ LTE_AS_Context_t as_context; /* They are mandatory for HO */
uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */ uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */
int size; /* size of above message in bytes */ int size; /* size of above message in bytes */
int x2_id; /* X2AP UE ID in the target eNB */
} HANDOVER_INFO; } HANDOVER_INFO;
#define RRC_HEADER_SIZE_MAX 64 #define RRC_HEADER_SIZE_MAX 64
......
This diff is collapsed.
...@@ -426,7 +426,7 @@ static e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm rrc_eNB_select_inte ...@@ -426,7 +426,7 @@ static e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm rrc_eNB_select_inte
*\param security_capabilities The security capabilities received from S1AP. *\param security_capabilities The security capabilities received from S1AP.
*\return TRUE if at least one algorithm has been changed else FALSE. *\return TRUE if at least one algorithm has been changed else FALSE.
*/ */
static int int
rrc_eNB_process_security( rrc_eNB_process_security(
const protocol_ctxt_t *const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP, rrc_eNB_ue_context_t *const ue_context_pP,
...@@ -477,7 +477,7 @@ rrc_eNB_process_security( ...@@ -477,7 +477,7 @@ rrc_eNB_process_security(
*\param security_key_pP The security key received from S1AP. *\param security_key_pP The security key received from S1AP.
*/ */
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static void process_eNB_security_key ( void process_eNB_security_key (
const protocol_ctxt_t *const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP, rrc_eNB_ue_context_t *const ue_context_pP,
uint8_t *security_key_pP uint8_t *security_key_pP
...@@ -1958,7 +1958,7 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP, ...@@ -1958,7 +1958,7 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr = create_tunnel_resp.enb_addr; S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr = create_tunnel_resp.enb_addr;
LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ", LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[inde_list[e_rab]].status, e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[inde_list[e_rab]].status,
ue_context_pP->ue_context.nb_of_e_rabs, S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id, S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid, S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[0], S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[0],
...@@ -1970,7 +1970,7 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP, ...@@ -1970,7 +1970,7 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
// NN: add conditions for e_rabs_failed // NN: add conditions for e_rabs_failed
if (e_rabs_done > 0) { if (e_rabs_done > 0) {
LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n", LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n",
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab); S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB, MSC_RRC_ENB,
MSC_S1AP_ENB, MSC_S1AP_ENB,
...@@ -2017,46 +2017,64 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg ...@@ -2017,46 +2017,64 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
ue_context_p->ue_context.mme_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).mme_ue_s1ap_id; ue_context_p->ue_context.mme_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).mme_ue_s1ap_id;
/* Save e RAB information for later */ /* Save e RAB information for later */
{ {
ue_context_p->ue_context.nb_release_of_e_rabs = S1AP_PATH_SWITCH_REQ_ACK (msg_p).nb_e_rabs_tobereleased;
for (i = 0; for (i = 0;
i < ue_context_p->ue_context.setup_e_rabs; // go over total number of e_rabs received through x2_ho_req msg i < ue_context_p->ue_context.setup_e_rabs; // go over total number of e_rabs received through x2_ho_req msg
i++) { i++) {
// assume that we are releasing all the DRBs // assume that we are releasing all the DRBs
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_TORELEASE; ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_REESTABLISHED;
if (ue_context_p->ue_context.nb_release_of_e_rabs==0) {
LOG_I(RRC,"Bearer re-established with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
}
} }
//memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req)); //memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req));
//uint8_t nb_e_rabs_tobeswitched = S1AP_PATH_SWITCH_REQ_ACK (msg_p).nb_e_rabs_tobeswitched; uint8_t nb_e_rabs_tobeswitched = S1AP_PATH_SWITCH_REQ_ACK (msg_p).nb_e_rabs_tobeswitched;
// keep the previous bearer // keep the previous bearer
// the index for the rec // the index for the rec
if (nb_e_rabs_tobeswitched>0) {
int e_rab_switch_index=0;
for (i = 0; for (i = 0;
i < 1;//nb_e_rabs_tobeswitched; // go over total number of e_rabs received through x2_ho_req msg i < ue_context_p->ue_context.setup_e_rabs; // go over total number of e_rabs received through x2_ho_req msg
i++) { i++) {
LOG_I(RRC,"Bearer re-established with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
/* Harmonize with enb_gtp_teid, enb_gtp_addrs, and enb_gtp_rbi vars in the top level structure */ /* Harmonize with enb_gtp_teid, enb_gtp_addrs, and enb_gtp_rbi vars in the top level structure */
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_REESTABLISHED; if (ue_context_p->ue_context.e_rab[i].param.e_rab_id == S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].e_rab_id) {
//ue_context_p->ue_context.e_rab[i].param.e_rab_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].e_rab_id; ue_context_p->ue_context.e_rab[i].param.e_rab_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].e_rab_id;
//ue_context_p->ue_context.e_rab[i].param.sgw_addr= S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].sgw_addr; ue_context_p->ue_context.e_rab[i].param.sgw_addr= S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].sgw_addr;
//ue_context_p->ue_context.e_rab[i].param.gtp_teid = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].gtp_teid; ue_context_p->ue_context.e_rab[i].param.gtp_teid = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].gtp_teid;
/* Tunnel must have been already created in X2_HO_REQ procedure */ e_rab_switch_index++;
}
}
} }
ue_context_p->ue_context.setup_e_rabs=i;
ue_context_p->ue_context.nb_of_e_rabs=i;
} }
ue_context_p->ue_context.ue_ambr=S1AP_PATH_SWITCH_REQ_ACK (msg_p).ue_ambr; ue_context_p->ue_context.ue_ambr=S1AP_PATH_SWITCH_REQ_ACK (msg_p).ue_ambr;
ue_context_p->ue_context.nb_release_of_e_rabs = S1AP_PATH_SWITCH_REQ_ACK (msg_p).nb_e_rabs_tobereleased;
memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req));
ue_context_p->ue_context.setup_e_rabs = ue_context_p->ue_context.setup_e_rabs - ue_context_p->ue_context.nb_release_of_e_rabs;
ue_context_p->ue_context.nb_of_e_rabs = ue_context_p->ue_context.nb_of_e_rabs - ue_context_p->ue_context.nb_release_of_e_rabs;
memset(&delete_tunnel_req, 0 , sizeof(delete_tunnel_req));
if (ue_context_p->ue_context.nb_release_of_e_rabs>0) {
int e_rab_release_index=0;
for (i = 0; for (i = 0;
i < ue_context_p->ue_context.nb_release_of_e_rabs; i < ue_context_p->ue_context.setup_e_rabs;
i++) { i++) {
if (ue_context_p->ue_context.e_rab[i].param.e_rab_id == S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[e_rab_release_index].e_rab_id) {
LOG_I(RRC,"Bearer released with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id); LOG_I(RRC,"Bearer released with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
ue_context_p->ue_context.e_rabs_tobereleased[i]=S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[i].e_rab_id; ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_TORELEASE;
delete_tunnel_req.eps_bearer_id[i] = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[i].e_rab_id; ue_context_p->ue_context.e_rabs_tobereleased[e_rab_release_index]=S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[e_rab_release_index].e_rab_id;
delete_tunnel_req.eps_bearer_id[e_rab_release_index] = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[e_rab_release_index].e_rab_id;
e_rab_release_index++;
}
else {
LOG_I(RRC,"Bearer re-established with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
}
}
} }
if (ue_context_p->ue_context.nb_release_of_e_rabs>0) { if (ue_context_p->ue_context.nb_release_of_e_rabs>0){
delete_tunnel_req.rnti= ue_context_p->ue_context.rnti; delete_tunnel_req.rnti= ue_context_p->ue_context.rnti;
delete_tunnel_req.num_erab= ue_context_p->ue_context.nb_release_of_e_rabs; delete_tunnel_req.num_erab= ue_context_p->ue_context.nb_release_of_e_rabs;
/* this could also be done through ITTI message */ /* this could also be done through ITTI message */
...@@ -2071,7 +2089,57 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg ...@@ -2071,7 +2089,57 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
memcpy ( ue_context_p->ue_context.next_security_key, memcpy ( ue_context_p->ue_context.next_security_key,
S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_security_key, S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_security_key,
SECURITY_KEY_LENGTH); SECURITY_KEY_LENGTH);
rrc_eNB_send_X2AP_UE_CONTEXT_RELEASE(&ctxt, ue_context_p);
return (0); return (0);
} }
} }
int rrc_eNB_send_X2AP_UE_CONTEXT_RELEASE(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP) {
MessageDef *msg_p = NULL;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, X2AP_UE_CONTEXT_RELEASE);
X2AP_UE_CONTEXT_RELEASE (msg_p).rnti = ue_context_pP->ue_context.rnti;
X2AP_UE_CONTEXT_RELEASE (msg_p).source_assoc_id = ue_context_pP->ue_context.handover_info->assoc_id;
itti_send_msg_to_task (TASK_X2AP, ctxt_pP->instance, msg_p);
return (0);
}
int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id){
s1ap_eNB_instance_t *s1ap_eNB_instance_p = NULL;
struct s1ap_eNB_ue_context_s *ue_context_p = NULL;
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
DevAssert(s1ap_eNB_instance_p != NULL);
if ((ue_context_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance_p,
eNB_ue_s1ap_id)) == NULL) {
/* The context for this eNB ue s1ap id doesn't exist in the map of eNB UEs */
LOG_W(RRC,"Failed to find ue context associated with eNB ue s1ap id: %u\n",
eNB_ue_s1ap_id);
return -1;
}
// release UE context
struct s1ap_eNB_ue_context_s *ue_context2_p = NULL;
if ((ue_context2_p = RB_REMOVE(s1ap_ue_map, &s1ap_eNB_instance_p->s1ap_ue_head, ue_context_p))
!= NULL) {
LOG_W(RRC,"Removed UE context eNB_ue_s1ap_id %u\n",
ue_context2_p->eNB_ue_s1ap_id);
s1ap_eNB_free_ue_context(ue_context2_p);
} else {
LOG_W(RRC,"Removing UE context eNB_ue_s1ap_id %u: did not find context\n",
ue_context_p->eNB_ue_s1ap_id);
}
/*RB_FOREACH(ue_context_p, s1ap_ue_map, &s1ap_eNB_instance_p->s1ap_ue_head) {
S1AP_WARN("in s1ap_ue_map: UE context eNB_ue_s1ap_id %u mme_ue_s1ap_id %u state %u\n",
ue_context_p->eNB_ue_s1ap_id, ue_context_p->mme_ue_s1ap_id,
ue_context_p->ue_state);
}*/
return 0;
}
...@@ -270,4 +270,8 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP, ...@@ -270,4 +270,8 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP); rrc_eNB_ue_context_t *const ue_context_pP);
int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance); int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance);
int rrc_eNB_send_X2AP_UE_CONTEXT_RELEASE(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP);
int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id);
#endif /* RRC_ENB_S1AP_H_ */ #endif /* RRC_ENB_S1AP_H_ */
...@@ -44,48 +44,56 @@ ...@@ -44,48 +44,56 @@
#include "nas_config.h" #include "nas_config.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "common/config/config_userapi.h"
//default values according to the examples, //default values according to the examples,
char *baseNetAddress = "10.0" ; char *baseNetAddress ;
char *netMask = "255.255.255.0" ; char *netMask ;
char *broadcastAddr = "10.0.255.255" ; char *broadcastAddr ;
#define NASHLP_NETPREFIX "<NAS network prefix, two first bytes of network addresses>\n"
#define NASHLP_NETMASK "<NAS network mask>\n"
#define NASHLP_BROADCASTADDR "<NAS network broadcast address>\n"
void nas_getparams(void) {
paramdef_t nasoptions[] = {
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* configuration parameters for netlink, includes network parameters when running in noS1 mode */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
{"NetworkPrefix", NASHLP_NETPREFIX, 0, strptr:&baseNetAddress, defstrval:"10.0", TYPE_STRING, 0 },
{"NetworkMask", NASHLP_NETMASK, 0, strptr:&netMask, defstrval:"255.255.255.0", TYPE_STRING, 0 },
{"BroadcastAddr", NASHLP_BROADCASTADDR, 0, strptr:&broadcastAddr, defstrval:"10.0.255.255", TYPE_STRING, 0 },
};
config_get( nasoptions,sizeof(nasoptions)/sizeof(paramdef_t),"nas.noS1");
}
void setBaseNetAddress (char* baseAddr) void setBaseNetAddress (char *baseAddr) {
{
strcpy(baseNetAddress,baseAddr); strcpy(baseNetAddress,baseAddr);
} }
char* getBaseNetAddress (void) char *getBaseNetAddress (void) {
{
return baseNetAddress; return baseNetAddress;
} }
void setNetMask (char* baseAddr) void setNetMask (char *baseAddr) {
{
strcpy(netMask,baseAddr); strcpy(netMask,baseAddr);
} }
char* getNetMask (void) char *getNetMask (void) {
{
return netMask; return netMask;
} }
void setBroadcastAddress (char* baseAddr) void setBroadcastAddress (char *baseAddr) {
{
strcpy(broadcastAddr, baseAddr); strcpy(broadcastAddr, baseAddr);
} }
char* getBroadcastAddress (void) char *getBroadcastAddress (void) {
{
return broadcastAddr; return broadcastAddr;
} }
//Add Gateway to the interface //Add Gateway to the interface
int set_gateway(char *interfaceName, char *gateway) int set_gateway(char *interfaceName, char *gateway) {
{
int sock_fd; int sock_fd;
struct rtentry rt; struct rtentry rt;
struct sockaddr_in addr; struct sockaddr_in addr;
...@@ -96,20 +104,16 @@ int set_gateway(char *interfaceName, char *gateway) ...@@ -96,20 +104,16 @@ int set_gateway(char *interfaceName, char *gateway)
} }
memset (&rt, 0, sizeof (rt)); memset (&rt, 0, sizeof (rt));
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
/*set Destination addr*/ /*set Destination addr*/
inet_aton("0.0.0.0",&addr.sin_addr); inet_aton("0.0.0.0",&addr.sin_addr);
memcpy(&rt.rt_dst, &addr, sizeof(struct sockaddr_in)); memcpy(&rt.rt_dst, &addr, sizeof(struct sockaddr_in));
/*set gateway addr*/ /*set gateway addr*/
inet_aton(gateway,&addr.sin_addr); inet_aton(gateway,&addr.sin_addr);
memcpy(&rt.rt_gateway, &addr, sizeof(struct sockaddr_in)); memcpy(&rt.rt_gateway, &addr, sizeof(struct sockaddr_in));
/*set genmask addr*/ /*set genmask addr*/
inet_aton("0.0.0.0",&addr.sin_addr); inet_aton("0.0.0.0",&addr.sin_addr);
memcpy(&rt.rt_genmask, &addr, sizeof(struct sockaddr_in)); memcpy(&rt.rt_genmask, &addr, sizeof(struct sockaddr_in));
rt.rt_dev = interfaceName; rt.rt_dev = interfaceName;
//rt.rt_flags = RTF_UP|RTF_GATEWAY|RTF_DEFAULT; //rt.rt_flags = RTF_UP|RTF_GATEWAY|RTF_DEFAULT;
/* SR: rt_flags on 16 bits but RTF_DEFAULT = 0x00010000 /* SR: rt_flags on 16 bits but RTF_DEFAULT = 0x00010000
...@@ -129,19 +133,16 @@ int set_gateway(char *interfaceName, char *gateway) ...@@ -129,19 +133,16 @@ int set_gateway(char *interfaceName, char *gateway)
LOG_I(OIP,"set_gateway OK!\n"); LOG_I(OIP,"set_gateway OK!\n");
return 0; return 0;
} }
} }
close(sock_fd); close(sock_fd);
LOG_D(OIP,"Set Gateway OK!\n"); LOG_D(OIP,"Set Gateway OK!\n");
return 0; return 0;
} }
// sets a genneric interface parameter // sets a genneric interface parameter
// (SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFFLAGS) // (SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFFLAGS)
int setInterfaceParameter(char *interfaceName, char *settingAddress, int operation) int setInterfaceParameter(char *interfaceName, char *settingAddress, int operation) {
{
int sock_fd; int sock_fd;
struct ifreq ifr; struct ifreq ifr;
struct sockaddr_in addr; struct sockaddr_in addr;
...@@ -154,10 +155,8 @@ int setInterfaceParameter(char *interfaceName, char *settingAddress, int operati ...@@ -154,10 +155,8 @@ int setInterfaceParameter(char *interfaceName, char *settingAddress, int operati
memset(&ifr, 0, sizeof(ifr)); memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name)-1); strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name)-1);
memset(&addr, 0, sizeof(struct sockaddr_in)); memset(&addr, 0, sizeof(struct sockaddr_in));
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
inet_aton(settingAddress,&addr.sin_addr); inet_aton(settingAddress,&addr.sin_addr);
memcpy(&ifr.ifr_ifru.ifru_addr,&addr,sizeof(struct sockaddr_in)); memcpy(&ifr.ifr_ifru.ifru_addr,&addr,sizeof(struct sockaddr_in));
...@@ -169,15 +168,13 @@ int setInterfaceParameter(char *interfaceName, char *settingAddress, int operati ...@@ -169,15 +168,13 @@ int setInterfaceParameter(char *interfaceName, char *settingAddress, int operati
} }
close(sock_fd); close(sock_fd);
// printf("Set OK!\n"); // printf("Set OK!\n");
return 0; return 0;
} }
// sets a genneric interface parameter // sets a genneric interface parameter
// (SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFFLAGS) // (SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFFLAGS)
int bringInterfaceUp(char *interfaceName, int up) int bringInterfaceUp(char *interfaceName, int up) {
{
int sock_fd; int sock_fd;
struct ifreq ifr; struct ifreq ifr;
...@@ -213,8 +210,7 @@ int bringInterfaceUp(char *interfaceName, int up) ...@@ -213,8 +210,7 @@ int bringInterfaceUp(char *interfaceName, int up)
return 0; return 0;
} }
// non blocking full configuration of the interface (address, net mask, and broadcast mask) // non blocking full configuration of the interface (address, net mask, and broadcast mask)
int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *broadcastAddress) int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *broadcastAddress) {
{
bringInterfaceUp(interfaceName, 0); bringInterfaceUp(interfaceName, 0);
// sets the machine address // sets the machine address
int returnValue= setInterfaceParameter(interfaceName, ipAddress,SIOCSIFADDR); int returnValue= setInterfaceParameter(interfaceName, ipAddress,SIOCSIFADDR);
...@@ -229,26 +225,21 @@ int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *br ...@@ -229,26 +225,21 @@ int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *br
// if(!returnValue) // if(!returnValue)
// returnValue=set_gateway(interfaceName, broadcastAddress); // returnValue=set_gateway(interfaceName, broadcastAddress);
bringInterfaceUp(interfaceName, 1); bringInterfaceUp(interfaceName, 1);
return returnValue; return returnValue;
} }
// non blocking full configuration of the interface (address, and the two lest octets of the address) // non blocking full configuration of the interface (address, and the two lest octets of the address)
int nas_config(int interface_id, int thirdOctet, int fourthOctet) int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifname) {
{
//char buf[5]; //char buf[5];
char ipAddress[20]; char ipAddress[20];
char broadcastAddress[20]; char broadcastAddress[20];
char interfaceName[8]; char interfaceName[20];
int returnValue; int returnValue;
sprintf(ipAddress, "10.0.%d.%d", thirdOctet,fourthOctet); sprintf(ipAddress, "10.0.%d.%d", thirdOctet,fourthOctet);
sprintf(broadcastAddress, "10.0.%d.255", thirdOctet); sprintf(broadcastAddress, "10.0.%d.255", thirdOctet);
sprintf(interfaceName, "%s%s%d", (UE_NAS_USE_TUN || ENB_NAS_USE_TUN)?"oaitun_":ifname,
sprintf(interfaceName, "oai%d", interface_id); UE_NAS_USE_TUN?"ue": (ENB_NAS_USE_TUN?"enb":""),interface_id);
bringInterfaceUp(interfaceName, 0); bringInterfaceUp(interfaceName, 0);
// sets the machine address // sets the machine address
returnValue= setInterfaceParameter(interfaceName, ipAddress,SIOCSIFADDR); returnValue= setInterfaceParameter(interfaceName, ipAddress,SIOCSIFADDR);
...@@ -262,18 +253,13 @@ int nas_config(int interface_id, int thirdOctet, int fourthOctet) ...@@ -262,18 +253,13 @@ int nas_config(int interface_id, int thirdOctet, int fourthOctet)
returnValue= setInterfaceParameter(interfaceName, broadcastAddress,SIOCSIFBRDADDR); returnValue= setInterfaceParameter(interfaceName, broadcastAddress,SIOCSIFBRDADDR);
bringInterfaceUp(interfaceName, 1); bringInterfaceUp(interfaceName, 1);
return returnValue; return returnValue;
} }
// Blocking full configuration of the interface (address, net mask, and broadcast mask) // Blocking full configuration of the interface (address, net mask, and broadcast mask)
int blocking_NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *broadcastAddress) int blocking_NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *broadcastAddress) {
{
char command[200]; char command[200];
command[0]='\0'; command[0]='\0';
strcat(command, "ifconfig "); strcat(command, "ifconfig ");
strncat(command, interfaceName, sizeof(command) - strlen(command) - 1); strncat(command, interfaceName, sizeof(command) - strlen(command) - 1);
strncat(command, " ", sizeof(command) - strlen(command) - 1); strncat(command, " ", sizeof(command) - strlen(command) - 1);
...@@ -282,16 +268,13 @@ int blocking_NAS_config(char *interfaceName, char *ipAddress, char *networkMask, ...@@ -282,16 +268,13 @@ int blocking_NAS_config(char *interfaceName, char *ipAddress, char *networkMask,
strncat(command, networkMask, sizeof(command) - strlen(command) - 1); strncat(command, networkMask, sizeof(command) - strlen(command) - 1);
strncat(command, " broadcast ", sizeof(command) - strlen(command) - 1); strncat(command, " broadcast ", sizeof(command) - strlen(command) - 1);
strncat(command, broadcastAddress, sizeof(command) - strlen(command) - 1); strncat(command, broadcastAddress, sizeof(command) - strlen(command) - 1);
// ifconfig nasmesh0 10.0.1.1 networkMask 255.255.255.0 broadcast 10.0.1.255 // ifconfig nasmesh0 10.0.1.1 networkMask 255.255.255.0 broadcast 10.0.1.255
int i = system (command); int i = system (command);
return i; return i;
} }
// program help // program help
void helpOptions(char **argv) void helpOptions(char **argv) {
{
printf("Help for %s\n", argv[0]); printf("Help for %s\n", argv[0]);
printf(" -i <interfaceName>\n"); printf(" -i <interfaceName>\n");
printf(" -a <IP address>\n"); printf(" -a <IP address>\n");
...@@ -303,13 +286,11 @@ void helpOptions(char **argv) ...@@ -303,13 +286,11 @@ void helpOptions(char **argv)
printf(" IP Address: 10.0.1.1\n"); printf(" IP Address: 10.0.1.1\n");
printf(" Net mask: 255.255.255.0\n"); printf(" Net mask: 255.255.255.0\n");
printf(" Broadcast address: [Beginning of the IP address].255\n"); printf(" Broadcast address: [Beginning of the IP address].255\n");
exit(1); exit(1);
} }
// creates the broadcast address if it wasn't set before // creates the broadcast address if it wasn't set before
void createBroadcast(char *broadcastAddress) void createBroadcast(char *broadcastAddress) {
{
int pos=strlen(broadcastAddress)-1; int pos=strlen(broadcastAddress)-1;
while(broadcastAddress[pos]!='.') while(broadcastAddress[pos]!='.')
...@@ -331,7 +312,6 @@ int main(int argc,char **argv) ...@@ -331,7 +312,6 @@ int main(int argc,char **argv)
char ipAddress[100]; char ipAddress[100];
char networkMask[100]; char networkMask[100];
char broadcastAddress[100]; char broadcastAddress[100];
strcpy(interfaceName, "oai0"); strcpy(interfaceName, "oai0");
strcpy(ipAddress, "10.0.1.1"); strcpy(ipAddress, "10.0.1.1");
strcpy(networkMask, "255.255.255.0"); strcpy(networkMask, "255.255.255.0");
...@@ -383,7 +363,6 @@ int main(int argc,char **argv) ...@@ -383,7 +363,6 @@ int main(int argc,char **argv)
//test //test
// setBaseNetAddress("11.11"); // setBaseNetAddress("11.11");
// nas_config(interfaceName, 33, 44); // nas_config(interfaceName, 33, 44);
} }
#endif #endif
...@@ -31,6 +31,13 @@ ...@@ -31,6 +31,13 @@
#include <netinet/in.h> #include <netinet/in.h>
/*! \fn void void nas_getparams(void)(void)
* \brief This function get parameters used to configure network interface when running in noS1 mode
* \note
* @ingroup ?????
*/
void nas_getparams(void);
/*! \fn int NAS_config(char*, char*, char*, char*) /*! \fn int NAS_config(char*, char*, char*, char*)
* \brief This function initializes the nasmesh interface * \brief This function initializes the nasmesh interface
* \param[in] interfaceName, the name of the interface, e.g. nasmesh0 or nasmesh1 * \param[in] interfaceName, the name of the interface, e.g. nasmesh0 or nasmesh1
...@@ -54,7 +61,7 @@ int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *br ...@@ -54,7 +61,7 @@ int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *br
* \note * \note
* @ingroup ????? * @ingroup ?????
*/ */
int nas_config(int interface_id, int thirdOctet, int fourthOctet); int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifsuffix);
/*! \fn int blocking_NAS_config(char*, char*, char*, char*) /*! \fn int blocking_NAS_config(char*, char*, char*, char*)
* \brief This function initializes the nasmesh interface, in a blocking way, * \brief This function initializes the nasmesh interface, in a blocking way,
...@@ -98,7 +105,7 @@ int set_gateway(char *interfaceName, char *gateway); ...@@ -98,7 +105,7 @@ int set_gateway(char *interfaceName, char *gateway);
* \note * \note
* @ingroup ????? * @ingroup ?????
*/ */
void setBaseNetAddress(char* baseAddr); void setBaseNetAddress(char *baseAddr);
/*! \fn char* getBaseNetAddress() /*! \fn char* getBaseNetAddress()
* \brief This function returns the basic network address used * \brief This function returns the basic network address used
...@@ -106,7 +113,7 @@ void setBaseNetAddress(char* baseAddr); ...@@ -106,7 +113,7 @@ void setBaseNetAddress(char* baseAddr);
* \note * \note
* @ingroup ????? * @ingroup ?????
*/ */
char* getBaseNetAddress(void); char *getBaseNetAddress(void);
/*! \fn void setNetMask(char*) /*! \fn void setNetMask(char*)
* \brief This function sets the new default network mask used * \brief This function sets the new default network mask used
...@@ -114,7 +121,7 @@ char* getBaseNetAddress(void); ...@@ -114,7 +121,7 @@ char* getBaseNetAddress(void);
* \note * \note
* @ingroup ????? * @ingroup ?????
*/ */
void setNetMask(char* baseAddr); void setNetMask(char *baseAddr);
/*! \fn char* getNetMask() /*! \fn char* getNetMask()
* \brief This function returns the network mask address in use * \brief This function returns the network mask address in use
...@@ -122,7 +129,7 @@ void setNetMask(char* baseAddr); ...@@ -122,7 +129,7 @@ void setNetMask(char* baseAddr);
* \note * \note
* @ingroup ????? * @ingroup ?????
*/ */
char* getNetMask(void); char *getNetMask(void);
/*! \fn coid setBroadcastAddress(char*) /*! \fn coid setBroadcastAddress(char*)
* \brief This function sets the new broadcast address used * \brief This function sets the new broadcast address used
...@@ -130,7 +137,7 @@ char* getNetMask(void); ...@@ -130,7 +137,7 @@ char* getNetMask(void);
* \note * \note
* @ingroup ????? * @ingroup ?????
*/ */
void setBroadcastAddress(char* baseAddr); void setBroadcastAddress(char *baseAddr);
/*! \fn char* getBroadcastAddress() /*! \fn char* getBroadcastAddress()
* \brief This function returns the broadcast address in use * \brief This function returns the broadcast address in use
...@@ -138,7 +145,7 @@ void setBroadcastAddress(char* baseAddr); ...@@ -138,7 +145,7 @@ void setBroadcastAddress(char* baseAddr);
* \note * \note
* @ingroup ????? * @ingroup ?????
*/ */
char* getBroadcastAddress(void); char *getBroadcastAddress(void);
int bringInterfaceUp(char *interfaceName, int up); int bringInterfaceUp(char *interfaceName, int up);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "x2ap_eNB_handler.h" #include "x2ap_eNB_handler.h"
#include "x2ap_eNB_generate_messages.h" #include "x2ap_eNB_generate_messages.h"
#include "x2ap_common.h" #include "x2ap_common.h"
#include "x2ap_ids.h"
#include "queue.h" #include "queue.h"
#include "assertions.h" #include "assertions.h"
...@@ -79,6 +80,11 @@ static ...@@ -79,6 +80,11 @@ static
void x2ap_eNB_handle_handover_req_ack(instance_t instance, void x2ap_eNB_handle_handover_req_ack(instance_t instance,
x2ap_handover_req_ack_t *x2ap_handover_req_ack); x2ap_handover_req_ack_t *x2ap_handover_req_ack);
static
void x2ap_eNB_ue_context_release(instance_t instance,
x2ap_ue_context_release_t *x2ap_ue_context_release);
static static
void x2ap_eNB_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) { void x2ap_eNB_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
int result; int result;
...@@ -130,7 +136,7 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa ...@@ -130,7 +136,7 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
sctp_new_association_resp->sctp_state, sctp_new_association_resp->sctp_state,
instance, instance,
sctp_new_association_resp->ulp_cnx_id); sctp_new_association_resp->ulp_cnx_id);
x2ap_handle_x2_setup_message(x2ap_enb_data_p, x2ap_handle_x2_setup_message(instance_p, x2ap_enb_data_p,
sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN); sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; return;
} }
...@@ -294,6 +300,8 @@ void x2ap_eNB_handle_register_eNB(instance_t instance, ...@@ -294,6 +300,8 @@ void x2ap_eNB_handle_register_eNB(instance_t instance,
new_instance->mnc_digit_length = x2ap_register_eNB->mnc_digit_length; new_instance->mnc_digit_length = x2ap_register_eNB->mnc_digit_length;
new_instance->num_cc = x2ap_register_eNB->num_cc; new_instance->num_cc = x2ap_register_eNB->num_cc;
x2ap_id_manager_init(&new_instance->id_manager);
for (int i = 0; i< x2ap_register_eNB->num_cc; i++) { for (int i = 0; i< x2ap_register_eNB->num_cc; i++) {
new_instance->eutra_band[i] = x2ap_register_eNB->eutra_band[i]; new_instance->eutra_band[i] = x2ap_register_eNB->eutra_band[i];
new_instance->downlink_frequency[i] = x2ap_register_eNB->downlink_frequency[i]; new_instance->downlink_frequency[i] = x2ap_register_eNB->downlink_frequency[i];
...@@ -371,30 +379,31 @@ static ...@@ -371,30 +379,31 @@ static
void x2ap_eNB_handle_handover_req(instance_t instance, void x2ap_eNB_handle_handover_req(instance_t instance,
x2ap_handover_req_t *x2ap_handover_req) x2ap_handover_req_t *x2ap_handover_req)
{ {
/* TODO: remove this hack (the goal is to find the correct
* eNodeB structure for the target) - we need a proper way for RRC
* and X2AP to identify eNodeBs
* RRC knows about mod_id and X2AP knows about eNB_id (eNB_ID in
* the configuration file)
* as far as I understand.. CROUX
*/
x2ap_eNB_instance_t *instance_p; x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *target; x2ap_eNB_data_t *target;
x2ap_id_manager *id_manager;
int ue_id;
int target_enb_id = x2ap_handover_req->target_physCellId; int target_pci = x2ap_handover_req->target_physCellId;
instance_p = x2ap_eNB_pci_get_instance(target_enb_id); instance_p = x2ap_eNB_get_instance(instance);
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
//instance_p = x2ap_eNB_get_instance(instance); target = x2ap_is_eNB_pci_in_list(target_pci);
//DevAssert(instance_p != NULL);
target = x2ap_is_eNB_id_in_list(instance_p->eNB_id);
DevAssert(target != NULL); DevAssert(target != NULL);
/* store rnti at index 0 */ /* allocate x2ap ID */
//x2id_to_source_rnti[0] = x2ap_handover_req->source_rnti; id_manager = &instance_p->id_manager;
x2ap_eNB_generate_x2_handover_request(target, x2ap_handover_req); ue_id = x2ap_allocate_new_id(id_manager);
if (ue_id == -1) {
X2AP_ERROR("could not allocate a new X2AP UE ID\n");
/* TODO: cancel handover: send (to be defined) message to RRC */
exit(1);
}
/* id_source is ue_id, id_target is unknown yet */
x2ap_set_ids(id_manager, ue_id, x2ap_handover_req->rnti, ue_id, -1);
x2ap_eNB_generate_x2_handover_request(instance_p, target, x2ap_handover_req, ue_id);
} }
static static
...@@ -410,17 +419,49 @@ void x2ap_eNB_handle_handover_req_ack(instance_t instance, ...@@ -410,17 +419,49 @@ void x2ap_eNB_handle_handover_req_ack(instance_t instance,
*/ */
x2ap_eNB_instance_t *instance_p; x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *target; x2ap_eNB_data_t *target;
int target_enb_id = x2ap_handover_req_ack->target_mod_id; int source_assoc_id = x2ap_handover_req_ack->source_assoc_id;
int ue_id;
int id_source;
int id_target;
instance_p = x2ap_eNB_get_instance(instance);
DevAssert(instance_p != NULL);
target = x2ap_get_eNB(NULL, source_assoc_id, 0);
DevAssert(target != NULL);
/* rnti is a new information, save it */
ue_id = x2ap_handover_req_ack->x2_id_target;
id_source = x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
id_target = ue_id;
x2ap_set_ids(&instance_p->id_manager, ue_id, x2ap_handover_req_ack->rnti, id_source, id_target);
x2ap_eNB_generate_x2_handover_request_ack(instance_p, target, x2ap_handover_req_ack);
}
static
void x2ap_eNB_ue_context_release(instance_t instance,
x2ap_ue_context_release_t *x2ap_ue_context_release)
{
x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *target;
int source_assoc_id = x2ap_ue_context_release->source_assoc_id;
int ue_id;
instance_p = x2ap_eNB_get_instance(instance); instance_p = x2ap_eNB_get_instance(instance);
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
target = x2ap_is_eNB_id_in_list(target_enb_id); target = x2ap_get_eNB(NULL, source_assoc_id, 0);
DevAssert(target != NULL); DevAssert(target != NULL);
x2ap_eNB_generate_x2_handover_request_ack(target, x2ap_handover_req_ack); x2ap_eNB_generate_x2_ue_context_release(instance_p, target, x2ap_ue_context_release);
//x2ap_eNB_generate_x2_handover_req_ack(instance_p, target, x2ap_handover_req_ack->source_x2id,
//x2ap_handover_req_ack->rrc_buffer, x2ap_handover_req_ack->rrc_buffer_size); /* free the X2AP UE ID */
ue_id = x2ap_find_id_from_rnti(&instance_p->id_manager, x2ap_ue_context_release->rnti);
if (ue_id == -1) {
X2AP_ERROR("could not find UE %x\n", x2ap_ue_context_release->rnti);
exit(1);
}
x2ap_release_id(&instance_p->id_manager, ue_id);
} }
void *x2ap_task(void *arg) { void *x2ap_task(void *arg) {
...@@ -454,6 +495,11 @@ void *x2ap_task(void *arg) { ...@@ -454,6 +495,11 @@ void *x2ap_task(void *arg) {
&X2AP_HANDOVER_REQ_ACK(received_msg)); &X2AP_HANDOVER_REQ_ACK(received_msg));
break; break;
case X2AP_UE_CONTEXT_RELEASE:
x2ap_eNB_ue_context_release(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&X2AP_UE_CONTEXT_RELEASE(received_msg));
break;
case SCTP_INIT_MSG_MULTI_CNF: case SCTP_INIT_MSG_MULTI_CNF:
x2ap_eNB_handle_sctp_init_msg_multi_cnf(ITTI_MESSAGE_GET_INSTANCE(received_msg), x2ap_eNB_handle_sctp_init_msg_multi_cnf(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_init_msg_multi_cnf); &received_msg->ittiMsg.sctp_init_msg_multi_cnf);
......
...@@ -48,6 +48,10 @@ static int x2ap_eNB_decode_initiating_message(X2AP_X2AP_PDU_t *pdu) ...@@ -48,6 +48,10 @@ static int x2ap_eNB_decode_initiating_message(X2AP_X2AP_PDU_t *pdu)
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu); //asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
X2AP_INFO("x2ap_eNB_decode_initiating_message!\n"); X2AP_INFO("x2ap_eNB_decode_initiating_message!\n");
break; break;
case X2AP_ProcedureCode_id_uEContextRelease:
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
X2AP_INFO("x2ap_eNB_decode_initiating_message!\n");
break;
default: default:
X2AP_ERROR("Unknown procedure ID (%d) for initiating message\n", X2AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include "sctp_eNB_defs.h" #include "sctp_eNB_defs.h"
#include "x2ap_ids.h"
#ifndef X2AP_ENB_DEFS_H_ #ifndef X2AP_ENB_DEFS_H_
#define X2AP_ENB_DEFS_H_ #define X2AP_ENB_DEFS_H_
...@@ -114,6 +116,10 @@ typedef struct x2ap_eNB_data_s { ...@@ -114,6 +116,10 @@ typedef struct x2ap_eNB_data_s {
/* SCTP association id */ /* SCTP association id */
int32_t assoc_id; int32_t assoc_id;
/* Nid cells */
uint32_t Nid_cell[MAX_NUM_CCs];
int num_cc;
/* Only meaningfull in virtual mode */ /* Only meaningfull in virtual mode */
struct x2ap_eNB_instance_s *x2ap_eNB_instance; struct x2ap_eNB_instance_s *x2ap_eNB_instance;
} x2ap_eNB_data_t; } x2ap_eNB_data_t;
...@@ -163,7 +169,6 @@ typedef struct x2ap_eNB_instance_s { ...@@ -163,7 +169,6 @@ typedef struct x2ap_eNB_instance_s {
uint32_t downlink_frequency[MAX_NUM_CCs]; uint32_t downlink_frequency[MAX_NUM_CCs];
int32_t uplink_frequency_offset[MAX_NUM_CCs]; int32_t uplink_frequency_offset[MAX_NUM_CCs];
uint32_t Nid_cell[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs];
uint32_t Nid_target_cell[MAX_NUM_CCs];
int16_t N_RB_DL[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs];
lte_frame_type_t frame_type[MAX_NUM_CCs]; lte_frame_type_t frame_type[MAX_NUM_CCs];
uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
...@@ -177,6 +182,8 @@ typedef struct x2ap_eNB_instance_s { ...@@ -177,6 +182,8 @@ typedef struct x2ap_eNB_instance_s {
uint16_t sctp_out_streams; uint16_t sctp_out_streams;
uint32_t enb_port_for_X2C; uint32_t enb_port_for_X2C;
int multi_sd; int multi_sd;
x2ap_id_manager id_manager;
} x2ap_eNB_instance_t; } x2ap_eNB_instance_t;
typedef struct { typedef struct {
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "x2ap_eNB_generate_messages.h" #include "x2ap_eNB_generate_messages.h"
#include "x2ap_eNB_encoder.h" #include "x2ap_eNB_encoder.h"
#include "x2ap_eNB_decoder.h" #include "x2ap_eNB_decoder.h"
#include "x2ap_ids.h"
#include "x2ap_eNB_itti_messaging.h" #include "x2ap_eNB_itti_messaging.h"
...@@ -180,7 +181,7 @@ int x2ap_eNB_generate_x2_setup_request( ...@@ -180,7 +181,7 @@ int x2ap_eNB_generate_x2_setup_request(
return ret; return ret;
} }
int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data_t *x2ap_eNB_data_p) int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p)
{ {
X2AP_X2AP_PDU_t pdu; X2AP_X2AP_PDU_t pdu;
X2AP_X2SetupResponse_t *out; X2AP_X2SetupResponse_t *out;
...@@ -189,18 +190,12 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data_t *x2ap_eNB_data_p) ...@@ -189,18 +190,12 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data_t *x2ap_eNB_data_p)
ServedCells__Member *servedCellMember; ServedCells__Member *servedCellMember;
X2AP_GU_Group_ID_t *gu; X2AP_GU_Group_ID_t *gu;
x2ap_eNB_instance_t *instance_p;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int ret = 0; int ret = 0;
DevAssert(x2ap_eNB_data_p != NULL);
/* get the eNB instance */
instance_p = x2ap_eNB_data_p->x2ap_eNB_instance;
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
DevAssert(x2ap_eNB_data_p != NULL);
/* Prepare the X2AP message to encode */ /* Prepare the X2AP message to encode */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -414,8 +409,8 @@ int x2ap_eNB_set_cause (X2AP_Cause_t * cause_p, ...@@ -414,8 +409,8 @@ int x2ap_eNB_set_cause (X2AP_Cause_t * cause_p,
return 0; return 0;
} }
int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p, int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
x2ap_handover_req_t *x2ap_handover_req) x2ap_handover_req_t *x2ap_handover_req, int ue_id)
{ {
X2AP_X2AP_PDU_t pdu; X2AP_X2AP_PDU_t pdu;
...@@ -425,19 +420,12 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p, ...@@ -425,19 +420,12 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p,
X2AP_E_RABs_ToBeSetup_Item_t *e_RABs_ToBeSetup_Item; X2AP_E_RABs_ToBeSetup_Item_t *e_RABs_ToBeSetup_Item;
X2AP_LastVisitedCell_Item_t *lastVisitedCell_Item; X2AP_LastVisitedCell_Item_t *lastVisitedCell_Item;
x2ap_eNB_instance_t *instance_p;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int ret = 0; int ret = 0;
DevAssert(x2ap_eNB_data_p != NULL);
/* get the eNB instance */
instance_p = x2ap_eNB_data_p->x2ap_eNB_instance;
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
DevAssert(x2ap_eNB_data_p != NULL);
/* Prepare the X2AP handover message to encode */ /* Prepare the X2AP handover message to encode */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -452,7 +440,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p, ...@@ -452,7 +440,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p,
ie->id = X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID; ie->id = X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_reject; ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_HandoverRequest_IEs__value_PR_UE_X2AP_ID; ie->value.present = X2AP_HandoverRequest_IEs__value_PR_UE_X2AP_ID;
ie->value.choice.UE_X2AP_ID = x2ap_handover_req->old_eNB_ue_x2ap_id; ie->value.choice.UE_X2AP_ID = x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -471,7 +459,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p, ...@@ -471,7 +459,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p,
ie->value.present = X2AP_HandoverRequest_IEs__value_PR_ECGI; ie->value.present = X2AP_HandoverRequest_IEs__value_PR_ECGI;
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
&ie->value.choice.ECGI.pLMN_Identity); &ie->value.choice.ECGI.pLMN_Identity);
MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id, 0, &ie->value.choice.ECGI.eUTRANcellIdentifier); MACRO_ENB_ID_TO_CELL_IDENTITY(x2ap_eNB_data_p->eNB_id, 0, &ie->value.choice.ECGI.eUTRANcellIdentifier);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -576,7 +564,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p, ...@@ -576,7 +564,7 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p,
return ret; return ret;
} }
int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p, int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
x2ap_handover_req_ack_t *x2ap_handover_req_ack) x2ap_handover_req_ack_t *x2ap_handover_req_ack)
{ {
...@@ -585,19 +573,20 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p, ...@@ -585,19 +573,20 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p,
X2AP_HandoverRequestAcknowledge_IEs_t *ie; X2AP_HandoverRequestAcknowledge_IEs_t *ie;
X2AP_E_RABs_Admitted_ItemIEs_t *e_RABS_Admitted_ItemIEs; X2AP_E_RABs_Admitted_ItemIEs_t *e_RABS_Admitted_ItemIEs;
X2AP_E_RABs_Admitted_Item_t *e_RABs_Admitted_Item; X2AP_E_RABs_Admitted_Item_t *e_RABs_Admitted_Item;
int ue_id;
x2ap_eNB_instance_t *instance_p; int id_source;
int id_target;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int ret = 0; int ret = 0;
DevAssert(instance_p != NULL);
DevAssert(x2ap_eNB_data_p != NULL); DevAssert(x2ap_eNB_data_p != NULL);
/* get the eNB instance */ ue_id = x2ap_handover_req_ack->x2_id_target;
instance_p = x2ap_eNB_data_p->x2ap_eNB_instance; id_source = x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
id_target = ue_id;
DevAssert(instance_p != NULL);
/* Prepare the X2AP handover message to encode */ /* Prepare the X2AP handover message to encode */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -612,15 +601,15 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p, ...@@ -612,15 +601,15 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p,
ie->id = X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID; ie->id = X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_ignore; ie->criticality = X2AP_Criticality_ignore;
ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID; ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID;
ie->value.choice.UE_X2AP_ID = 0; ie->value.choice.UE_X2AP_ID = id_source;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
ie = (X2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequestAcknowledge_IEs_t)); ie = (X2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequestAcknowledge_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID; ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_ignore; ie->criticality = X2AP_Criticality_ignore;
ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID; ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID_1;
ie->value.choice.UE_X2AP_ID = 0; ie->value.choice.UE_X2AP_ID_1 = id_target;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
...@@ -668,25 +657,30 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p, ...@@ -668,25 +657,30 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p,
return ret; return ret;
} }
int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_data_t *x2ap_eNB_data_p) int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p, x2ap_ue_context_release_t *x2ap_ue_context_release)
{ {
X2AP_X2AP_PDU_t pdu; X2AP_X2AP_PDU_t pdu;
X2AP_UEContextRelease_t *out; X2AP_UEContextRelease_t *out;
X2AP_UEContextRelease_IEs_t *ie; X2AP_UEContextRelease_IEs_t *ie;
int ue_id;
x2ap_eNB_instance_t *instance_p; int id_source;
int id_target;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int ret = 0; int ret = 0;
DevAssert(instance_p != NULL);
DevAssert(x2ap_eNB_data_p != NULL); DevAssert(x2ap_eNB_data_p != NULL);
/* get the eNB instance */ ue_id = x2ap_find_id_from_rnti(&instance_p->id_manager, x2ap_ue_context_release->rnti);
instance_p = x2ap_eNB_data_p->x2ap_eNB_instance; if (ue_id == -1) {
X2AP_ERROR("could not find UE %x\n", x2ap_ue_context_release->rnti);
DevAssert(instance_p != NULL); exit(1);
}
id_source = x2ap_id_get_id_source(&instance_p->id_manager, ue_id);
id_target = ue_id;
/* Prepare the X2AP ue context relase message to encode */ /* Prepare the X2AP ue context relase message to encode */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -701,15 +695,15 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_data_t *x2ap_eNB_data_p) ...@@ -701,15 +695,15 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_data_t *x2ap_eNB_data_p)
ie->id = X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID; ie->id = X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_reject; ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID; ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID;
ie->value.choice.UE_X2AP_ID = 0; ie->value.choice.UE_X2AP_ID = id_source;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
ie = (X2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(X2AP_UEContextRelease_IEs_t)); ie = (X2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(X2AP_UEContextRelease_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID; ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_reject; ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID; ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID_1;
ie->value.choice.UE_X2AP_ID = 0; ie->value.choice.UE_X2AP_ID_1 = id_target;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p, int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
x2ap_eNB_data_t *x2ap_eNB_data_p); x2ap_eNB_data_t *x2ap_eNB_data_p);
int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data_t *x2ap_eNB_data_p); int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p);
int x2ap_eNB_generate_x2_setup_failure(instance_t instance, int x2ap_eNB_generate_x2_setup_failure(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
...@@ -47,12 +47,13 @@ int x2ap_eNB_set_cause (X2AP_Cause_t * cause_p, ...@@ -47,12 +47,13 @@ int x2ap_eNB_set_cause (X2AP_Cause_t * cause_p,
X2AP_Cause_PR cause_type, X2AP_Cause_PR cause_type,
long cause_value); long cause_value);
int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_data_t *x2ap_eNB_data_p, int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
x2ap_handover_req_t *x2ap_handover_req); x2ap_handover_req_t *x2ap_handover_req, int ue_id);
int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p, int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
x2ap_handover_req_ack_t *x2ap_handover_req_ack); x2ap_handover_req_ack_t *x2ap_handover_req_ack);
int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_data_t *x2ap_eNB_data_p); int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
x2ap_ue_context_release_t *x2ap_ue_context_release);
#endif /* X2AP_ENB_GENERATE_MESSAGES_H_ */ #endif /* X2AP_ENB_GENERATE_MESSAGES_H_ */
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "x2ap_eNB_defs.h" #include "x2ap_eNB_defs.h"
void x2ap_handle_x2_setup_message(x2ap_eNB_data_t *eNB_desc_p, int sctp_shutdown); void x2ap_handle_x2_setup_message(x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *eNB_desc_p, int sctp_shutdown);
int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length); const uint8_t * const data, const uint32_t data_length);
......
...@@ -169,23 +169,6 @@ x2ap_eNB_instance_t *x2ap_eNB_get_instance(instance_t instance) ...@@ -169,23 +169,6 @@ x2ap_eNB_instance_t *x2ap_eNB_get_instance(instance_t instance)
return NULL; return NULL;
} }
x2ap_eNB_instance_t *x2ap_eNB_pci_get_instance(uint32_t pci)
{
x2ap_eNB_instance_t *temp = NULL;
STAILQ_FOREACH(temp, &x2ap_eNB_internal_data.x2ap_eNB_instances_head,
x2ap_eNB_entries) {
for (int i=0; i<temp->num_cc;i++) {
if (temp->Nid_target_cell[i] == pci) {
/* Matching occurence */
return temp;
}
}
}
return NULL;
}
/// utility functions /// utility functions
void x2ap_dump_eNB (x2ap_eNB_data_t * eNB_ref); void x2ap_dump_eNB (x2ap_eNB_data_t * eNB_ref);
...@@ -222,6 +205,22 @@ void x2ap_dump_eNB (x2ap_eNB_data_t * eNB_ref) { ...@@ -222,6 +205,22 @@ void x2ap_dump_eNB (x2ap_eNB_data_t * eNB_ref) {
indent--; indent--;
} }
x2ap_eNB_data_t * x2ap_is_eNB_pci_in_list (const uint32_t pci)
{
x2ap_eNB_instance_t *inst;
struct x2ap_eNB_data_s *elm;
STAILQ_FOREACH(inst, &x2ap_eNB_internal_data.x2ap_eNB_instances_head, x2ap_eNB_entries) {
RB_FOREACH(elm, x2ap_enb_map, &inst->x2ap_enb_head) {
for (int i = 0; i<elm->num_cc; i++) {
if (elm->Nid_cell[i] == pci) {
return elm;
}
}
}
}
return NULL;
}
x2ap_eNB_data_t * x2ap_is_eNB_id_in_list (const uint32_t eNB_id) x2ap_eNB_data_t * x2ap_is_eNB_id_in_list (const uint32_t eNB_id)
{ {
......
...@@ -37,8 +37,6 @@ void x2ap_eNB_insert_new_instance(x2ap_eNB_instance_t *new_instance_p); ...@@ -37,8 +37,6 @@ void x2ap_eNB_insert_new_instance(x2ap_eNB_instance_t *new_instance_p);
x2ap_eNB_instance_t *x2ap_eNB_get_instance(uint8_t mod_id); x2ap_eNB_instance_t *x2ap_eNB_get_instance(uint8_t mod_id);
x2ap_eNB_instance_t *x2ap_eNB_pci_get_instance(uint32_t pci);
uint16_t x2ap_eNB_fetch_add_global_cnx_id(void); uint16_t x2ap_eNB_fetch_add_global_cnx_id(void);
void x2ap_eNB_prepare_internal_data(void); void x2ap_eNB_prepare_internal_data(void);
...@@ -47,6 +45,8 @@ x2ap_eNB_data_t* x2ap_is_eNB_id_in_list(uint32_t eNB_id); ...@@ -47,6 +45,8 @@ x2ap_eNB_data_t* x2ap_is_eNB_id_in_list(uint32_t eNB_id);
x2ap_eNB_data_t* x2ap_is_eNB_assoc_id_in_list(uint32_t sctp_assoc_id); x2ap_eNB_data_t* x2ap_is_eNB_assoc_id_in_list(uint32_t sctp_assoc_id);
x2ap_eNB_data_t* x2ap_is_eNB_pci_in_list (const uint32_t pci);
struct x2ap_eNB_data_s *x2ap_get_eNB(x2ap_eNB_instance_t *instance_p, struct x2ap_eNB_data_s *x2ap_get_eNB(x2ap_eNB_instance_t *instance_p,
int32_t assoc_id, int32_t assoc_id,
uint16_t cnx_id); uint16_t cnx_id);
......
This diff is collapsed.
This diff is collapsed.
...@@ -38,7 +38,7 @@ int sctp_itti_send_init_msg_multi_cnf(task_id_t task_id, instance_t instance, in ...@@ -38,7 +38,7 @@ int sctp_itti_send_init_msg_multi_cnf(task_id_t task_id, instance_t instance, in
return itti_send_msg_to_task(task_id, instance, message_p); return itti_send_msg_to_task(task_id, instance, message_p);
} }
int sctp_itti_send_new_message_ind(task_id_t task_id, uint32_t assoc_id, uint8_t *buffer, int sctp_itti_send_new_message_ind(task_id_t task_id, instance_t instance, uint32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream) uint32_t buffer_length, uint16_t stream)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -57,7 +57,7 @@ int sctp_itti_send_new_message_ind(task_id_t task_id, uint32_t assoc_id, uint8_t ...@@ -57,7 +57,7 @@ int sctp_itti_send_new_message_ind(task_id_t task_id, uint32_t assoc_id, uint8_t
sctp_data_ind_p->buffer_length = buffer_length; sctp_data_ind_p->buffer_length = buffer_length;
sctp_data_ind_p->assoc_id = assoc_id; sctp_data_ind_p->assoc_id = assoc_id;
return itti_send_msg_to_task(task_id, INSTANCE_DEFAULT, message_p); return itti_send_msg_to_task(task_id, instance, message_p);
} }
int sctp_itti_send_association_resp(task_id_t task_id, instance_t instance, int sctp_itti_send_association_resp(task_id_t task_id, instance_t instance,
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
int sctp_itti_send_init_msg_multi_cnf(task_id_t task_id, instance_t instance, int multi_sd); int sctp_itti_send_init_msg_multi_cnf(task_id_t task_id, instance_t instance, int multi_sd);
int sctp_itti_send_new_message_ind(task_id_t task_id, uint32_t assoc_id, uint8_t *buffer, int sctp_itti_send_new_message_ind(task_id_t task_id, instance_t instance, uint32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream); uint32_t buffer_length, uint16_t stream);
int sctp_itti_send_association_resp(task_id_t task_id, instance_t instance, int sctp_itti_send_association_resp(task_id_t task_id, instance_t instance,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -13,7 +13,7 @@ eNBs = ...@@ -13,7 +13,7 @@ eNBs =
eNB_name = "eNB_Eurecom_LTEBox"; eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1"; tracking_area_code = 1;
plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2;} ); plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2;} );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment