enb_config.c 153 KB
Newer Older
1
/*******************************************************************************
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom

    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.


    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.

    You should have received a copy of the GNU General Public License
    along with OpenAirInterface.The full GNU General Public License is
18 19
    included in this distribution in the file called "COPYING". If not,
    see <http://www.gnu.org/licenses/>.
20 21 22 23

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
24
  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
25

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
27

28
 *******************************************************************************/
29

Lionel Gauthier's avatar
Lionel Gauthier committed
30 31 32
/*
                                enb_config.c
                             -------------------
33
  AUTHOR  : Lionel GAUTHIER, navid nikaein, Laurent Winckel
Lionel Gauthier's avatar
Lionel Gauthier committed
34
  COMPANY : EURECOM
35
  EMAIL   : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr
36
 */
37 38 39

#include <string.h>
#include <libconfig.h>
40
#include <inttypes.h>
41

Lionel Gauthier's avatar
 
Lionel Gauthier committed
42
#include "log.h"
43
#include "log_extern.h"
44 45
#include "assertions.h"
#include "enb_config.h"
46 47
#include "UTIL/OTG/otg.h"
#include "UTIL/OTG/otg_externs.h"
winckel's avatar
winckel committed
48 49 50 51
#if defined(OAI_EMU)
# include "OCG.h"
# include "OCG_extern.h"
#endif
52 53 54 55 56 57 58
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
#   include "s1ap_eNB.h"
#   include "sctp_eNB_task.h"
# endif
#endif
59
#include "sctp_default_values.h"
60
#include "SystemInformationBlockType2.h"
61 62
#include "LAYER2/MAC/extern.h"

63 64 65 66 67 68 69 70 71 72 73
#define ENB_CONFIG_STRING_ACTIVE_ENBS                   "Active_eNBs"

#define ENB_CONFIG_STRING_ENB_LIST                      "eNBs"
#define ENB_CONFIG_STRING_ENB_ID                        "eNB_ID"
#define ENB_CONFIG_STRING_CELL_TYPE                     "cell_type"
#define ENB_CONFIG_STRING_ENB_NAME                      "eNB_name"

#define ENB_CONFIG_STRING_TRACKING_AREA_CODE            "tracking_area_code"
#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE           "mobile_country_code"
#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE           "mobile_network_code"

Raymond Knopp's avatar
 
Raymond Knopp committed
74
#define ENB_CONFIG_STRING_COMPONENT_CARRIERS                            "component_carriers"
75

Raymond Knopp's avatar
 
Raymond Knopp committed
76 77 78 79 80 81 82
#define ENB_CONFIG_STRING_FRAME_TYPE                                    "frame_type"
#define ENB_CONFIG_STRING_TDD_CONFIG                                    "tdd_config"
#define ENB_CONFIG_STRING_TDD_CONFIG_S                                  "tdd_config_s"
#define ENB_CONFIG_STRING_PREFIX_TYPE                                   "prefix_type"
#define ENB_CONFIG_STRING_EUTRA_BAND                                    "eutra_band"
#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY                            "downlink_frequency"
#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET                       "uplink_frequency_offset"
83

Raymond Knopp's avatar
 
Raymond Knopp committed
84 85
#define ENB_CONFIG_STRING_NID_CELL                                      "Nid_cell"
#define ENB_CONFIG_STRING_N_RB_DL                                       "N_RB_DL"
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
#define ENB_CONFIG_STRING_CELL_MBSFN                                  "Nid_cell_mbsfn"
#define ENB_CONFIG_STRING_NB_ANT_TX                                 "nb_antennas_tx"
#define ENB_CONFIG_STRING_NB_ANT_RX                                 "nb_antennas_rx"
#define ENB_CONFIG_STRING_TX_GAIN                                       "tx_gain"
#define ENB_CONFIG_STRING_RX_GAIN                                       "rx_gain"
#define ENB_CONFIG_STRING_PRACH_ROOT                                  "prach_root"
#define ENB_CONFIG_STRING_PRACH_CONFIG_INDEX                          "prach_config_index"
#define ENB_CONFIG_STRING_PRACH_HIGH_SPEED                          "prach_high_speed"
#define ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION                  "prach_zero_correlation"
#define ENB_CONFIG_STRING_PRACH_FREQ_OFFSET                         "prach_freq_offset"
#define ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT                         "pucch_delta_shift"
#define ENB_CONFIG_STRING_PUCCH_NRB_CQI                                 "pucch_nRB_CQI"
#define ENB_CONFIG_STRING_PUCCH_NCS_AN                                  "pucch_nCS_AN"
#ifndef Rel10
#define ENB_CONFIG_STRING_PUCCH_N1_AN                                 "pucch_n1_AN"
Raymond Knopp's avatar
 
Raymond Knopp committed
101
#endif
102 103 104
#define ENB_CONFIG_STRING_PDSCH_RS_EPRE                                 "pdsch_referenceSignalPower"
#define ENB_CONFIG_STRING_PDSCH_PB                                  "pdsch_p_b"
#define ENB_CONFIG_STRING_PUSCH_N_SB                                  "pusch_n_SB"
Raymond Knopp's avatar
 
Raymond Knopp committed
105 106
#define ENB_CONFIG_STRING_PUSCH_HOPPINGMODE                             "pusch_hoppingMode"
#define ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET                           "pusch_hoppingOffset"
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
#define ENB_CONFIG_STRING_PUSCH_ENABLE64QAM                         "pusch_enable64QAM"
#define ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN                  "pusch_groupHoppingEnabled"
#define ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT                  "pusch_groupAssignment"
#define ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN                 "pusch_sequenceHoppingEnabled"
#define ENB_CONFIG_STRING_PUSCH_NDMRS1                                  "pusch_nDMRS1"
#define ENB_CONFIG_STRING_PHICH_DURATION                          "phich_duration"
#define ENB_CONFIG_STRING_PHICH_RESOURCE                          "phich_resource"
#define ENB_CONFIG_STRING_SRS_ENABLE                                  "srs_enable"
#define ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG                          "srs_BandwidthConfig"
#define ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG                         "srs_SubframeConfig"
#define ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG                          "srs_ackNackST"
#define ENB_CONFIG_STRING_SRS_MAXUPPTS                                  "srs_MaxUpPts"
#define ENB_CONFIG_STRING_PUSCH_PO_NOMINAL                          "pusch_p0_Nominal"
#define ENB_CONFIG_STRING_PUSCH_ALPHA                                 "pusch_alpha"
#define ENB_CONFIG_STRING_PUCCH_PO_NOMINAL                          "pucch_p0_Nominal"
#define ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE                         "msg3_delta_Preamble"
#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1                          "pucch_deltaF_Format1"
#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b                         "pucch_deltaF_Format1b"
#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2                          "pucch_deltaF_Format2"
#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A                         "pucch_deltaF_Format2a"
#define ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B                         "pucch_deltaF_Format2b"
#define ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES                         "rach_numberOfRA_Preambles"
#define ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG                  "rach_preamblesGroupAConfig"
Raymond Knopp's avatar
 
Raymond Knopp committed
130
#define ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA                 "rach_sizeOfRA_PreamblesGroupA"
131
#define ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA                        "rach_messageSizeGroupA"
Raymond Knopp's avatar
 
Raymond Knopp committed
132
#define ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB                 "rach_messagePowerOffsetGroupB"
133 134 135 136 137 138
#define ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP                         "rach_powerRampingStep"
#define ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER "rach_preambleInitialReceivedTargetPower"
#define ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX                         "rach_preambleTransMax"
#define ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE                 "rach_raResponseWindowSize"
#define ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER         "rach_macContentionResolutionTimer"
#define ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX                          "rach_maxHARQ_Msg3Tx"
Raymond Knopp's avatar
 
Raymond Knopp committed
139 140 141 142 143 144 145 146 147
#define ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE                     "pcch_default_PagingCycle"
#define ENB_CONFIG_STRING_PCCH_NB                                       "pcch_nB"
#define ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF                  "bcch_modificationPeriodCoeff"
#define ENB_CONFIG_STRING_UETIMERS_T300                                 "ue_TimersAndConstants_t300"
#define ENB_CONFIG_STRING_UETIMERS_T301                                 "ue_TimersAndConstants_t301"
#define ENB_CONFIG_STRING_UETIMERS_T310                                 "ue_TimersAndConstants_t310"
#define ENB_CONFIG_STRING_UETIMERS_T311                                 "ue_TimersAndConstants_t311"
#define ENB_CONFIG_STRING_UETIMERS_N310                                 "ue_TimersAndConstants_n310"
#define ENB_CONFIG_STRING_UETIMERS_N311                                 "ue_TimersAndConstants_n311"
148

149 150 151 152 153 154 155
#define ENB_CONFIG_STRING_SRB1                                          "srb1_parameters"
#define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT                    "timer_poll_retransmit"
#define ENB_CONFIG_STRING_SRB1_TIMER_REORDERING                         "timer_reordering"
#define ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT                    "timer_status_prohibit"
#define ENB_CONFIG_STRING_SRB1_POLL_PDU                                 "poll_pdu"
#define ENB_CONFIG_STRING_SRB1_POLL_BYTE                                "poll_byte"
#define ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD                       "max_retx_threshold"
156 157 158 159 160 161
#define ENB_CONFIG_STRING_MME_IP_ADDRESS                "mme_ip_address"
#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS              "ipv4"
#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS              "ipv6"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE         "active"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE     "preference"

162 163 164 165
#define ENB_CONFIG_STRING_SCTP_CONFIG                    "SCTP"
#define ENB_CONFIG_STRING_SCTP_INSTREAMS                 "SCTP_INSTREAMS"
#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS                "SCTP_OUTSTREAMS"

166 167 168 169 170
#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG     "NETWORK_INTERFACES"
#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME"
#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME   "ENB_IPV4_ADDRESS_FOR_S1_MME"
#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U    "ENB_INTERFACE_NAME_FOR_S1U"
#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U         "ENB_IPV4_ADDRESS_FOR_S1U"
Lionel Gauthier's avatar
 
Lionel Gauthier committed
171
#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U              "ENB_PORT_FOR_S1U"
172

173 174 175 176 177 178
#define ENB_CONFIG_STRING_RRH_GW_CONFIG                   "rrh_gw_config"
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME            "local_if_name"
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS            "local_address"
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS           "remote_address"
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT               "local_port"
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT              "remote_port"
179
#define ENB_CONFIG_STRING_RRH_GW_ACTIVE                   "rrh_gw_active"
180 181 182 183 184
#define ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE     "tr_preference"
#define ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE     "rf_preference"
#define ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT               "iq_txshift"
#define ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE        "tx_sample_advance"
#define ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE    "tx_scheduling_advance"
Lionel Gauthier's avatar
Lionel Gauthier committed
185

186 187 188 189
#define ENB_CONFIG_STRING_ASN1_VERBOSITY                   "Asn1_verbosity"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE              "none"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING          "annoying"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO              "info"
Lionel Gauthier's avatar
Lionel Gauthier committed
190

191
// OTG config per ENB-UE DL
192 193 194 195
#define ENB_CONF_STRING_OTG_CONFIG                         "otg_config"
#define ENB_CONF_STRING_OTG_UE_ID                          "ue_id"
#define ENB_CONF_STRING_OTG_APP_TYPE                       "app_type"
#define ENB_CONF_STRING_OTG_BG_TRAFFIC                     "bg_traffic"
Lionel Gauthier's avatar
Lionel Gauthier committed
196

197
// per eNB configuration
198 199
#define ENB_CONFIG_STRING_LOG_CONFIG                       "log_config"
#define ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL                 "global_log_level"
Lionel Gauthier's avatar
 
Lionel Gauthier committed
200 201 202
#define ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY             "global_log_verbosity"
#define ENB_CONFIG_STRING_HW_LOG_LEVEL                     "hw_log_level"
#define ENB_CONFIG_STRING_HW_LOG_VERBOSITY                 "hw_log_verbosity"
203 204 205 206 207 208 209 210 211 212
#define ENB_CONFIG_STRING_PHY_LOG_LEVEL                    "phy_log_level"
#define ENB_CONFIG_STRING_PHY_LOG_VERBOSITY                "phy_log_verbosity"
#define ENB_CONFIG_STRING_MAC_LOG_LEVEL                    "mac_log_level"
#define ENB_CONFIG_STRING_MAC_LOG_VERBOSITY                "mac_log_verbosity"
#define ENB_CONFIG_STRING_RLC_LOG_LEVEL                    "rlc_log_level"
#define ENB_CONFIG_STRING_RLC_LOG_VERBOSITY                "rlc_log_verbosity"
#define ENB_CONFIG_STRING_PDCP_LOG_LEVEL                   "pdcp_log_level"
#define ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY               "pdcp_log_verbosity"
#define ENB_CONFIG_STRING_RRC_LOG_LEVEL                    "rrc_log_level"
#define ENB_CONFIG_STRING_RRC_LOG_VERBOSITY                "rrc_log_verbosity"
Lionel Gauthier's avatar
 
Lionel Gauthier committed
213 214 215 216
#define ENB_CONFIG_STRING_GTPU_LOG_LEVEL                   "gtpu_log_level"
#define ENB_CONFIG_STRING_GTPU_LOG_VERBOSITY               "gtpu_log_verbosity"
#define ENB_CONFIG_STRING_UDP_LOG_LEVEL                    "udp_log_level"
#define ENB_CONFIG_STRING_UDP_LOG_VERBOSITY                "udp_log_verbosity"
217 218
#define ENB_CONFIG_STRING_OSA_LOG_LEVEL                    "osa_log_level"
#define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY                "osa_log_verbosity"
219 220


221 222 223
#define KHz (1000UL)
#define MHz (1000 * KHz)

224 225 226 227 228 229 230
typedef struct eutra_band_s {
  int16_t             band;
  uint32_t            ul_min;
  uint32_t            ul_max;
  uint32_t            dl_min;
  uint32_t            dl_max;
  lte_frame_type_t    frame_type;
231 232
} eutra_band_t;

233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
static const eutra_band_t eutra_bands[] = {
  { 1, 1920    * MHz, 1980    * MHz, 2110    * MHz, 2170    * MHz, FDD},
  { 2, 1850    * MHz, 1910    * MHz, 1930    * MHz, 1990    * MHz, FDD},
  { 3, 1710    * MHz, 1785    * MHz, 1805    * MHz, 1880    * MHz, FDD},
  { 4, 1710    * MHz, 1755    * MHz, 2110    * MHz, 2155    * MHz, FDD},
  { 5,  824    * MHz,  849    * MHz,  869    * MHz,  894    * MHz, FDD},
  { 6,  830    * MHz,  840    * MHz,  875    * MHz,  885    * MHz, FDD},
  { 7, 2500    * MHz, 2570    * MHz, 2620    * MHz, 2690    * MHz, FDD},
  { 8,  880    * MHz,  915    * MHz,  925    * MHz,  960    * MHz, FDD},
  { 9, 1749900 * KHz, 1784900 * KHz, 1844900 * KHz, 1879900 * KHz, FDD},
  {10, 1710    * MHz, 1770    * MHz, 2110    * MHz, 2170    * MHz, FDD},
  {11, 1427900 * KHz, 1452900 * KHz, 1475900 * KHz, 1500900 * KHz, FDD},
  {12,  698    * MHz,  716    * MHz,  728    * MHz,  746    * MHz, FDD},
  {13,  777    * MHz,  787    * MHz,  746    * MHz,  756    * MHz, FDD},
  {14,  788    * MHz,  798    * MHz,  758    * MHz,  768    * MHz, FDD},

  {17,  704    * MHz,  716    * MHz,  734    * MHz,  746    * MHz, FDD},
  {20,  832    * MHz,  862    * MHz,  791    * MHz,  821    * MHz, FDD},
  {33, 1900    * MHz, 1920    * MHz, 1900    * MHz, 1920    * MHz, TDD},
  {33, 1900    * MHz, 1920    * MHz, 1900    * MHz, 1920    * MHz, TDD},
  {34, 2010    * MHz, 2025    * MHz, 2010    * MHz, 2025    * MHz, TDD},
  {35, 1850    * MHz, 1910    * MHz, 1850    * MHz, 1910    * MHz, TDD},
  {36, 1930    * MHz, 1990    * MHz, 1930    * MHz, 1990    * MHz, TDD},
  {37, 1910    * MHz, 1930    * MHz, 1910    * MHz, 1930    * MHz, TDD},
  {38, 2570    * MHz, 2620    * MHz, 2570    * MHz, 2630    * MHz, TDD},
  {39, 1880    * MHz, 1920    * MHz, 1880    * MHz, 1920    * MHz, TDD},
  {40, 2300    * MHz, 2400    * MHz, 2300    * MHz, 2400    * MHz, TDD},
  {41, 2496    * MHz, 2690    * MHz, 2496    * MHz, 2690    * MHz, TDD},
  {42, 3400    * MHz, 3600    * MHz, 3400    * MHz, 3600    * MHz, TDD},
  {43, 3600    * MHz, 3800    * MHz, 3600    * MHz, 3800    * MHz, TDD},
  {44, 703    * MHz, 803    * MHz, 703    * MHz, 803    * MHz, TDD},
264 265
};

266
Enb_properties_array_t enb_properties;
267

268
void enb_config_display(void)
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
{
  int i,j;

  printf( "\n----------------------------------------------------------------------\n");
  printf( " ENB CONFIG FILE CONTENT LOADED (TBC):\n");
  printf( "----------------------------------------------------------------------\n");

  for (i = 0; i < enb_properties.number; i++) {
    printf( "ENB CONFIG for instance %u:\n\n", i);
    printf( "\teNB name:           \t%s:\n",enb_properties.properties[i]->eNB_name);
    printf( "\teNB ID:             \t%"PRIu32":\n",enb_properties.properties[i]->eNB_id);
    printf( "\tCell type:          \t%s:\n",enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB");
    printf( "\tTAC:                \t%"PRIu16":\n",enb_properties.properties[i]->tac);
    printf( "\tMCC:                \t%"PRIu16":\n",enb_properties.properties[i]->mcc);

284
    if (enb_properties.properties[i]->mnc_digit_length == 3) {
285
      printf( "\tMNC:                \t%03"PRIu16":\n",enb_properties.properties[i]->mnc);
286
    } else {
287
      printf( "\tMNC:                \t%02"PRIu16":\n",enb_properties.properties[i]->mnc);
288
    }
289 290 291 292 293 294 295 296 297
    
    for (j=0; j< enb_properties.properties[i]->nb_rrh_gw; j++) {
      if (enb_properties.properties[i]->rrh_gw_config[j].active == 1 ){
	printf( "\n\tRRH GW %d config for eNB %u:\n\n", j, i);
	printf( "\tinterface name :       \t%s:\n",enb_properties.properties[i]->rrh_gw_if_name);
	printf( "\tlocal address  :       \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].local_address);
	printf( "\tlocal port     :       \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].local_port);
	printf( "\tremote address :       \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_address);
	printf( "\tremote port    :       \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_port);
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
	printf( "\ttx_scheduling_advance :\t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_scheduling_advance);
	printf( "\ttx_sample_advance :    \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_sample_advance);
	printf( "\tiq_txshift :           \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift);
	printf( "\ttransport  :           \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP");
	if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) {
	  printf( "\tRF target  :           \tEXMIMO:\n\n");
	} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) {
	  printf( "\tRF target  :           \tUSRP_B200:\n\n");
	} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_x300 == 1) {
	  printf( "\tRF target  :           \tUSRP_X300:\n\n");
	} else if (enb_properties.properties[i]->rrh_gw_config[j].bladerf == 1) {
	  printf( "\tRF target  :           \tBLADERF:\n\n");
	} else if (enb_properties.properties[i]->rrh_gw_config[j].lmssdr == 1) {
	  printf( "\tRF target  :           \tLMSSDR:\n\n");
	} else {
	  printf( "\tRF target  :           \tNONE:\n\n");
	}
315 316
      }
    }
317 318 319 320 321 322 323 324 325 326

    for (j=0; j< enb_properties.properties[i]->nb_cc; j++) {
      printf( "\teutra band for CC %d:         \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]);
      printf( "\tdownlink freq for CC %d:      \t%"PRIu64":\n",j,enb_properties.properties[i]->downlink_frequency[j]);
      printf( "\tuplink freq offset for CC %d: \t%"PRId32":\n",j,enb_properties.properties[i]->uplink_frequency_offset[j]);

      printf( "\n\tCell ID for CC %d:\t%"PRId16":\n",j,enb_properties.properties[i]->Nid_cell[j]);
      printf( "\tN_RB_DL for CC %d:\t%"PRId16":\n",j,enb_properties.properties[i]->N_RB_DL[j]);
      printf( "\tnb_antennas_tx for CC %d:\t%d:\n",j,enb_properties.properties[i]->nb_antennas_tx[j]);
      printf( "\tnb_antennas_rx for CC %d:\t%d:\n",j,enb_properties.properties[i]->nb_antennas_rx[j]);
327 328

      // RACH-Config
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
      printf( "\trach_numberOfRA_Preambles for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_numberOfRA_Preambles[j]);
      printf( "\trach_preamblesGroupAConfig for CC %d:\t%d:\n",j,enb_properties.properties[i]->rach_preamblesGroupAConfig[j]);

      if (enb_properties.properties[i]->rach_preamblesGroupAConfig[j]) {
        printf( "\trach_sizeOfRA_PreamblesGroupA for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_sizeOfRA_PreamblesGroupA[j]);
        printf( "\trach_messageSizeGroupA for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_messageSizeGroupA[j]);
        printf( "\trach_messagePowerOffsetGroupB for CC %d:\t%d:\n",j,enb_properties.properties[i]->rach_messagePowerOffsetGroupB[j]);
      }

      printf( "\trach_powerRampingStep for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_powerRampingStep[j]);
      printf( "\trach_preambleInitialReceivedTargetPower for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_preambleInitialReceivedTargetPower[j]);
      printf( "\trach_preambleTransMax for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_preambleTransMax[j]);
      printf( "\trach_raResponseWindowSize for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_raResponseWindowSize[j]);
      printf( "\trach_macContentionResolutionTimer for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_macContentionResolutionTimer[j]);
      printf( "\trach_maxHARQ_Msg3Tx for CC %d:\t%ld:\n",j,enb_properties.properties[i]->rach_maxHARQ_Msg3Tx[j]);

      // BCCH-Config
      printf( "\tbcch_modificationPeriodCoeff for CC %d:\t%ld:\n",j,enb_properties.properties[i]->bcch_modificationPeriodCoeff[j]);

      // PCCH-Config
      printf( "\tpcch_defaultPagingCycle for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pcch_defaultPagingCycle[j]);
      printf( "\tpcch_nB for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pcch_nB[j]);

      // PRACH-Config
      printf( "\tprach_root for CC %d:\t%ld:\n",j,enb_properties.properties[i]->prach_root[j]);
      printf( "\tprach_config_index for CC %d:\t%ld:\n",j,enb_properties.properties[i]->prach_config_index[j]);
      printf( "\tprach_high_speed for CC %d:\t%d:\n",j,enb_properties.properties[i]->prach_high_speed[j]);
      printf( "\tprach_zero_correlation for CC %d:\t%ld:\n",j,enb_properties.properties[i]->prach_zero_correlation[j]);
      printf( "\tprach_freq_offset for CC %d:\t%ld:\n",j,enb_properties.properties[i]->prach_freq_offset[j]);

      // PDSCH-Config
      printf( "\tpdsch_referenceSignalPower for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pdsch_referenceSignalPower[j]);
      printf( "\tpdsch_p_b for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pdsch_p_b[j]);

      // PUSCH-Config
      printf( "\tpusch_n_SB for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pusch_n_SB[j]);
      printf( "\tpusch_hoppingMode for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pusch_hoppingMode[j]);
      printf( "\tpusch_hoppingOffset for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pusch_hoppingOffset[j]);
      printf( "\tpusch_enable64QAM for CC %d:\t%d:\n",j,enb_properties.properties[i]->pusch_enable64QAM[j]);
      printf( "\tpusch_groupHoppingEnabled for CC %d:\t%d:\n",j,enb_properties.properties[i]->pusch_groupHoppingEnabled[j]);
      printf( "\tpusch_groupAssignment for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pusch_groupAssignment[j]);
      printf( "\tpusch_sequenceHoppingEnabled for CC %d:\t%d:\n",j,enb_properties.properties[i]->pusch_sequenceHoppingEnabled[j]);
      printf( "\tpusch_nDMRS1 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pusch_nDMRS1[j]);

      // PUCCH-Config

      printf( "\tpucch_delta_shift for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pucch_delta_shift[j]);
      printf( "\tpucch_nRB_CQI for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pucch_nRB_CQI[j]);
      printf( "\tpucch_nCS_AN for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pucch_nCS_AN[j]);
378
#ifndef Rel10
379
      printf( "\tpucch_n1_AN for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pucch_n1_AN[j]);
380
#endif
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419

      // SRS Config
      printf( "\tsrs_enable for CC %d:\t%d:\n",j,enb_properties.properties[i]->srs_enable[j]);

      if (enb_properties.properties[i]->srs_enable[j]) {
        printf( "\tsrs_BandwidthConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_BandwidthConfig[j]);
        printf( "\tsrs_BandwidthConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_SubframeConfig[j]);
        printf( "\tsrs_ackNackST for CC %d:\t%d:\n",j,enb_properties.properties[i]->srs_ackNackST[j]);
        printf( "\tsrs_MaxUpPts for CC %d:\t%d:\n",j,enb_properties.properties[i]->srs_MaxUpPts[j]);
      }

      // uplinkPowerControlCommon

      printf( "\tpusch_p0_Nominal for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pusch_p0_Nominal[j]);
      printf( "\tpucch_p0_Nominal for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pucch_p0_Nominal[j]);
      printf( "\tpusch_alpha for CC %d:\t%ld:\n",j,enb_properties.properties[i]->pusch_alpha[j]);
      printf( "\tpucch_deltaF_Format1 for CC %d:\t%d:\n",j,enb_properties.properties[i]->pucch_deltaF_Format1[j]);
      printf( "\tpucch_deltaF_Format1b for CC %d:\t%d:\n",j,enb_properties.properties[i]->pucch_deltaF_Format1b[j]);
      printf( "\tpucch_deltaF_Format2 for CC %d:\t%d:\n",j,enb_properties.properties[i]->pucch_deltaF_Format2[j]);
      printf( "\tpucch_deltaF_Format2a for CC %d:\t%d:\n",j,enb_properties.properties[i]->pucch_deltaF_Format2a[j]);
      printf( "\tpucch_deltaF_Format2b for CC %d:\t%d:\n",j,enb_properties.properties[i]->pucch_deltaF_Format2b[j]);
      printf( "\tmsg3_delta_Preamble for CC %d:\t%ld:\n",j,enb_properties.properties[i]->msg3_delta_Preamble[j]);
      printf( "\tul_CyclicPrefixLength for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ul_CyclicPrefixLength[j]);

      // UE Timers and Constants

      printf( "\tue_TimersAndConstants_t300 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t300[j]);
      printf( "\tue_TimersAndConstants_t301 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t301[j]);
      printf( "\tue_TimersAndConstants_t310 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t310[j]);
      printf( "\tue_TimersAndConstants_n310 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n310[j]);
      printf( "\tue_TimersAndConstants_t311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t311[j]);
      printf( "\tue_TimersAndConstants_n311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n311[j]);

    }

    for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) {
      printf( "\n\tOTG Destination UE ID:  \t%"PRIu16, enb_properties.properties[i]->otg_ue_id[j]);
      printf( "\n\tOTG App Type:  \t%"PRIu8, enb_properties.properties[i]->otg_app_type[j]);
      printf( "\n\tOTG Background Traffic:  \t%s\n", (enb_properties.properties[i]->otg_bg_traffic[j]==1) ? "Enabled" : "Disabled");
Lionel Gauthier's avatar
 
Lionel Gauthier committed
420
    }
421 422 423 424 425 426 427 428 429 430 431 432 433 434

    printf( "\n\tGlobal log level:  \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->glog_level));
    printf( "\tHW log level:      \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->hw_log_level));
    printf( "\tPHY log level:     \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->phy_log_level));
    printf( "\tMAC log level:     \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->mac_log_level));
    printf( "\tRLC log level:     \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->rlc_log_level));
    printf( "\tPDCP log level:    \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->pdcp_log_level));
    printf( "\tRRC log level:     \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->rrc_log_level));
    printf( "\tUDP log level:     \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->udp_log_level));
    printf( "\tGTP log level:     \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->gtpu_log_level));
    printf( "\tOSA log level:     \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->osa_log_level));

    printf( "\n--------------------------------------------------------\n");
  }
Lionel Gauthier's avatar
 
Lionel Gauthier committed
435 436 437
}


438
static int enb_check_band_frequencies(char* lib_config_file_name_pP,
439 440 441 442 443
                                      int enb_properties_index,
                                      int16_t band,
                                      uint32_t downlink_frequency,
                                      int32_t uplink_frequency_offset,
                                      lte_frame_type_t frame_type)
444
{
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
  int errors = 0;

  if (band > 0) {
    int band_index;

    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 ++,
                     "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too low (%u) for band %d!",
                     lib_config_file_name_pP, enb_properties_index, downlink_frequency, eutra_bands[band_index].dl_min, band);
        AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++,
                     "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too high (%u) for band %d!",
                     lib_config_file_name_pP, enb_properties_index, downlink_frequency, eutra_bands[band_index].dl_max, band);

        AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++,
                     "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too low (%u) for band %d!",
                     lib_config_file_name_pP, enb_properties_index, uplink_frequency, eutra_bands[band_index].ul_min, band);
        AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++,
                     "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too high (%u) for band %d!",
                     lib_config_file_name_pP, enb_properties_index, uplink_frequency, eutra_bands[band_index].ul_max, band);

        AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++,
                     "Failed to parse eNB configuration file %s, enb %d invalid frame type (%d/%d) for band %d!",
                     lib_config_file_name_pP, enb_properties_index, eutra_bands[band_index].frame_type, frame_type, band);
      }
472
    }
473 474 475
  }

  return errors;
476 477
}

Lionel Gauthier's avatar
Lionel Gauthier committed
478 479 480 481 482
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
extern int asn_debug;
extern int asn1_xer_print;
#endif

Raymond Knopp's avatar
 
Raymond Knopp committed
483 484 485 486 487
#ifdef LIBCONFIG_LONG
#define libconfig_int long
#else
#define libconfig_int int
#endif
488 489 490 491 492 493 494
const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
{
  config_t          cfg;
  config_setting_t *setting                       = NULL;
  config_setting_t *subsetting                    = NULL;
  config_setting_t *setting_component_carriers    = NULL;
  config_setting_t *component_carrier             = NULL;
495
  config_setting_t *setting_srb1                  = NULL;
496 497
  config_setting_t *setting_mme_addresses         = NULL;
  config_setting_t *setting_mme_address           = NULL;
498 499
  config_setting_t *setting_rrh_gws               = NULL;
  config_setting_t *setting_rrh_gw                = NULL;
500 501
  config_setting_t *setting_enb                   = NULL;
  config_setting_t *setting_otg                   = NULL;
502
  config_setting_t *subsetting_otg                = NULL;
503 504
  int               num_enb_properties            = 0;
  int               enb_properties_index          = 0;
505 506
  int               num_enbs                      = 0;
  int               num_mme_address               = 0;
507
  int               num_rrh_gw                    = 0;
508 509
  int               num_otg_elements              = 0;
  int               num_component_carriers        = 0;
510 511
  int               i                             = 0;
  int               j                             = 0;
512 513 514 515 516 517 518
  int               parse_errors                  = 0;
  libconfig_int     enb_id                        = 0;
  const char*       cell_type                     = NULL;
  const char*       tac                           = 0;
  const char*       enb_name                      = NULL;
  const char*       mcc                           = 0;
  const char*       mnc                           = 0;
519 520 521
  const char*       frame_type                    = NULL;
  libconfig_int     tdd_config                    = 0;
  libconfig_int     tdd_config_s                  = 0;
522
  const char*            prefix_type              = NULL;
523 524 525 526 527 528 529 530 531 532 533 534
  libconfig_int     eutra_band                    = 0;
  long long int     downlink_frequency            = 0;
  libconfig_int     uplink_frequency_offset       = 0;
  libconfig_int     Nid_cell                      = 0;
  libconfig_int     Nid_cell_mbsfn                = 0;
  libconfig_int     N_RB_DL                       = 0;
  libconfig_int     nb_antennas_tx                = 0;
  libconfig_int     nb_antennas_rx                = 0;
  libconfig_int     tx_gain                       = 0;
  libconfig_int     rx_gain                       = 0;
  libconfig_int     prach_root                    = 0;
  libconfig_int     prach_config_index            = 0;
535
  const char*            prach_high_speed         = NULL;
536 537 538 539 540
  libconfig_int     prach_zero_correlation        = 0;
  libconfig_int     prach_freq_offset             = 0;
  libconfig_int     pucch_delta_shift             = 0;
  libconfig_int     pucch_nRB_CQI                 = 0;
  libconfig_int     pucch_nCS_AN                  = 0;
541
#ifndef Rel10
542
  libconfig_int     pucch_n1_AN                   = 0;
Raymond Knopp's avatar
 
Raymond Knopp committed
543
#endif
544 545 546
  libconfig_int     pdsch_referenceSignalPower    = 0;
  libconfig_int     pdsch_p_b                     = 0;
  libconfig_int     pusch_n_SB                    = 0;
547
  const char *      pusch_hoppingMode             = NULL;
548
  libconfig_int     pusch_hoppingOffset           = 0;
549 550
  const char*          pusch_enable64QAM          = NULL;
  const char*          pusch_groupHoppingEnabled  = NULL;
551
  libconfig_int     pusch_groupAssignment         = 0;
552
  const char*          pusch_sequenceHoppingEnabled = NULL;
553 554 555 556 557 558 559 560 561 562 563 564
  libconfig_int     pusch_nDMRS1                  = 0;
  const char*       phich_duration                = NULL;
  const char*       phich_resource                = NULL;
  const char*       srs_enable                    = NULL;
  libconfig_int     srs_BandwidthConfig           = 0;
  libconfig_int     srs_SubframeConfig            = 0;
  const char*       srs_ackNackST                 = NULL;
  const char*       srs_MaxUpPts                  = NULL;
  libconfig_int     pusch_p0_Nominal              = 0;
  const char*       pusch_alpha                   = NULL;
  libconfig_int     pucch_p0_Nominal              = 0;
  libconfig_int     msg3_delta_Preamble           = 0;
565
  //libconfig_int     ul_CyclicPrefixLength         = 0;
566
  const char*       pucch_deltaF_Format1          = NULL;
567
  //const char*       pucch_deltaF_Format1a         = NULL;
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591
  const char*       pucch_deltaF_Format1b         = NULL;
  const char*       pucch_deltaF_Format2          = NULL;
  const char*       pucch_deltaF_Format2a         = NULL;
  const char*       pucch_deltaF_Format2b         = NULL;
  libconfig_int     rach_numberOfRA_Preambles     = 0;
  const char*       rach_preamblesGroupAConfig    = NULL;
  libconfig_int     rach_sizeOfRA_PreamblesGroupA = 0;
  libconfig_int     rach_messageSizeGroupA        = 0;
  const char*       rach_messagePowerOffsetGroupB = NULL;
  libconfig_int     rach_powerRampingStep         = 0;
  libconfig_int     rach_preambleInitialReceivedTargetPower    = 0;
  libconfig_int     rach_preambleTransMax         = 0;
  libconfig_int     rach_raResponseWindowSize     = 0;
  libconfig_int     rach_macContentionResolutionTimer = 0;
  libconfig_int     rach_maxHARQ_Msg3Tx           = 0;
  libconfig_int     pcch_defaultPagingCycle       = 0;
  const char*       pcch_nB                       = NULL;
  libconfig_int     bcch_modificationPeriodCoeff  = 0;
  libconfig_int     ue_TimersAndConstants_t300    = 0;
  libconfig_int     ue_TimersAndConstants_t301    = 0;
  libconfig_int     ue_TimersAndConstants_t310    = 0;
  libconfig_int     ue_TimersAndConstants_t311    = 0;
  libconfig_int     ue_TimersAndConstants_n310    = 0;
  libconfig_int     ue_TimersAndConstants_n311    = 0;
592 593


Lionel Gauthier's avatar
sync  
Lionel Gauthier committed
594

595 596 597 598 599 600
  libconfig_int     srb1_timer_poll_retransmit    = 0;
  libconfig_int     srb1_timer_reordering         = 0;
  libconfig_int     srb1_timer_status_prohibit    = 0;
  libconfig_int     srb1_poll_pdu                 = 0;
  libconfig_int     srb1_poll_byte                = 0;
  libconfig_int     srb1_max_retx_threshold       = 0;
601

602 603
  libconfig_int     my_int;

604 605

  char*             if_name                       = NULL;
606
  char*             ipv4                          = NULL;
607
  char*             ipv4_remote                   = NULL;
608 609 610
  char*             ipv6                          = NULL;
  char*             active                        = NULL;
  char*             preference                    = NULL;
611 612 613 614 615 616

  char*             tr_preference                 = NULL;
  char*             rf_preference                 = NULL;
  libconfig_int     tx_scheduling_advance         = 0;
  libconfig_int     tx_sample_advance             = 0;
  libconfig_int     iq_txshift                    = 0;
617 618
  libconfig_int     local_port                    = 0;
  libconfig_int     remote_port                   = 0;
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651
  const char*       active_enb[MAX_ENB];
  char*             enb_interface_name_for_S1U    = NULL;
  char*             enb_ipv4_address_for_S1U      = NULL;
  libconfig_int     enb_port_for_S1U              = 0;
  char*             enb_interface_name_for_S1_MME = NULL;
  char*             enb_ipv4_address_for_S1_MME   = NULL;
  char             *address                       = NULL;
  char             *cidr                          = NULL;
  char             *astring                       = NULL;
  libconfig_int     otg_ue_id                     = 0;
  char*             otg_app_type                  = NULL;
  char*             otg_bg_traffic                = NULL;
  char*             glog_level                    = NULL;
  char*             glog_verbosity                = NULL;
  char*             hw_log_level                  = NULL;
  char*             hw_log_verbosity              = NULL;
  char*             phy_log_level                 = NULL;
  char*             phy_log_verbosity             = NULL;
  char*             mac_log_level                 = NULL;
  char*             mac_log_verbosity             = NULL;
  char*             rlc_log_level                 = NULL;
  char*             rlc_log_verbosity             = NULL;
  char*             pdcp_log_level                = NULL;
  char*             pdcp_log_verbosity            = NULL;
  char*             rrc_log_level                 = NULL;
  char*             rrc_log_verbosity             = NULL;
  char*             gtpu_log_level                = NULL;
  char*             gtpu_log_verbosity            = NULL;
  char*             udp_log_level                 = NULL;
  char*             udp_log_verbosity             = NULL;
  char*             osa_log_level                 = NULL;
  char*             osa_log_verbosity             = NULL;

Cedric Roux's avatar
Cedric Roux committed
652 653 654 655
  /* for no gcc warnings */
  (void)astring;
  (void)my_int;

656 657 658 659 660
  memset((char*) (enb_properties.properties), 0 , MAX_ENB * sizeof(Enb_properties_t *));
  memset((char*)active_enb,     0 , MAX_ENB * sizeof(char*));

  config_init(&cfg);

661
  if (lib_config_file_name_pP != NULL) {
662
    /* Read the file. If there is an error, report it and exit. */
663
    if (! config_read_file(&cfg, lib_config_file_name_pP)) {
664 665
      config_destroy(&cfg);
      AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
666
    }
667 668 669 670
  } else {
    config_destroy(&cfg);
    AssertFatal (0, "No eNB configuration file provided!\n");
  }
671

Lionel Gauthier's avatar
Lionel Gauthier committed
672
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
673

674
  if (  (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) {
675 676 677 678 679 680 681 682 683 684 685 686
    if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
      asn_debug      = 0;
      asn1_xer_print = 0;
    } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) {
      asn_debug      = 1;
      asn1_xer_print = 1;
    } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) {
      asn_debug      = 1;
      asn1_xer_print = 2;
    } else {
      asn_debug      = 0;
      asn1_xer_print = 0;
687
    }
688 689
  }

Lionel Gauthier's avatar
Lionel Gauthier committed
690
#endif
691 692 693
  // Get list of active eNBs, (only these will be configured)
  setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS);

694
  if (setting != NULL) {
695 696 697 698 699 700 701 702 703 704
    num_enbs = config_setting_length(setting);

    for (i = 0; i < num_enbs; i++) {
      setting_enb   = config_setting_get_elem(setting, i);
      active_enb[i] = config_setting_get_string (setting_enb);
      AssertFatal (active_enb[i] != NULL,
                   "Failed to parse config file %s, %uth attribute %s \n",
                   lib_config_file_name_pP, i, ENB_CONFIG_STRING_ACTIVE_ENBS);
      active_enb[i] = strdup(active_enb[i]);
      num_enb_properties += 1;
705
    }
706 707 708 709
  }

  /* Output a list of all eNBs. */
  setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST);
710

711
  if (setting != NULL) {
712 713 714 715 716 717 718
    enb_properties_index = 0;
    parse_errors      = 0;
    num_enbs = config_setting_length(setting);

    for (i = 0; i < num_enbs; i++) {
      setting_enb = config_setting_get_elem(setting, i);

719
      if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) {
720
        /* Calculate a default eNB ID */
721
# if defined(ENABLE_USE_MME)
722
        uint32_t hash;
723

724 725
        hash = s1ap_generate_eNB_id ();
        enb_id = i + (hash & 0xFFFF8);
726
# else
727
        enb_id = i;
728
# endif
729
      }
730

731
      if (  !(       config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE,           &cell_type)
732 733 734 735
                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME,            &enb_name)
                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE,  &tac)
                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc)
                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc)
Raymond Knopp's avatar
 
Raymond Knopp committed
736

737 738

            )
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779
        ) {
        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++) {
        if (strcmp(active_enb[j], enb_name) == 0) {
          enb_properties.properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t));

          enb_properties.properties[enb_properties_index]->eNB_id   = enb_id;

          if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) {
            enb_properties.properties[enb_properties_index]->cell_type = CELL_MACRO_ENB;
          } else  if (strcmp(cell_type, "CELL_HOME_ENB") == 0) {
            enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB;
          } else {
            AssertError (0, parse_errors ++,
                         "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
                         lib_config_file_name_pP, i, cell_type);
          }

          enb_properties.properties[enb_properties_index]->eNB_name         = strdup(enb_name);
          enb_properties.properties[enb_properties_index]->tac              = (uint16_t)atoi(tac);
          enb_properties.properties[enb_properties_index]->mcc              = (uint16_t)atoi(mcc);
          enb_properties.properties[enb_properties_index]->mnc              = (uint16_t)atoi(mnc);
          enb_properties.properties[enb_properties_index]->mnc_digit_length = strlen(mnc);
          AssertFatal((enb_properties.properties[enb_properties_index]->mnc_digit_length == 2) ||
                      (enb_properties.properties[enb_properties_index]->mnc_digit_length == 3),
                      "BAD MNC DIGIT LENGTH %d",
                      enb_properties.properties[i]->mnc_digit_length);


          // Parse optional physical parameters


          setting_component_carriers = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_COMPONENT_CARRIERS);
          enb_properties.properties[enb_properties_index]->nb_cc = 0;

780
          if (setting_component_carriers != NULL) {
781 782 783 784 785 786 787 788 789

            num_component_carriers     = config_setting_length(setting_component_carriers);
            printf("num component carrier %d \n", num_component_carriers);

            //enb_properties.properties[enb_properties_index]->nb_cc = num_component_carriers;
            for (j = 0; j < num_component_carriers /*&& j < MAX_NUM_CCs*/; j++) {
              component_carrier = config_setting_get_elem(setting_component_carriers, j);

              //printf("Component carrier %d\n",component_carrier);
790
              if (!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type)
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG, &tdd_config)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG_S, &tdd_config_s)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PREFIX_TYPE, &prefix_type)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_EUTRA_BAND, &eutra_band)
                   && config_setting_lookup_int64(component_carrier, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NID_CELL, &Nid_cell)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_N_RB_DL, &N_RB_DL)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_CELL_MBSFN, &Nid_cell_mbsfn)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NB_ANT_TX, &nb_antennas_tx)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NB_ANT_RX, &nb_antennas_rx)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TX_GAIN, &tx_gain)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RX_GAIN, &rx_gain)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_ROOT, &prach_root)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, &prach_config_index)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PRACH_HIGH_SPEED, &prach_high_speed)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, &prach_zero_correlation)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, &prach_freq_offset)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, &pucch_delta_shift)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_NRB_CQI, &pucch_nRB_CQI)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_NCS_AN, &pucch_nCS_AN)
#ifndef Rel10
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_N1_AN, &pucch_n1_AN)
#endif
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PDSCH_RS_EPRE, &pdsch_referenceSignalPower)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PDSCH_PB, &pdsch_p_b)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_N_SB, &pusch_n_SB)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, &pusch_hoppingMode)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, &pusch_hoppingOffset)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, &pusch_enable64QAM)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, &pusch_groupHoppingEnabled)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, &pusch_groupAssignment)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, &pusch_sequenceHoppingEnabled)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_NDMRS1, &pusch_nDMRS1)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PHICH_DURATION, &phich_duration)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PHICH_RESOURCE, &phich_resource)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_ENABLE, &srs_enable)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, &pusch_p0_Nominal)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_ALPHA, &pusch_alpha)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, &pucch_p0_Nominal)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, &msg3_delta_Preamble)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, &pucch_deltaF_Format1)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, &pucch_deltaF_Format1b)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, &pucch_deltaF_Format2)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, &pucch_deltaF_Format2a)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, &pucch_deltaF_Format2b)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, &rach_numberOfRA_Preambles)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, &rach_preamblesGroupAConfig)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, &rach_powerRampingStep)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER, &rach_preambleInitialReceivedTargetPower)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, &rach_preambleTransMax)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, &rach_raResponseWindowSize)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, &rach_macContentionResolutionTimer)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, &rach_maxHARQ_Msg3Tx)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, &bcch_modificationPeriodCoeff)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE,  &pcch_defaultPagingCycle)
                   && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PCCH_NB,  &pcch_nB)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF,  &bcch_modificationPeriodCoeff)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T300,  &ue_TimersAndConstants_t300)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T301,  &ue_TimersAndConstants_t301)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T310,  &ue_TimersAndConstants_t310)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T311,  &ue_TimersAndConstants_t311)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N310,  &ue_TimersAndConstants_n310)
                   && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N311,  &ue_TimersAndConstants_n311)

#ifdef Rel10

#endif
                  )) {
860
                AssertError (0, parse_errors ++,
861 862
                             "Failed to parse eNB configuration file %s, Component Carrier %d!\n",
                             lib_config_file_name_pP, enb_properties.properties[enb_properties_index]->nb_cc++);
863
                continue; // FIXME this prevents segfaults below, not sure what happens after function exit
864 865 866 867 868 869 870 871 872 873 874 875 876 877
              }

              enb_properties.properties[enb_properties_index]->nb_cc++;

              enb_properties.properties[enb_properties_index]->tdd_config[j] = tdd_config;
              AssertError (tdd_config <= TDD_Config__subframeAssignment_sa6, parse_errors ++,
                           "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!",
                           lib_config_file_name_pP, i, tdd_config, TDD_Config__subframeAssignment_sa6);

              enb_properties.properties[enb_properties_index]->tdd_config_s[j] = tdd_config_s;
              AssertError (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, parse_errors ++,
                           "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!",
                           lib_config_file_name_pP, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8);

878 879 880 881 882
              if (!prefix_type)
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n",
                             lib_config_file_name_pP, i, ENB_CONFIG_STRING_PREFIX_TYPE);
              else if (strcmp(prefix_type, "NORMAL") == 0) {
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014
                enb_properties.properties[enb_properties_index]->prefix_type[j] = NORMAL;
              } else  if (strcmp(prefix_type, "EXTENDED") == 0) {
                enb_properties.properties[enb_properties_index]->prefix_type[j] = EXTENDED;
              } else {
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n",
                             lib_config_file_name_pP, i, prefix_type);
              }

              enb_properties.properties[enb_properties_index]->eutra_band[j] = eutra_band;
              enb_properties.properties[enb_properties_index]->downlink_frequency[j] = (uint32_t) downlink_frequency;
              enb_properties.properties[enb_properties_index]->uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset;
              enb_properties.properties[enb_properties_index]->Nid_cell[j]= Nid_cell;

              if (Nid_cell>503) {
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for Nid_cell choice: 0...503 !\n",
                             lib_config_file_name_pP, i, Nid_cell);
              }

              enb_properties.properties[enb_properties_index]->N_RB_DL[j]= N_RB_DL;

              if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) {
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for N_RB_DL choice: 6,15,25,50,75,100 !\n",
                             lib_config_file_name_pP, i, N_RB_DL);
              }

              if (strcmp(frame_type, "FDD") == 0) {
                enb_properties.properties[enb_properties_index]->frame_type[j] = FDD;
              } else  if (strcmp(frame_type, "TDD") == 0) {
                enb_properties.properties[enb_properties_index]->frame_type[j] = TDD;
              } else {
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for frame_type choice: FDD or TDD !\n",
                             lib_config_file_name_pP, i, frame_type);
              }


              enb_properties.properties[enb_properties_index]->tdd_config[j] = tdd_config;
              AssertError (tdd_config <= TDD_Config__subframeAssignment_sa6, parse_errors ++,
                           "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!",
                           lib_config_file_name_pP, i, tdd_config, TDD_Config__subframeAssignment_sa6);


              enb_properties.properties[enb_properties_index]->tdd_config_s[j] = tdd_config_s;
              AssertError (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, parse_errors ++,
                           "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!",
                           lib_config_file_name_pP, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8);



              if (!prefix_type)
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n",
                             lib_config_file_name_pP, i, ENB_CONFIG_STRING_PREFIX_TYPE);
              else if (strcmp(prefix_type, "NORMAL") == 0) {
                enb_properties.properties[enb_properties_index]->prefix_type[j] = NORMAL;
              } else  if (strcmp(prefix_type, "EXTENDED") == 0) {
                enb_properties.properties[enb_properties_index]->prefix_type[j] = EXTENDED;
              } else {
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n",
                             lib_config_file_name_pP, i, prefix_type);
              }



              enb_properties.properties[enb_properties_index]->eutra_band[j] = eutra_band;
              // printf( "\teutra band:\t%d\n",enb_properties.properties[enb_properties_index]->eutra_band);



              enb_properties.properties[enb_properties_index]->downlink_frequency[j] = (uint32_t) downlink_frequency;
              //printf( "\tdownlink freq:\t%u\n",enb_properties.properties[enb_properties_index]->downlink_frequency);


              enb_properties.properties[enb_properties_index]->uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset;

              parse_errors += enb_check_band_frequencies(lib_config_file_name_pP,
                              enb_properties_index,
                              enb_properties.properties[enb_properties_index]->eutra_band[j],
                              enb_properties.properties[enb_properties_index]->downlink_frequency[j],
                              enb_properties.properties[enb_properties_index]->uplink_frequency_offset[j],
                              enb_properties.properties[enb_properties_index]->frame_type[j]);

              enb_properties.properties[enb_properties_index]->nb_antennas_tx[j] = nb_antennas_tx;

              if ((nb_antennas_tx <1) || (nb_antennas_tx > 4))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antennas_tx choice: 1..4 !\n",
                             lib_config_file_name_pP, i, nb_antennas_tx);

              enb_properties.properties[enb_properties_index]->nb_antennas_rx[j] = nb_antennas_rx;

              if ((nb_antennas_rx <1) || (nb_antennas_rx > 4))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antennas_rx choice: 1..4 !\n",
                             lib_config_file_name_pP, i, nb_antennas_rx);

              enb_properties.properties[enb_properties_index]->tx_gain[j] = tx_gain;

              if ((tx_gain <0) || (tx_gain > 127))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for tx_gain choice: 0..127 !\n",
                             lib_config_file_name_pP, i, tx_gain);

              enb_properties.properties[enb_properties_index]->rx_gain[j] = rx_gain;

              if ((rx_gain <0) || (rx_gain > 160))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rx_gain choice: 0..160 !\n",
                             lib_config_file_name_pP, i, rx_gain);

              enb_properties.properties[enb_properties_index]->prach_root[j] =  prach_root;

              if ((prach_root <0) || (prach_root > 1023))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_root choice: 0..1023 !\n",
                             lib_config_file_name_pP, i, prach_root);

              enb_properties.properties[enb_properties_index]->prach_config_index[j] = prach_config_index;

              if ((prach_config_index <0) || (prach_config_index > 63))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_config_index choice: 0..1023 !\n",
                             lib_config_file_name_pP, i, prach_config_index);

              if (!prach_high_speed)
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
                             lib_config_file_name_pP, i, ENB_CONFIG_STRING_PRACH_HIGH_SPEED);
1015
              else if (strcmp(prach_high_speed, "ENABLE") == 0) {
1016
                enb_properties.properties[enb_properties_index]->prach_high_speed[j] = TRUE;
1017
              } else if (strcmp(prach_high_speed, "DISABLE") == 0) {
1018
                enb_properties.properties[enb_properties_index]->prach_high_speed[j] = FALSE;
1019
              } else
1020 1021 1022 1023 1024 1025
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n",
                             lib_config_file_name_pP, i, prach_high_speed);

              enb_properties.properties[enb_properties_index]->prach_zero_correlation[j] =prach_zero_correlation;

1026
              if ((prach_zero_correlation <0) || (prach_zero_correlation > 15))
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n",
                             lib_config_file_name_pP, i, prach_zero_correlation);

              enb_properties.properties[enb_properties_index]->prach_freq_offset[j] = prach_freq_offset;

              if ((prach_freq_offset <0) || (prach_freq_offset > 94))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 0..94!\n",
                             lib_config_file_name_pP, i, prach_freq_offset);


              enb_properties.properties[enb_properties_index]->pucch_delta_shift[j] = pucch_delta_shift-1;

              if ((pucch_delta_shift <1) || (pucch_delta_shift > 3))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_delta_shift choice: 1..3!\n",
                             lib_config_file_name_pP, i, pucch_delta_shift);

              enb_properties.properties[enb_properties_index]->pucch_nRB_CQI[j] = pucch_nRB_CQI;

              if ((pucch_nRB_CQI <0) || (pucch_nRB_CQI > 98))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nRB_CQI choice: 0..98!\n",
                             lib_config_file_name_pP, i, pucch_nRB_CQI);

              enb_properties.properties[enb_properties_index]->pucch_nCS_AN[j] = pucch_nCS_AN;

              if ((pucch_nCS_AN <0) || (pucch_nCS_AN > 7))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n",
                             lib_config_file_name_pP, i, pucch_nCS_AN);

Raymond Knopp's avatar
 
Raymond Knopp committed
1060
#ifndef Rel10
1061 1062 1063 1064 1065 1066
              enb_properties.properties[enb_properties_index]->pucch_n1_AN[j] = pucch_n1_AN;

              if ((pucch_n1_AN <0) || (pucch_n1_AN > 2047))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_n1_AN choice: 0..2047!\n",
                             lib_config_file_name_pP, i, pucch_n1_AN);
Raymond Knopp's avatar
 
Raymond Knopp committed
1067 1068

#endif
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
              enb_properties.properties[enb_properties_index]->pdsch_referenceSignalPower[j] = pdsch_referenceSignalPower;

              if ((pdsch_referenceSignalPower <-60) || (pdsch_referenceSignalPower > 50))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_referenceSignalPower choice:-60..50!\n",
                             lib_config_file_name_pP, i, pdsch_referenceSignalPower);

              enb_properties.properties[enb_properties_index]->pdsch_p_b[j] = pdsch_p_b;

              if ((pdsch_p_b <0) || (pdsch_p_b > 3))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_p_b choice: 0..3!\n",
                             lib_config_file_name_pP, i, pdsch_p_b);

              enb_properties.properties[enb_properties_index]->pusch_n_SB[j] = pusch_n_SB;

              if ((pusch_n_SB <1) || (pusch_n_SB > 4))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_n_SB choice: 1..4!\n",
                             lib_config_file_name_pP, i, pusch_n_SB);

              if (!pusch_hoppingMode)
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d define %s: interSubframe,intraAndInterSubframe!\n",
                             lib_config_file_name_pP, i, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE);
1094
              else if (strcmp(pusch_hoppingMode,"interSubFrame")==0) {
1095
                enb_properties.properties[enb_properties_index]->pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame;
1096
              }  else if (strcmp(pusch_hoppingMode,"intraAndInterSubFrame")==0) {
1097
                enb_properties.properties[enb_properties_index]->pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame;
1098
              } else
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingMode choice: interSubframe,intraAndInterSubframe!\n",
                             lib_config_file_name_pP, i, pusch_hoppingMode);

              enb_properties.properties[enb_properties_index]->pusch_hoppingOffset[j] = pusch_hoppingOffset;

              if ((pusch_hoppingOffset<0) || (pusch_hoppingOffset>98))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingOffset choice: 0..98!\n",
                             lib_config_file_name_pP, i, pusch_hoppingMode);

              if (!pusch_enable64QAM)
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
                             lib_config_file_name_pP, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM);
1114
              else if (strcmp(pusch_enable64QAM, "ENABLE") == 0) {
1115
                enb_properties.properties[enb_properties_index]->pusch_enable64QAM[j] = TRUE;
1116
              }  else if (strcmp(pusch_enable64QAM, "DISABLE") == 0) {
1117
                enb_properties.properties[enb_properties_index]->pusch_enable64QAM[j] = FALSE;
1118
              } else
1119 1120 1121 1122 1123 1124 1125 1126
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n",
                             lib_config_file_name_pP, i, pusch_enable64QAM);

              if (!pusch_groupHoppingEnabled)
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
                             lib_config_file_name_pP, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN);
1127
              else if (strcmp(pusch_groupHoppingEnabled, "ENABLE") == 0) {
1128
                enb_properties.properties[enb_properties_index]->pusch_groupHoppingEnabled[j] = TRUE;
1129
              }  else if (strcmp(pusch_groupHoppingEnabled, "DISABLE") == 0) {
1130
                enb_properties.properties[enb_properties_index]->pusch_groupHoppingEnabled[j] = FALSE;
1131
              } else
1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n",
                             lib_config_file_name_pP, i, pusch_groupHoppingEnabled);


              enb_properties.properties[enb_properties_index]->pusch_groupAssignment[j] = pusch_groupAssignment;

              if ((pusch_groupAssignment<0)||(pusch_groupAssignment>29))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_groupAssignment choice: 0..29!\n",
                             lib_config_file_name_pP, i, pusch_groupAssignment);

              if (!pusch_sequenceHoppingEnabled)
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
                             lib_config_file_name_pP, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN);
1148
              else if (strcmp(pusch_sequenceHoppingEnabled, "ENABLE") == 0) {
1149
                enb_properties.properties[enb_properties_index]->pusch_sequenceHoppingEnabled[j] = TRUE;
1150
              }  else if (strcmp(pusch_sequenceHoppingEnabled, "DISABLE") == 0) {
1151
                enb_properties.properties[enb_properties_index]->pusch_sequenceHoppingEnabled[j] = FALSE;
1152
              } else
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n",
                             lib_config_file_name_pP, i, pusch_sequenceHoppingEnabled);

              enb_properties.properties[enb_properties_index]->pusch_nDMRS1[j] = pusch_nDMRS1;  //cyclic_shift in RRC!

              if ((pusch_nDMRS1 <0) || (pusch_nDMRS1>7))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_nDMRS1 choice: 0..7!\n",
                             lib_config_file_name_pP, i, pusch_nDMRS1);

1164
              if (strcmp(phich_duration,"NORMAL")==0) {
1165
                enb_properties.properties[enb_properties_index]->phich_duration[j] = normal;
1166
              } else if (strcmp(phich_duration,"EXTENDED")==0) {
1167
                enb_properties.properties[enb_properties_index]->phich_duration[j] = extended;
1168
              } else
1169 1170 1171 1172
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_duration choice: NORMAL,EXTENDED!\n",
                             lib_config_file_name_pP, i, phich_duration);

1173
              if (strcmp(phich_resource,"ONESIXTH")==0) {
1174
                enb_properties.properties[enb_properties_index]->phich_resource[j] = oneSixth;
roux's avatar
roux committed
1175
              } else if (strcmp(phich_resource,"HALF")==0) {
1176
                enb_properties.properties[enb_properties_index]->phich_resource[j] = half;
roux's avatar
roux committed
1177
              } else if (strcmp(phich_resource,"ONE")==0) {
1178
                enb_properties.properties[enb_properties_index]->phich_resource[j] = one;
roux's avatar
roux committed
1179
              } else if (strcmp(phich_resource,"TWO")==0) {
1180
                enb_properties.properties[enb_properties_index]->phich_resource[j] = two;
1181
              } else
1182 1183 1184 1185
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n",
                             lib_config_file_name_pP, i, phich_resource);

1186
              if (strcmp(srs_enable, "ENABLE") == 0) {
1187
                enb_properties.properties[enb_properties_index]->srs_enable[j] = TRUE;
1188
              } else if (strcmp(srs_enable, "DISABLE") == 0) {
1189
                enb_properties.properties[enb_properties_index]->srs_enable[j] = FALSE;
1190
              } else
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
                             lib_config_file_name_pP, i, srs_enable);

              if (enb_properties.properties[enb_properties_index]->srs_enable[j] == TRUE) {
                if (!(config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, &srs_BandwidthConfig)
                      && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, &srs_SubframeConfig)
                      && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, &srs_ackNackST)
                      && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_MAXUPPTS, &srs_MaxUpPts)
                     ))
1201 1202 1203
                  AssertError(0,
                              parse_errors++,
                              "Failed to parse eNB configuration file %s, enb %d unknown values for srs_BandwidthConfig, srs_SubframeConfig, srs_ackNackST, srs_MaxUpPts\n",
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218
                              lib_config_file_name_pP, i);

                enb_properties.properties[enb_properties_index]->srs_BandwidthConfig[j] = srs_BandwidthConfig;

                if ((srs_BandwidthConfig < 0) || (srs_BandwidthConfig >7))
                  AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value %d for srs_BandwidthConfig choice: 0...7\n",
                               lib_config_file_name_pP, i, srs_BandwidthConfig);

                enb_properties.properties[enb_properties_index]->srs_SubframeConfig[j] = srs_SubframeConfig;

                if ((srs_SubframeConfig<0) || (srs_SubframeConfig>15))
                  AssertError (0, parse_errors ++,
                               "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for srs_SubframeConfig choice: 0..15 !\n",
                               lib_config_file_name_pP, i, srs_SubframeConfig);

1219
                if (strcmp(srs_ackNackST, "ENABLE") == 0) {
1220
                  enb_properties.properties[enb_properties_index]->srs_ackNackST[j] = TRUE;
1221
                } else if (strcmp(srs_ackNackST, "DISABLE") == 0) {
1222
                  enb_properties.properties[enb_properties_index]->srs_ackNackST[j] = FALSE;
1223
                } else
1224 1225 1226 1227
                  AssertError (0, parse_errors ++,
                               "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
                               lib_config_file_name_pP, i, srs_ackNackST);

1228
                if (strcmp(srs_MaxUpPts, "ENABLE") == 0) {
1229
                  enb_properties.properties[enb_properties_index]->srs_MaxUpPts[j] = TRUE;
1230
                } else if (strcmp(srs_MaxUpPts, "DISABLE") == 0) {
1231
                  enb_properties.properties[enb_properties_index]->srs_MaxUpPts[j] = FALSE;
1232
                } else
1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244
                  AssertError (0, parse_errors ++,
                               "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n",
                               lib_config_file_name_pP, i, srs_MaxUpPts);
              }

              enb_properties.properties[enb_properties_index]->pusch_p0_Nominal[j] = pusch_p0_Nominal;

              if ((pusch_p0_Nominal<-126) || (pusch_p0_Nominal>24))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_p0_Nominal choice: -126..24 !\n",
                             lib_config_file_name_pP, i, pusch_p0_Nominal);

1245
              if (strcmp(pusch_alpha,"AL0")==0) {
1246
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al0;
1247
              } else if (strcmp(pusch_alpha,"AL04")==0) {
1248
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al04;
1249
              } else if (strcmp(pusch_alpha,"AL05")==0) {
1250
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al05;
1251
              } else if (strcmp(pusch_alpha,"AL06")==0) {
1252
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al06;
1253
              } else if (strcmp(pusch_alpha,"AL07")==0) {
1254
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al07;
1255
              } else if (strcmp(pusch_alpha,"AL08")==0) {
1256
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al08;
1257
              } else if (strcmp(pusch_alpha,"AL09")==0) {
1258
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al09;
1259
              } else if (strcmp(pusch_alpha,"AL1")==0) {
1260
                enb_properties.properties[enb_properties_index]->pusch_alpha[j] = UplinkPowerControlCommon__alpha_al1;
1261
              } else
1262
                AssertError (0, parse_errors ++,
1263
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_Alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n",
1264 1265 1266 1267 1268 1269
                             lib_config_file_name_pP, i, pusch_alpha);

              enb_properties.properties[enb_properties_index]->pucch_p0_Nominal[j] = pucch_p0_Nominal;

              if ((pucch_p0_Nominal<-127) || (pucch_p0_Nominal>-96))
                AssertError (0, parse_errors ++,
1270
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_p0_Nominal choice: -127..-96 !\n",
1271 1272 1273 1274 1275 1276 1277 1278 1279 1280
                             lib_config_file_name_pP, i, pucch_p0_Nominal);

              enb_properties.properties[enb_properties_index]->msg3_delta_Preamble[j] = msg3_delta_Preamble;

              if ((msg3_delta_Preamble<-1) || (msg3_delta_Preamble>6))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for msg3_delta_Preamble choice: -1..6 !\n",
                             lib_config_file_name_pP, i, msg3_delta_Preamble);


1281
              if (strcmp(pucch_deltaF_Format1,"deltaF_2")==0) {
1282
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2;
1283
              } else if (strcmp(pucch_deltaF_Format1,"deltaF0")==0) {
1284
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0;
1285
              } else if (strcmp(pucch_deltaF_Format1,"deltaF2")==0) {
1286
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2;
1287
              } else
1288 1289 1290 1291
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1 choice: deltaF_2,dltaF0,deltaF2!\n",
                             lib_config_file_name_pP, i, pucch_deltaF_Format1);

1292
              if (strcmp(pucch_deltaF_Format1b,"deltaF1")==0) {
1293
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1;
1294
              } else if (strcmp(pucch_deltaF_Format1b,"deltaF3")==0) {
1295
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3;
1296
              } else if (strcmp(pucch_deltaF_Format1b,"deltaF5")==0) {
1297
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5;
1298
              } else
1299 1300 1301 1302 1303
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1b choice: deltaF1,dltaF3,deltaF5!\n",
                             lib_config_file_name_pP, i, pucch_deltaF_Format1b);


1304
              if (strcmp(pucch_deltaF_Format2,"deltaF_2")==0) {
1305
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2;
1306
              } else if (strcmp(pucch_deltaF_Format2,"deltaF0")==0) {
1307
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0;
1308
              } else if (strcmp(pucch_deltaF_Format2,"deltaF1")==0) {
1309
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1;
1310
              } else if (strcmp(pucch_deltaF_Format2,"deltaF2")==0) {
1311
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2;
1312
              } else
1313 1314 1315 1316
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2 choice: deltaF_2,dltaF0,deltaF1,deltaF2!\n",
                             lib_config_file_name_pP, i, pucch_deltaF_Format2);

1317
              if (strcmp(pucch_deltaF_Format2a,"deltaF_2")==0) {
1318
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2;
1319
              } else if (strcmp(pucch_deltaF_Format2a,"deltaF0")==0) {
1320
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0;
1321
              } else if (strcmp(pucch_deltaF_Format2a,"deltaF2")==0) {
1322
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2;
1323
              } else
1324 1325 1326 1327
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2a choice: deltaF_2,dltaF0,deltaF2!\n",
                             lib_config_file_name_pP, i, pucch_deltaF_Format2a);

1328
              if (strcmp(pucch_deltaF_Format2b,"deltaF_2")==0) {
1329
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2;
1330
              } else if (strcmp(pucch_deltaF_Format2b,"deltaF0")==0) {
1331
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0;
1332
              } else if (strcmp(pucch_deltaF_Format2b,"deltaF2")==0) {
1333
                enb_properties.properties[enb_properties_index]->pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2;
1334
              } else
1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2b choice: deltaF_2,dltaF0,deltaF2!\n",
                             lib_config_file_name_pP, i, pucch_deltaF_Format2b);




              enb_properties.properties[enb_properties_index]->rach_numberOfRA_Preambles[j] = (rach_numberOfRA_Preambles/4)-1;

              if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>64) || ((rach_numberOfRA_Preambles&3)!=0))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_numberOfRA_Preambles choice: 4,8,12,...,64!\n",
                             lib_config_file_name_pP, i, rach_numberOfRA_Preambles);

              if (strcmp(rach_preamblesGroupAConfig, "ENABLE") == 0) {
                enb_properties.properties[enb_properties_index]->rach_preamblesGroupAConfig[j] = TRUE;

                if (!(config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, &rach_sizeOfRA_PreamblesGroupA)
                      && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, &rach_messageSizeGroupA)
                      && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, &rach_messagePowerOffsetGroupB)))
                  AssertError (0, parse_errors ++,
                               "Failed to parse eNB configuration file %s, enb %d  rach_sizeOfRA_PreamblesGroupA, messageSizeGroupA,messagePowerOffsetGroupB!\n",
                               lib_config_file_name_pP, i);

                enb_properties.properties[enb_properties_index]->rach_sizeOfRA_PreamblesGroupA[j] = (rach_sizeOfRA_PreamblesGroupA/4)-1;

                if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>60) || ((rach_numberOfRA_Preambles&3)!=0))
                  AssertError (0, parse_errors ++,
                               "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_sizeOfRA_PreamblesGroupA choice: 4,8,12,...,60!\n",
                               lib_config_file_name_pP, i, rach_sizeOfRA_PreamblesGroupA);


                switch (rach_messageSizeGroupA) {
                case 56:
                  enb_properties.properties[enb_properties_index]->rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56;
                  break;

                case 144:
                  enb_properties.properties[enb_properties_index]->rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144;
                  break;

                case 208:
                  enb_properties.properties[enb_properties_index]->rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208;
                  break;

                case 256:
                  enb_properties.properties[enb_properties_index]->rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256;
                  break;

                default:
                  AssertError (0, parse_errors ++,
                               "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_messageSizeGroupA choice: 56,144,208,256!\n",
                               lib_config_file_name_pP, i, rach_messageSizeGroupA);
                  break;
                }

1391
                if (strcmp(rach_messagePowerOffsetGroupB,"minusinfinity")==0) {
1392
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity;
1393 1394 1395
                }

                else if (strcmp(rach_messagePowerOffsetGroupB,"dB0")==0) {
1396
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0;
1397 1398 1399
                }

                else if (strcmp(rach_messagePowerOffsetGroupB,"dB5")==0) {
1400
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5;
1401 1402 1403
                }

                else if (strcmp(rach_messagePowerOffsetGroupB,"dB8")==0) {
1404
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8;
1405 1406 1407
                }

                else if (strcmp(rach_messagePowerOffsetGroupB,"dB10")==0) {
1408
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10;
1409 1410 1411
                }

                else if (strcmp(rach_messagePowerOffsetGroupB,"dB12")==0) {
1412
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12;
1413 1414 1415
                }

                else if (strcmp(rach_messagePowerOffsetGroupB,"dB15")==0) {
1416
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15;
1417 1418 1419
                }

                else if (strcmp(rach_messagePowerOffsetGroupB,"dB18")==0) {
1420
                  enb_properties.properties[enb_properties_index]->rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18;
1421
                } else
1422 1423 1424 1425
                  AssertError (0, parse_errors ++,
                               "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n",
                               lib_config_file_name_pP, i, rach_messagePowerOffsetGroupB);

1426
              } else if (strcmp(rach_preamblesGroupAConfig, "DISABLE") == 0) {
1427
                enb_properties.properties[enb_properties_index]->rach_preamblesGroupAConfig[j] = FALSE;
1428
              } else
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n",
                             lib_config_file_name_pP, i, rach_preamblesGroupAConfig);

              enb_properties.properties[enb_properties_index]->rach_preambleInitialReceivedTargetPower[j] = (rach_preambleInitialReceivedTargetPower+120)/2;

              if ((rach_preambleInitialReceivedTargetPower<-120) || (rach_preambleInitialReceivedTargetPower>-90) || ((rach_preambleInitialReceivedTargetPower&1)!=0))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleInitialReceivedTargetPower choice: -120,-118,...,-90 !\n",
                             lib_config_file_name_pP, i, rach_preambleInitialReceivedTargetPower);


              enb_properties.properties[enb_properties_index]->rach_powerRampingStep[j] = rach_powerRampingStep/2;

              if ((rach_powerRampingStep<0) || (rach_powerRampingStep>6) || ((rach_powerRampingStep&1)!=0))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_powerRampingStep choice: 0,2,4,6 !\n",
                             lib_config_file_name_pP, i, rach_powerRampingStep);



              switch (rach_preambleTransMax) {
              case 3:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3;
                break;

              case 4:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n4;
                break;

              case 5:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n5;
                break;

              case 6:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n6;
                break;

              case 7:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n7;
                break;

              case 8:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n8;
                break;

              case 10:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10;
                break;

              case 20:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n20;
                break;

              case 50:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n50;
                break;

              case 100:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n100;
                break;

              case 200:
                enb_properties.properties[enb_properties_index]->rach_preambleTransMax[j] =  RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n200;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleTransMax choice: 3,4,5,6,7,8,10,20,50,100,200!\n",
                             lib_config_file_name_pP, i, rach_preambleTransMax);
                break;
              }

              enb_properties.properties[enb_properties_index]->rach_raResponseWindowSize[j] =  (rach_raResponseWindowSize==10)?7:rach_raResponseWindowSize-2;

              if ((rach_raResponseWindowSize<0)||(rach_raResponseWindowSize==9)||(rach_raResponseWindowSize>10))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_raResponseWindowSize choice: 2,3,4,5,6,7,8,10!\n",
                             lib_config_file_name_pP, i, rach_preambleTransMax);


              enb_properties.properties[enb_properties_index]->rach_macContentionResolutionTimer[j] = (rach_macContentionResolutionTimer/8)-1;

              if ((rach_macContentionResolutionTimer<8) || (rach_macContentionResolutionTimer>64) || ((rach_macContentionResolutionTimer&7)!=0))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_macContentionResolutionTimer choice: 8,16,...,56,64!\n",
                             lib_config_file_name_pP, i, rach_preambleTransMax);

              enb_properties.properties[enb_properties_index]->rach_maxHARQ_Msg3Tx[j] = rach_maxHARQ_Msg3Tx;

              if ((rach_maxHARQ_Msg3Tx<0) || (rach_maxHARQ_Msg3Tx>8))
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_maxHARQ_Msg3Tx choice: 1..8!\n",
                             lib_config_file_name_pP, i, rach_preambleTransMax);


              switch (pcch_defaultPagingCycle) {
              case 32:
                enb_properties.properties[enb_properties_index]->pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf32;
                break;

              case 64:
                enb_properties.properties[enb_properties_index]->pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf64;
                break;

              case 128:
                enb_properties.properties[enb_properties_index]->pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf128;
                break;

              case 256:
                enb_properties.properties[enb_properties_index]->pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf256;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_defaultPagingCycle choice: 32,64,128,256!\n",
                             lib_config_file_name_pP, i, pcch_defaultPagingCycle);
                break;
              }

              if (strcmp(pcch_nB, "fourT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_fourT;
              } else if (strcmp(pcch_nB, "twoT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_twoT;
              } else if (strcmp(pcch_nB, "oneT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_oneT;
              } else if (strcmp(pcch_nB, "halfT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_halfT;
              } else if (strcmp(pcch_nB, "quarterT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_quarterT;
              } else if (strcmp(pcch_nB, "oneEighthT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_oneEighthT;
              } else if (strcmp(pcch_nB, "oneSixteenthT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_oneSixteenthT;
              } else if (strcmp(pcch_nB, "oneThirtySecondT") == 0) {
                enb_properties.properties[enb_properties_index]->pcch_nB[j] = PCCH_Config__nB_oneThirtySecondT;
              } else
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n",
                             lib_config_file_name_pP, i, pcch_defaultPagingCycle);



              switch (bcch_modificationPeriodCoeff) {
              case 2:
                enb_properties.properties[enb_properties_index]->bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n2;
                break;

              case 4:
                enb_properties.properties[enb_properties_index]->bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n4;
                break;

              case 8:
                enb_properties.properties[enb_properties_index]->bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n8;
                break;

              case 16:
                enb_properties.properties[enb_properties_index]->bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n16;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for bcch_modificationPeriodCoeff choice: 2,4,8,16",
                             lib_config_file_name_pP, i, bcch_modificationPeriodCoeff);

                break;
              }


              switch (ue_TimersAndConstants_t300) {
              case 100:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms100;
                break;

              case 200:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms200;
                break;

              case 300:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms300;
                break;

              case 400:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms400;
                break;

              case 600:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms600;
                break;

              case 1000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1000;
                break;

              case 1500:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1500;
                break;

              case 2000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms2000;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t300 choice: 100,200,300,400,600,1000,1500,2000 ",
                             lib_config_file_name_pP, i, ue_TimersAndConstants_t300);
                break;

              }

              switch (ue_TimersAndConstants_t301) {
              case 100:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms100;
                break;

              case 200:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms200;
                break;

              case 300:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms300;
                break;

              case 400:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms400;
                break;

              case 600:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms600;
                break;

              case 1000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1000;
                break;

              case 1500:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1500;
                break;

              case 2000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms2000;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t301 choice: 100,200,300,400,600,1000,1500,2000 ",
                             lib_config_file_name_pP, i, ue_TimersAndConstants_t301);
                break;

              }

              switch (ue_TimersAndConstants_t310) {
              case 0:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms0;
                break;

              case 50:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms50;
                break;

              case 100:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms100;
                break;

              case 200:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms200;
                break;

              case 500:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms500;
                break;

              case 1000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms1000;
                break;

              case 2000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms2000;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t310 choice: 0,50,100,200,500,1000,1500,2000 ",
                             lib_config_file_name_pP, i, ue_TimersAndConstants_t310);
                break;

              }

              switch (ue_TimersAndConstants_t311) {
              case 1000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms1000;
                break;

              case 3110:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms3000;
                break;

              case 5000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms5000;
                break;

              case 10000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms10000;
                break;

              case 15000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms15000;
                break;

              case 20000:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms20000;
                break;

              case 31100:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms30000;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1000,3000,5000,10000,150000,20000,30000",
                             lib_config_file_name_pP, i, ue_TimersAndConstants_t311);
                break;

              }

              switch (ue_TimersAndConstants_n310) {
              case 1:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n1;
                break;

              case 2:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n2;
                break;

              case 3:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n3;
                break;

              case 4:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n4;
                break;

              case 6:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n6;
                break;

              case 8:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n8;
                break;

              case 10:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n10;
                break;

              case 20:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n20;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_n310 choice: 1,2,3,4,6,6,8,10,20",
                             lib_config_file_name_pP, i, ue_TimersAndConstants_n311);
                break;

              }

              switch (ue_TimersAndConstants_n311) {
              case 1:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n1;
                break;

              case 2:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n2;
                break;

              case 3:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n3;
                break;

              case 4:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n4;
                break;

              case 5:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n5;
                break;

              case 6:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n6;
                break;

              case 8:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n8;
                break;

              case 10:
                enb_properties.properties[enb_properties_index]->ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n10;
                break;

              default:
                AssertError (0, parse_errors ++,
                             "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1,2,3,4,5,6,8,10",
                             lib_config_file_name_pP, i, ue_TimersAndConstants_t311);
                break;

              }
            }
          }

1838
          setting_srb1 = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SRB1);
1839

1840 1841
          if (setting_srb1 != NULL) {
            if (!(config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, &srb1_timer_poll_retransmit)
1842 1843 1844 1845 1846 1847 1848 1849 1850
                  && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_REORDERING,      &srb1_timer_reordering)
                  && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, &srb1_timer_status_prohibit)
                  && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD,    &srb1_max_retx_threshold)
                  && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_POLL_PDU,              &srb1_poll_pdu)
                  && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_POLL_BYTE,             &srb1_poll_byte)))
              AssertError (0, parse_errors ++,
                           "Failed to parse eNB configuration file %s, enb %d  timer_poll_retransmit, timer_reordering, "
                           "timer_status_prohibit, poll_pdu, poll_byte, max_retx_threshold !\n",
                           lib_config_file_name_pP, i);
1851 1852

            switch (srb1_max_retx_threshold) {
1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884
            case 1:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t1;
              break;

            case 2:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t2;
              break;

            case 3:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t3;
              break;

            case 4:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t4;
              break;

            case 6:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t6;
              break;

            case 8:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8;
              break;

            case 16:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t16;
              break;

            case 32:
              enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t32;
              break;

1885 1886
            default:
              AssertError (0, parse_errors ++,
1887 1888
                           "Bad config value when parsing eNB configuration file %s, enb %d  srb1_max_retx_threshold %u!\n",
                           lib_config_file_name_pP, i, srb1_max_retx_threshold);
1889 1890 1891
            }

            switch (srb1_poll_pdu) {
1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919
            case 4:
              enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_p4;
              break;

            case 8:
              enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_p8;
              break;

            case 16:
              enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_p16;
              break;

            case 32:
              enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_p32;
              break;

            case 64:
              enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_p64;
              break;

            case 128:
              enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_p128;
              break;

            case 256:
              enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_p256;
              break;

1920 1921
            default:
              if (srb1_poll_pdu >= 10000)
1922
                enb_properties.properties[enb_properties_index]->srb1_poll_pdu = PollPDU_pInfinity;
1923 1924
              else
                AssertError (0, parse_errors ++,
1925 1926
                             "Bad config value when parsing eNB configuration file %s, enb %d  srb1_poll_pdu %u!\n",
                             lib_config_file_name_pP, i, srb1_poll_pdu);
1927 1928 1929
            }

            enb_properties.properties[enb_properties_index]->srb1_poll_byte             = srb1_poll_byte;
1930

1931
            switch (srb1_poll_byte) {
1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987
            case 25:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB25;
              break;

            case 50:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB50;
              break;

            case 75:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB75;
              break;

            case 100:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB100;
              break;

            case 125:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB125;
              break;

            case 250:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB250;
              break;

            case 375:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB375;
              break;

            case 500:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB500;
              break;

            case 750:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB750;
              break;

            case 1000:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB1000;
              break;

            case 1250:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB1250;
              break;

            case 1500:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB1500;
              break;

            case 2000:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB2000;
              break;

            case 3000:
              enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kB3000;
              break;

1988 1989
            default:
              if (srb1_poll_byte >= 10000)
1990
                enb_properties.properties[enb_properties_index]->srb1_poll_byte = PollByte_kBinfinity;
1991 1992
              else
                AssertError (0, parse_errors ++,
1993 1994
                             "Bad config value when parsing eNB configuration file %s, enb %d  srb1_poll_byte %u!\n",
                             lib_config_file_name_pP, i, srb1_poll_byte);
1995 1996
            }

1997
            if (srb1_timer_poll_retransmit <= 250) {
1998
              enb_properties.properties[enb_properties_index]->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 5)/5;
1999
            } else if (srb1_timer_poll_retransmit <= 500) {
2000
              enb_properties.properties[enb_properties_index]->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 300)/50 + 50;
2001
            } else {
2002 2003 2004
              AssertError (0, parse_errors ++,
                           "Bad config value when parsing eNB configuration file %s, enb %d  srb1_timer_poll_retransmit %u!\n",
                           lib_config_file_name_pP, i, srb1_timer_poll_retransmit);
2005 2006
            }

2007
            if (srb1_timer_status_prohibit <= 250) {
2008
              enb_properties.properties[enb_properties_index]->srb1_timer_status_prohibit = srb1_timer_status_prohibit/5;
2009
            } else if ((srb1_timer_poll_retransmit >= 300) && (srb1_timer_poll_retransmit <= 500)) {
2010
              enb_properties.properties[enb_properties_index]->srb1_timer_status_prohibit = (srb1_timer_status_prohibit - 300)/50 + 51;
2011
            } else {
2012 2013 2014
              AssertError (0, parse_errors ++,
                           "Bad config value when parsing eNB configuration file %s, enb %d  srb1_timer_status_prohibit %u!\n",
                           lib_config_file_name_pP, i, srb1_timer_status_prohibit);
2015 2016 2017
            }

            switch (srb1_timer_reordering) {
2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141
            case 0:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms0;
              break;

            case 5:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms5;
              break;

            case 10:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms10;
              break;

            case 15:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms15;
              break;

            case 20:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms20;
              break;

            case 25:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms25;
              break;

            case 30:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms30;
              break;

            case 35:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms35;
              break;

            case 40:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms40;
              break;

            case 45:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms45;
              break;

            case 50:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms50;
              break;

            case 55:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms55;
              break;

            case 60:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms60;
              break;

            case 65:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms65;
              break;

            case 70:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms70;
              break;

            case 75:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms75;
              break;

            case 80:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms80;
              break;

            case 85:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms85;
              break;

            case 90:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms90;
              break;

            case 95:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms95;
              break;

            case 100:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms100;
              break;

            case 110:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms110;
              break;

            case 120:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms120;
              break;

            case 130:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms130;
              break;

            case 140:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms140;
              break;

            case 150:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms150;
              break;

            case 160:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms160;
              break;

            case 170:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms170;
              break;

            case 180:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms180;
              break;

            case 190:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms190;
              break;

            case 200:
              enb_properties.properties[enb_properties_index]->srb1_timer_reordering = T_Reordering_ms200;
              break;

2142 2143
            default:
              AssertError (0, parse_errors ++,
2144 2145
                           "Bad config value when parsing eNB configuration file %s, enb %d  srb1_timer_reordering %u!\n",
                           lib_config_file_name_pP, i, srb1_timer_reordering);
2146 2147 2148 2149 2150 2151 2152 2153 2154 2155
            }
          } else {
            enb_properties.properties[enb_properties_index]->srb1_timer_poll_retransmit = T_PollRetransmit_ms80;
            enb_properties.properties[enb_properties_index]->srb1_timer_reordering      = T_Reordering_ms35;
            enb_properties.properties[enb_properties_index]->srb1_timer_status_prohibit = T_StatusProhibit_ms0;
            enb_properties.properties[enb_properties_index]->srb1_poll_pdu              = PollPDU_p4;
            enb_properties.properties[enb_properties_index]->srb1_poll_byte             = PollByte_kBinfinity;
            enb_properties.properties[enb_properties_index]->srb1_max_retx_threshold    = UL_AM_RLC__maxRetxThreshold_t8;
          }

2156 2157 2158 2159 2160 2161 2162
          setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS);
          num_mme_address     = config_setting_length(setting_mme_addresses);
          enb_properties.properties[enb_properties_index]->nb_mme = 0;

          for (j = 0; j < num_mme_address; j++) {
            setting_mme_address = config_setting_get_elem(setting_mme_addresses, j);

2163
            if (  !(
2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182
                   config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV4_ADDRESS, (const char **)&ipv4)
                   && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV6_ADDRESS, (const char **)&ipv6)
                   && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, (const char **)&active)
                   && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference)
                 )
              ) {
              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;

            enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4);
            enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6);

            if (strcmp(active, "yes") == 0) {
              enb_properties.properties[enb_properties_index]->mme_ip_address[j].active = 1;
winckel's avatar
winckel committed
2183
#if defined(ENABLE_USE_MME)
2184
              EPC_MODE_ENABLED = 1;
winckel's avatar
winckel committed
2185
#endif
2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
            } // else { (calloc)

            if (strcmp(preference, "ipv4") == 0) {
              enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1;
            } else if (strcmp(preference, "ipv6") == 0) {
              enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
            } else if (strcmp(preference, "no") == 0) {
              enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1;
              enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
            }
          }
2197 2198
	  // RRH Config 
	  setting_rrh_gws = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_RRH_GW_CONFIG);
2199
	  if ( setting_rrh_gws != NULL) {
2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212
          num_rrh_gw     = config_setting_length(setting_rrh_gws);
          enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;

          for (j = 0; j < num_rrh_gw; j++) {
            setting_rrh_gw = config_setting_get_elem(setting_rrh_gws, j);

            if (  !(
                   config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME, (const char **)&if_name)
		   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS, (const char **)&ipv4)
                   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS , (const char **)&ipv4_remote)
                   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT, &local_port)
                   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT, &remote_port)
                   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_ACTIVE, (const char **)&active)
2213 2214 2215 2216 2217
		   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE, (const char **)&tr_preference)
		   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE, (const char **)&rf_preference)
		   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT, &iq_txshift) 
		   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE, &tx_sample_advance)
		   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE, &tx_scheduling_advance)
2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230
                 )
              ) {
              AssertError (0, parse_errors ++,
                           "Failed to parse eNB configuration file %s, %u th enb %u the RRH GW 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_rrh_gw += 1;

	    enb_properties.properties[enb_properties_index]->rrh_gw_if_name = strdup(if_name);
            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address  = strdup(ipv4);
            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = strdup(ipv4_remote);
2231 2232 2233 2234 2235
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port = local_port;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port = remote_port;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = iq_txshift;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = tx_sample_advance;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance= tx_scheduling_advance;
2236 2237 2238 2239 2240

            if (strcmp(active, "yes") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 1;
            } 

2241
            if (strcmp(tr_preference, "udp") == 0) {
2242
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
2243
            } else if (strcmp(tr_preference, "raw") == 0) {
2244
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
2245 2246 2247 2248
            } else if (strcmp(tr_preference, "udpif4") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udpif4 = 1; 
            } else if (strcmp(tr_preference, "rawif4") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].rawif4 = 1;
2249 2250 2251 2252
            } else {//if (strcmp(preference, "no") == 0) 
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
            }
2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271

	    if (strcmp(rf_preference, "exmimo") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1;
            } else if (strcmp(rf_preference, "usrp_b200") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1;
	    } else if (strcmp(rf_preference, "usrp_x300") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1;
            } else if (strcmp(rf_preference, "bladerf") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1;
	    } else if (strcmp(rf_preference, "bladerf") == 0) {
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1;	      
            } else {//if (strcmp(preference, "no") == 0) 
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1;
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1;
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1;
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1;    
              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1;    

            }
2272
          }
2273 2274 2275 2276 2277 2278 2279 2280 2281 2282
	  } else {
	    enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;	    
	    enb_properties.properties[enb_properties_index]->rrh_gw_if_name = "none";
            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address  = "0.0.0.0";
            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = "0.0.0.0";
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= 0;	    
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 0;	    
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 0;
2283 2284 2285 2286 2287 2288 2289 2290
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 0;
	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 0;
2291
	  }
2292

2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309
          // SCTP SETTING
          enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS;
          enb_properties.properties[enb_properties_index]->sctp_in_streams  = SCTP_IN_STREAMS;
# if defined(ENABLE_USE_MME)
          subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SCTP_CONFIG);

          if (subsetting != NULL) {
            if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_INSTREAMS, &my_int) )) {
            	enb_properties.properties[enb_properties_index]->sctp_in_streams = (uint16_t)my_int;
            }

            if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_OUTSTREAMS, &my_int) )) {
            	enb_properties.properties[enb_properties_index]->sctp_out_streams = (uint16_t)my_int;
            }
          }
#endif

2310 2311 2312
          // NETWORK_INTERFACES
          subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);

2313 2314
          if (subsetting != NULL) {
            if (  (
2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349
                   config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME,
                                                 (const char **)&enb_interface_name_for_S1_MME)
                   && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME,
                                                    (const char **)&enb_ipv4_address_for_S1_MME)
                   && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U,
                                                    (const char **)&enb_interface_name_for_S1U)
                   && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U,
                                                    (const char **)&enb_ipv4_address_for_S1U)
                   && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U,
                                                &enb_port_for_S1U)
                 )
              ) {
              enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U);
              cidr = enb_ipv4_address_for_S1U;
              address = strtok(cidr, "/");

              if (address) {
                IPV4_STR_ADDR_TO_INT_NWBO ( address, enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
              }

              enb_properties.properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U;

              enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME);
              cidr = enb_ipv4_address_for_S1_MME;
              address = strtok(cidr, "/");

              if (address) {
                IPV4_STR_ADDR_TO_INT_NWBO ( address, enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" );
              }
            }
          }

          // OTG _CONFIG
          setting_otg = config_setting_get_member (setting_enb, ENB_CONF_STRING_OTG_CONFIG);

2350
          if (setting_otg != NULL) {
2351 2352 2353 2354 2355 2356 2357
            num_otg_elements  = config_setting_length(setting_otg);
            printf("num otg elements %d \n", num_otg_elements);
            enb_properties.properties[enb_properties_index]->num_otg_elements = 0;

            for (j = 0; j < num_otg_elements; j++) {
              subsetting_otg=config_setting_get_elem(setting_otg, j);

2358
              if (config_setting_lookup_int(subsetting_otg, ENB_CONF_STRING_OTG_UE_ID, &otg_ue_id)) {
2359
                enb_properties.properties[enb_properties_index]->otg_ue_id[j] = otg_ue_id;
2360
              } else {
2361
                enb_properties.properties[enb_properties_index]->otg_ue_id[j] = 1;
2362
              }
2363

2364
              if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_APP_TYPE, (const char **)&otg_app_type)) {
2365
                if ((enb_properties.properties[enb_properties_index]->otg_app_type[j] = map_str_to_int(otg_app_type_names,otg_app_type))== -1) {
2366
                  enb_properties.properties[enb_properties_index]->otg_app_type[j] = BCBR;
2367 2368
                }
              } else {
2369
                enb_properties.properties[enb_properties_index]->otg_app_type[j] = NO_PREDEFINED_TRAFFIC; // 0
2370
              }
2371

2372
              if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_BG_TRAFFIC, (const char **)&otg_bg_traffic)) {
2373 2374 2375

                if ((enb_properties.properties[enb_properties_index]->otg_bg_traffic[j] = map_str_to_int(switch_names,otg_bg_traffic)) == -1) {
                  enb_properties.properties[enb_properties_index]->otg_bg_traffic[j]=0;
2376
                }
2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389
              } else {
                enb_properties.properties[enb_properties_index]->otg_bg_traffic[j] = 0;
                printf("otg bg %s\n", otg_bg_traffic);
              }

              enb_properties.properties[enb_properties_index]->num_otg_elements+=1;

            }
          }

          // log_config
          subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_LOG_CONFIG);

2390
          if (subsetting != NULL) {
2391
            // global
2392
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL, (const char **)  &glog_level)) {
2393
              if ((enb_properties.properties[enb_properties_index]->glog_level = map_str_to_int(log_level_names, glog_level)) == -1) {
2394
                enb_properties.properties[enb_properties_index]->glog_level = LOG_INFO;
2395
              }
2396 2397 2398 2399 2400 2401

              //printf( "\tGlobal log level :\t%s->%d\n",glog_level, enb_properties.properties[enb_properties_index]->glog_level);
            } else {
              enb_properties.properties[enb_properties_index]->glog_level = LOG_INFO;
            }

2402
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,(const char **)  &glog_verbosity)) {
2403
              if ((enb_properties.properties[enb_properties_index]->glog_verbosity = map_str_to_int(log_verbosity_names, glog_verbosity)) == -1) {
2404
                enb_properties.properties[enb_properties_index]->glog_verbosity = LOG_MED;
2405
              }
2406 2407 2408 2409 2410 2411 2412

              //printf( "\tGlobal log verbosity:\t%s->%d\n",glog_verbosity, enb_properties.properties[enb_properties_index]->glog_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->glog_verbosity = LOG_MED;
            }

            // HW
2413
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_LEVEL, (const char **) &hw_log_level)) {
2414
              if ((enb_properties.properties[enb_properties_index]->hw_log_level = map_str_to_int(log_level_names,hw_log_level)) == -1) {
2415
                enb_properties.properties[enb_properties_index]->hw_log_level = LOG_INFO;
2416
              }
2417 2418 2419 2420 2421 2422

              //printf( "\tHW log level :\t%s->%d\n",hw_log_level,enb_properties.properties[enb_properties_index]->hw_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->hw_log_level = LOG_INFO;
            }

2423
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_VERBOSITY, (const char **) &hw_log_verbosity)) {
2424
              if ((enb_properties.properties[enb_properties_index]->hw_log_verbosity = map_str_to_int(log_verbosity_names,hw_log_verbosity)) == -1) {
2425
                enb_properties.properties[enb_properties_index]->hw_log_verbosity = LOG_MED;
2426
              }
2427 2428 2429 2430 2431 2432 2433

              //printf( "\tHW log verbosity:\t%s->%d\n",hw_log_verbosity, enb_properties.properties[enb_properties_index]->hw_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->hw_log_verbosity = LOG_MED;
            }

            // phy
2434
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_LEVEL,(const char **) &phy_log_level)) {
2435
              if ((enb_properties.properties[enb_properties_index]->phy_log_level = map_str_to_int(log_level_names,phy_log_level)) == -1) {
2436
                enb_properties.properties[enb_properties_index]->phy_log_level = LOG_INFO;
2437
              }
2438 2439 2440 2441 2442 2443

              //printf( "\tPHY log level :\t%s->%d\n",phy_log_level,enb_properties.properties[enb_properties_index]->phy_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->phy_log_level = LOG_INFO;
            }

2444
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_VERBOSITY, (const char **)&phy_log_verbosity)) {
2445
              if ((enb_properties.properties[enb_properties_index]->phy_log_verbosity = map_str_to_int(log_verbosity_names,phy_log_verbosity)) == -1) {
2446
                enb_properties.properties[enb_properties_index]->phy_log_verbosity = LOG_MED;
2447
              }
2448 2449 2450 2451

              //printf( "\tPHY log verbosity:\t%s->%d\n",phy_log_level,enb_properties.properties[enb_properties_index]->phy_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->phy_log_verbosity = LOG_MED;
2452
            }
2453 2454

            //mac
2455
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_LEVEL, (const char **)&mac_log_level)) {
2456
              if ((enb_properties.properties[enb_properties_index]->mac_log_level = map_str_to_int(log_level_names,mac_log_level)) == -1 ) {
2457
                enb_properties.properties[enb_properties_index]->mac_log_level = LOG_INFO;
2458
              }
2459 2460 2461 2462 2463 2464

              //printf( "\tMAC log level :\t%s->%d\n",mac_log_level,enb_properties.properties[enb_properties_index]->mac_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->mac_log_level = LOG_INFO;
            }

2465
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_VERBOSITY, (const char **)&mac_log_verbosity)) {
2466
              if ((enb_properties.properties[enb_properties_index]->mac_log_verbosity = map_str_to_int(log_verbosity_names,mac_log_verbosity)) == -1) {
2467
                enb_properties.properties[enb_properties_index]->mac_log_verbosity = LOG_MED;
2468
              }
2469 2470 2471 2472 2473 2474 2475

              //printf( "\tMAC log verbosity:\t%s->%d\n",mac_log_verbosity,enb_properties.properties[enb_properties_index]->mac_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->mac_log_verbosity = LOG_MED;
            }

            //rlc
2476
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_LEVEL, (const char **)&rlc_log_level)) {
2477
              if ((enb_properties.properties[enb_properties_index]->rlc_log_level = map_str_to_int(log_level_names,rlc_log_level)) == -1) {
2478
                enb_properties.properties[enb_properties_index]->rlc_log_level = LOG_INFO;
2479
              }
2480 2481 2482 2483 2484 2485

              //printf( "\tRLC log level :\t%s->%d\n",rlc_log_level, enb_properties.properties[enb_properties_index]->rlc_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->rlc_log_level = LOG_INFO;
            }

2486
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_VERBOSITY, (const char **)&rlc_log_verbosity)) {
2487
              if ((enb_properties.properties[enb_properties_index]->rlc_log_verbosity = map_str_to_int(log_verbosity_names,rlc_log_verbosity)) == -1) {
2488
                enb_properties.properties[enb_properties_index]->rlc_log_verbosity = LOG_MED;
2489
              }
2490 2491 2492 2493 2494 2495 2496

              //printf( "\tRLC log verbosity:\t%s->%d\n",rlc_log_verbosity, enb_properties.properties[enb_properties_index]->rlc_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->rlc_log_verbosity = LOG_MED;
            }

            //pdcp
2497
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_LEVEL, (const char **)&pdcp_log_level)) {
2498
              if ((enb_properties.properties[enb_properties_index]->pdcp_log_level = map_str_to_int(log_level_names,pdcp_log_level)) == -1) {
2499
                enb_properties.properties[enb_properties_index]->pdcp_log_level = LOG_INFO;
2500
              }
2501 2502 2503 2504 2505 2506

              //printf( "\tPDCP log level :\t%s->%d\n",pdcp_log_level, enb_properties.properties[enb_properties_index]->pdcp_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->pdcp_log_level = LOG_INFO;
            }

2507
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY, (const char **)&pdcp_log_verbosity)) {
2508 2509 2510 2511 2512 2513 2514
              enb_properties.properties[enb_properties_index]->pdcp_log_verbosity = map_str_to_int(log_verbosity_names,pdcp_log_verbosity);
              //printf( "\tPDCP log verbosity:\t%s->%d\n",pdcp_log_verbosity, enb_properties.properties[enb_properties_index]->pdcp_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->pdcp_log_verbosity = LOG_MED;
            }

            //rrc
2515
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_LEVEL, (const char **)&rrc_log_level)) {
2516
              if ((enb_properties.properties[enb_properties_index]->rrc_log_level = map_str_to_int(log_level_names,rrc_log_level)) == -1 ) {
2517
                enb_properties.properties[enb_properties_index]->rrc_log_level = LOG_INFO;
2518
              }
2519 2520 2521 2522 2523 2524

              //printf( "\tRRC log level :\t%s->%d\n",rrc_log_level,enb_properties.properties[enb_properties_index]->rrc_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->rrc_log_level = LOG_INFO;
            }

2525
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_VERBOSITY, (const char **)&rrc_log_verbosity)) {
2526
              if ((enb_properties.properties[enb_properties_index]->rrc_log_verbosity = map_str_to_int(log_verbosity_names,rrc_log_verbosity)) == -1) {
2527
                enb_properties.properties[enb_properties_index]->rrc_log_verbosity = LOG_MED;
2528
              }
2529 2530 2531 2532 2533 2534

              //printf( "\tRRC log verbosity:\t%s->%d\n",rrc_log_verbosity,enb_properties.properties[enb_properties_index]->rrc_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->rrc_log_verbosity = LOG_MED;
            }

2535
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GTPU_LOG_LEVEL, (const char **)&gtpu_log_level)) {
2536
              if ((enb_properties.properties[enb_properties_index]->gtpu_log_level = map_str_to_int(log_level_names,gtpu_log_level)) == -1 ) {
2537
                enb_properties.properties[enb_properties_index]->gtpu_log_level = LOG_INFO;
2538
              }
2539 2540 2541 2542 2543 2544

              //printf( "\tGTPU log level :\t%s->%d\n",gtpu_log_level,enb_properties.properties[enb_properties_index]->gtpu_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->gtpu_log_level = LOG_INFO;
            }

2545
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GTPU_LOG_VERBOSITY, (const char **)&gtpu_log_verbosity)) {
2546
              if ((enb_properties.properties[enb_properties_index]->gtpu_log_verbosity = map_str_to_int(log_verbosity_names,gtpu_log_verbosity)) == -1) {
2547
                enb_properties.properties[enb_properties_index]->gtpu_log_verbosity = LOG_MED;
2548
              }
2549 2550 2551 2552 2553 2554

              //printf( "\tGTPU log verbosity:\t%s->%d\n",gtpu_log_verbosity,enb_properties.properties[enb_properties_index]->gtpu_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->gtpu_log_verbosity = LOG_MED;
            }

2555
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_UDP_LOG_LEVEL, (const char **)&udp_log_level)) {
2556
              if ((enb_properties.properties[enb_properties_index]->udp_log_level = map_str_to_int(log_level_names,udp_log_level)) == -1 ) {
2557
                enb_properties.properties[enb_properties_index]->udp_log_level = LOG_INFO;
2558
              }
2559 2560 2561 2562 2563 2564

              //printf( "\tUDP log level :\t%s->%d\n",udp_log_level,enb_properties.properties[enb_properties_index]->udp_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->udp_log_level = LOG_INFO;
            }

2565
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_UDP_LOG_VERBOSITY, (const char **)&udp_log_verbosity)) {
2566
              if ((enb_properties.properties[enb_properties_index]->udp_log_verbosity = map_str_to_int(log_verbosity_names,udp_log_verbosity)) == -1) {
2567
                enb_properties.properties[enb_properties_index]->udp_log_verbosity = LOG_MED;
2568
              }
2569 2570 2571 2572 2573 2574

              //printf( "\tUDP log verbosity:\t%s->%d\n",udp_log_verbosity,enb_properties.properties[enb_properties_index]->gtpu_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->udp_log_verbosity = LOG_MED;
            }

2575
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_OSA_LOG_LEVEL, (const char **)&osa_log_level)) {
2576
              if ((enb_properties.properties[enb_properties_index]->osa_log_level = map_str_to_int(log_level_names,osa_log_level)) == -1 ) {
2577
                enb_properties.properties[enb_properties_index]->osa_log_level = LOG_INFO;
2578
              }
2579 2580 2581 2582 2583 2584

              //printf( "\tOSA log level :\t%s->%d\n",osa_log_level,enb_properties.properties[enb_properties_index]->osa_log_level);
            } else {
              enb_properties.properties[enb_properties_index]->osa_log_level = LOG_INFO;
            }

2585
            if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_OSA_LOG_VERBOSITY, (const char **)&osa_log_verbosity)) {
2586
              if ((enb_properties.properties[enb_properties_index]->osa_log_verbosity = map_str_to_int(log_verbosity_names,osa_log_verbosity)) == -1) {
2587
                enb_properties.properties[enb_properties_index]->osa_log_verbosity = LOG_MED;
2588
              }
2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619

              //printf( "\tOSA log verbosity:\t%s->%d\n",osa_log_verbosity,enb_properties.properties[enb_properties_index]->gosa_log_verbosity);
            } else {
              enb_properties.properties[enb_properties_index]->osa_log_verbosity = LOG_MED;
            }

          } else { // not configuration is given
            enb_properties.properties[enb_properties_index]->glog_level         = LOG_INFO;
            enb_properties.properties[enb_properties_index]->glog_verbosity     = LOG_MED;
            enb_properties.properties[enb_properties_index]->hw_log_level       = LOG_INFO;
            enb_properties.properties[enb_properties_index]->hw_log_verbosity   = LOG_MED;
            enb_properties.properties[enb_properties_index]->phy_log_level      = LOG_INFO;
            enb_properties.properties[enb_properties_index]->phy_log_verbosity  = LOG_MED;
            enb_properties.properties[enb_properties_index]->mac_log_level      = LOG_INFO;
            enb_properties.properties[enb_properties_index]->mac_log_verbosity  = LOG_MED;
            enb_properties.properties[enb_properties_index]->rlc_log_level      = LOG_INFO;
            enb_properties.properties[enb_properties_index]->rlc_log_verbosity  = LOG_MED;
            enb_properties.properties[enb_properties_index]->pdcp_log_level     = LOG_INFO;
            enb_properties.properties[enb_properties_index]->pdcp_log_verbosity = LOG_MED;
            enb_properties.properties[enb_properties_index]->rrc_log_level      = LOG_INFO;
            enb_properties.properties[enb_properties_index]->rrc_log_verbosity  = LOG_MED;
            enb_properties.properties[enb_properties_index]->gtpu_log_level     = LOG_INFO;
            enb_properties.properties[enb_properties_index]->gtpu_log_verbosity = LOG_MED;
            enb_properties.properties[enb_properties_index]->udp_log_level      = LOG_INFO;
            enb_properties.properties[enb_properties_index]->udp_log_verbosity  = LOG_MED;
            enb_properties.properties[enb_properties_index]->osa_log_level      = LOG_INFO;
            enb_properties.properties[enb_properties_index]->osa_log_verbosity  = LOG_MED;
          }

          enb_properties_index += 1;
          break;
2620
        }
2621
      }
2622
    }
2623
  }
2624

2625
  enb_properties.number = num_enb_properties;
2626

2627 2628 2629 2630 2631 2632 2633 2634 2635
  AssertError (enb_properties_index == num_enb_properties, parse_errors ++,
               "Failed to parse eNB configuration file %s, mismatch between %u active eNBs and %u corresponding defined eNBs !\n",
               lib_config_file_name_pP, num_enb_properties, enb_properties_index);

  AssertFatal (parse_errors == 0,
               "Failed to parse eNB configuration file %s, found %d error%s !\n",
               lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : "");
  enb_config_display();
  return &enb_properties;
Lionel Gauthier's avatar
Lionel Gauthier committed
2636

2637 2638
}

2639 2640 2641
const Enb_properties_array_t *enb_config_get(void)
{
  return &enb_properties;
2642
}
Lionel Gauthier's avatar
 
Lionel Gauthier committed
2643