Commit 40cb79e4 authored by nepes's avatar nepes

Merge remote-tracking branch 'origin/develop' into eMTC-testing

parents 4c505b86 b6296d8d
......@@ -272,7 +272,7 @@ pipeline {
}
}
} catch (Exception e) {
echo "Red Hat build failed not an error now"
echo "Red Hat build failed but we could keep running pipeline if all ubuntu-based build passed"
}
}
}
......@@ -290,6 +290,17 @@ pipeline {
}
if ("MERGE".equals(env.gitlabActionType)) {
sh "./ci-scripts/oai-ci-vm-tool report-build --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
// If the merge request has introduced more CPPCHECK errors or warnings, notifications in GitLab
if (fileExists('oai_cppcheck_added_errors.txt')) {
def ret=readFile('./oai_cppcheck_added_errors.txt').trim();
if ("0".equals(ret)) {
echo "No added cppcheck warnings/errors in this merge request"
} else {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some modified files in Merge Request MAY have INTRODUCED up to " + ret + " CPPCHECK errors/warnings"
addGitLabMRComment comment: message
}
}
// If the merge request has introduced compilation warnings, notifications in GitLab
sh "./ci-scripts/checkAddedWarnings.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
def res=readFile('./oai_warning_files.txt').trim();
if ("0".equals(res)) {
......@@ -313,40 +324,68 @@ pipeline {
stage ("Variant Tests") {
parallel {
stage ("Test physical simulators") {
steps {
gitlabCommitStatus(name: "Test phy-sim") {
timeout (time: 20, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
stage ("VM-based tests") {
stages {
stage ("Test physical simulators") {
steps {
script {
gitlabCommitStatus(name: "Test phy-sim") {
timeout (time: 20, unit: 'MINUTES') {
try {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
}
}
}
}
}
}
}
stage ("Test basic simulator") {
steps {
gitlabCommitStatus(name: "Test basic-sim") {
timeout (time: 30, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
stage ("Build Flexran Controller") {
when {
expression {doFlexranCtrlTest}
}
steps {
script {
timeout (time: 20, unit: 'MINUTES') {
try {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
}
}
}
}
}
}
stage ("Test L2 simulator") {
steps {
gitlabCommitStatus(name: "Test L2-sim") {
timeout (time: 30, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
stage ("Test basic simulator") {
steps {
script {
gitlabCommitStatus(name: "Test basic-sim") {
timeout (time: 30, unit: 'MINUTES') {
try {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
}
}
}
}
}
}
}
stage ("Build Flexran Controller") {
when {
expression {doFlexranCtrlTest}
}
steps {
timeout (time: 20, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
stage ("Test L2 simulator") {
steps {
script {
gitlabCommitStatus(name: "Test L2-sim") {
timeout (time: 30, unit: 'MINUTES') {
try {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
}
}
}
}
}
}
}
......
......@@ -95,7 +95,7 @@ fi
# Merge request scenario
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
MERGE_COMMMIT=`git log -n1 --pretty=format:%H`
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
echo " ---- Checking the modified files by the merge request ----"
......
......@@ -111,7 +111,7 @@ fi
# Merge request scenario
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
MERGE_COMMMIT=`git log -n1 --pretty=format:%H`
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
echo " ---- Checking the modified files by the merge request ----"
......
This diff is collapsed.
......@@ -112,7 +112,7 @@ function start_basic_sim_ue {
rm $1
local i="0"
echo "ifconfig oip1 | egrep -c \"inet addr\"" > $1
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
while [ $i -lt 10 ]
do
sleep 5
......@@ -134,7 +134,7 @@ function start_basic_sim_ue {
}
function get_ue_ip_addr {
echo "ifconfig oip1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1
echo "ifconfig oaitun_ue1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1
UE_IP_ADDR=`ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1`
echo "UE IP Address for EPC is : $UE_IP_ADDR"
rm $1
......@@ -149,9 +149,9 @@ function ping_ue_ip_addr {
}
function ping_epc_ip_addr {
echo "echo \"COMMAND IS: ping -I oip1 -c 20 $3\" > $4" > $1
echo "echo \"COMMAND IS: ping -I oaitun_ue1 -c 20 $3\" > $4" > $1
echo "rm -f $4" >> $1
echo "ping -I oip1 -c 20 $3 | tee -a $4" >> $1
echo "ping -I oaitun_ue1 -c 20 $3 | tee -a $4" >> $1
cat $1
ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1
rm -f $1
......@@ -618,9 +618,9 @@ function start_l2_sim_ue {
UE_SYNC=1
echo "L2-SIM UE is sync'ed w/ eNB"
fi
# Checking oip1 interface has now an IP address
# Checking oaitun_ue1 interface has now an IP address
i="0"
echo "ifconfig oip1 | egrep -c \"inet addr\"" > $1
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
while [ $i -lt 10 ]
do
sleep 5
......@@ -636,10 +636,10 @@ function start_l2_sim_ue {
if [ $i -lt 50 ]
then
UE_SYNC=0
echo "L2-SIM UE oip1 is NOT sync'ed w/ EPC"
echo "L2-SIM UE oaitun_ue1 is NOT sync'ed w/ EPC"
else
UE_SYNC=1
echo "L2-SIM UE oip1 is sync'ed w/ EPC"
echo "L2-SIM UE oaitun_ue1 is sync'ed w/ EPC"
fi
sleep 10
}
......
......@@ -250,7 +250,7 @@ add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros")
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode")
add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
#add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
......@@ -595,7 +595,6 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
##############################################################
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
##############################################################
add_boolean_option(ENABLE_SECURITY True "Enable LTE integrity and ciphering between RRC UE and eNB")
add_boolean_option(ENABLE_USE_MME True "eNB connected to MME (INTERFACE S1-C), not standalone eNB")
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer")
......@@ -693,10 +692,10 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
# PDCP LAYER OPTIONS
##########################
add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
#add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
#add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
##########################
# RRC LAYER OPTIONS
......@@ -1994,26 +1993,29 @@ add_executable(lte-softmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-softmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
-Wl,--end-group z dl)
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
# lte-uesoftmodem is UE implementation
#######################################
......@@ -2027,6 +2029,8 @@ add_executable(lte-uesoftmodem
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
......@@ -2070,6 +2074,7 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${XFORMS_SOURCE}
......@@ -2080,18 +2085,18 @@ add_executable(lte-uesoftmodem-nos1
)
add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-uesoftmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
-Wl,--end-group z dl)
target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
# USIM process
#################
#add_executable(usim
......
......@@ -547,9 +547,9 @@ function main() {
mkdir -p $DIR/$lte_build_dir/build
cmake_file=$DIR/$lte_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
if [ "$NOS1" = "1" ] ; then
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
fi
# if [ "$NOS1" = "1" ] ; then
# cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
# fi
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
......@@ -936,7 +936,7 @@ fi
echo "set (LINUX True )" >> $cmake_file
echo "set (PDCP_USE_NETLINK True )" >> $cmake_file
echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file
echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
# echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file
echo_info "Build UE"
......
......@@ -9,7 +9,6 @@ set ( EMIT_ASN_DEBUG False )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
set ( ENABLE_USE_MME True )
......
......@@ -8,7 +8,6 @@ set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
set ( ENABLE_USE_MME True )
......
......@@ -8,7 +8,6 @@ set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST False )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False )
set ( ENABLE_STANDALONE_EPC False )
set ( ENABLE_USE_CPU_EXECUTION_TIME False )
set ( ENABLE_USE_MME False )
......
......@@ -7,7 +7,6 @@ set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
set ( ENABLE_USE_MME False )
......
......@@ -9,7 +9,6 @@ set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
set ( ENABLE_USE_MME True )
......
......@@ -303,8 +303,8 @@ void log_getconfig(log_t *g_log) {
logparams_dump[i].numelt = 0;
}
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
/* set the debug mask according to the debug parameters values */
......@@ -385,7 +385,6 @@ int logInit (void) {
register_log_component("OCG","",OCG);
register_log_component("PERF","",PERF);
register_log_component("OIP","",OIP);
register_log_component("CLI","",CLI);
register_log_component("MSC","log",MSC);
register_log_component("OCM","log",OCM);
register_log_component("HW","",HW);
......@@ -408,6 +407,8 @@ int logInit (void) {
register_log_component("X2AP","",X2AP);
register_log_component("LOADER","log",LOADER);
register_log_component("ASN","log",ASN);
register_log_component("NFAPI_PNF","log",NFAPI_PNF);
register_log_component("NFAPI_VNF","log",NFAPI_VNF);
for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
......@@ -438,7 +439,7 @@ char *log_getthreadname(char *threadname, int bufsize) {
static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
char threadname[PR_SET_NAME];
return snprintf(log_buffer, buffsize , "%s%s[%s]%c %s %s%s",
return snprintf(log_buffer, buffsize, "%s%s[%s]%c %s %s%s",
log_level_highlight_end[level],
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name,
......@@ -452,11 +453,17 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
char log_buffer[MAX_LOG_TOTAL];
va_list args;
va_start(args, format);
log_header(log_buffer,MAX_LOG_TOTAL ,comp, level,format);
log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
va_end(args);
}
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ) {
char log_buffer[MAX_LOG_TOTAL];
log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
}
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ) {
va_list args;
char *wbuf;
......@@ -474,7 +481,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
if (wbuf != NULL) {
va_start(args, format);
int pos=log_header(wbuf,MAX_LOG_TOTAL ,component, OAILOG_INFO,"");
int pos=log_header(wbuf,MAX_LOG_TOTAL,component, OAILOG_INFO,"");
int pos2=vsprintf(wbuf+pos,format, args);
pos=pos+pos2;
va_end(args);
......
......@@ -198,7 +198,6 @@ typedef enum {
NAS,
PERF,
OIP,
CLI,
MSC,
OCM,
UDP_,
......@@ -218,6 +217,8 @@ typedef enum {
X2AP,
LOADER,
ASN,
NFAPI_VNF,
NFAPI_PNF,
MAX_LOG_PREDEF_COMPONENTS,
}
comp_name_t;
......@@ -286,6 +287,7 @@ extern "C" {
int logInit (void);
int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
int set_log(int component, int level);
void set_glog(int level);
......@@ -365,9 +367,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
# define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0)
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
/* bitmask dependant macros, to isolate debugging code */
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
......
......@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_INFO
DESC = NFAPI_VNF legacy logs - info level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_ERROR
DESC = NFAPI_VNF legacy logs - error level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_WARNING
DESC = NFAPI_VNF legacy logs - warning level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_DEBUG
DESC = NFAPI_VNF legacy logs - debug level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_TRACE
DESC = NFAPI_VNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_INFO
DESC = NFAPI_PNF legacy logs - info level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_ERROR
DESC = NFAPI_PNF legacy logs - error level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_WARNING
DESC = NFAPI_PNF legacy logs - warning level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_DEBUG
DESC = NFAPI_PNF legacy logs - debug level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_TRACE
DESC = NFAPI_PNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
# this is a bad hack but I won't fix (function util_print_hex_octets
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
# does funky things with the LOG_x macros but we work on the C pre-processor
......@@ -845,27 +886,7 @@ ID = LEGACY_componentP_TRACE
GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
#needed?
ID = LEGACY_CLI_INFO
DESC = CLI legacy logs - info level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_ERROR
DESC = CLI legacy logs - error level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_WARNING
DESC = CLI legacy logs - warning level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_DEBUG
DESC = CLI legacy logs - debug level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_TRACE
DESC = CLI legacy logs - trace level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
#################
#### UE LOGS ####
......
......@@ -3,7 +3,7 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I..
LIBS=-lX11 -lm -lpng -lXft
all: dump_nack_signal time_meas timeplot
all: dump_nack_signal time_meas timeplot multi-rru-clean
dump_nack_signal: ../utils.o ../database.o ../config.o ../event.o \
dump_nack_signal.o
......@@ -16,6 +16,9 @@ time_meas: ../utils.o ../database.o ../config.o ../event.o \
timplot: timeplot.o
$(CC) $(CFLAGS) -o timeplot $^ $(LIBS)
multi-rru-clean: ../utils.o ../database.o ../event.o ../config.o multi-rru-clean.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
.PHONY: all
%.o: %.c
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "database.h"
#include "utils.h"
#include "event.h"
#include "../T_defs.h"
void usage(void)
{
printf(
"usage: <number of tags> <input record file> <output curated record file>\n"
"options:\n"
" -d <database file> this option is mandatory\n"
);
exit(1);
}
#define ERR printf("ERROR: read file %s failed\n", input_filename)
typedef struct {
OBUF b;
struct timespec t;
int filled;
int error;
} cache_t;
void clear_cache(int n, cache_t *c)
{
int i;
for (i = 0; i < n; i++) {
c[i].filled = 0;
c[i].error = 0;
c[i].b.osize = 0;
}
}
void store_in_cache(cache_t *c, int pos, OBUF *b)
{
int i;
for (i = 0; i < b->osize; i++)
PUTC(&c[pos].b, b->obuf[i]);
}
int get_field(database_event_format *f, char *field, char *type)
{
int i;
for (i = 0; i < f->count; i++)
if (!strcmp(f->name[i], field)) {
if (strcmp(f->type[i], type)) break;
return i;
}
printf("bad field %s, check that it exists and has type '%s'\n",field,type);
exit(1);
}
void process_cache(FILE *out, cache_t *c, int n, int frame, int subframe)
{
int i;
struct tm *t;
for (i = 0; i < n; i++)
if (c[i].filled == 0 || c[i].error == 1)
goto error;
for (i = 0; i < n; i++)
fwrite(c[i].b.obuf, c[i].b.osize, 1, out);
clear_cache(n, c);
return;
error:
printf("ERROR: incorrect data at frame %d subframe %d", frame, subframe);
for (i = 0; i < n; i++) if (c[i].filled) {
t = localtime(&c[i].t.tv_sec);
printf(" [tag %d time %2.2d:%2.2d:%2.2d.%9.9ld]", i,
t->tm_hour, t->tm_min, t->tm_sec, c[i].t.tv_nsec);
}
printf("\n");
clear_cache(n, c);
}
int main(int n, char **v)
{
char *database_filename = NULL;
void *database;
int channel_estimate_id;
int number_of_tags = -1;
char *input_filename = NULL;
char *output_filename = NULL;
int i;
FILE *in;
FILE *out;
database_event_format f;
int frame_arg;
int subframe_arg;
int tag_arg;
cache_t *cache;
int cur_frame = -1;
int cur_subframe = -1;
int frame;
int subframe;
int tag;
for (i = 1; i < n; i++) {
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
if (!strcmp(v[i], "-d")) { if (i > n-2) usage();
database_filename = v[++i]; continue; }
if (number_of_tags == -1) { number_of_tags = atoi(v[i]);
if (number_of_tags <= 0) {usage();} continue; }
if (input_filename == NULL) { input_filename = v[i]; continue; }
if (output_filename == NULL) { output_filename = v[i]; continue; }
usage();
}
if (database_filename == NULL) {
printf("ERROR: provide a database file (-d)\n");
exit(1);
}
if (output_filename == NULL || input_filename == NULL || number_of_tags == -1)
usage();
database = parse_database(database_filename);
channel_estimate_id = event_id_from_name(database, "CALIBRATION_CHANNEL_ESTIMATES");
f = get_format(database, channel_estimate_id);
frame_arg = get_field(&f, "frame", "int");
subframe_arg = get_field(&f, "subframe", "int");
tag_arg = get_field(&f, "tag", "int");
in = fopen(input_filename, "r");
if (in == NULL) { perror(input_filename); abort(); }
out = fopen(output_filename, "w");
if (out == NULL) { perror(output_filename); abort(); }
cache = calloc(number_of_tags, sizeof(cache_t));
if (cache == NULL) { perror("malloc"); exit(1); }
clear_cache(number_of_tags, cache);
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
while (1) {
int type;
int32_t length;
char *v;
int vpos = 0;
struct timespec t;
char *buf;
/* read event from file */
if (fread(&length, 4, 1, in) != 1) break;
if (ebuf.omaxsize < length) {
ebuf.omaxsize = (length + 65535) & ~65535;
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
}
v = ebuf.obuf;
memcpy(v+vpos, &length, 4);
vpos += 4;
#ifdef T_SEND_TIME
if (length < sizeof(struct timespec)) { ERR; break; }
if (fread(&t, sizeof(struct timespec), 1, in) != 1) { ERR; break; }
memcpy(v+vpos, &t, sizeof(struct timespec));
vpos += sizeof(struct timespec);
length -= sizeof(struct timespec);
#endif
if (length < sizeof(int)) { ERR; break; }
if (fread(&type, sizeof(int), 1, in) != 1) { ERR; break; }
memcpy(v+vpos, &type, sizeof(int));
vpos += sizeof(int);
length -= sizeof(int);
if (length) if (fread(v+vpos, length, 1, in) != 1) { ERR; break; }
buf = v + vpos;
vpos += length;
ebuf.osize = vpos;
if (type != channel_estimate_id) continue;
event e;
#ifdef T_SEND_TIME
e = new_event(t, type, length, buf, database);
#else
e = new_event(type, length, buf, database);
#endif
frame = e.e[frame_arg].i;
subframe = e.e[subframe_arg].i;
tag = e.e[tag_arg].i;
if (tag < 0 || tag >= number_of_tags) {
struct tm *tt;
tt = localtime(&t.tv_sec);
printf("ERROR: invalid tag (%d), skipping event for frame %d subframe %d (time %2.2d:%2.2d:%2.2d.%9.9ld)\n",
tag, frame, subframe,
tt->tm_hour, tt->tm_min, tt->tm_sec, t.tv_nsec);
continue;
}
if (cur_frame != frame || cur_subframe != subframe)
if (cur_frame != -1)
process_cache(out, cache, number_of_tags, cur_frame, cur_subframe);
cur_frame = frame;
cur_subframe = subframe;
if (cache[tag].filled) {
struct tm *tt;
tt = localtime(&t.tv_sec);
printf("ERROR: tag %d present twice at frame %d subframe %d (time %2.2d:%2.2d:%2.2d.%9.9ld)\n",
tag, frame, subframe,
tt->tm_hour, tt->tm_min, tt->tm_sec, t.tv_nsec);
cache[tag].error = 1;
continue;
}
store_in_cache(cache, tag, &ebuf);
cache[tag].filled = 1;
cache[tag].t = t;
}
if (fclose(in)) perror(input_filename);
if (fclose(out)) perror(output_filename);
free(cache);
return 0;
}
This diff is collapsed.
......@@ -606,7 +606,7 @@ void vnf_deallocate(void *ptr) {
void vnf_trace(nfapi_trace_level_t nfapi_level, const char *message, ...) {
va_list args;
va_start(args, message);
nfapi_log("FILE>", "FUNC", 999, PHY, nfapitooai_level(nfapi_level), message, args);
VLOG( NFAPI_VNF, nfapitooai_level(nfapi_level), message, args);
va_end(args);
}
......
......@@ -39,13 +39,14 @@
#include <fcntl.h>
#include <errno.h>
#include "platform_constants.h"
#ifdef UE_NAS_USE_TUN
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include "openairinterface5g_limits.h"
#endif
#include "pdcp.h"
char nl_rx_buf[NL_MAX_PAYLOAD];
......@@ -54,20 +55,16 @@ struct nlmsghdr *nas_nlh_tx = NULL;
struct nlmsghdr *nas_nlh_rx = NULL;
struct iovec nas_iov_tx;
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
#ifdef UE_NAS_USE_TUN
int nas_sock_fd[NUMBER_OF_UE_MAX];
#else
int nas_sock_fd;
#endif
int nas_sock_fd[MAX_MOBILES_PER_ENB];
struct msghdr nas_msg_tx;
struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31
#ifdef UE_NAS_USE_TUN
static int tun_alloc(char *dev)
{
static int tun_alloc(char *dev) {
struct ifreq ifr;
int fd, err;
......@@ -77,66 +74,58 @@ static int tun_alloc(char *dev)
}
memset(&ifr, 0, sizeof(ifr));
/* Flags: IFF_TUN - TUN device (no Ethernet headers)
* IFF_TAP - TAP device
*
* IFF_NO_PI - Do not provide packet information
*/
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
if( *dev )
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){
close(fd);
return err;
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
close(fd);
return err;
}
strcpy(dev, ifr.ifr_name);
return fd;
}
int netlink_init(void)
{
int i;
int netlink_init_tun(void) {
int ret;
char ifname[64];
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
sprintf(ifname, "oip%d", i+1);
for (int i = 0; i < NUMBER_OF_UE_MAX; i++) {
sprintf(ifname, "oaitun_ue%d",i+1);
nas_sock_fd[i] = tun_alloc(ifname);
if (nas_sock_fd[i] == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[i],errno, strerror(errno));
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
exit(1);
}
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd[i]);
#if !defined(PDCP_USE_NETLINK_QUEUES)
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_fd[i]);
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1);
#endif
}
#endif
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
}
}
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd[i], (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
ret = bind(nas_sock_fd[i], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
......@@ -144,7 +133,6 @@ int netlink_init(void)
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
......@@ -152,61 +140,50 @@ int netlink_init(void)
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
}
} /* for */
return 1;
}
#else /* UE_NAS_USE_TUN */
int netlink_init(void)
{
int netlink_init(void) {
int ret;
nas_sock_fd[0] = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd[0] == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
if (nas_sock_fd == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1);
#endif
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
}
}
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
#if !defined(PDCP_USE_NETLINK_QUEUES)
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd[0]);
ret = fcntl(nas_sock_fd[0],F_SETFL,O_NONBLOCK);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1);
#endif
}
#endif
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
}
}
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
ret = bind(nas_sock_fd[0], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
......@@ -214,7 +191,6 @@ int netlink_init(void)
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
......@@ -222,16 +198,12 @@ int netlink_init(void)
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
return(nas_sock_fd);
return(nas_sock_fd[0]);
}
#endif /* UE_NAS_USE_TUN */
......@@ -34,7 +34,7 @@
#define EMU_PROTO_H_
void init_bypass (void);
void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char*, unsigned int*, unsigned int*),unsigned int (*rx_handlerP) (unsigned char,char*,unsigned int));
void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char *, unsigned int *, unsigned int *),unsigned int (*rx_handlerP) (unsigned char,char *,unsigned int));
int bypass_rx_data(unsigned int frame, unsigned int last_slot,
unsigned int next_slot, uint8_t is_master);
void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot,
......@@ -43,7 +43,7 @@ void bypass_tx_data (emu_transport_info_t Type, unsigned int frame, unsigned int
void emulation_tx_rx(void);
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int* Nbytes,unsigned int *Nb_flows);
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int *Nbytes,unsigned int *Nb_flows);
unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer, unsigned int Nbytes);
unsigned int emul_rx_data(void);
......@@ -62,5 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
void clear_eNB_transport_info(uint8_t);
void clear_UE_transport_info(uint8_t);
int netlink_init(void);
int netlink_init_tun(void);
#endif /* EMU_PROTO_H_ */
......@@ -26,7 +26,6 @@
* Author: winckel
*/
#if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
//-------------------------------------------------------------------------------------------//
// Messages for NAS logging
MESSAGE_DEF(NAS_DL_EMM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_dl_emm_raw_msg)
......@@ -46,4 +45,4 @@ MESSAGE_DEF(NAS_DL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_
MESSAGE_DEF(NAS_UL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_ul_esm_protected_msg)
//-------------------------------------------------------------------------------------------//
#endif /* ENABLE_USE_MME */
......@@ -29,7 +29,7 @@
#ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_
# if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
#include "nas_message.h"
......@@ -142,5 +142,4 @@ typedef struct nas_esm_protected_msg_s {
ESM_msg choice;
} nas_esm_protected_msg_t;
# endif /* ENABLE_USE_MME */
#endif /* NAS_MESSAGES_TYPES_H_ */
......@@ -33,13 +33,9 @@
#include "log.h"
#include "log_extern.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "SystemInformationBlockType2.h"
#include "PHY/phy_extern.h"
......
......@@ -24,7 +24,7 @@
-------------------
AUTHOR : Francois TABURET
COMPANY : NOKIA BellLabs France
EMAIL : francois.taburet@nokia-bell-labs.com
EMAIL : francois.taburet@nokia-bell-labs.com
*/
......@@ -33,13 +33,9 @@
#include "common/utils/LOG/log.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "LTE_SystemInformationBlockType2.h"
#include "common/config/config_userapi.h"
#include "RRC_config_tools.h"
......@@ -84,8 +80,7 @@ int config_check_band_frequencies( int ind,
int16_t band,
uint32_t downlink_frequency,
int32_t uplink_frequency_offset,
uint32_t frame_type)
{
uint32_t frame_type) {
int errors = 0;
if (band > 0) {
......@@ -94,21 +89,18 @@ int config_check_band_frequencies( int ind,
for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) {
if (band == eutra_bands[band_index].band) {
uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset;
AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++,
"enb %d downlink frequency %u too low (%u) for band %d!",
ind, downlink_frequency, eutra_bands[band_index].dl_min, band);
AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++,
"enb %d downlink frequency %u too high (%u) for band %d!",
ind, downlink_frequency, eutra_bands[band_index].dl_max, band);
AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++,
"enb %d uplink frequency %u too low (%u) for band %d!",
ind, uplink_frequency, eutra_bands[band_index].ul_min, band);
AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++,
"enb %d uplink frequency %u too high (%u) for band %d!",
ind, uplink_frequency, eutra_bands[band_index].ul_max, band);
AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++,
"enb %d invalid frame type (%d/%d) for band %d!",
ind, eutra_bands[band_index].frame_type, frame_type, band);
......@@ -116,7 +108,6 @@ int config_check_band_frequencies( int ind,
}
}
return errors;
}
This diff is collapsed.
This diff is collapsed.
......@@ -45,114 +45,89 @@
#include "common/ran_context.h"
extern FILL_UL_INFO_MUTEX_t fill_ul_mutex;
extern uint8_t nfapi_mode;
extern void openair_rrc_top_init_ue( int eMBMS_active, char* uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync) //init as MR
{
LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
module_idP, frameP, eNB_index);
#if defined(ENABLE_USE_MME)
int mme_enabled = 1;
#else
int mme_enabled = 0;
#endif
if (first_sync == 1 && !(mme_enabled == 1)) {
//layer2_init_UE(module_idP);
openair_rrc_ue_init(module_idP, eNB_index);
} else {
rrc_in_sync_ind(module_idP, frameP, eNB_index);
}
extern void openair_rrc_top_init_ue( int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync) { //init as MR
LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
module_idP, frameP, eNB_index);
if (first_sync == 1 && !(EPC_MODE_ENABLED)) {
//layer2_init_UE(module_idP);
openair_rrc_ue_init(module_idP, eNB_index);
} else {
rrc_in_sync_ind(module_idP, frameP, eNB_index);
}
}
void
mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
uint16_t eNB_index)
{
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
uint16_t eNB_index) {
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
}
int
mac_top_init_ue(int eMBMS_active, char *uecap_xer,
uint8_t cba_group_active, uint8_t HO_active)
{
int i;
LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST);
if (NB_UE_INST > 0) {
UE_mac_inst =
(UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST));
AssertFatal(UE_mac_inst != NULL,
"[MAIN] Can't ALLOCATE %zu Bytes for %d UE_MAC_INST with size %zu \n",
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST,
sizeof(UE_MAC_INST));
LOG_D(MAC, "[MAIN] ALLOCATE %zu Bytes for %d UE_MAC_INST @ %p\n",
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST, UE_mac_inst);
bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST));
for (i = 0; i < NB_UE_INST; i++) {
ue_init_mac(i);
}
} else {
UE_mac_inst = NULL;
}
// mutex below are used for multiple UE's L2 FAPI simulation.
if (nfapi_mode == 3){
pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.harq_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.cqi_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.rach_mutex,NULL);
uint8_t cba_group_active, uint8_t HO_active) {
int i;
LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST);
if (NB_UE_INST > 0) {
UE_mac_inst =
(UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST));
AssertFatal(UE_mac_inst != NULL,
"[MAIN] Can't ALLOCATE %zu Bytes for %d UE_MAC_INST with size %zu \n",
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST,
sizeof(UE_MAC_INST));
LOG_D(MAC, "[MAIN] ALLOCATE %zu Bytes for %d UE_MAC_INST @ %p\n",
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST, UE_mac_inst);
bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST));
for (i = 0; i < NB_UE_INST; i++) {
ue_init_mac(i);
}
LOG_I(MAC, "[MAIN] calling RRC\n");
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,
HO_active);
LOG_I(MAC, "[MAIN][INIT] Init function finished\n");
return (0);
} else {
UE_mac_inst = NULL;
}
// mutex below are used for multiple UE's L2 FAPI simulation.
if (nfapi_mode == 3) {
pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.harq_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.cqi_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.rach_mutex,NULL);
}
LOG_I(MAC, "[MAIN] calling RRC\n");
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,
HO_active);
LOG_I(MAC, "[MAIN][INIT] Init function finished\n");
return (0);
}
int rlcmac_init_global_param_ue(void)
{
LOG_I(MAC, "[MAIN] CALLING RLC_MODULE_INIT...\n");
if (rlc_module_init() != 0) {
return (-1);
}
pdcp_layer_init();
int rlcmac_init_global_param_ue(void) {
LOG_I(MAC, "[MAIN] CALLING RLC_MODULE_INIT...\n");
LOG_I(MAC, "[MAIN] Init Global Param Done\n");
if (rlc_module_init() != 0) {
return (-1);
}
return 0;
pdcp_layer_init();
LOG_I(MAC, "[MAIN] Init Global Param Done\n");
return 0;
}
int
l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,
uint8_t HO_active)
{
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
// NB_NODE=2;
// NB_INST=2;
rlcmac_init_global_param_ue();
LOG_I(MAC, "[MAIN] init UE MAC functions \n");
mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active);
return (1);
uint8_t HO_active) {
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
// NB_NODE=2;
// NB_INST=2;
rlcmac_init_global_param_ue();
LOG_I(MAC, "[MAIN] init UE MAC functions \n");
mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active);
return (1);
}
......@@ -2573,8 +2573,12 @@ ue_scheduler(const module_id_t module_idP,
// data to/from NETLINK is treated in pdcp_run.
// one socket is used in multiple UE's L2 FAPI simulator and
// only first UE need to do this.
if(module_idP == 0){
if (UE_NAS_USE_TUN) {
pdcp_run(&ctxt);
} else {
if(module_idP == 0){
pdcp_run(&ctxt);
}
}
//#endif
UE_mac_inst[module_idP].txFrame = txFrameP;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -173,7 +173,6 @@ int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
void pdcp_config_set_security(const protocol_ctxt_t* const ctxt_pP, pdcp_t *pdcp_pP, rb_id_t rb_idP,
uint16_t lc_idP, uint8_t security_modeP, uint8_t *kRRCenc_pP, uint8_t *kRRCint_pP, uint8_t *kUPenc_pP);
#if defined(ENABLE_SECURITY)
int pdcp_apply_security(const protocol_ctxt_t* const ctxt_pP,
pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
......@@ -188,10 +187,10 @@ int pdcp_validate_security(const protocol_ctxt_t* const ctxt_pP,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint32_t hfn,
int sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size);
#endif /* defined(ENABLE_SECURITY) */
#endif
/** @}*/
......@@ -59,11 +59,6 @@ uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity);
* Advances the RX window state of given PDCP entity upon successfull receipt of a SDU
*/
boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity);
/**
* Checks if incoming PDU has a sequence number in accordance with the RX window
* @return TRUE if it is valid, FALSE otherwise
*/
boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_flag_t srb_flagP);
/**
* Updates missing PDU bitmap with incoming sequence number
* @return TRUE if successful, FALSE otherwise
......
This diff is collapsed.
......@@ -3745,7 +3745,6 @@ do_RRCConnectionReestablishment(
rrc->carrier[CC_id].dl_CarrierFreq,
earfcn_dl,
is_rel8_only == true ? "true": "false");
#if defined(ENABLE_SECURITY)
if (ue_context_pP->ue_context.nh_ncc >= 0) {
derive_keNB_star(ue_context_pP->ue_context.nh, pci, earfcn_dl, is_rel8_only, KeNB_star);
......@@ -3759,9 +3758,6 @@ do_RRCConnectionReestablishment(
// copy KeNB_star to ue_context_pP->ue_context.kenb
memcpy (ue_context_pP->ue_context.kenb, KeNB_star, 32);
ue_context_pP->ue_context.kenb_ncc = 0;
#else
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nextHopChainingCount = 0;
#endif
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nonCriticalExtension = NULL;
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -30,10 +30,6 @@
#ifndef RRC_ENB_GTPV1U_H_
#define RRC_ENB_GTPV1U_H_
# if defined(ENABLE_USE_MME)
# if defined(ENABLE_ITTI)
/*! \fn rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(const protocol_ctxt_t* const ctxt_pP, const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP)
*\brief Process GTPV1U_ENB_CREATE_TUNNEL_RESP message received from GTPV1U, retrieve the enb teid created.
......@@ -42,11 +38,10 @@
*\return 0 when successful, -1 if the UE index can not be retrieved. */
int
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
const protocol_ctxt_t* const ctxt_pP,
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP,
const protocol_ctxt_t *const ctxt_pP,
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
uint8_t *inde_list
);
# endif
# endif /* defined(ENABLE_USE_MME) */
#endif /* RRC_ENB_GTPV1U_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -45,7 +45,7 @@ Description Defines functions used to handle state of EPS bearer contexts
#include "esmData.h"
#include "nas_timer.h"
#include "user_defs.h"
#include "../user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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