From 9ba19119a5e5451d3285754ff81a7cd31a441e4c Mon Sep 17 00:00:00 2001 From: Navid Nikaein <navid.nikaein@eurecom.fr> Date: Thu, 12 Feb 2015 15:03:13 +0000 Subject: [PATCH] * adding additional tests for 10MHz and 20MHz channel BW * applying patches 8 and 9 contributed from S. Held git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6536 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- common/utils/itti/timer.c | 2 +- openair1/PHY/INIT/lte_init.c | 7 +- openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c | 4 + .../PHY/LTE_TRANSPORT/dlsch_demodulation.c | 1 + openair1/PHY/LTE_TRANSPORT/print_stats.c | 8 +- openair1/PHY/LTE_TRANSPORT/srs_modulation.c | 3 +- openair1/PHY/LTE_TRANSPORT/uci_tools.c | 1 + openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c | 10 +- openair1/SCHED/phy_procedures_lte_eNb.c | 1 + openair1/SCHED/phy_procedures_lte_ue.c | 4 +- openair1/SCHED/pusch_pc.c | 13 +- openair2/ENB_APP/enb_config.c | 3 + openair2/ENB_APP/enb_config.h | 4 +- openair2/LAYER2/MAC/config.c | 7 +- openair2/LAYER2/MAC/eNB_scheduler.c | 4 + openair2/LAYER2/MAC/eNB_scheduler_RA.c | 1 + openair2/LAYER2/MAC/eNB_scheduler_bch.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 8 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 8 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 6 +- openair2/LAYER2/MAC/l1_helpers.c | 4 +- openair2/LAYER2/MAC/openair2_proc.c | 6 +- openair2/LAYER2/MAC/pre_processor.c | 4 +- openair2/LAYER2/MAC/ra_procedures.c | 1 + openair2/LAYER2/MAC/ue_procedures.c | 11 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 1 + openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 6 +- openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c | 3 +- .../RLC/UM_v9.3.0/rlc_um_control_primitives.c | 2 +- openair2/RRC/LITE/L2_interface.c | 9 +- openair2/RRC/LITE/defs.h | 4 +- openair2/UTIL/LISTS/list.c | 6 +- openair2/UTIL/LISTS/list2.c | 7 +- openair2/UTIL/OCG/OCG.h | 2 +- openair2/UTIL/OMG/id_manager.c | 10 +- openair2/UTIL/OMG/omg.c | 2 +- openair2/UTIL/OMG/rwalk.c | 4 +- openair2/UTIL/OMG/rwp.c | 4 +- openair2/UTIL/OMG/steadystaterwp.c | 4 +- openair2/UTIL/OMG/sumo.c | 4 + openair2/UTIL/OPT/probe.c | 16 +- openair2/UTIL/OTG/otg.c | 20 +-- .../SIMU/EXAMPLES/OSD/WEBXML/template_26.xml | 4 +- targets/SIMU/USER/event_handler.c | 6 +- targets/SIMU/USER/oaisim_config.c | 4 +- targets/SIMU/USER/oaisim_functions.c | 5 +- targets/SIMU/USER/sinr_sim.c | 2 +- targets/TEST/OAI/case01.py | 39 ++-- targets/TEST/OAI/case02.py | 169 ++++++++++-------- targets/TEST/OAI/case03.py | 54 +++--- targets/TEST/OAI/case04.py | 45 ++--- targets/TEST/OAI/case05.py | 45 ++--- targets/TEST/OAI/test01.py | 39 ++-- 53 files changed, 365 insertions(+), 274 deletions(-) diff --git a/common/utils/itti/timer.c b/common/utils/itti/timer.c index 236dfb2cd8..ddd9a5141a 100644 --- a/common/utils/itti/timer.c +++ b/common/utils/itti/timer.c @@ -222,7 +222,7 @@ int timer_remove(long timer_id) /* We didn't find the timer in list */ if (timer_p == NULL) { pthread_mutex_unlock(&timer_desc.timer_list_mutex); - TMR_ERROR("Didn't find timer 0x%lx in list\n", (long)timer_p->timer); + TMR_ERROR("Didn't find timer 0x%lx in list\n", timer_id); return -1; } diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 8e3141953d..667925bcb2 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -619,8 +619,11 @@ void phy_config_dedicated_eNB(uint8_t Mod_id, struct PhysicalConfigDedicated *physicalConfigDedicated) { PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id]; - uint8_t UE_id = find_ue(rnti,phy_vars_eNB); - + int8_t UE_id = find_ue(rnti,phy_vars_eNB); + if (UE_id == -1) { + LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id, phy_vars_eNB->proc[8].frame_tx ); + return; + } if (physicalConfigDedicated) { diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c index 1ae5887f9b..68366a85be 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c @@ -155,6 +155,10 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset; + DevAssert( Ns < 20 ); + DevAssert( l < 2 ); + DevAssert( mprime>>4 < 14 ); + for (m=0;m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1;m++) { mprime_dword = mprime>>4; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index 3d642e55b0..85a7d6123d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -618,6 +618,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, } } else { // TM3 + DevAssert(dlsch1_harq); if (get_Qm(dlsch1_harq->mcs) == 2) { /* dlsch_qpsk_llr(frame_parms, lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0, diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 340286aa62..3f1508ad2c 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -632,9 +632,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) { phy_vars_eNB->eNB_UE_stats[UE_id].mode); #ifdef OPENAIR2 UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); - RRC_status = mac_get_rrc_status(phy_vars_eNB->Mod_id,1,UE_id_mac); - - len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); + if (UE_id_mac != -1) { + RRC_status = mac_get_rrc_status(phy_vars_eNB->Mod_id,1,UE_id_mac); + len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); + } else + len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = -1\n"); #endif #ifdef OPENAIR2 diff --git a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c index 64f1986e84..9cb5137bcb 100644 --- a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c @@ -131,7 +131,8 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue, mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0]; uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset; uint16_t *Msc_idx_ptr; - uint32_t k0,T_SFC; + int32_t k0; + uint32_t T_SFC; uint32_t subframe_offset; uint8_t Bsrs = soundingrs_ul_config_dedicated->srs_Bandwidth; uint8_t Csrs = frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig; diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c index b7928324cf..4ad130053c 100644 --- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c @@ -132,6 +132,7 @@ void do_diff_cqi(uint8_t N_RB_DL, break; case 15: nb_sb = 4; + break; case 25: nb_sb = 7; break; diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c index b8acf3dbc9..cc7fbfee7f 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c @@ -336,6 +336,8 @@ void ulsch_modulation(mod_sym_t **txdataF, uint8_t qam16_table_offset_im = 0; short gain_lin_QPSK; + DevAssert(frame_parms); + int re_offset,re_offset0,i,Msymb,j,k,nsymb,Msc_PUSCH,l; // uint8_t harq_pid = (rag_flag == 1) ? 0 : subframe2harq_pid_tdd(frame_parms->tdd_config,subframe); uint8_t harq_pid = subframe2harq_pid(frame_parms,frame,subframe); @@ -349,14 +351,14 @@ void ulsch_modulation(mod_sym_t **txdataF, uint32_t x1, x2, s=0; uint8_t c; - // x1 is set in lte_gold_generic - x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 - if (!ulsch) { msg("ulsch_modulation.c: Null ulsch\n"); return; } + // x1 is set in lte_gold_generic + x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 + if (harq_pid > 7) { msg("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid); return; @@ -645,6 +647,8 @@ void ulsch_modulation(mod_sym_t **txdataF, dft_lte(ulsch->z,ulsch->d,Msc_PUSCH,ulsch->Nsymb_pusch); #endif +DevAssert(txdataF); + #ifdef OFDMA_ULSCH re_offset0 = frame_parms->first_carrier_offset + (ulsch->harq_processes[harq_pid]->first_rb*12); if (re_offset0>frame_parms->ofdm_symbol_size) { diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index c3e0845266..ff9fdafa13 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1877,6 +1877,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (UE_id<0) { LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Unknown UE_id for rnti %"PRIx16"\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,DCI_pdu->dci_alloc[i].rnti); mac_exit_wrapper("Invalid UE id (< 0) detected"); + return; // not reached } #ifdef DEBUG_PHY_PROC //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index a26b7f1a06..9f62cf0600 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -1707,6 +1707,8 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst uint16_t frame_tx; static uint8_t first_run = 1; uint8_t pbch_trials = 0; + + DevAssert(phy_vars_ue); int slot_rx = phy_vars_ue->slot_rx; int frame_rx = phy_vars_ue->frame_rx; @@ -1832,7 +1834,7 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst phy_vars_ue->lte_frame_parms.N_RB_DL, phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration, phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource); - if ((frame_rx%100==0)&&(phy_vars_ue!=NULL)) { + if (frame_rx%100 == 0) { LOG_I(PHY,"[UE %d] frame %d, slot %d, PBCH: mode1_flag %d, tx_ant %d, frame_tx %d, phase %d. N_RB_DL %d, phich_duration %d, phich_resource %d/6\n", phy_vars_ue->Mod_id, frame_rx, diff --git a/openair1/SCHED/pusch_pc.c b/openair1/SCHED/pusch_pc.c index 50d9f3957c..714b79fe66 100644 --- a/openair1/SCHED/pusch_pc.c +++ b/openair1/SCHED/pusch_pc.c @@ -52,6 +52,9 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id, uint32_t Nre,sumKr,MPR_x100,Kr,r; uint16_t beta_offset_pusch; + DevAssert( UE_id < NUMBER_OF_UE_MAX+1 ); + DevAssert( harq_pid < 8 ); + Nre = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->Nsymb_initial * phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb*12; @@ -74,6 +77,9 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id, beta_offset_pusch = 8; //(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->control_only == 1) ? phy_vars_eNB->ulsch_eNB[UE_id]->beta_offset_cqi_times8:8; + DevAssert( UE_id < NUMBER_OF_UE_MAX ); + DevAssert( MPR_x100/6 < 100 ); + if (phy_vars_eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) { // This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch) if (bw_factor == 1) { @@ -89,7 +95,12 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id, } int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid) { - return get_hundred_times_delta_IF_eNB(PHY_vars_eNB_g[module_idP][CC_id],find_ue(rnti,PHY_vars_eNB_g[module_idP][CC_id]),harq_pid, 0); + int8_t UE_id = find_ue( rnti, PHY_vars_eNB_g[module_idP][CC_id] ); + if (UE_id == -1) { + // not found + return 0; + } + return get_hundred_times_delta_IF_eNB( PHY_vars_eNB_g[module_idP][CC_id], UE_id, harq_pid, 0 ); } int16_t get_hundred_times_delta_IF(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t harq_pid) { diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 2a503ec42f..75b79300a2 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -654,6 +654,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, %u th enb\n", lib_config_file_name_pP, i); + continue; // FIXME this prevents segfaults below, not sure what happens after function exit } // search if in active list for (j=0; j < num_enb_properties; j++) { @@ -768,6 +769,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, Component Carrier %d!\n", lib_config_file_name_pP, enb_properties.properties[enb_properties_index]->nb_cc++); + continue; // FIXME this prevents segfaults below, not sure what happens after function exit } enb_properties.properties[enb_properties_index]->nb_cc++; @@ -1633,6 +1635,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, %u th enb %u th mme address !\n", lib_config_file_name_pP, i, j); + continue; // FIXME will prevent segfaults below, not sure what happens at function exit... } enb_properties.properties[enb_properties_index]->nb_mme += 1; diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index 05c823cd11..9cfb905521 100755 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -37,7 +37,9 @@ #ifndef ENB_CONFIG_H_ #define ENB_CONFIG_H_ -#include <netinet/in.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> #include "commonDef.h" #include "platform_types.h" diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 6df986f364..cae81c7fd4 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -134,8 +134,8 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui } } - if ((tdd_Config!=NULL)||(SIwindowsize!=NULL)||(SIperiod!=NULL)){ - if (eNB_flagP==1) + if (tdd_Config && SIwindowsize && SIperiod) { + if (eNB_flagP == ENB_FLAG_YES) mac_xface->phy_config_sib1_eNB(Mod_id,0,tdd_Config,*SIwindowsize,*SIperiod); else mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod); @@ -226,7 +226,8 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer); UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_id].scheduling_info.PathlossChange); LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n", - Mod_id,mac_MainConfig->phr_Config->present, + Mod_id, + (mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1, UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF, UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF, UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db); diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 12461bf520..1d83ebc323 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -283,6 +283,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, switch (mac_xface->lte_frame_parms->tdd_config) { case 2: schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7,nCCE); + // no break here! case 5: schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); @@ -307,8 +308,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 1: // schedule_RA(module_idP,frameP,subframeP,nprb,nCCE); schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8,nCCE); + // no break here! case 2: + // no break here! case 4: + // no break here! case 5: schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index a7d455bd7f..14e87633d0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -389,6 +389,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un } LOG_I(MAC,"[eNB %d][RAPROC] Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", module_idP,frameP,subframeP,TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); + DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], 1, //num_sdus &rrc_sdu_length, // diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 8b9cad6133..ecd2ea4e29 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -71,7 +71,7 @@ void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned int *nprbP,unsi - unsigned char bcch_sdu_length; + int8_t bcch_sdu_length; int mcs = -1; void *BCCH_alloc_pdu; int CC_id; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 934e5eaa1f..f1b4c293e0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -2146,14 +2146,16 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP unsigned char *get_dlsch_sdu(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rntiP, uint8_t TBindex) { - int UE_id; eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP]; if (rntiP==SI_RNTI) { LOG_D(MAC,"[eNB %d] Frame %d Get DLSCH sdu for BCCH \n",module_idP,frameP); return((unsigned char *)&eNB->common_channels[CC_id].BCCH_pdu.payload[0]); - } else if ((UE_id = find_UE_id(module_idP,rntiP)) != UE_INDEX_INVALID ){ + } + + int UE_id = find_UE_id(module_idP,rntiP); + if (UE_id != -1) { LOG_D(MAC,"[eNB %d] Frame %d: CC_id %d Get DLSCH sdu for rnti %x => UE_id %d\n",module_idP,frameP,CC_id,rntiP,UE_id); return((unsigned char *)&eNB->UE_list.DLSCH_pdu[CC_id][TBindex][UE_id].payload[0]); } else { @@ -2191,6 +2193,7 @@ void set_ue_dai(sub_frame_t subframeP, case 0: if ((subframeP==0)||(subframeP==1)||(subframeP==3)||(subframeP==5)||(subframeP==6)||(subframeP==8)) UE_list->UE_template[CC_id][UE_id].DAI = 0; + break; case 1: if ((subframeP==0)||(subframeP==4)||(subframeP==5)||(subframeP==9)) UE_list->UE_template[CC_id][UE_id].DAI = 0; @@ -2214,6 +2217,7 @@ void set_ue_dai(sub_frame_t subframeP, case 6: if ((subframeP==0)||(subframeP==1)||(subframeP==5)||(subframeP==6)||(subframeP==9)) UE_list->UE_template[CC_id][UE_id].DAI = 0; + break; default: UE_list->UE_template[CC_id][UE_id].DAI = 0; LOG_N(MAC,"unknow TDD config %d\n",tdd_config); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 186b4b313b..bca6a85ecb 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -362,8 +362,10 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) { prev_i = prev(listP,nodeiP,ul_flag); prev_j = prev(listP,nodejP,ul_flag); - if ((prev_i<0) || (prev_j<0)) - mac_xface->macphy_exit(""); + if ((prev_i<0) || (prev_j<0)) { + mac_xface->macphy_exit(""); + return; // not reached + } if (ul_flag == 0){ next_i = listP->next[nodeiP]; @@ -471,7 +473,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP int UE_id = find_UE_id(mod_idP, rntiP); UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; - if (UE_id != UE_INDEX_INVALID ) { + if (UE_id != -1) { LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 882d1542dc..10d6ec5b5b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -94,7 +94,7 @@ void rx_sdu(module_id_t enb_mod_idP,int CC_idP,frame_t frameP,rnti_t rntiP,uint8 switch (rx_ces[i]) { // implement and process BSR + CRNTI + case POWER_HEADROOM: - if (UE_id != UE_INDEX_INVALID ){ + if (UE_id != -1){ UE_list->UE_template[CC_idP][UE_id].phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET; LOG_D(MAC, "[eNB] MAC CE_LCID %d : Received PHR PH = %d (db)\n", rx_ces[i], UE_list->UE_template[CC_idP][UE_id].phr_info); UE_list->UE_template[CC_idP][UE_id].phr_info_configured=1; @@ -107,7 +107,7 @@ void rx_sdu(module_id_t enb_mod_idP,int CC_idP,frame_t frameP,rnti_t rntiP,uint8 break; case TRUNCATED_BSR: case SHORT_BSR: { - if (UE_id != UE_INDEX_INVALID ){ + if (UE_id != -1){ uint8_t lcgid; lcgid = (payload_ptr[0] >> 6); LOG_D(MAC, "[eNB] MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n", @@ -119,7 +119,7 @@ void rx_sdu(module_id_t enb_mod_idP,int CC_idP,frame_t frameP,rnti_t rntiP,uint8 payload_ptr += 1;//sizeof(SHORT_BSR); // fixme } break; case LONG_BSR: - if (UE_id != UE_INDEX_INVALID ){ + if (UE_id != -1){ UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] = ((payload_ptr[0] & 0xFC) >> 2); UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1] = ((payload_ptr[0] & 0x03) << 4) | ((payload_ptr[1] & 0xF0) >> 4); diff --git a/openair2/LAYER2/MAC/l1_helpers.c b/openair2/LAYER2/MAC/l1_helpers.c index dbb4504fd4..a82bb24192 100644 --- a/openair2/LAYER2/MAC/l1_helpers.c +++ b/openair2/LAYER2/MAC/l1_helpers.c @@ -47,7 +47,7 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id) { if (CC_id>0) { LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n"); mac_xface->macphy_exit("MAC FATAL CC_id>0"); - return; + return 0; // not reached } if (UE_mac_inst[module_idP].radioResourceConfigCommon) @@ -66,7 +66,7 @@ int8_t get_deltaP_rampup(module_id_t module_idP,uint8_t CC_id) { if (CC_id>0) { LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n"); mac_xface->macphy_exit("MAC FATAL CC_id>0"); - return; + return 0; // not reached } LOG_D(MAC,"[PUSCH]%d dB\n",UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER<<1); diff --git a/openair2/LAYER2/MAC/openair2_proc.c b/openair2/LAYER2/MAC/openair2_proc.c index 4e50d5e0ca..f71912d78e 100644 --- a/openair2/LAYER2/MAC/openair2_proc.c +++ b/openair2/LAYER2/MAC/openair2_proc.c @@ -91,16 +91,16 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length) len+=sprintf(&buffer[len],"UE TTI: %d\n",UE_mac_inst[ue_id].frame); - for (enb_id= 0; enb_id <NUM_eNB_INST;enb_id++) { + for (enb_id= 0; enb_id <NB_SIG_CNX_UE;enb_id++) { - switch (mac_get_rrc_status(eNB_id,0,ue_id) > RRC_CONNECTED) { + switch (mac_get_rrc_status(ue_id,0,enb_id) > RRC_CONNECTED) { case RRC_RECONFIGURED : case RRC_CONNECTED: case RRC_SI_RECEIVED: case RRC_IDLE: break; - if (mac_get_rrc_status(eNB_id,0,ue_id) > RRC_CONNECTED) { + if (mac_get_rrc_status(ue_id,0,enb_id) > RRC_CONNECTED) { // if (UE_mac_inst[ue_id].Dcch_lchan[CH_index].Active==1) { len+=sprintf(&buffer[len],"eNB %d: Wideband SINR %d dB---\n", CH_index,UE_mac_inst[Mod_id].Def_meas[CH_index].Wideband_sinr); diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index db2cadbe50..e7b8537e5b 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -249,8 +249,10 @@ int maxcqi(module_id_t Mod_id,int32_t UE_id) { for (n=0;n<UE_list->numactiveCCs[UE_id];n++) { CC_id = UE_list->ordered_CCids[n][UE_id]; eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,UE_RNTI(Mod_id,UE_id)); - if (eNB_UE_stats==NULL) + if (eNB_UE_stats==NULL) { mac_xface->macphy_exit("maxcqi: could not get eNB_UE_stats\n"); + return 0; // not reached + } if (eNB_UE_stats->DL_cqi[0] > CQI) CQI = eNB_UE_stats->DL_cqi[0]; } diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c index b7ae6b6ce8..e00a12f3cd 100644 --- a/openair2/LAYER2/MAC/ra_procedures.c +++ b/openair2/LAYER2/MAC/ra_procedures.c @@ -127,6 +127,7 @@ void get_prach_resources(module_id_t module_idP, else { LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",module_idP); mac_xface->macphy_exit("MAC FATAL radioResourceConfigCommon is NULL"); + return; // not reached } if (rach_ConfigDedicated) { // This is for network controlled Mobility, later diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index e7ccdbe944..bb3870596a 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -219,7 +219,7 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i if (CC_id>0) { LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n"); mac_xface->macphy_exit("MAC FATAL CC_id>0"); - return; + return 0; } // determin the measurement gap @@ -1733,7 +1733,7 @@ boolean_t update_bsr(module_id_t module_idP, frame_t frameP, uint8_t lcid, uint boolean_t sr_pending = FALSE; - if ((lcg_id < 0) || (lcg_id > MAX_NUM_LCGID) ) + if ((lcg_id < 0) || (lcg_id >= MAX_NUM_LCGID) ) return sr_pending; // fixme: need a better way to reset if ((lcid == DCCH) || (lcid == DTCH)){ @@ -1766,10 +1766,13 @@ uint8_t locate (const uint32_t *table, int size, int value){ uint8_t ju, jm, jl; int ascend; + DevAssert( size > 0 ); + DevAssert( size <= 256 ); + if (value == 0) return 0; //elseif (value > 150000) return 63; - jl = 0; // lower bound - ju = size ;// upper bound + jl = 0; // lower bound + ju = size - 1; // upper bound ascend = (table[ju] >= table[jl]) ? 1 : 0; // determine the order of the the table: 1 if ascending order of table, 0 otherwise while (ju-jl > 1) { //If we are not yet done, diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 16b5e03fe3..a8029adebe 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -655,6 +655,7 @@ boolean_t pdcp_data_ind( module_id_t src_id, dst_id; int ctime; + DevAssert(pdcp_p); if (pdcp_p->rlc_mode == RLC_MODE_AM ) { pdcp_p->last_submitted_pdcp_rx_sn = sequence_number; } diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index 38bc2abde7..2e4b871bad 100755 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -157,8 +157,7 @@ config_req_rlc_am ( config_am_pP->t_status_prohibit); } else { LOG_E(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" CONFIG_REQ RLC NOT FOUND\n", - PROTOCOL_CTXT_ARGS(ctxt_pP), - RB_AM_ARGS(l_rlc_p)); + PROTOCOL_CTXT_ARGS(ctxt_pP) ); } } uint32_t pollPDU_tab[PollPDU_pInfinity+1]={4,8,16,32,64,128,256,1024}; // What is PollPDU_pInfinity??? 1024 for now @@ -224,8 +223,7 @@ void config_req_rlc_am_asn1 ( } } else { LOG_E(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT "CONFIG_REQ RLC NOT FOUND\n", - PROTOCOL_CTXT_ARGS(ctxt_pP), - RB_AM_ARGS(l_rlc_p)); + PROTOCOL_CTXT_ARGS(ctxt_pP) ); } } diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 83df86d9ce..d576f8f9d6 100755 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -417,9 +417,10 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP status_resp.head_sdu_remaining_size_to_send = 0; status_resp.head_sdu_creation_time = 0; status_resp.head_sdu_is_segmented = 0; - status_resp.rlc_info.rlc_protocol_state = ((rlc_um_entity_t *) rlc_pP)->protocol_state; if (rlc_pP) { + status_resp.rlc_info.rlc_protocol_state = ((rlc_um_entity_t *) rlc_pP)->protocol_state; + rlc_p = (rlc_um_entity_t *) rlc_pP; rlc_um_check_timer_dar_time_out(ctxt_pP, rlc_p); diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c index e8dbf59ccb..b1c551fd3f 100755 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c @@ -145,7 +145,7 @@ void config_req_rlc_um_asn1 ( (ctxt_pP->enb_flag) ? "eNB" : "UE", ctxt_pP->enb_module_id, ctxt_pP->ue_module_id, - (dl_rlc_pP->t_Reordering<31)?t_Reordering_tab[dl_rlc_pP->t_Reordering]:-1, + (dl_rlc_pP && dl_rlc_pP->t_Reordering<31)?t_Reordering_tab[dl_rlc_pP->t_Reordering]:-1, ctxt_pP->enb_module_id, ctxt_pP->ue_module_id, rb_idP); diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 00d2f9ef23..f8348eb4ce 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -628,10 +628,15 @@ void rrc_lite_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_ //-------------------------------------------------------------------------------------------// int mac_get_rrc_lite_status(module_id_t Mod_idP,eNB_flag_t enb_flagP,uint8_t index){ //-------------------------------------------------------------------------------------------// - if(enb_flagP == ENB_FLAG_YES) + if (enb_flagP == ENB_FLAG_YES) { + DevAssert( Mod_idP < NB_eNB_INST ); + DevAssert( index < NUMBER_OF_UE_MAX ); return(eNB_rrc_inst[Mod_idP].Info.UE[index].Status); - else + } else { + DevAssert( Mod_idP < NB_UE_INST ); + DevAssert( index < NB_SIG_CNX_UE ); return(UE_rrc_inst[Mod_idP].Info[index].State); + } } //-------------------------------------------------------------------------------------------// diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index 10b1a6209b..2037dc7f07 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -131,8 +131,8 @@ typedef struct rrc_ral_threshold_key_s { //#define NUM_PRECONFIGURED_LCHAN (NB_CH_CX*2) //BCCH, CCCH -#define UE_MODULE_INVALID ((module_id_t) ~0) -#define UE_INDEX_INVALID ((module_id_t) ~0) +#define UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! +#define UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1 typedef enum UE_STATE_e { RRC_INACTIVE=0, diff --git a/openair2/UTIL/LISTS/list.c b/openair2/UTIL/LISTS/list.c index 51b7e84cd0..409f181c4f 100755 --- a/openair2/UTIL/LISTS/list.c +++ b/openair2/UTIL/LISTS/list.c @@ -38,6 +38,7 @@ #define NULL 0 #include "list.h" +#include <string.h> //----------------------------------------------------------------------------- /* @@ -48,10 +49,9 @@ void list_init (list_t * listP, char *nameP) { //----------------------------------------------------------------------------- - int i = 0; - if (nameP) { - while ((listP->name[i] = nameP[i]) && (i++ < LIST_NAME_MAX_CHAR)); + strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR ); + listP->name[LIST_NAME_MAX_CHAR-1] = 0; // terminate string } listP->tail = NULL; listP->head = NULL; diff --git a/openair2/UTIL/LISTS/list2.c b/openair2/UTIL/LISTS/list2.c index 6dfdafec1a..1c09c94cd2 100644 --- a/openair2/UTIL/LISTS/list2.c +++ b/openair2/UTIL/LISTS/list2.c @@ -23,6 +23,8 @@ #define NULL 0 #endif +#include <string.h> + //----------------------------------------------------------------------------- /* @@ -33,10 +35,9 @@ void list2_init (list2_t * listP, char *nameP) { //----------------------------------------------------------------------------- - unsigned char i = 0; - if (nameP) { - while ((listP->name[i] = nameP[i]) && (i++ < LIST_NAME_MAX_CHAR)); + strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR ); + listP->name[LIST_NAME_MAX_CHAR-1] = 0; // terminate string } listP->tail = NULL; listP->head = NULL; diff --git a/openair2/UTIL/OCG/OCG.h b/openair2/UTIL/OCG/OCG.h index dcd6180668..3b1b0e03b2 100644 --- a/openair2/UTIL/OCG/OCG.h +++ b/openair2/UTIL/OCG/OCG.h @@ -366,7 +366,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need typedef struct { char *command; - char *file; + char *file; //!< 256 bytes memory (see oaisim_config.c) int start; int end; int step; diff --git a/openair2/UTIL/OMG/id_manager.c b/openair2/UTIL/OMG/id_manager.c index ff79275a9f..5a489e43fd 100644 --- a/openair2/UTIL/OMG/id_manager.c +++ b/openair2/UTIL/OMG/id_manager.c @@ -39,6 +39,7 @@ */ #include "id_manager.h" +#include "assertions.h" #include <stdio.h> #include <string.h> @@ -135,13 +136,8 @@ void remove_oaiID_by_SUMO(char *sumo_id, IDManagerPtr ID_manager) { char* get_sumo_entry(int oai_id, Map_list Map_Vector) { Map_list tmp = Map_Vector; - if(Map_Vector == NULL) { - printf("bug here..should not be NULL"); - } - - if(Map_Vector->map == NULL) { - printf("bug here..map should have been initialized"); - } + AssertFatal( Map_Vector, "bug here..should not be NULL" ); + AssertFatal( Map_Vector->map, "bug here..map should have been initialized" ); if (tmp->map->oai_id == oai_id) { //printf("got it...at the head and value is %s \n",tmp->map->sumo_id); diff --git a/openair2/UTIL/OMG/omg.c b/openair2/UTIL/OMG/omg.c index b0fc9ce442..8bd1ae02a0 100644 --- a/openair2/UTIL/OMG/omg.c +++ b/openair2/UTIL/OMG/omg.c @@ -78,7 +78,7 @@ init_omg_global_params (void) job_vector_end[mob_t] = NULL; } - for (node_t = eNB; node_t < MAX_NUM_MOB_TYPES; node_t++) + for (node_t = eNB; node_t < MAX_NUM_NODE_TYPES; node_t++) { node_vector[node_t] = NULL; node_vector_end[node_t] = NULL; diff --git a/openair2/UTIL/OMG/rwalk.c b/openair2/UTIL/OMG/rwalk.c index ac37b70446..02fb8c9080 100644 --- a/openair2/UTIL/OMG/rwalk.c +++ b/openair2/UTIL/OMG/rwalk.c @@ -345,13 +345,12 @@ update_rwalk_nodes (double cur_time) node_struct *my_node; while (tmp != NULL && done == 0) { - my_node = (node_struct *) tmp->pair->b; - //case1:time to next event equals to current time if (tmp->pair != NULL && ((double) tmp->pair->next_event_t >= cur_time - omg_eps) && ((double) tmp->pair->next_event_t <= cur_time + omg_eps)) { + my_node = tmp->pair->b; if (my_node->mobile == 1) sleep_rwalk_node (tmp->pair, cur_time); else @@ -364,6 +363,7 @@ update_rwalk_nodes (double cur_time) && (cur_time - omg_eps) > tmp->pair->next_event_t) { + my_node = tmp->pair->b; while (cur_time >= tmp->pair->next_event_t) { if (my_node->mobile == 1) diff --git a/openair2/UTIL/OMG/rwp.c b/openair2/UTIL/OMG/rwp.c index 11a8560274..ebf028afcb 100644 --- a/openair2/UTIL/OMG/rwp.c +++ b/openair2/UTIL/OMG/rwp.c @@ -320,13 +320,12 @@ update_rwp_nodes (double cur_time) node_struct *my_node; while (tmp != NULL && done == 0) { - my_node = (node_struct *) tmp->pair->b; - //case1:time to next event equals to current time if (tmp->pair != NULL && ((double) tmp->pair->next_event_t >= cur_time - omg_eps) && ((double) tmp->pair->next_event_t <= cur_time + omg_eps)) { + my_node = tmp->pair->b; if (my_node->mobile == 1) sleep_rwp_node (tmp->pair, cur_time); else @@ -339,6 +338,7 @@ update_rwp_nodes (double cur_time) && (cur_time - omg_eps) > tmp->pair->next_event_t) { + my_node = tmp->pair->b; while (cur_time >= tmp->pair->next_event_t) { if (my_node->mobile == 1) diff --git a/openair2/UTIL/OMG/steadystaterwp.c b/openair2/UTIL/OMG/steadystaterwp.c index edf3081fb9..2e7d23715b 100644 --- a/openair2/UTIL/OMG/steadystaterwp.c +++ b/openair2/UTIL/OMG/steadystaterwp.c @@ -525,13 +525,12 @@ update_steadystaterwp_nodes (double cur_time) node_struct *my_node; while (tmp != NULL && done == 0) { - my_node = (node_struct *) tmp->pair->b; - //case1:time to next event equals to current time if (tmp->pair != NULL && ((double) tmp->pair->next_event_t >= cur_time - omg_eps) && ((double) tmp->pair->next_event_t <= cur_time + omg_eps)) { + my_node = tmp->pair->b; if (my_node->mobile == 1) sleep_rwp_node (tmp->pair, cur_time); else @@ -544,6 +543,7 @@ update_steadystaterwp_nodes (double cur_time) && (cur_time - omg_eps) > tmp->pair->next_event_t) { + my_node = tmp->pair->b; while (cur_time >= tmp->pair->next_event_t) { if (my_node->mobile == 1) diff --git a/openair2/UTIL/OMG/sumo.c b/openair2/UTIL/OMG/sumo.c index 4b729f1620..270fbf5c5c 100644 --- a/openair2/UTIL/OMG/sumo.c +++ b/openair2/UTIL/OMG/sumo.c @@ -50,6 +50,7 @@ #include "sumo.h" #include "client_traci_OMG.h" +#include "assertions.h" int @@ -170,6 +171,9 @@ start_sumo_generator (omg_global_param omg_param_list) node->generator = SUMO; // SUMO node->mob = mobility; + DevAssert( SUMO >= sizeof(node_vector_end) ); // FIXME node_vector_end is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types + DevAssert( SUMO >= sizeof(node_vector) ); // FIXME node_vector is declared with MAX_NUM_NODE_TYPES elements, but here we are indexing with SUMO from enum mobility_types + node_vector_end[SUMO] = (node_list *) add_entry (node, node_vector_end[SUMO]); diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index 8d6185ba7c..e3a631ac8f 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -469,6 +469,7 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size, 1, 0, 1, //guint8 isPredefinedData, guint8 retx, guint8 crcStatus oob_event,oob_event_value, pdu_buffer, pdu_buffer_size); + break; case OPT_PCAP: if (file_fd == NULL) { return; @@ -496,15 +497,16 @@ int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p) { subframesSinceCaptureStart = 0; - if (ip != NULL) { - strcpy(&in_path[0], path); + if (path != NULL) { + strncpy( in_path, sizeof(in_path), path ); + in_path[sizeof(in_path) - 1] = 0; // terminate string } else { - strcpy(&in_path[0], "oai_opt.pcap"); + strcpy( in_path, "oai_opt.pcap" ); } - if (path != NULL) { - strcpy(&in_ip[0], ip); + if (ip != NULL) { + strncpy( in_ip, sizeof(in_ip), ip ); } else { - strcpy(&in_ip[0], "127.0.0.1"); + strcpy( in_ip, "127.0.0.1" ); } if (port != NULL) { in_port = atoi(port); @@ -544,6 +546,8 @@ int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p) break; case OPT_TSHARK: LOG_D(OPT, "Tshark is currently not supported\n"); + opt_type = OPT_NONE; + break; default: opt_type = OPT_NONE; break; diff --git a/openair2/UTIL/OTG/otg.c b/openair2/UTIL/OTG/otg.c index 7134aa8500..6a992e33eb 100644 --- a/openair2/UTIL/OTG/otg.c +++ b/openair2/UTIL/OTG/otg.c @@ -127,15 +127,12 @@ int get_ctime(void){ void free_otg(){ int i,j,k; - for (i=0; i<g_otg->num_nodes; i++){ - if (NULL != g_otg->dst_ip[i]){ - free(g_otg->dst_ip[i]); - } - } + for (i=0; i<g_otg->num_nodes; i++) + for (j=0; j<g_otg->num_nodes; j++) + free( g_otg->dst_ip[i][j] ); - if (NULL !=g_otg){ - free(g_otg); - } + free( g_otg ); + g_otg = 0; LOG_D(OTG,"DEBUG TARMA: free_otg() called \n"); for(i=0; i<NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++){ @@ -157,11 +154,6 @@ void free_otg(){ } } - if (NULL !=otg_info){ - free(otg_info); - } - - - + free(otg_info); } diff --git a/targets/SIMU/EXAMPLES/OSD/WEBXML/template_26.xml b/targets/SIMU/EXAMPLES/OSD/WEBXML/template_26.xml index e5bf79f26d..5f84eca3cc 100755 --- a/targets/SIMU/EXAMPLES/OSD/WEBXML/template_26.xml +++ b/targets/SIMU/EXAMPLES/OSD/WEBXML/template_26.xml @@ -46,8 +46,8 @@ <BACKGROUND_TRAFFIC>disable</BACKGROUND_TRAFFIC> <!-- options: enable, disable. If enable, it generates a background traffic corresponding to the traffic direction--> <IDT_DIST>uniform</IDT_DIST> <!-- available distributions: none (default), uniform, poission, gaussian, exponential,pareto, cauchy,fixed, weibull, gammav--> - <IDT_MIN_ms>40</IDT_MIN_ms> <!--Minimum IDT values in milliseconds--> - <IDT_MAX_ms>50</IDT_MAX_ms> <!--Minimum IDT values in milliseconds--> + <IDT_MIN_ms>50</IDT_MIN_ms> <!--Minimum IDT values in milliseconds--> + <IDT_MAX_ms>100</IDT_MAX_ms> <!--Minimum IDT values in milliseconds--> <SIZE_DIST>uniform</SIZE_DIST> <!-- available distributions: none (default), uniform, poission, gaussian, exponential,pareto, cauchy,fixed, weibull, gammav--> <SIZE_MIN_byte>128</SIZE_MIN_byte> <!--Minimum PAYLOAD size values in bytes--> <SIZE_MAX_byte>1400</SIZE_MAX_byte> <!--MAximum PAYLOAD size values in bytes--> diff --git a/targets/SIMU/USER/event_handler.c b/targets/SIMU/USER/event_handler.c index f11c8f6554..335252afb4 100644 --- a/targets/SIMU/USER/event_handler.c +++ b/targets/SIMU/USER/event_handler.c @@ -1565,7 +1565,8 @@ void update_topo_model(Event_t event) { oai_emulation->topology_config.mobility.UE_mobility.sumo_config.end = new_mobility_model->UE_mobility.sumo_config.end; oai_emulation->topology_config.mobility.UE_mobility.sumo_config.step = new_mobility_model->UE_mobility.sumo_config.step; // 1000ms oai_emulation->topology_config.mobility.UE_mobility.sumo_config.hport = new_mobility_model->UE_mobility.sumo_config.hport; - } + } else { + // event.key is not NULL if(!strcmp((char *) event.key, "UE_mobility_type")) { sprintf(oai_emulation->topology_config.mobility.UE_mobility.UE_mobility_type.selected_option, "%s", new_mobility_model->UE_mobility.UE_mobility_type.selected_option); @@ -1669,7 +1670,7 @@ oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed } else if(!strcmp((char *) event.key, "sumo_config_file")) { - sprintf(oai_emulation->topology_config.mobility.UE_mobility.sumo_config.file,"%s/UTIL/OMG/SUMO/SCENARIOS/scen.sumo.cfg",getenv("OPENAIR2_DIR")); + snprintf( oai_emulation->topology_config.mobility.UE_mobility.sumo_config.file, 256, "%s/UTIL/OMG/SUMO/SCENARIOS/scen.sumo.cfg", getenv("OPENAIR2_DIR") ); } else if(!strcmp((char *) event.key, "sumo_config_start")) { @@ -1691,6 +1692,7 @@ oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed { sprintf(oai_emulation->topology_config.mobility.UE_mobility.sumo_config.hip,"127.0.1.1"); } + } } diff --git a/targets/SIMU/USER/oaisim_config.c b/targets/SIMU/USER/oaisim_config.c index 76be422b73..5d521dd649 100644 --- a/targets/SIMU/USER/oaisim_config.c +++ b/targets/SIMU/USER/oaisim_config.c @@ -154,7 +154,7 @@ void init_oai_emulation(void) { oai_emulation.topology_config.mobility.UE_mobility.sumo_config.command = (char*) malloc(20); sprintf(oai_emulation.topology_config.mobility.UE_mobility.sumo_config.command,"sumo"); oai_emulation.topology_config.mobility.UE_mobility.sumo_config.file = (char*) malloc(256); - sprintf(oai_emulation.topology_config.mobility.UE_mobility.sumo_config.file,"%s/UTIL/OMG/SUMO/SCENARIOS/scen.sumo.cfg",getenv("OPENAIR2_DIR")); + snprintf( oai_emulation.topology_config.mobility.UE_mobility.sumo_config.file, 256, "%s/UTIL/OMG/SUMO/SCENARIOS/scen.sumo.cfg", getenv("OPENAIR2_DIR") ); oai_emulation.topology_config.mobility.UE_mobility.sumo_config.start=0; oai_emulation.topology_config.mobility.UE_mobility.sumo_config.end=0; oai_emulation.topology_config.mobility.UE_mobility.sumo_config.step=1; // 1000ms @@ -595,7 +595,7 @@ int ocg_config_topo(void) { omg_param_list[i].mobility_file = (char*) malloc(256);// user-specific trace file "%s/UTIL/OMG/mobility.txt",getenv("OPENAIR2_DIR") //memset(oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file,0,256); //sprintf(omg_param_list.mobility_file,"%s",oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file); - sprintf(omg_param_list[i].mobility_file,"%s/UTIL/OMG/TRACE/%s", + snprintf( omg_param_list[i].mobility_file, 256, "%s/UTIL/OMG/TRACE/%s", getenv("OPENAIR2_DIR"), oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file); LOG_I(OMG,"TRACE file at %s\n", omg_param_list[i].mobility_file); diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 6d9e5ead74..eb1cbc8e6b 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -782,7 +782,7 @@ void init_omv(void) { if(pipe(pfd) == -1) perror("pipe error \n"); - sprintf(full_name, "%s/UTIL/OMV/OMV",getenv("OPENAIR2_DIR")); + snprintf( full_name, sizeof(full_name), "%s/UTIL/OMV/OMV",getenv("OPENAIR2_DIR") ); LOG_I(EMU,"Stating the OMV path %s pfd[0] %d pfd[1] %d \n", full_name, pfd[0],pfd[1]); switch(fork()) { @@ -1308,7 +1308,8 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) { src_id = module_id; - for (dst_id=0;dst_id<NUMBER_OF_eNB_MAX;dst_id++) { + for (dst_id=0;dst_id<NB_SIG_CNX_UE;dst_id++) { + // only consider the first attached eNB if (mac_get_rrc_status(ue_mod_idP, 0, dst_id ) > 2 /*RRC_CONNECTED*/) { Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t)); if (otg_pkt!=NULL) diff --git a/targets/SIMU/USER/sinr_sim.c b/targets/SIMU/USER/sinr_sim.c index 5374adb686..d1368a251f 100644 --- a/targets/SIMU/USER/sinr_sim.c +++ b/targets/SIMU/USER/sinr_sim.c @@ -549,7 +549,7 @@ void get_beta_map() { file_path = (char*) malloc(512); for (mcs = 0; mcs < MCS_COUNT; mcs++) { - sprintf(file_path,"%s/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs%d.csv",getenv("OPENAIR1_DIR"),mcs); + snprintf( file_path, 512, "%s/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs%d.csv", getenv("OPENAIR1_DIR"), mcs ); fp = fopen(file_path,"r"); if (fp == NULL) { LOG_E(OCM,"ERROR: Unable to open the file %s! Exitng.\n", file_path); diff --git a/targets/TEST/OAI/case01.py b/targets/TEST/OAI/case01.py index c4d5247c00..cd0468d442 100644 --- a/targets/TEST/OAI/case01.py +++ b/targets/TEST/OAI/case01.py @@ -1,31 +1,32 @@ #****************************************************************************** -# Eurecom OpenAirInterface -# Copyright(c) 1999 - 2013 Eurecom +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see <http://www.gnu.org/licenses/>. # Contact Information -# Openair Admin: openair_admin@eurecom.fr -# Openair Tech : openair_tech@eurecom.fr -# Forums : http://forums.eurecom.fsr/openairinterface -# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE -#***************************************************************************** +#*******************************************************************************/ # \file case01.py # \brief test case 01 for OAI: compilations diff --git a/targets/TEST/OAI/case02.py b/targets/TEST/OAI/case02.py index 1eb2c07ecc..d3d9577c4e 100644 --- a/targets/TEST/OAI/case02.py +++ b/targets/TEST/OAI/case02.py @@ -1,36 +1,37 @@ #****************************************************************************** -# Eurecom OpenAirInterface -# Copyright(c) 1999 - 2013 Eurecom +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see <http://www.gnu.org/licenses/>. # Contact Information -# Openair Admin: openair_admin@eurecom.fr -# Openair Tech : openair_tech@eurecom.fr -# Forums : http://forums.eurecom.fsr/openairinterface -# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE -#***************************************************************************** +#*******************************************************************************/ # \file case02.py # \brief test case 02 for OAI: executions # \author Navid Nikaein -# \date 2013 +# \date 2013 - 2015 # \version 0.1 # @ingroup _test @@ -76,7 +77,7 @@ def execute(oai, user, pw, host, logfile,logdir,debug): test = '01' name = 'Run oai.rel8.err' conf = '-a -A AWGN -n 100 ' - trace = logdir + '/log_' + host + case + test + '_3.txt;' + trace = logdir + '/log_' + host + case + test + '_1.txt;' tee = ' 2>&1 | tee ' + trace diag = '[E] Error(s) found during the execution, check the execution logs' oai.send_expect_false('./oaisim.rel8.'+ host + ' ' + conf, '[E]', 30) @@ -89,12 +90,12 @@ def execute(oai, user, pw, host, logfile,logdir,debug): try: log.start() test = '02' - name = 'Run oai.rel8.abs.rrc' + name = 'Run oai.rel8.tdd.5MHz.rrc.abs' diag = 'RRC procedure is not finished completely, check the execution logs and trace BCCH, CCCH, and DCCH channels' for i in range(NUM_UE) : for j in range(NUM_eNB) : conf = '-a -A AWGN -n' + str((i+1+j) * 50) + ' -u' + str(i+1) +' -b'+ str(j+1) - trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt' + trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt;' tee = ' 2>&1 | tee ' + trace oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 100) except log.err, e: @@ -102,43 +103,10 @@ def execute(oai, user, pw, host, logfile,logdir,debug): else: log.ok(case, test, name, conf, '', logfile) - try: log.start() test = '03' - name = 'Run oai.rel8.phy.rrc.tdd' - diag = 'RRC procedure is not finished completely, check the execution logs and trace BCCH, CCCH, and DCCH channels' - for i in range(NUM_UE) : - for j in range(NUM_eNB) : - conf = '-A AWGN -n' + str((i+1+j) * 100) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -x1' - trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt' - tee = ' 2>&1 | tee ' + trace - oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 500) - except log.err, e: - log.fail(case, test, name, conf, e.value, diag, logfile,trace) - else: - log.ok(case, test, name, conf, '', logfile) - - try: - log.start() - test = '04' - name = 'Run oai.rel8.phy.rrc.fdd' - diag = 'RRC procedure is not finished completely in FDD mode, check the execution logs and trace BCCH, CCCH, and DCCH channels' - for i in range(NUM_UE) : - for j in range(NUM_eNB) : - conf = '-A AWGN -F -n' + str((i+1+j) * 100) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -x1' - trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt' - tee = ' 2>&1 | tee ' + trace - oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 500) - except log.err, e: - log.fail(case, test, name, conf, e.value, diag, logfile,trace) - else: - log.ok(case, test, name, conf, '', logfile) - - try: - log.start() - test = '05' - name = 'Run oai.rel8.itti.abs.rrc' + name = 'Run oai.rel8.tdd.5MHz.rrc.itti.abs' diag = 'RRC procedure is not finished completely, check the eNB config file (default is enb.band7.generic.conf), in addition to the execution logs and trace BCCH, CCCH, and DCCH channels' for i in range(NUM_UE) : for j in range(NUM_eNB) : @@ -154,15 +122,14 @@ def execute(oai, user, pw, host, logfile,logdir,debug): log.fail(case, test, name, conf, e.value, diag, logfile, trace_name) else: log.ok(case, test, name, conf, '', logfile) - - + try: log.start() - test='06' - name = 'Run oai.rel8.abs.ocg.otg.tdd' - diag = 'Check the scenario if the tests 0202 and 0203 are passed.' + test='04' + name = 'Run oai.rel8.tdd.5MHz.abs.ocg.otg' + diag = 'Check the scenario if the test 0202 is passed.' conf = '-a -c26' - trace = logdir + '/log_' + host + case + test + '.txt' + trace = logdir + '/log_' + host + case + test + '.txt;' tee = ' 2>&1 | tee ' + trace oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' DL and UL loss rate below 10 ', 500) except log.err, e: @@ -172,11 +139,11 @@ def execute(oai, user, pw, host, logfile,logdir,debug): try: log.start() - test='07' - name = 'Run oai.rel8.abs.ocg.otg.fdd' - diag = 'Check the template 26 and the results of tests 0202 and 0203.' + test='05' + name = 'Run oai.rel8.fdd.5MHz.abs.ocg.otg' + diag = 'Check the template 26 and the results of test 0202.' conf = '-a -F -c26' - trace = logdir + '/log_' + host + case + test + '.txt' + trace = logdir + '/log_' + host + case + test + '.txt;' tee = ' 2>&1 | tee ' + trace oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' DL and UL loss rate below 10 ', 500) except log.err, e: @@ -187,8 +154,8 @@ def execute(oai, user, pw, host, logfile,logdir,debug): try: log.start() - test = '08' - name = 'Run oai.rel8.abs.ping' + test = '06' + name = 'Run oai.rel8.tdd.5MHz.abs.ping' diag = 'Data-plane is not working normally, check the OAI protocol stack, OAI driver, and normal operation of the OS' oai.driver(oai,user,pw) @@ -196,7 +163,7 @@ def execute(oai, user, pw, host, logfile,logdir,debug): for i in range(NUM_eNB) : for j in range(NUM_UE) : conf = '-a -A AWGN -u' + str(j+1) +' -b'+ str(i+1) - trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt' + trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt;' tee = ' 2>&1 > ' + trace if user == 'root' : @@ -205,7 +172,7 @@ def execute(oai, user, pw, host, logfile,logdir,debug): oai.send_nowait('echo '+pw+ ' | sudo -S -E ./oaisim.rel8.nas.'+ host + ' ' + conf + tee + ' &') time.sleep(10) for k in range(NUM_TRIALS) : - trace_ping = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + str(k) + '_ping.txt' + trace_ping = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + str(k) + '_ping.txt;' tee_ping = ' 2>&1 | tee ' + trace_ping oai.send_expect('ping 10.0.'+str(j+1)+'.'+str(NUM_eNB+i+1) + ' -c ' + str(random.randint(2, 10))+ ' -s ' + str(random.randint(128, 1500)) + tee_ping, ' 0% packet loss', 20) @@ -227,3 +194,63 @@ def execute(oai, user, pw, host, logfile,logdir,debug): log.fail(case, test, name, conf, e.value, diag, logfile,trace) else: log.ok(case, test, name, conf, '', logfile) + + try: + log.start() + test = '07' + name = 'Run oai.rel8.tdd.5MHz.phy.rrc' + diag = 'RRC procedure is not finished completely, check the execution logs and trace BCCH, CCCH, and DCCH channels' + for i in range(NUM_UE) : + for j in range(NUM_eNB) : + conf = '-A AWGN -n' + str((i+1+j) * 100) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -x1' + trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt;' + tee = ' 2>&1 | tee ' + trace + oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 500) + except log.err, e: + log.fail(case, test, name, conf, e.value, diag, logfile,trace) + else: + log.ok(case, test, name, conf, '', logfile) + + try: + log.start() + test = '08' + name = 'Run oai.rel8.fdd.5MHz.phy.rrc' + diag = 'RRC procedure is not finished completely in FDD mode, check the execution logs and trace BCCH, CCCH, and DCCH channels' + for i in range(NUM_UE) : + for j in range(NUM_eNB) : + conf = '-A AWGN -F -n' + str((i+1+j) * 100) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -x1' + trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt;' + tee = ' 2>&1 | tee ' + trace + oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 500) + except log.err, e: + log.fail(case, test, name, conf, e.value, diag, logfile,trace) + else: + log.ok(case, test, name, conf, '', logfile) + + try: + log.start() + test = '09' + name = 'Run oai.rel8.fdd.10MHz.phy.rrc' + diag = 'RRC procedure is not finished completely, check th execution logs and trace BCCH, CCCH, and DCCH channels and the results of test 0204' + conf = '-A AWGN -F -R 50 -n 150 -u 1 -b 1 -x1' + trace = logdir + '/log_' + host + case + test + '_1.txt;' + tee = ' 2>&1 | tee ' + trace + oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE 0', 600) + except log.err, e: + log.fail(case, test, name, conf, e.value, diag, logfile,trace) + else: + log.ok(case, test, name, conf, '', logfile) + + try: + log.start() + test = '10' + name = 'Run oai.rel8.fdd.20MHz.phy.rrc' + diag = 'RRC procedure is not finished completely, check th execution logs and trace BCCH, CCCH, and DCCH channels and the results of test 0204' + conf = '-A AWGN -F -R 100 -n 200 -u 1 -b 1 -x1' + trace = logdir + '/log_' + host + case + test + '_1.txt;' + tee = ' 2>&1 | tee ' + trace + oai.send_expect('./oaisim.rel8.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE 0', 700) + except log.err, e: + log.fail(case, test, name, conf, e.value, diag, logfile,trace) + else: + log.ok(case, test, name, conf, '', logfile) diff --git a/targets/TEST/OAI/case03.py b/targets/TEST/OAI/case03.py index e9c3e085da..e75b96a03f 100644 --- a/targets/TEST/OAI/case03.py +++ b/targets/TEST/OAI/case03.py @@ -1,31 +1,32 @@ #****************************************************************************** -# Eurecom OpenAirInterface -# Copyright(c) 1999 - 2013 Eurecom +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see <http://www.gnu.org/licenses/>. # Contact Information -# Openair Admin: openair_admin@eurecom.fr -# Openair Tech : openair_tech@eurecom.fr -# Forums : http://forums.eurecom.fsr/openairinterface -# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE -#***************************************************************************** +#*******************************************************************************/ # \file case03.py # \brief test case 03 for OAI: executions @@ -76,7 +77,7 @@ def execute(oai, user, pw, host, logfile,logdir,debug): test = '01' name = 'Run oai.rel10.err' conf = '-a -A AWGN -l7 -n 100' - trace = logdir + '/log_' + host + case + test + '.txt' + trace = logdir + '/log_' + host + case + test + '.txt;' tee = ' 2>&1 | tee ' + trace diag = 'Error(s) found in the execution, check the execution logs' oai.send_expect_false('./oaisim.rel10.' + host + ' ' + conf + tee, '[E]', 30) @@ -89,12 +90,12 @@ def execute(oai, user, pw, host, logfile,logdir,debug): try: log.start() test = '02' - name = 'Run oai.rel10.abs.rrc' + name = 'Run oai.rel10.tdd.5MHz.abs.rrc' diag = 'RRC procedure is not finished completely, check the execution logs and trace BCCH, CCCH, and DCCH channels' for i in range(NUM_UE) : for j in range(NUM_eNB) : conf = '-a -l7 -A AWGN -n' + str((i+1+j) * 50) + ' -u' + str(i+1) +' -b'+ str(j+1) - trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt' + trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt;' tee = ' 2>&1 | tee ' + trace oai.send_expect('./oaisim.rel10.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 100) except log.err, e: @@ -105,12 +106,12 @@ def execute(oai, user, pw, host, logfile,logdir,debug): try: log.start() test = '03' - name = 'Run oai.rel10.phy.rrc' + name = 'Run oai.rel10.tdd.5MHz.phy.rrc' diag = 'RRC procedure is not finished completely, check the execution logs and trace BCCH, CCCH, and DCCH channels' for i in range(NUM_UE) : for j in range(NUM_eNB) : conf = '-A AWGN -l7 -x 1 -n' + str((i+1+j) * 100) + ' -u' + str(i+1) +' -b'+ str(j+1) - trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt' + trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt;' tee = ' 2>&1 | tee ' + trace oai.send_expect('./oaisim.rel10.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 500) except log.err, e: @@ -121,12 +122,12 @@ def execute(oai, user, pw, host, logfile,logdir,debug): try: log.start() test = '04' - name = 'Run oai.rel10.phy.rrc.fdd' + name = 'Run oai.rel10.fdd.5MHz.phy.rrc' diag = 'RRC procedure is not finished completely in FDD mode, check the execution logs and trace BCCH, CCCH, and DCCH channels' for i in range(NUM_UE) : for j in range(NUM_eNB) : conf = '-A AWGN -l7 -F -x 1 -n' + str((i+1+j) * 100) + ' -u' + str(i+1) +' -b'+ str(j+1) - trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt' + trace = logdir + '/log_' + host + case + test + '_' + str(i) + str(j) + '.txt;' tee = ' 2>&1 | tee ' + trace oai.send_expect('./oaisim.rel10.' + host + ' ' + conf + tee, ' Received RRCConnectionReconfigurationComplete from UE ' + str(i), (i+1) * 500) except log.err, e: @@ -134,6 +135,7 @@ def execute(oai, user, pw, host, logfile,logdir,debug): else: log.ok(case, test, name, conf, '', logfile) + # try: # test = '05' # name = 'Run oai.rel10.phy.eMBMS.MCCH' diff --git a/targets/TEST/OAI/case04.py b/targets/TEST/OAI/case04.py index 57ec5ce858..8b17265970 100644 --- a/targets/TEST/OAI/case04.py +++ b/targets/TEST/OAI/case04.py @@ -1,36 +1,37 @@ #****************************************************************************** -# Eurecom OpenAirInterface -# Copyright(c) 1999 - 2013 Eurecom +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see <http://www.gnu.org/licenses/>. # Contact Information -# Openair Admin: openair_admin@eurecom.fr -# Openair Tech : openair_tech@eurecom.fr -# Forums : http://forums.eurecom.fsr/openairinterface -# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE -#***************************************************************************** +#*******************************************************************************/ -# \file case02.py -# \brief test case 02 for OAI: executions +# \file case04.py +# \brief test case 04 for OAI: executions # \author Navid Nikaein -# \date 2013 +# \date 2013 - 2015 # \version 0.1 # @ingroup _test diff --git a/targets/TEST/OAI/case05.py b/targets/TEST/OAI/case05.py index c25517f6f9..48b39bd9d4 100644 --- a/targets/TEST/OAI/case05.py +++ b/targets/TEST/OAI/case05.py @@ -1,36 +1,37 @@ #****************************************************************************** -# Eurecom OpenAirInterface -# Copyright(c) 1999 - 2013 Eurecom +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see <http://www.gnu.org/licenses/>. # Contact Information -# Openair Admin: openair_admin@eurecom.fr -# Openair Tech : openair_tech@eurecom.fr -# Forums : http://forums.eurecom.fsr/openairinterface -# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE -#***************************************************************************** +#*******************************************************************************/ -# \file case02.py -# \brief test case 02 for OAI: executions +# \file case05.py +# \brief test case 05 for OAI: executions # \author Navid Nikaein -# \date 2013 +# \date 2013 - 2015 # \version 0.1 # @ingroup _test diff --git a/targets/TEST/OAI/test01.py b/targets/TEST/OAI/test01.py index d5b6c0ff76..f1c048fdcf 100644 --- a/targets/TEST/OAI/test01.py +++ b/targets/TEST/OAI/test01.py @@ -1,32 +1,33 @@ #! /usr/bin/python #****************************************************************************** -# Eurecom OpenAirInterface -# Copyright(c) 1999 - 2013 Eurecom +# OpenAirInterface +# Copyright(c) 1999 - 2014 Eurecom -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# OpenAirInterface is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# OpenAirInterface is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". +# You should have received a copy of the GNU General Public License +# along with OpenAirInterface.The full GNU General Public License is +# included in this distribution in the file called "COPYING". If not, +# see <http://www.gnu.org/licenses/>. # Contact Information -# Openair Admin: openair_admin@eurecom.fr -# Openair Tech : openair_tech@eurecom.fr -# Forums : http://forums.eurecom.fsr/openairinterface -# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France +# OpenAirInterface Admin: openair_admin@eurecom.fr +# OpenAirInterface Tech : openair_tech@eurecom.fr +# OpenAirInterface Dev : openair4g-devel@eurecom.fr + +# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE -#***************************************************************************** +# *******************************************************************************/ # \file test01.py # \brief test 01 for OAI -- GitLab