[GITLAB] - UPGRADE TO v12 on Wednesday the 18th of December at 11.30AM

Commit e18fc7c3 authored by gauthier's avatar gauthier

Work better (ue connect/disconnect/reconnect...) but more work needed

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7663 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 358850d2
......@@ -518,7 +518,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "Otherwise it is UM, confi
##########################
# S1AP LAYER OPTIONS
##########################
add_boolean_option(S1AP_LIMIT_STREAM_ID_TO_1 True "FIXME: Despite Eurecom has implemented the spec concerning management of stream ids, there are always issues with other EPCs than EURECOM")
# none
##########################
# PROJECTS (IST, FRENCH COLL., etc)
......
......@@ -67,8 +67,8 @@ MME :
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 32;
SCTP_OUTSTREAMS = 32;
SCTP_INSTREAMS = 8;
SCTP_OUTSTREAMS = 8;
};
# ------- S1AP definitions
......
......@@ -34,8 +34,8 @@ MME :
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 32;
SCTP_OUTSTREAMS = 32;
SCTP_INSTREAMS = 8;
SCTP_OUTSTREAMS = 8;
};
# ------- S1AP definitions
......
......@@ -39,6 +39,8 @@
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper
declare -i g_run_msc_gen=0
declare g_msc_dir="/tmp"
function help()
......@@ -57,6 +59,7 @@ function help()
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
......@@ -68,13 +71,40 @@ function help()
}
function do_msc_gen()
{
cd $g_msc_dir
last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py
sync
last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
if [ x"$last_created_file" != x"$last_created_file2" ]; then
if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
fi
fi
}
function control_c()
# run if user hits control-c
{
echo_warning "\nExiting by ctrl+c\n"
if [ $g_run_msc_gen -eq 1 ]; then
do_msc_gen
fi
exit $?
}
function main()
{
local -i run_gdb=0
local -i run_mscgen=0
local -i show_stdout=0
local exe_arguments=""
local MSC_DIR="/tmp"
local itti_dump_file=""
until [ -z "$1" ]
do
......@@ -99,7 +129,7 @@ function main()
;;
-g | --gdb)
run_gdb=1
echo "setting GDB flag to: $GDB"
echo "setting GDB flag to: $run_gdb"
shift;
;;
-h | --help)
......@@ -108,23 +138,23 @@ function main()
exit 0
;;
-K | --itti-dump-file)
ITTI_DUMP_FILE=$2
itti_dump_file=$2
# can omit file name if last arg on the line
if [ "x$ITTI_DUMP_FILE" = "x" ]; then
ITTI_DUMP_FILE="/tmp/enb_s1_usrp_itti.log"
if [ "x$itti_dump_file" = "x" ]; then
itti_dump_file="/tmp/enb_s1_usrp_itti.log"
shift 1;
else
shift 2;
fi
echo "setting ITTI dump file to: $ITTI_DUMP_FILE"
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
echo "setting ITTI dump file to: $itti_dump_file"
exe_arguments="$exe_arguments -K $itti_dump_file"
;;
-m | --mscgen)
MSC_DIR=$2
g_msc_dir=$2
# can omit file name if last arg on the line
if [ -d "$MSC_DIR" ]; then
echo "setting mscgen log files to dir: $MSC_DIR"
run_mscgen=1
if [ -d "$g_msc_dir" ]; then
echo "setting mscgen log files to dir: $g_msc_dir"
g_run_msc_gen=1
shift 2;
else
echo_error "Mscgen log dir does not exist"
......@@ -141,6 +171,11 @@ function main()
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ;
;;
-s | --show-stdout)
echo "setting show stdout"
show_stdout=1
shift ;
;;
-S | --enable-missed-slot)
echo "setting continue even if missed slot"
exe_arguments="$exe_arguments -S"
......@@ -151,14 +186,14 @@ function main()
exe_arguments="$exe_arguments -t $2"
shift 2;
;;
-W | ----wireshark-l2)
-W | --wireshark-l2)
echo "setting l2 pcap dump output"
exe_arguments="$exe_arguments -W"
shift ;
;;
-x | --xforms)
exe_arguments="$exe_arguments -d"
echo "setting xforms to: $XFORMS"
echo "setting xforms"
shift;
;;
*)
......@@ -180,32 +215,32 @@ function main()
if [ $run_gdb -eq 0 ]; then
# trap keyboard interrupt (control-c)
trap control_c SIGINT
if [ $show_stdout -eq 0 ]; then
echo_warning "stdout/sderr of lte-softmodem executable redirected to /tmp/lte_softmodem.stdout.txt"
exec $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 `echo $exe_arguments` 2>&1 > /tmp/lte_softmodem.stdout.txt
else
exec $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 `echo $exe_arguments`
fi
else
# trap keyboard interrupt (control-c) is done by gdb
touch ~/.gdb_lte_softmodem
chmod 777 ~/.gdb_lte_softmodem
echo "file $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10" > ~/.gdb_lte_softmodem
echo "set args $exe_arguments" >> ~/.gdb_lte_softmodem
echo "run" >> ~/.gdb_lte_softmodem
cat ~/.gdb_lte_softmodem
gdb -n -x ~/.gdb_lte_softmodem 2>&1
#> /tmp/gdb_lte_softmodem.stdout.txt
fi
if [ $run_mscgen -eq 1 ]; then
cd $MSC_DIR
last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN
sync
last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
if [ x"$last_created_file" != x"$last_created_file2" ]; then
if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
if [ $show_stdout -eq 0 ]; then
echo_warning "stdout/sderr of lte-softmodem executable redirected to /tmp/gdb_lte_softmodem.stdout.txt"
gdb -n -x ~/.gdb_lte_softmodem 2>&1 > /tmp/gdb_lte_softmodem.stdout.txt
else
gdb -n -x ~/.gdb_lte_softmodem
fi
if [ $g_run_msc_gen -eq 1 ]; then
do_msc_gen
fi
fi
}
......
......@@ -39,8 +39,8 @@
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper
global -i g_run_msc_gen=0
global g_msc_dir="/tmp"
declare -i g_run_msc_gen=0
declare g_msc_dir="/tmp"
set_openair_env
......@@ -128,11 +128,9 @@ function main()
;;
-m | --mscgen)
g_msc_dir=$2
# can omit file name if last arg on the line
if [ -d "$g_msc_dir" ]; then
echo "setting mscgen log files to dir: $g_msc_dir"
g_run_msc_gen=1
exe_arguments="-m $exe_arguments"
shift 2;
else
echo_error "Mscgen log dir does not exist"
......
......@@ -64,6 +64,7 @@
#include "s6a_defs.h"
#include "oai_epc.h"
#include "msc.h"
int main(int argc, char *argv[])
{
......@@ -73,6 +74,7 @@ int main(int argc, char *argv[])
mme_config.itti_config.log_file));
/* Parse the command line for options and set the mme_config accordingly. */
CHECK_INIT_RETURN(config_parse_opt_line(argc, argv, &mme_config) < 0);
MSC_INIT(MSC_MME_GW, THREAD_MAX+TASK_MAX);
/* Calling each layer init function */
CHECK_INIT_RETURN(log_init(&mme_config, oai_epc_log_specific));
......
......@@ -98,7 +98,9 @@ uint32_t s1ap_generate_eNB_id(void)
static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
net_ip_address_t *mme_ip_address,
net_ip_address_t *local_ip_addr)
net_ip_address_t *local_ip_addr,
uint16_t in_streams,
uint16_t out_streams)
{
MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
......@@ -114,6 +116,9 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
sctp_new_association_req_p->port = S1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = in_streams;
sctp_new_association_req_p->out_streams = out_streams;
memcpy(&sctp_new_association_req_p->remote_address,
mme_ip_address,
sizeof(*mme_ip_address));
......@@ -197,8 +202,11 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
/* Trying to connect to provided list of MME ip address */
for (index = 0; index < s1ap_register_eNB->nb_mme; index++) {
s1ap_eNB_register_mme(new_instance, &s1ap_register_eNB->mme_ip_address[index],
&s1ap_register_eNB->enb_ip_address);
s1ap_eNB_register_mme(new_instance,
&s1ap_register_eNB->mme_ip_address[index],
&s1ap_register_eNB->enb_ip_address,
s1ap_register_eNB->sctp_in_streams,
s1ap_register_eNB->sctp_out_streams);
}
}
......
......@@ -224,13 +224,6 @@ int s1ap_eNB_handle_nas_first_req(
mme_desc_p->nextstream += 1;
}
#if defined(S1AP_LIMIT_STREAM_ID_TO_0)
mme_desc_p->nextstream = 0;
#else
# if defined(S1AP_LIMIT_STREAM_ID_TO_1)
mme_desc_p->nextstream = 1;
# endif
#endif
ue_desc_p->stream = mme_desc_p->nextstream;
MSC_LOG_TX_MESSAGE(
......
......@@ -29,8 +29,8 @@
#ifndef SCTP_DEFAULT_VALUES_H_
#define SCTP_DEFAULT_VALUES_H_
#define SCTP_OUT_STREAMS (64)
#define SCTP_IN_STREAMS (64)
#define SCTP_OUT_STREAMS (16)
#define SCTP_IN_STREAMS (16)
#define SCTP_MAX_ATTEMPTS (2)
#define SCTP_TIMEOUT (5)
#define SCTP_RECV_BUFFER_SIZE (1024)
......
......@@ -125,7 +125,7 @@ sctp_handle_new_association_req(
const task_id_t requestor,
const sctp_new_association_req_t * const sctp_new_association_req_p)
{
int sd;
int sd = 0;
int32_t assoc_id = 0;
struct sctp_event_subscribe events;
......@@ -134,8 +134,10 @@ sctp_handle_new_association_req(
enum sctp_connection_type_e connection_type = SCTP_TYPE_CLIENT;
struct ifreq ifr;
struct ifaddrs *ifaddr, *ifa;
int family, s;
struct ifaddrs *ifaddr = NULL;
struct ifaddrs *ifa = NULL;
int family = 0;
int s = 0;
struct in_addr in;
struct in6_addr in6;
/* Prepare a new SCTP association as requested by upper layer and try to connect
......@@ -144,6 +146,7 @@ sctp_handle_new_association_req(
DevAssert(sctp_new_association_req_p != NULL);
/* Create new socket with IPv6 affinity */
#warning "SCTP may Force IPv4 only, here"
#ifdef NO_VIRTUAL_MACHINE
// in init chunk appears a list of host addresses, IPv4 and IPv4 in an arbitrary (unsorted) order
......@@ -162,7 +165,9 @@ sctp_handle_new_association_req(
/* Add the socket to list of fd monitored by ITTI */
itti_subscribe_event_fd(TASK_SCTP, sd);
if (sctp_set_init_opt(sd, SCTP_IN_STREAMS, SCTP_OUT_STREAMS,
if (sctp_set_init_opt(sd,
sctp_new_association_req_p->in_streams,
sctp_new_association_req_p->out_streams,
SCTP_MAX_ATTEMPTS, SCTP_TIMEOUT) != 0) {
SCTP_ERROR("Setsockopt IPPROTO_SCTP_INITMSG failed: %s\n",
strerror(errno));
......
......@@ -55,6 +55,8 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
net_ip_address_t *mme_ip_address,
net_ip_address_t *local_ip_addr);
net_ip_address_t *local_ip_addr,
uint16_t in_streams,
uint16_t out_streams);
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB);
void *s1ap_eNB_task(void *arg);
......@@ -653,10 +653,6 @@ static void usage(void)
fprintf(stdout, "Usage: oaisim_mme [options]\n\n");
fprintf(stdout, "Available options:\n");
fprintf(stdout, "-h Print this help and return\n");
fprintf(stdout, "-i<interface name>\n");
fprintf(stdout, " Set the network card to use for IPv4 forwarding\n");
fprintf(stdout, "-m\n");
fprintf(stdout, " Use mscgen dump trace tool\n");
fprintf(stdout, "-c<path>\n");
fprintf(stdout, " Set the configuration file for mme\n");
fprintf(stdout, " See template in UTILS/CONF\n");
......@@ -677,7 +673,7 @@ int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config_p)
mme_config_init(mme_config_p);
/* Parsing command line */
while ((c = getopt (argc, argv, "O:c:hi:K:mv:V")) != -1) {
while ((c = getopt (argc, argv, "O:c:hi:K:v:V")) != -1) {
switch (c) {
case 'O':
case 'c': {
......@@ -692,21 +688,6 @@ int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config_p)
}
break;
case 'm': {
fprintf(stdout, "Logging Message chart(mscgen)\n");
MSC_INIT(MSC_MME_GW, THREAD_MAX+TASK_MAX);
}
break;
/*case 'i': {
int interface_len = 0;
// Copying provided interface name to use for ipv4 forwarding
interface_len = strlen(optarg);
mme_config_p->ipv4.sgw_interface_name_for_S1u_S12_S4_up = calloc(interface_len + 1, sizeof(char));
memcpy(mme_config_p->ipv4.sgw_interface_name_for_S1u_S12_S4_up, optarg, interface_len);
mme_config_p->ipv4.sgw_interface_name_for_S1u_S12_S4_up[interface_len] = '\0';
} break;*/
case 'v': {
mme_config_p->verbosity_level = atoi(optarg);
}
......
......@@ -59,8 +59,8 @@
******************************************************************************/
#define SCTP_RECV_BUFFER_SIZE (1 << 16)
#define SCTP_OUT_STREAMS (64)
#define SCTP_IN_STREAMS (64)
#define SCTP_OUT_STREAMS (32)
#define SCTP_IN_STREAMS (32)
#define SCTP_MAX_ATTEMPTS (5)
/*******************************************************************************
......
......@@ -317,6 +317,10 @@ typedef struct s1ap_register_enb_req_s {
uint8_t nb_mme;
/* List of MME to connect to */
net_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
} s1ap_register_enb_req_t;
//-------------------------------------------------------------------------------------------//
......
......@@ -54,6 +54,10 @@ typedef struct sctp_new_association_req_s {
/* Payload Protocol Identifier to use */
uint32_t ppid;
/* Number of streams used for this association */
uint16_t in_streams;
uint16_t out_streams;
/* Local address to bind to */
net_ip_address_t local_address;
/* Remote address to connect to */
......
......@@ -245,6 +245,10 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address));
}
s1ap_register_eNB->sctp_in_streams = enb_properties->properties[enb_id]->sctp_in_streams;
s1ap_register_eNB->sctp_out_streams = enb_properties->properties[enb_id]->sctp_out_streams;
s1ap_register_eNB->enb_ip_address.ipv6 = 0;
s1ap_register_eNB->enb_ip_address.ipv4 = 1;
addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME;
......
......@@ -56,6 +56,7 @@
# include "sctp_eNB_task.h"
# endif
#endif
#include "sctp_default_values.h"
#include "SystemInformationBlockType2.h"
#include "LAYER2/MAC/extern.h"
......@@ -158,6 +159,10 @@
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference"
#define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP"
#define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS"
#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS"
#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"
......@@ -551,6 +556,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
libconfig_int srb1_poll_byte = 0;
libconfig_int srb1_max_retx_threshold = 0;
libconfig_int my_int;
char* ipv4 = NULL;
char* ipv6 = NULL;
char* active = NULL;
......@@ -593,9 +600,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
config_init(&cfg);
if(lib_config_file_name_pP != NULL) {
if (lib_config_file_name_pP != NULL) {
/* Read the file. If there is an error, report it and exit. */
if(! config_read_file(&cfg, lib_config_file_name_pP)) {
if (! config_read_file(&cfg, lib_config_file_name_pP)) {
config_destroy(&cfg);
AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
}
......@@ -606,7 +613,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) {
if ( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) {
if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0;
asn1_xer_print = 0;
......@@ -626,7 +633,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
// Get list of active eNBs, (only these will be configured)
setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS);
if(setting != NULL) {
if (setting != NULL) {
num_enbs = config_setting_length(setting);
for (i = 0; i < num_enbs; i++) {
......@@ -643,7 +650,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
/* Output a list of all eNBs. */
setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST);
if(setting != NULL) {
if (setting != NULL) {
enb_properties_index = 0;
parse_errors = 0;
num_enbs = config_setting_length(setting);
......@@ -651,7 +658,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
for (i = 0; i < num_enbs; i++) {
setting_enb = config_setting_get_elem(setting, i);
if(! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) {
if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) {
/* Calculate a default eNB ID */
# if defined(ENABLE_USE_MME)
uint32_t hash;
......@@ -663,7 +670,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
# endif
}
if( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type)
if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type)
&& 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)
......@@ -712,7 +719,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
setting_component_carriers = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_COMPONENT_CARRIERS);
enb_properties.properties[enb_properties_index]->nb_cc = 0;
if(setting_component_carriers != NULL) {
if (setting_component_carriers != NULL) {
num_component_carriers = config_setting_length(setting_component_carriers);
printf("num component carrier %d \n", num_component_carriers);
......@@ -722,7 +729,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
component_carrier = config_setting_get_elem(setting_component_carriers, j);
//printf("Component carrier %d\n",component_carrier);
if(!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type)
if (!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type)
&& 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)
......@@ -2095,7 +2102,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
for (j = 0; j < num_mme_address; j++) {
setting_mme_address = config_setting_get_elem(setting_mme_addresses, j);
if( !(
if ( !(
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)
......@@ -2130,11 +2137,28 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
}
// 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
// NETWORK_INTERFACES
subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
if(subsetting != NULL) {
if( (
if (subsetting != NULL) {
if ( (
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,
......@@ -2170,7 +2194,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
// OTG _CONFIG
setting_otg = config_setting_get_member (setting_enb, ENB_CONF_STRING_OTG_CONFIG);
if(setting_otg != NULL) {
if (setting_otg != NULL) {
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;
......@@ -2178,13 +2202,13 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
for (j = 0; j < num_otg_elements; j++) {
subsetting_otg=config_setting_get_elem(setting_otg, j);
if(config_setting_lookup_int(subsetting_otg, ENB_CONF_STRING_OTG_UE_ID, &otg_ue_id)) {
if (config_setting_lookup_int(subsetting_otg, ENB_CONF_STRING_OTG_UE_ID, &otg_ue_id)) {
enb_properties.properties[enb_properties_index]->otg_ue_id[j] = otg_ue_id;
} else {
enb_properties.properties[enb_properties_index]->otg_ue_id[j] = 1;
}
if(config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_APP_TYPE, (const char **)&otg_app_type)) {
if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_APP_TYPE, (const char **)&otg_app_type)) {
if ((enb_properties.properties[enb_properties_index]->otg_app_type[j] = map_str_to_int(otg_app_type_names,otg_app_type))== -1) {
enb_properties.properties[enb_properties_index]->otg_app_type[j] = BCBR;
}
......@@ -2192,7 +2216,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->otg_app_type[j] = NO_PREDEFINED_TRAFFIC; // 0
}
if(config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_BG_TRAFFIC, (const char **)&otg_bg_traffic)) {
if (config_setting_lookup_string(subsetting_otg, ENB_CONF_STRING_OTG_BG_TRAFFIC, (const char **)&otg_bg_traffic)) {
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;
......@@ -2210,9 +2234,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
// log_config
subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_LOG_CONFIG);
if(subsetting != NULL) {
if (subsetting != NULL) {
// global
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL, (const char **) &glog_level)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL, (const char **) &glog_level)) {
if ((enb_properties.properties[enb_properties_index]->glog_level = map_str_to_int(log_level_names, glog_level)) == -1) {
enb_properties.properties[enb_properties_index]->glog_level = LOG_INFO;
}
......@@ -2222,7 +2246,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->glog_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,(const char **) &glog_verbosity)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,(const char **) &glog_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->glog_verbosity = map_str_to_int(log_verbosity_names, glog_verbosity)) == -1) {
enb_properties.properties[enb_properties_index]->glog_verbosity = LOG_MED;
}
......@@ -2233,7 +2257,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
// HW
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_LEVEL, (const char **) &hw_log_level)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_LEVEL, (const char **) &hw_log_level)) {
if ((enb_properties.properties[enb_properties_index]->hw_log_level = map_str_to_int(log_level_names,hw_log_level)) == -1) {
enb_properties.properties[enb_properties_index]->hw_log_level = LOG_INFO;
}
......@@ -2243,7 +2267,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->hw_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_VERBOSITY, (const char **) &hw_log_verbosity)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_VERBOSITY, (const char **) &hw_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->hw_log_verbosity = map_str_to_int(log_verbosity_names,hw_log_verbosity)) == -1) {
enb_properties.properties[enb_properties_index]->hw_log_verbosity = LOG_MED;
}
......@@ -2254,7 +2278,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
// phy
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_LEVEL,(const char **) &phy_log_level)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_LEVEL,(const char **) &phy_log_level)) {
if ((enb_properties.properties[enb_properties_index]->phy_log_level = map_str_to_int(log_level_names,phy_log_level)) == -1) {
enb_properties.properties[enb_properties_index]->phy_log_level = LOG_INFO;
}
......@@ -2264,7 +2288,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->phy_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_VERBOSITY, (const char **)&phy_log_verbosity)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_VERBOSITY, (const char **)&phy_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->phy_log_verbosity = map_str_to_int(log_verbosity_names,phy_log_verbosity)) == -1) {
enb_properties.properties[enb_properties_index]->phy_log_verbosity = LOG_MED;
}
......@@ -2275,7 +2299,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
//mac
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_LEVEL, (const char **)&mac_log_level)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_LEVEL, (const char **)&mac_log_level)) {
if ((enb_properties.properties[enb_properties_index]->mac_log_level = map_str_to_int(log_level_names,mac_log_level)) == -1 ) {
enb_properties.properties[enb_properties_index]->mac_log_level = LOG_INFO;
}
......@@ -2285,7 +2309,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->mac_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_VERBOSITY, (const char **)&mac_log_verbosity)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_VERBOSITY, (const char **)&mac_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->mac_log_verbosity = map_str_to_int(log_verbosity_names,mac_log_verbosity)) == -1) {
enb_properties.properties[enb_properties_index]->mac_log_verbosity = LOG_MED;
}
......@@ -2296,7 +2320,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
//rlc
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_LEVEL, (const char **)&rlc_log_level)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_LEVEL, (const char **)&rlc_log_level)) {
if ((enb_properties.properties[enb_properties_index]->rlc_log_level = map_str_to_int(log_level_names,rlc_log_level)) == -1) {
enb_properties.properties[enb_properties_index]->rlc_log_level = LOG_INFO;
}
......@@ -2306,7 +2330,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->rlc_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_VERBOSITY, (const char **)&rlc_log_verbosity)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_VERBOSITY, (const char **)&rlc_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->rlc_log_verbosity = map_str_to_int(log_verbosity_names,rlc_log_verbosity)) == -1) {
enb_properties.properties[enb_properties_index]->rlc_log_verbosity = LOG_MED;
}
......@@ -2317,7 +2341,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
//pdcp
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_LEVEL, (const char **)&pdcp_log_level)) {
if (config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_LEVEL, (const char **)&pdcp_log_level)) {
if ((enb_properties.properties[enb_properties_index]->pdcp_log_level = map_str_to_int(log_level_names,pdcp_log_level)) == -1) {
enb_properties.properties[enb_properties_index]->pdcp_log_level = LOG_INFO;
}
......@@ -2327,7 +2351,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->pdcp_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY, (const char **)&pdcp_log_verbosity)) {
if (config_setting_lookup_string(subsetting, ENB_CO