Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常顺宇
OpenXG-RAN
Commits
cdca16f6
Commit
cdca16f6
authored
Sep 04, 2017
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add configuration module, with compilation, but not yet integrated in softmodem
parent
f962c2e3
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1783 additions
and
293 deletions
+1783
-293
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+15
-2
cmake_targets/build_oai
cmake_targets/build_oai
+8
-0
common/config/config_cmdline.c
common/config/config_cmdline.c
+121
-0
common/config/config_load_configmodule.c
common/config/config_load_configmodule.c
+210
-0
common/config/config_load_configmodule.h
common/config/config_load_configmodule.h
+93
-0
common/config/config_paramdesc.h
common/config/config_paramdesc.h
+108
-0
common/config/config_userapi.c
common/config/config_userapi.c
+91
-0
common/config/config_userapi.h
common/config/config_userapi.h
+54
-0
common/config/libconfig/config_libconfig.c
common/config/libconfig/config_libconfig.c
+337
-0
common/config/libconfig/config_libconfig.h
common/config/libconfig/config_libconfig.h
+54
-0
common/config/libconfig/config_libconfig_private.h
common/config/libconfig/config_libconfig_private.h
+39
-0
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+1
-291
openair2/ENB_APP/enb_paramdef.h
openair2/ENB_APP/enb_paramdef.h
+652
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
cdca16f6
...
...
@@ -485,8 +485,20 @@ add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
add_list2_option
(
RF_BOARD
"EXMIMO"
"RF head type"
"None"
"EXMIMO"
"OAI_USRP"
"OAI_BLADERF"
"CPRIGW"
"OAI_LMSSDR"
)
add_list2_option
(
TRANSP_PRO
"None"
"Transport protocol type"
"None"
"ETHERNET"
)
#NOKIA config enhancement
set
(
CONFIG_ROOTDIR
${
OPENAIR_DIR
}
/common/config
)
set
(
CONFIG_SOURCES
${
CONFIG_ROOTDIR
}
/config_load_configmodule.c
${
CONFIG_ROOTDIR
}
/config_userapi.c
${
CONFIG_ROOTDIR
}
/config_cmdline.c
)
set
(
CONFIG_LIBCONFIG_SOURCES
${
CONFIG_ROOTDIR
}
/libconfig/config_libconfig.c
)
add_library
(
params_libconfig MODULE
${
CONFIG_LIBCONFIG_SOURCES
}
)
target_link_libraries
(
params_libconfig config
)
# include RF devices / transport protocols library modules
######################################################################
...
...
@@ -1721,6 +1733,7 @@ add_executable(lte-softmodem
${
XFORMS_SOURCE
}
${
XFORMS_SOURCE_SOFTMODEM
}
${
T_SOURCE
}
${
CONFIG_SOURCES
}
)
target_link_libraries
(
lte-softmodem -ldl
...
...
cmake_targets/build_oai
View file @
cdca16f6
...
...
@@ -478,6 +478,9 @@ function main() {
lte_exec
=
lte-softmodem
fi
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib
=
params_libconfig
# first generate the CMakefile in the right directory
if
[
"
$eNB
"
=
"1"
-o
"
$UE
"
=
"1"
-o
"
$HW
"
=
"EXMIMO"
]
;
then
...
...
@@ -520,6 +523,11 @@ function main() {
$lte_build_dir
$lte_exec
\
$lte_exec
$dbin
/
$lte_exec
.
$REL
# mandatory shared lib
compilations
\
$lte_build_dir
$config_libconfig_shlib
\
lib
$config_libconfig_shlib
.so
$dbin
/lib
$config_libconfig_shlib
.so
if
[
"
$NOS1
"
=
"1"
]
;
then
compilations
\
$lte_build_dir
nasmesh
\
...
...
common/config/config_cmdline.c
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/cmdline/config_libconfig.c
* \brief configuration module, command line parsing implementation
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "config_userapi.h"
int
processoption
(
paramdef_t
*
cfgoptions
,
char
*
value
)
{
int
ret
=
0
;
switch
(
cfgoptions
->
type
)
{
case
TYPE_STRING
:
check_valptr
(
cfgoptions
,
(
char
**
)(
cfgoptions
->
strptr
),
sizeof
(
char
*
));
check_valptr
(
cfgoptions
,
cfgoptions
->
strptr
,
strlen
(
value
+
1
));
sprintf
(
*
(
cfgoptions
->
strptr
),
"%s"
,
value
);
printf_cmdl
(
"[LIBCONFIG] %s set to %s from command line
\n
"
,
cfgoptions
->
optname
,
value
);
ret
++
;
break
;
case
TYPE_STRINGLIST
:
break
;
case
TYPE_UINT
:
case
TYPE_INT
:
case
TYPE_UINT64
:
case
TYPE_INT64
:
check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
i64ptr
),
sizeof
(
uint64_t
));
*
(
cfgoptions
->
uptr
)
=
strtol
(
value
,
NULL
,
0
);
printf_cmdl
(
"[LIBCONFIG] %s set to %lli from command line
\n
"
,
cfgoptions
->
optname
,
(
long
long
)
*
(
cfgoptions
->
i64ptr
));
ret
++
;
break
;
case
TYPE_UINTARRAY
:
case
TYPE_INTARRAY
:
break
;
case
TYPE_IPV4ADDR
:
break
;
default:
fprintf
(
stderr
,
"[LIBCONFIG] command line, %s type %i not supported
\n
"
,
cfgoptions
->
optname
,
cfgoptions
->
type
);
break
;
}
/* switch on param type */
return
ret
;
}
int
config_process_cmdline
(
paramdef_t
*
cfgoptions
,
int
numoptions
,
char
*
prefix
)
{
char
**
p
=
config_get_if
()
->
argv
;
int
c
=
config_get_if
()
->
argc
;
int
j
;
char
*
cfgpath
;
j
=
(
prefix
==
NULL
)
?
0
:
strlen
(
prefix
);
cfgpath
=
malloc
(
j
+
MAX_OPTNAME_SIZE
+
1
);
if
(
cfgpath
==
NULL
)
{
fprintf
(
stderr
,
"[CONFIG] %s %i malloc error, %s
\n
"
,
__FILE__
,
__LINE__
,
strerror
(
errno
));
return
-
1
;
}
j
=
0
;
p
++
;
c
--
;
while
(
c
>=
0
&&
*
p
!=
NULL
)
{
if
(
strcmp
(
*
p
,
"-h"
)
==
0
||
strcmp
(
*
p
,
"--help"
)
==
0
)
{
config_printhelp
(
cfgoptions
,
numoptions
);
}
for
(
int
i
=
0
;
i
<
numoptions
;
i
++
)
{
if
(
(
cfgoptions
[
i
].
paramflags
&
PARAMFLAG_DISABLECMDLINE
)
!=
0
)
{
continue
;
}
sprintf
(
cfgpath
,
"%s.%s"
,
prefix
,
cfgoptions
[
i
].
optname
);
if
(
strcmp
(
*
p
+
1
,
cfgoptions
[
i
].
shortopt
)
==
0
||
strcmp
(
*
p
+
2
,
cfgpath
)
==
0
)
{
p
++
;
j
=+
processoption
(
&
(
cfgoptions
[
i
]),
*
p
);
c
--
;
}
}
p
++
;
c
--
;
}
/* fin du while */
printf_cmdl
(
"[CONFIG] %s %i options set from command line
\n
"
,((
prefix
==
NULL
)
?
""
:
prefix
),
j
);
free
(
cfgpath
);
return
j
;
}
/* parse_cmdline*/
common/config/config_load_configmodule.c
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/config_load_configmodule.c
* \brief configuration module, load the shared library implementing the configuration module
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <dlfcn.h>
#define CONFIG_LOADCONFIG_MAIN
#include "config_load_configmodule.h"
#include "config_userapi.h"
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
int
load_config_sharedlib
(
char
*
cfgmode
,
char
*
cfgP
[],
int
numP
,
configmodule_interface_t
*
cfgptr
)
{
void
*
lib_handle
;
char
fname
[
128
];
char
libname
[
FILENAME_MAX
];
int
st
;
st
=
0
;
sprintf
(
libname
,
CONFIG_SHAREDLIBFORMAT
,
cfgmode
);
lib_handle
=
dlopen
(
libname
,
RTLD_NOW
|
RTLD_GLOBAL
|
RTLD_NODELETE
);
if
(
!
lib_handle
)
{
fprintf
(
stderr
,
"[CONFIG] %s %d Error calling dlopen(%s): %s
\n
"
,
__FILE__
,
__LINE__
,
libname
,
dlerror
());
st
=
-
1
;
}
else
{
sprintf
(
fname
,
"config_%s_init"
,
cfgmode
);
cfgptr
->
init
=
dlsym
(
lib_handle
,
fname
);
if
(
cfgptr
->
init
==
NULL
)
{
printf
(
"[CONFIG] %s %d no function %s for config mode %s
\n
"
,
__FILE__
,
__LINE__
,
fname
,
cfgmode
);
}
else
{
st
=
cfgptr
->
init
(
cfgP
,
numP
);
printf
(
"[CONFIG] function %s returned %i
\n
"
,
fname
,
st
);
}
sprintf
(
fname
,
"config_%s_get"
,
cfgmode
);
cfgptr
->
get
=
dlsym
(
lib_handle
,
fname
);
if
(
cfgptr
->
get
==
NULL
)
{
printf
(
"[CONFIG] %s %d no function %s for config mode %s
\n
"
,
__FILE__
,
__LINE__
,
fname
,
cfgmode
);
st
=
-
1
;
}
sprintf
(
fname
,
"config_%s_getlist"
,
cfgmode
);
cfgptr
->
getlist
=
dlsym
(
lib_handle
,
fname
);
if
(
cfgptr
->
getlist
==
NULL
)
{
printf
(
"[CONFIG] %s %d no function %s for config mode %s
\n
"
,
__FILE__
,
__LINE__
,
fname
,
cfgmode
);
st
=
-
1
;
}
sprintf
(
fname
,
"config_%s_end"
,
cfgmode
);
cfgptr
->
end
=
dlsym
(
lib_handle
,
fname
);
if
(
cfgptr
->
getlist
==
NULL
)
{
printf
(
"[CONFIG] %s %d no function %s for config mode %s
\n
"
,
__FILE__
,
__LINE__
,
fname
,
cfgmode
);
}
}
return
st
;
}
/*-----------------------------------------------------------------------------------*/
/* from here: interface implementtion of the configuration module */
configmodule_interface_t
*
load_configmodule
(
int
argc
,
char
**
argv
)
{
char
*
cfgparam
=
NULL
;
char
*
modeparams
=
NULL
;
char
*
cfgmode
=
NULL
;
char
*
strtokctx
=
NULL
;
char
*
cfgP
[
CONFIG_MAX_OOPT_PARAMS
];
int
i
;
int
p
;
for
(
i
=
0
;
i
<
CONFIG_MAX_OOPT_PARAMS
;
i
++
)
{
cfgP
[
i
]
=
NULL
;
}
/* first parse the command line to look for the -O option */
opterr
=
0
;
while
((
i
=
getopt
(
argc
,
argv
,
"O:"
))
!=
-
1
)
{
if
(
i
==
'O'
)
{
cfgparam
=
optarg
;
}
}
/* look for the OAI_CONFIGMODULE environement variable */
if
(
cfgparam
==
NULL
)
{
cfgparam
=
getenv
(
"OAI_CONFIGMODULE"
);
}
/* default */
if
(
cfgparam
==
NULL
)
{
cfgparam
=
"libconfig:oaisoftmodem.conf"
;
}
/* parse the config parameters to set the config source */
i
=
sscanf
(
cfgparam
,
"%m[^':']:%ms"
,
&
cfgmode
,
&
modeparams
);
if
(
i
<
0
)
{
fprintf
(
stderr
,
"[CONFIG] %s, %d, sscanf error parsing config source %s: %s
\n
"
,
__FILE__
,
__LINE__
,
cfgparam
,
strerror
(
errno
));
return
NULL
;
}
else
if
(
i
==
1
)
{
modeparams
=
cfgmode
;
cfgmode
=
strdup
(
"libconfig"
);
}
cfgptr
=
malloc
(
sizeof
(
configmodule_interface_t
));
p
=
0
;
cfgP
[
p
]
=
strtok_r
(
modeparams
,
":"
,
&
strtokctx
);
while
(
p
<
CONFIG_MAX_OOPT_PARAMS
&&
cfgP
[
p
]
!=
NULL
)
{
char
*
aptr
;
aptr
=
strcasestr
(
cfgP
[
p
],
"dbgl"
);
if
(
aptr
!=
NULL
)
{
cfgptr
->
rtflags
=
strtol
(
aptr
+
4
,
NULL
,
0
);
Config_Params
[
CONFIGPARAM_DEBUGFLAGS_IDX
].
paramflags
=
Config_Params
[
CONFIGPARAM_DEBUGFLAGS_IDX
].
paramflags
|
PARAMFLAG_DONOTREAD
;
for
(
int
j
=
p
;
j
<
(
CONFIG_MAX_OOPT_PARAMS
-
1
);
j
++
)
cfgP
[
j
]
=
cfgP
[
j
+
1
];
p
--
;
}
p
++
;
cfgP
[
p
]
=
strtok_r
(
NULL
,
":"
,
&
strtokctx
);
}
printf
(
"[CONFIG] get parameters from %s "
,
cfgmode
);
for
(
i
=
0
;
i
<
p
;
i
++
)
{
printf
(
"%s "
,
cfgP
[
i
]);
}
printf
(
"
\n
"
);
i
=
load_config_sharedlib
(
cfgmode
,
cfgP
,
p
,
cfgptr
);
if
(
i
<
0
)
{
fprintf
(
stderr
,
"[CONFIG] %s %d config module %s couldn't be loaded
\n
"
,
__FILE__
,
__LINE__
,
cfgmode
);
return
NULL
;
}
else
{
printf
(
"[CONFIG] config module %s loaded
\n
"
,
cfgmode
);
}
Config_Params
[
CONFIGPARAM_DEBUGFLAGS_IDX
].
uptr
=&
(
cfgptr
->
rtflags
);
config_get
(
Config_Params
,
CONFIG_PARAMLENGTH
(
Config_Params
),
CONFIG_SECTIONNAME
);
if
(
modeparams
!=
NULL
)
free
(
modeparams
);
if
(
cfgmode
!=
NULL
)
free
(
cfgmode
);
optind
=
1
;
cfgptr
->
argc
=
argc
;
cfgptr
->
argv
=
argv
;
return
cfgptr
;
}
void
end_configmodule
()
{
if
(
cfgptr
!=
NULL
)
{
printf
(
"[CONFIG] free %u pointers
\n
"
,
cfgptr
->
numptrs
);
for
(
int
i
=
0
;
i
<
cfgptr
->
numptrs
;
i
++
)
{
if
(
cfgptr
->
ptrs
[
i
]
!=
NULL
)
{
free
(
cfgptr
->
ptrs
[
i
]);
}
cfgptr
->
ptrs
[
i
]
=
NULL
;
}
if
(
cfgptr
->
end
!=
NULL
)
{
printf
(
"[CONFIG] calling config module end function...
\n
"
);
cfgptr
->
end
();
}
free
(
cfgptr
);
cfgptr
=
NULL
;
}
}
common/config/config_load_configmodule.h
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/config_load_configmodule.h
* \brief: configuration module, include file to be used by the source code calling the
* configuration module initialization
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#ifndef INCLUDE_CONFIG_LOADCONFIGMODULE_H
#define INCLUDE_CONFIG_LOADCONFIGMODULE_H
#include <string.h>
#include <stdlib.h>
#include "common/config/config_paramdesc.h"
#define CONFIG_MAX_OOPT_PARAMS 10 // maximum number of parameters in the -O option (-O <cfgmode>:P1:P2...
#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly alloted in the config module
/* rtflags bit position definitions */
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
#define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
typedef
int
(
*
configmodule_initfunc_t
)(
char
*
cfgP
[],
int
numP
);
typedef
int
(
*
configmodule_getfunc_t
)(
paramdef_t
*
,
int
numparams
,
char
*
prefix
);
typedef
int
(
*
configmodule_getlistfunc_t
)(
paramlist_def_t
*
,
paramdef_t
*
,
int
numparams
,
char
*
prefix
);
typedef
void
(
*
configmodule_endfunc_t
)(
void
);
typedef
struct
configmodule_interface
{
int
argc
;
char
**
argv
;
configmodule_initfunc_t
init
;
configmodule_getfunc_t
get
;
configmodule_getlistfunc_t
getlist
;
configmodule_endfunc_t
end
;
uint32_t
numptrs
;
uint32_t
rtflags
;
char
*
ptrs
[
CONFIG_MAX_ALLOCATEDPTRS
];
}
configmodule_interface_t
;
#ifdef CONFIG_LOADCONFIG_MAIN
configmodule_interface_t
*
cfgptr
=
NULL
;
static
char
config_helpstr
[]
=
" \
config debugflags: mask, 1->print parameters, 2->print memory allocations debug messages \
4->print command line processing debug messages \
-O <config mode><:dbg> \
debugflags can also be defined in the config_libconfig section of the config file \
"
;
#define CONFIG_SECTIONNAME "config"
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
static
paramdef_t
Config_Params
[]
=
{
{
"debugflags"
,
""
,
config_helpstr
,
0
,
uptr
:
NULL
,
defintval
:
0
,
TYPE_UINT
,
0
},
};
#else
extern
configmodule_interface_t
*
cfgptr
;
#endif
#define printf_params(...) if ( (cfgptr->rtflags & CONFIG_PRINTPARAMS) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_ptrs(...) if ( (cfgptr->rtflags & CONFIG_DEBUGPTR) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_cmdl(...) if ( (cfgptr->rtflags & CONFIG_DEBUGCMDLINE) != 0 ) { printf ( __VA_ARGS__ ); }
extern
configmodule_interface_t
*
load_configmodule
(
int
argc
,
char
**
argv
);
extern
void
end_configmodule
(
void
);
#endif
/* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
common/config/config_paramdesc.h
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/config_paramdesc.h
* \brief configuration module, include file describing parameters, common to all implementations
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#include <stdint.h>
#ifndef INCLUDE_CONFIG_PARAMDESC_H
#define INCLUDE_CONFIG_PARAMDESC_H
#define MAX_OPTNAME_SIZE 64
#define MAX_SHORTOPT_SIZE 8
/* parameter flags definitions */
/* Flags to be used by calling modules in their parameters definitions: */
#define PARAMFLAG_DISABLECMDLINE (1 << 0) // parameter can bet set from comand line
/* Flags used by config modules: */
/* flags to be used by caller modules when defining parameters */
#define PARAMFLAG_MANDATORY (1 << 1) // parameter must be explicitely set, default value ignored
/* flags used by config modules, at runtime to manage memory allocations */
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module
#define PARAMFLAG_NOFREE (1 << 14) // don't free parameter in end function
/* flags to be used by caller modules to modify get behavior */
#define PARAMFLAG_DONOTREAD (1 << 20) // parameter must be ignored in get function
typedef
struct
paramdef
{
char
optname
[
MAX_OPTNAME_SIZE
];
char
shortopt
[
MAX_SHORTOPT_SIZE
];
char
*
helpstr
;
unsigned
int
paramflags
;
union
{
char
**
strptr
;
char
**
strlistptr
;
uint32_t
*
uptr
;
int32_t
*
iptr
;
uint64_t
*
u64ptr
;
int64_t
*
i64ptr
;
}
;
union
{
char
*
defstrval
;
char
**
defstrlistval
;
uint32_t
defuintval
;
int
defintval
;
uint64_t
defint64val
;
int
*
defintarrayval
;
}
;
char
type
;
int
numelt
;
}
paramdef_t
;
#define TYPE_STRING 1
#define TYPE_INT 2
#define TYPE_UINT 3
#define TYPE_INT64 4
#define TYPE_UINT64 5
#define TYPE_IPV4ADDR 20
#define TYPE_STRINGLIST 50
#define TYPE_INTARRAY 51
#define TYPE_UINTARRAY 52
#define TYPE_LIST 55
#define NO_UINTDEFAULT ((int)(-1))
#define ANY_IPV4ADDR_STRING "0.0.0.0"
typedef
struct
paramlist_def
{
char
listname
[
MAX_OPTNAME_SIZE
];
paramdef_t
**
paramarray
;
int
numelt
;
}
paramlist_def_t
;
/* macro helpers for module users */
#define CONFIG_PARAMLENGTH(A) (sizeof(A)/sizeof(paramdef_t))
#endif
/* INCLUDE_CONFIG_PARAMDESC_H */
common/config/config_userapi.c
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/config_userapi.c
* \brief configuration module, api implementation to access configuration parameters
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <dlfcn.h>
#include "config_userapi.h"
configmodule_interface_t
*
config_get_if
(
void
)
{
if
(
cfgptr
==
NULL
)
{
fprintf
(
stderr
,
"[CONFIG] %s %d config module not initialized
\n
"
,
__FILE__
,
__LINE__
);
exit
(
-
1
);
}
return
cfgptr
;
}
char
*
check_valptr
(
paramdef_t
*
cfgoptions
,
char
**
ptr
,
int
length
)
{
printf_ptrs
(
"-- %s 0x%08lx %i
\n
"
,
cfgoptions
->
optname
,(
uintptr_t
)(
*
ptr
),
length
);
if
(
*
ptr
==
NULL
)
{
*
ptr
=
malloc
(
length
);
if
(
*
ptr
!=
NULL
)
{
memset
(
*
ptr
,
0
,
length
);
if
(
(
cfgoptions
->
paramflags
&
PARAMFLAG_NOFREE
)
!=
0
)
{
config_get_if
()
->
ptrs
[
config_get_if
()
->
numptrs
]
=
*
ptr
;
config_get_if
()
->
numptrs
++
;
}
}
else
{
fprintf
(
stderr
,
"[LIBCONFIG] %s %d malloc error
\n
"
,
__FILE__
,
__LINE__
);
exit
(
-
1
);
}
}
return
*
ptr
;
}
void
config_printhelp
(
paramdef_t
*
params
,
int
numparams
)
{
for
(
int
i
=
0
;
i
<
numparams
;
i
++
)
{
if
(
params
[
i
].
helpstr
!=
NULL
)
{
printf
(
"%s"
,
params
[
i
].
helpstr
);
}
}
}
int
config_get
(
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
)
{
int
ret
=
-
1
;
configmodule_interface_t
*
cfgif
=
config_get_if
();
if
(
cfgif
!=
NULL
)
{
ret
=
config_get_if
()
->
get
(
params
,
numparams
,
prefix
);
if
(
ret
>=
0
)
{
config_process_cmdline
(
params
,
numparams
,
prefix
);
}
return
ret
;
}
return
ret
;
}
common/config/config_userapi.h
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/config_userapi.h
* \brief: configuration module, include file to be used by the source code calling the
* configuration module to access configuration parameters
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#ifndef INCLUDE_CONFIG_USERAPI_H
#define INCLUDE_CONFIG_USERAPI_H
#include "config_load_configmodule.h"
#ifdef __cplusplus
extern
"C"
{
#endif
extern
configmodule_interface_t
*
config_get_if
(
void
);
extern
char
*
check_valptr
(
paramdef_t
*
cfgoptions
,
char
**
ptr
,
int
length
)
;
extern
void
config_printhelp
(
paramdef_t
*
,
int
numparams
);
extern
int
config_process_cmdline
(
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
);
extern
int
config_get
(
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
);
#define config_getlist config_get_if()->getlist
#ifdef __cplusplus
}
#endif
#endif
common/config/libconfig/config_libconfig.c
0 → 100644
View file @
cdca16f6
#define _GNU_SOURCE
#include <libconfig.h>
#include <string.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include "config_libconfig.h"
#include "config_libconfig_private.h"
#include "../config_userapi.h"
#include "errno.h"
void
config_libconfig_end
(
void
);
int
read_strlist
(
paramdef_t
*
cfgoptions
,
config_setting_t
*
setting
,
char
*
cfgpath
)
{
const
char
*
str
;
int
st
;
cfgoptions
->
numelt
=
config_setting_length
(
setting
);
cfgoptions
->
strlistptr
=
malloc
(
sizeof
(
char
*
)
*
(
cfgoptions
->
numelt
));
st
=
0
;
for
(
int
i
=
0
;
i
<
cfgoptions
->
numelt
&&
cfgoptions
->
strlistptr
!=
NULL
;
i
++
)
{
str
=
config_setting_get_string_elem
(
setting
,
i
);
if
(
str
==
NULL
)
{
printf
(
"[LIBCONFIG] %s%i not found in config file
\n
"
,
cfgoptions
->
optname
,
i
);
}
else
{
cfgoptions
->
strlistptr
[
i
]
=
malloc
(
strlen
(
str
)
+
1
);
sprintf
(
cfgoptions
->
strlistptr
[
i
],
"%s"
,
str
);
st
++
;
printf_params
(
"[LIBCONFIG] %s%i: %s
\n
"
,
cfgpath
,
i
,
cfgoptions
->
strlistptr
[
i
]);
}
}
return
st
;
}
int
read_intarray
(
paramdef_t
*
cfgoptions
,
config_setting_t
*
setting
,
char
*
cfgpath
)
{
cfgoptions
->
numelt
=
config_setting_length
(
setting
);
if
(
cfgoptions
->
numelt
>
0
)
{
cfgoptions
->
iptr
=
malloc
(
sizeof
(
int
)
*
(
cfgoptions
->
numelt
));
for
(
int
i
=
0
;
i
<
cfgoptions
->
numelt
&&
cfgoptions
->
iptr
!=
NULL
;
i
++
)
{
cfgoptions
->
iptr
[
i
]
=
config_setting_get_int_elem
(
setting
,
i
);
printf_params
(
"[LIBCONFIG] %s[%i]: %i
\n
"
,
cfgpath
,
i
,
cfgoptions
->
iptr
[
i
]);
}
/* for loop on array element... */
}
return
cfgoptions
->
numelt
;
}
int
config_libconfig_get
(
paramdef_t
*
cfgoptions
,
int
numoptions
,
char
*
prefix
)
{
config_setting_t
*
setting
;
const
char
*
str
;
int
i
,
u
;
long
long
int
llu
;
int
rst
;
int
status
=
0
;
int
notfound
;
int
fatalerror
=
0
;
char
*
cfgpath
;
/* listname.[listindex].paramname */
int
defvals
=
0
;
i
=
(
prefix
==
NULL
)
?
0
:
strlen
(
prefix
);
cfgpath
=
malloc
(
i
+
MAX_OPTNAME_SIZE
+
1
);
if
(
cfgpath
==
NULL
)
{
fprintf
(
stderr
,
"[LIBCONFIG] %s %i malloc error, %s
\n
"
,
__FILE__
,
__LINE__
,
strerror
(
errno
));
return
-
1
;
}
for
(
i
=
0
;
i
<
numoptions
;
i
++
)
{
if
(
prefix
!=
NULL
)
{
sprintf
(
cfgpath
,
"%s.%s"
,
prefix
,
cfgoptions
[
i
].
optname
);
}
else
{
sprintf
(
cfgpath
,
"%s"
,
cfgoptions
[
i
].
optname
);
}
if
(
(
cfgoptions
->
paramflags
&
PARAMFLAG_DONOTREAD
)
!=
0
)
{
printf_params
(
"[LIBCONFIG] %s.%s ignored
\n
"
,
cfgpath
,
cfgoptions
[
i
].
optname
);
continue
;
}
notfound
=
0
;
switch
(
cfgoptions
[
i
].
type
)
{
case
TYPE_STRING
:
if
(
config_lookup_string
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
&
str
))
{
check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
str
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
)
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s: %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
)
);
}
else
{
if
(
cfgoptions
[
i
].
defstrval
!=
NULL
)
{
defvals
++
;
check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
cfgoptions
[
i
].
defstrval
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
),
"%s"
,
cfgoptions
[
i
].
defstrval
);
printf_params
(
"[LIBCONFIG] %s set to default value %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
));
}
else
{
notfound
=
1
;
}
}
break
;
case
TYPE_STRINGLIST
:
setting
=
config_setting_lookup
(
config_root_setting
(
&
(
libconfig_privdata
.
cfg
)),
cfgpath
);
if
(
setting
!=
NULL
)
{
read_strlist
(
&
cfgoptions
[
i
],
setting
,
cfgpath
);
}
else
{
if
(
cfgoptions
[
i
].
defstrlistval
!=
NULL
)
{
cfgoptions
[
i
].
strlistptr
=
cfgoptions
[
i
].
defstrlistval
;
defvals
++
;
for
(
int
j
=
0
;
j
<
cfgoptions
[
i
].
numelt
;
j
++
)
printf_params
(
"[LIBCONFIG] %s%i set to default value %s
\n
"
,
cfgpath
,
j
,
cfgoptions
[
i
].
strlistptr
[
j
]);
}
else
{
notfound
=
1
;
}
}
break
;
case
TYPE_UINT
:
case
TYPE_INT
:
check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
iptr
)),
sizeof
(
int
));
if
(
config_lookup_int
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
&
u
))
{
if
(
cfgoptions
[
i
].
type
==
TYPE_UINT
)
{
*
(
cfgoptions
[
i
].
uptr
)
=
(
unsigned
int
)
u
;
printf_params
(
"[LIBCONFIG] %s: %u
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
uptr
)
);
}
else
{
*
(
cfgoptions
[
i
].
iptr
)
=
u
;
printf_params
(
"[LIBCONFIG] %s: %i
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
iptr
)
);
}
}
else
{
if
(
cfgoptions
[
i
].
defuintval
!=
NO_UINTDEFAULT
)
{
*
(
cfgoptions
[
i
].
uptr
)
=
cfgoptions
[
i
].
defuintval
;
defvals
++
;
printf_params
(
"[LIBCONFIG] %s set to default value %i
\n
"
,
cfgpath
,
(
int32_t
)(
*
(
cfgoptions
[
i
].
uptr
)));
}
else
{
notfound
=
1
;
}
}
break
;
case
TYPE_UINT64
:
case
TYPE_INT64
:
check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)
&
(
cfgoptions
[
i
].
i64ptr
),
sizeof
(
long
long
));
if
(
config_lookup_int64
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
&
llu
))
{
if
(
cfgoptions
[
i
].
type
==
TYPE_UINT64
)
{
*
(
cfgoptions
[
i
].
u64ptr
)
=
(
uint64_t
)
llu
;
printf_params
(
"[LIBCONFIG] %s: %llu
\n
"
,
cfgpath
,(
long
long
unsigned
)(
*
(
cfgoptions
[
i
].
u64ptr
))
);
}
else
{
*
(
cfgoptions
[
i
].
iptr
)
=
llu
;
printf_params
(
"[LIBCONFIG] %s: %lli
\n
"
,
cfgpath
,(
long
long
unsigned
)(
*
(
cfgoptions
[
i
].
i64ptr
))
);
}
}
else
{
if
(
cfgoptions
[
i
].
defuintval
!=
NO_UINTDEFAULT
)
{
*
(
cfgoptions
[
i
].
u64ptr
)
=
cfgoptions
[
i
].
defuintval
;
defvals
++
;
printf_params
(
"[LIBCONFIG] %s set to default value %llu
\n
"
,
cfgpath
,
(
long
long
unsigned
)(
*
(
cfgoptions
[
i
].
u64ptr
)));
}
else
{
notfound
=
1
;
}
}
break
;
case
TYPE_UINTARRAY
:
case
TYPE_INTARRAY
:
setting
=
config_setting_lookup
(
config_root_setting
(
&
(
libconfig_privdata
.
cfg
)),
cfgpath
);
if
(
setting
!=
NULL
)
{
read_intarray
(
&
cfgoptions
[
i
],
setting
,
cfgpath
);
}
else
{
if
(
cfgoptions
[
i
].
defintarrayval
!=
NULL
)
{
check_valptr
(
&
(
cfgoptions
[
i
]),(
char
**
)
&
(
cfgoptions
[
i
].
iptr
),
sizeof
(
int32_t
));
cfgoptions
[
i
].
iptr
=
cfgoptions
[
i
].
defintarrayval
;
defvals
++
;
for
(
int
j
=
0
;
j
<
cfgoptions
[
i
].
numelt
;
j
++
)
{
printf_params
(
"[LIBCONFIG] %s[%i] set to default value %i
\n
"
,
cfgpath
,
j
,(
int
)
cfgoptions
[
i
].
iptr
[
j
]);
}
}
else
{
notfound
=
1
;
}
}
break
;
case
TYPE_IPV4ADDR
:
check_valptr
(
&
(
cfgoptions
[
i
]),(
char
**
)
&
(
cfgoptions
[
i
].
uptr
),
sizeof
(
int
));
if
(
!
config_lookup_string
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
&
str
))
{
str
=
cfgoptions
[
i
].
defstrval
;
defvals
++
;
printf_params
(
"[LIBCONFIG] %s set to default value %s
\n
"
,
cfgpath
,
str
);
}
if
(
str
!=
NULL
)
{
rst
=
inet_pton
(
AF_INET
,
str
,
cfgoptions
[
i
].
uptr
);
if
(
rst
==
1
&&
*
(
cfgoptions
[
i
].
uptr
)
>
0
)
{
printf_params
(
"[LIBCONFIG] %s: %s
\n
"
,
cfgpath
,
str
);
}
else
{
if
(
strncmp
(
str
,
ANY_IPV4ADDR_STRING
,
sizeof
(
ANY_IPV4ADDR_STRING
))
==
0
)
{
printf_params
(
"[LIBCONFIG] %s:%s (INADDR_ANY)
\n
"
,
cfgpath
,
str
);
*
cfgoptions
[
i
].
uptr
=
INADDR_ANY
;
}
else
{
fprintf
(
stderr
,
"[LIBCONFIG] %s not valid for %s
\n
"
,
str
,
cfgpath
);
fatalerror
=
1
;
}
}
}
else
{
notfound
=
1
;
}
break
;
case
TYPE_LIST
:
setting
=
config_setting_lookup
(
config_root_setting
(
&
(
libconfig_privdata
.
cfg
)),
cfgpath
);
if
(
setting
)
{
cfgoptions
[
i
].
numelt
=
config_setting_length
(
setting
);
}
else
{
notfound
=
1
;
}
break
;
default:
fprintf
(
stderr
,
"[LIBCONFIG] %s type %i not supported
\n
"
,
cfgpath
,
cfgoptions
[
i
].
type
);
fatalerror
=
1
;
break
;
}
/* switch on param type */
if
(
notfound
==
1
)
{
printf
(
"[LIBCONFIG] %s not found in %s "
,
cfgpath
,
libconfig_privdata
.
configfile
);
if
(
(
cfgoptions
[
i
].
paramflags
&
PARAMFLAG_MANDATORY
)
!=
0
)
{
fatalerror
=
1
;
printf
(
" mandatory parameter missing
\n
"
);
}
else
{
printf
(
"
\n
"
);
}
}
else
{
status
++
;
}
}
/* for loop on options */
printf
(
"[LIBCONFIG] %s: %i/%i parameters successfully set, (%i to default value)
\n
"
,
((
prefix
==
NULL
)
?
"(root)"
:
prefix
),
status
,
numoptions
,
defvals
);
if
(
fatalerror
==
1
)
{
fprintf
(
stderr
,
"[LIBCONFIG] fatal errors found when processing %s
\n
"
,
libconfig_privdata
.
configfile
);
config_libconfig_end
();
end_configmodule
();
}
free
(
cfgpath
);
return
status
;
}
int
config_libconfig_getlist
(
paramlist_def_t
*
ParamList
,
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
)
{
config_setting_t
*
setting
;
int
i
,
j
,
status
;
char
*
listpath
=
NULL
;
char
cfgpath
[
MAX_OPTNAME_SIZE
*
2
+
6
];
/* prefix.listname.[listindex] */
if
(
prefix
!=
NULL
)
{
i
=
asprintf
(
&
listpath
,
"%s.%s"
,
prefix
,
ParamList
->
listname
);
}
else
{
i
=
asprintf
(
&
listpath
,
"%s"
,
ParamList
->
listname
);
}
setting
=
config_lookup
(
&
(
libconfig_privdata
.
cfg
),
listpath
);
if
(
setting
)
{
status
=
ParamList
->
numelt
=
config_setting_length
(
setting
);
printf_params
(
"[LIBCONFIG] %i %s in config file %s
\n
"
,
ParamList
->
numelt
,
listpath
,
libconfig_privdata
.
configfile
);
}
else
{
printf
(
"[LIBCONFIG] list %s not found in config file %s
\n
"
,
listpath
,
libconfig_privdata
.
configfile
);
ParamList
->
numelt
=
0
;
status
=
-
1
;
}
if
(
ParamList
->
numelt
>
0
&&
params
!=
NULL
)
{
ParamList
->
paramarray
=
malloc
(
ParamList
->
numelt
*
sizeof
(
paramdef_t
*
));
if
(
ParamList
->
paramarray
!=
NULL
)
{
config_get_if
()
->
ptrs
[
config_get_if
()
->
numptrs
]
=
(
char
*
)(
ParamList
->
paramarray
);
config_get_if
()
->
numptrs
++
;
}
else
{
fprintf
(
stderr
,
"[LIBCONFIG] %s %d malloc error
\n
"
,
__FILE__
,
__LINE__
);
exit
(
-
1
);
}
for
(
i
=
0
;
i
<
ParamList
->
numelt
;
i
++
)
{
ParamList
->
paramarray
[
i
]
=
malloc
(
numparams
*
sizeof
(
paramdef_t
));
if
(
ParamList
->
paramarray
[
i
]
!=
NULL
)
{
config_get_if
()
->
ptrs
[
config_get_if
()
->
numptrs
]
=
(
char
*
)(
ParamList
->
paramarray
[
i
]);
config_get_if
()
->
numptrs
++
;
}
else
{
fprintf
(
stderr
,
"[LIBCONFIG] %s %d malloc error
\n
"
,
__FILE__
,
__LINE__
);
exit
(
-
1
);
}
memcpy
(
ParamList
->
paramarray
[
i
],
params
,
sizeof
(
paramdef_t
)
*
numparams
);
for
(
j
=
0
;
j
<
numparams
;
j
++
)
{
ParamList
->
paramarray
[
i
][
j
].
strptr
=
NULL
;
}
sprintf
(
cfgpath
,
"%s.[%i]"
,
listpath
,
i
);
config_libconfig_get
(
ParamList
->
paramarray
[
i
],
numparams
,
cfgpath
);
}
/* for i... */
}
/* ParamList->numelt > 0 && params != NULL */
if
(
listpath
!=
NULL
)
free
(
listpath
);
return
status
;
}
int
config_libconfig_init
(
char
*
cfgP
[],
int
numP
)
{
config_init
(
&
(
libconfig_privdata
.
cfg
));
libconfig_privdata
.
configfile
=
strdup
((
char
*
)
cfgP
[
0
]);
config_get_if
()
->
numptrs
=
0
;
memset
(
config_get_if
()
->
ptrs
,
0
,
sizeof
(
void
*
)
*
CONFIG_MAX_ALLOCATEDPTRS
);
/* Read the file. If there is an error, report it and exit. */
if
(
!
config_read_file
(
&
(
libconfig_privdata
.
cfg
),
libconfig_privdata
.
configfile
))
{
fprintf
(
stderr
,
"[LIBCONFIG] %s:%d - %s
\n
"
,
config_error_file
(
&
(
libconfig_privdata
.
cfg
)),
config_error_line
(
&
(
libconfig_privdata
.
cfg
)),
config_error_text
(
&
(
libconfig_privdata
.
cfg
)));
config_destroy
(
&
(
libconfig_privdata
.
cfg
));
printf
(
"
\n
"
);
return
-
1
;
}
return
0
;
}
void
config_libconfig_end
(
void
)
{
config_destroy
(
&
(
libconfig_privdata
.
cfg
));
if
(
libconfig_privdata
.
configfile
!=
NULL
)
{
free
(
libconfig_privdata
.
configfile
);
}
}
common/config/libconfig/config_libconfig.h
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/libconfig/config_libconfig.c
* \brief configuration module, include file for libconfig implementation
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#ifndef INCLUDE_CONFIG_LIBCONFIG_H
#define INCLUDE_CONFIG_LIBCONFIG_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include "common/config/config_paramdesc.h"
typedef
struct
libconfig_privatedata
{
char
*
configfile
;
config_t
cfg
;
}
libconfig_privatedata_t
;
#ifdef __cplusplus
}
#endif
#endif
/* INCLUDE_CONFIG_LIBCONFIG_H */
common/config/libconfig/config_libconfig_private.h
0 → 100644
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/config/libconfig/config_libconfig_private.h
* \brief configuration module, include file for libconfig implementation
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
static
libconfig_privatedata_t
libconfig_privdata
;
openair2/ENB_APP/enb_config.c
View file @
cdca16f6
...
...
@@ -53,7 +53,7 @@
#include "LAYER2/MAC/extern.h"
#include "PHY/extern.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "enb_paramdef.h"
/* those macros are here to help diagnose problems in configuration files
* if the lookup fails, a warning is printed
* (yes we can use the function name for the macro itself, the C preprocessor
...
...
@@ -75,276 +75,6 @@
(config_setting_lookup_string(setting, name, value) || \
(printf("WARNING: setting '%s' not found in configuration file\n", name), 0))
#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"
#define ENB_CONFIG_STRING_LOCAL_S_IF_NAME "local_s_if_name"
#define ENB_CONFIG_STRING_LOCAL_S_ADDRESS "local_s_address"
#define ENB_CONFIG_STRING_REMOTE_S_ADDRESS "remote_s_address"
#define ENB_CONFIG_STRING_LOCAL_S_PORTC "local_s_portc"
#define ENB_CONFIG_STRING_REMOTE_S_PORTC "remote_s_portc"
#define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd"
#define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd"
#define ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE "tr_s_preference"
#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing"
#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref"
#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_PBCH_REPETITION "pbch_repetition"
#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"
#define ENB_CONFIG_STRING_NID_CELL "Nid_cell"
#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL"
#define ENB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn"
#define ENB_CONFIG_STRING_NB_ANT_PORTS "nb_antenna_ports"
#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"
#if !defined(Rel10) && !defined(Rel14)
#define ENB_CONFIG_STRING_PUCCH_N1_AN "pucch_n1_AN"
#endif
#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"
#define ENB_CONFIG_STRING_PUSCH_HOPPINGMODE "pusch_hoppingMode"
#define ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET "pusch_hoppingOffset"
#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"
#define ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA "rach_sizeOfRA_PreamblesGroupA"
#define ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA "rach_messageSizeGroupA"
#define ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB "rach_messagePowerOffsetGroupB"
#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"
#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"
#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode"
#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"
#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"
#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"
#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"
#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U"
#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE"
#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"
// OTG config per ENB-UE DL
#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"
// per eNB configuration
#define ENB_CONFIG_STRING_LOG_CONFIG "log_config"
#define ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level"
#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"
#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"
#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"
#define ENB_CONFIG_STRING_OSA_LOG_LEVEL "osa_log_level"
#define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY "osa_log_verbosity"
#define CONFIG_STRING_MACRLC_LIST "MACRLCs"
#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config"
#define CONFIG_STRING_MACRLC_CC "num_cc"
#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address"
#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd"
#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference"
#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_L1_LIST "L1s"
#define CONFIG_STRING_L1_CONFIG "l1_config"
#define CONFIG_STRING_L1_CC "num_cc"
#define CONFIG_STRING_L1_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_L1_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_L1_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_L1_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_L1_REMOTE_N_PORTC "remote_n_portc"
#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_ACTIVE_RUS "Active_RUs"
#define CONFIG_STRING_RU_LIST "RUs"
#define CONFIG_STRING_RU_CONFIG "ru_config"
#define CONFIG_STRING_RU_LOCAL_IF_NAME "local_if_name"
#define CONFIG_STRING_RU_LOCAL_ADDRESS "local_address"
#define CONFIG_STRING_RU_REMOTE_ADDRESS "remote_address"
#define CONFIG_STRING_RU_LOCAL_PORTC "local_portc"
#define CONFIG_STRING_RU_REMOTE_PORTC "remote_portc"
#define CONFIG_STRING_RU_LOCAL_PORTD "local_portd"
#define CONFIG_STRING_RU_REMOTE_PORTD "remote_portd"
#define CONFIG_STRING_RU_LOCAL_RF "local_rf"
#define CONFIG_STRING_RU_TRANSPORT_PREFERENCE "tr_preference"
#define CONFIG_STRING_RU_BAND_LIST "bands"
#define CONFIG_STRING_RU_ENB_LIST "eNB_instances"
#define CONFIG_STRING_RU_NB_TX "nb_tx"
#define CONFIG_STRING_RU_NB_RX "nb_rx"
#define CONFIG_STRING_RU_ATT_TX "att_tx"
#define CONFIG_STRING_RU_ATT_RX "att_rx"
#define CONFIG_STRING_RU_MAX_RS_EPRE "max_pdschReferenceSignalPower"
#define CONFIG_STRING_RU_MAX_RXGAIN "max_rxgain"
#define CONFIG_STRING_RU_IF_COMPRESSION "if_compression"
#define KHz (1000UL)
#define MHz (1000 * KHz)
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
;
}
eutra_band_t
;
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
},
};
static
int
enb_check_band_frequencies
(
char
*
lib_config_file_name_pP
,
...
...
@@ -387,26 +117,6 @@ static int enb_check_band_frequencies(char* lib_config_file_name_pP,
return
errors
;
}
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
extern
int
asn_debug
;
extern
int
asn1_xer_print
;
#endif
#ifdef LIBCONFIG_LONG
#define libconfig_int long
#else
#define libconfig_int int
#endif
typedef
enum
{
RU
=
0
,
L1
=
1
,
L2
=
2
,
L3
=
3
,
S1
=
4
,
lastel
=
5
}
RC_config_functions_t
;
void
RCconfig_RU
(
void
);
void
RCconfig_L1
(
void
);
void
RCconfig_macrlc
(
void
);
...
...
openair2/ENB_APP/enb_paramdef.h
0 → 100755
View file @
cdca16f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/ENB_APP/enb_paramdef.f
* \brief definition of configuration parameters for all eNodeB modules
* \author Francois TABURET
* \date 2017
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#include "common/config/config_paramdesc.h"
#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing"
#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref"
// OTG config per ENB-UE DL
#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"
// per eNB configuration
#define ENB_CONFIG_STRING_LOG_CONFIG "log_config"
#define ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level"
#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"
#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"
#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"
#define ENB_CONFIG_STRING_OSA_LOG_LEVEL "osa_log_level"
#define ENB_CONFIG_STRING_OSA_LOG_VERBOSITY "osa_log_verbosity"
#define KHz (1000UL)
#define MHz (1000 * KHz)
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
;
}
eutra_band_t
;
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
},
};
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
extern
int
asn_debug
;
extern
int
asn1_xer_print
;
#endif
#ifdef LIBCONFIG_LONG
#define libconfig_int long
#else
#define libconfig_int int
#endif
typedef
enum
{
RU
=
0
,
L1
=
1
,
L2
=
2
,
L3
=
3
,
S1
=
4
,
lastel
=
5
}
RC_config_functions_t
;
#define CONFIG_STRING_ACTIVE_RUS "Active_RUs"
#define CONFIG_STRING_RU_LIST "RUs"
#define CONFIG_STRING_RU_CONFIG "ru_config"
#define CONFIG_STRING_RU_LOCAL_IF_NAME "local_if_name"
#define CONFIG_STRING_RU_LOCAL_ADDRESS "local_address"
#define CONFIG_STRING_RU_REMOTE_ADDRESS "remote_address"
#define CONFIG_STRING_RU_LOCAL_PORTC "local_portc"
#define CONFIG_STRING_RU_REMOTE_PORTC "remote_portc"
#define CONFIG_STRING_RU_LOCAL_PORTD "local_portd"
#define CONFIG_STRING_RU_REMOTE_PORTD "remote_portd"
#define CONFIG_STRING_RU_LOCAL_RF "local_rf"
#define CONFIG_STRING_RU_TRANSPORT_PREFERENCE "tr_preference"
#define CONFIG_STRING_RU_BAND_LIST "bands"
#define CONFIG_STRING_RU_ENB_LIST "eNB_instances"
#define CONFIG_STRING_RU_NB_TX "nb_tx"
#define CONFIG_STRING_RU_NB_RX "nb_rx"
#define CONFIG_STRING_RU_ATT_TX "att_tx"
#define CONFIG_STRING_RU_ATT_RX "att_rx"
#define CONFIG_STRING_RU_MAX_RS_EPRE "max_pdschReferenceSignalPower"
#define CONFIG_STRING_RU_MAX_RXGAIN "max_rxgain"
#define CONFIG_STRING_RU_IF_COMPRESSION "if_compression"
#define RU_LOCAL_IF_NAME_IDX 0
#define RU_LOCAL_ADDRESS_IDX 1
#define RU_REMOTE_ADDRESS_IDX 2
#define RU_LOCAL_PORTC_IDX 3
#define RU_REMOTE_PORTC_IDX 4
#define RU_LOCAL_PORTD_IDX 5
#define RU_REMOTE_PORTD_IDX 6
#define RU_TRANSPORT_PREFERENCE_IDX 7
#define RU_LOCAL_RF_IDX 8
#define RU_NB_TX_IDX 9
#define RU_NB_RX_IDX 10
#define RU_MAX_RS_EPRE_IDX 11
#define RU_MAX_RXGAIN_IDX 12
#define RU_BAND_LIST_IDX 13
#define RU_ENB_LIST_IDX 14
#define RU_ATT_TX_IDX 15
#define RU_ATT_RX_IDX 16
static
int
DEFBANDS
[]
=
{
7
};
static
int
DEFENBS
[]
=
{
0
};
#define RUPARAMS_DESC { \
{CONFIG_STRING_RU_LOCAL_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_REMOTE_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_REMOTE_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_LOCAL_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_REMOTE_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"udp_if4p5", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_RF, "", NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_NB_TX, "", NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_NB_RX, "", NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_MAX_RS_EPRE, "", NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \
{CONFIG_STRING_RU_MAX_RXGAIN, "", NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \
{CONFIG_STRING_RU_BAND_LIST, "", NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY,1}, \
{CONFIG_STRING_RU_ENB_LIST, "", NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY,1}, \
{CONFIG_STRING_RU_ATT_TX, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_ATT_RX, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0} \
}
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info"
#define ENB_ASN1_VERBOSITY_IDX 0
#define ENB_ACTIVE_ENBS_IDX 1
#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity"
#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs"
#define ENBSPARAMS_DESC { \
{ENB_CONFIG_STRING_ASN1_VERBOSITY,"", "", 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ACTIVE_ENBS, "", "", 0, uptr:NULL, defstrval:NULL, TYPE_STRINGLIST, 0} \
}
/*
{ENB_CONFIG_STRING_COMPONENT_CARRIERS,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \
{ENB_CONFIG_STRING_CC_NODE_FUNCTION,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \
{ENB_CONFIG_STRING_CC_NODE_TIMING,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \
{ENB_CONFIG_STRING_CC_NODE_SYNCH_REF,"", "", 0, uptr:NULL,defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE,TYPE_STRING,0}, \
*/
#define ENB_ENB_ID_IDX 0
#define ENB_CELL_TYPE_IDX 1
#define ENB_ENB_NAME_IDX 2
#define ENB_TRACKING_AREA_CODE_IDX 3
#define ENB_MOBILE_COUNTRY_CODE_IDX 4
#define ENB_MOBILE_NETWORK_CODE_IDX 5
#define ENB_TRANSPORT_S_PREFERENCE_IDX 6
#define ENB_LOCAL_S_IF_NAME_IDX 7
#define ENB_LOCAL_S_ADDRESS_IDX 8
#define ENB_REMOTE_S_ADDRESS_IDX 9
#define ENB_LOCAL_S_PORTC_IDX 10
#define ENB_REMOTE_S_PORTC_IDX 11
#define ENB_LOCAL_S_PORTD_IDX 12
#define ENB_REMOTE_S_PORTD_IDX 13
#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"
#define ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE "tr_s_preference"
#define ENB_CONFIG_STRING_LOCAL_S_IF_NAME "local_s_if_name"
#define ENB_CONFIG_STRING_LOCAL_S_ADDRESS "local_s_address"
#define ENB_CONFIG_STRING_REMOTE_S_ADDRESS "remote_s_address"
#define ENB_CONFIG_STRING_LOCAL_S_PORTC "local_s_portc"
#define ENB_CONFIG_STRING_REMOTE_S_PORTC "remote_s_portc"
#define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd"
#define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd"
#define ENBPARAMS_DESC { \
{ENB_CONFIG_STRING_ENB_ID, "", NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_CELL_TYPE, "", NULL, 0, strptr:NULL, defstrval:"CELL_MACRO_ENB", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_NAME, "", NULL, 0, strptr:NULL, defstrval:"OAIeNodeB", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TRACKING_AREA_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, "", NULL, 0, strptr:NULL, defstrval:"0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_PORTC, "", NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_PORTD, "", NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
}
#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
#define ENB_CONFIG_STRING_FRAME_TYPE "frame_type"
#define ENB_CONFIG_STRING_PBCH_REPETITION "pbch_repetition"
#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"
#define ENB_CONFIG_STRING_NID_CELL "Nid_cell"
#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL"
#define ENB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn"
#define ENB_CONFIG_STRING_NB_ANT_PORTS "nb_antenna_ports"
#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"
//#if !defined(Rel10) && !defined(Rel14)
#define ENB_CONFIG_STRING_PUCCH_N1_AN "pucch_n1_AN"
//#endif
#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"
#define ENB_CONFIG_STRING_PUSCH_HOPPINGMODE "pusch_hoppingMode"
#define ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET "pusch_hoppingOffset"
#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"
#define ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA "rach_sizeOfRA_PreamblesGroupA"
#define ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA "rach_messageSizeGroupA"
#define ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB "rach_messagePowerOffsetGroupB"
#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"
#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"
#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode"
#define CCPARAMS_DESC { \
{ENB_CONFIG_STRING_FRAME_TYPE, "", NULL, 0, strptr:&frame_type, defstrval:"FDD", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TDD_CONFIG, "", NULL, 0, iptr:&tdd_config, defintval:3, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_TDD_CONFIG_S, "", NULL, 0, iptr:&tdd_config_s, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PREFIX_TYPE, "", NULL, 0, strptr:&prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PBCH_REPETITION, "", NULL, 0, strptr:&pbch_repetition, defstrval:"FALSE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_EUTRA_BAND, "", NULL, 0, iptr:&eutra_band, defintval:7, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, "", NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \
{ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, "", NULL, 0, iptr:&uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_NID_CELL, "", NULL, 0, iptr:&Nid_cell, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_N_RB_DL, "", NULL, 0, iptr:&N_RB_DL, defintval:25, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_CELL_MBSFN, "", NULL, 0, iptr:&Nid_cell_mbsfn, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_NB_ANT_PORTS, "", NULL, 0, iptr:&nb_antenna_ports, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_ROOT, "", NULL, 0, iptr:&prach_root, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, "", NULL, 0, iptr:&prach_config_index, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PRACH_HIGH_SPEED, "", NULL, 0, strptr:&prach_high_speed, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, "", NULL, 0, iptr:&prach_zero_correlation, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, "", NULL, 0, iptr:&prach_freq_offset, defintval:2, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, "", NULL, 0, iptr:&pucch_delta_shift, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_NRB_CQI, "", NULL, 0, iptr:&pucch_nRB_CQI, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_NCS_AN, "", NULL, 0, iptr:&pucch_nCS_AN, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_N1_AN, "", NULL, 0, iptr:&pucch_n1_AN, defintval:32, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PDSCH_RS_EPRE, "", NULL, 0, iptr:&pdsch_referenceSignalPower, defintval:-29, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PDSCH_PB, "", NULL, 0, iptr:&pdsch_p_b, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_N_SB, "", NULL, 0, iptr:&pusch_n_SB, defintval:1, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, "", NULL, 0, strptr:&pusch_hoppingMode, defstrval:"interSubFrame", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, "", NULL, 0, iptr:&pusch_hoppingOffset, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, "", NULL, 0, strptr:&pusch_enable64QAM, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, "", NULL, 0, strptr:&pusch_groupHoppingEnabled, defstrval:"ENABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, "", NULL, 0, iptr:&pusch_groupAssignment, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, "", NULL, 0, strptr:&pusch_sequenceHoppingEnabled, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_NDMRS1, "", NULL, 0, iptr:&pusch_nDMRS1, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PHICH_DURATION, "", NULL, 0, strptr:&phich_duration, defstrval:"NORMAL", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PHICH_RESOURCE, "", NULL, 0, strptr:&phich_resource, defstrval:"ONESIXTH", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_ENABLE, "", NULL, 0, strptr:&srs_enable, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, "", NULL, 0, iptr:&srs_BandwidthConfig, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, "", NULL, 0, iptr:&srs_SubframeConfig, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, "", NULL, 0, strptr:&srs_ackNackST, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_MAXUPPTS, "", NULL, 0, strptr:&srs_MaxUpPts, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, "", NULL, 0, iptr:&pusch_p0_Nominal, defintval:-90, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_ALPHA, "", NULL, 0, strptr:&pusch_alpha, defstrval:"AL1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, "", NULL, 0, iptr:&pucch_p0_Nominal, defintval:-96, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, "", NULL, 0, iptr:&msg3_delta_Preamble, defintval:6, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, "", NULL, 0, strptr:&pucch_deltaF_Format1, defstrval:"DELTAF2", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, "", NULL, 0, strptr:&pucch_deltaF_Format1b, defstrval:"deltaF3", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, "", NULL, 0, strptr:&pucch_deltaF_Format2, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, "", NULL, 0, strptr:&pucch_deltaF_Format2a, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, "", NULL, 0, strptr:&pucch_deltaF_Format2b, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, "", NULL, 0, iptr:&rach_numberOfRA_Preambles, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, "", NULL, 0, strptr:&rach_preamblesGroupAConfig, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, "", NULL, 0, iptr:&rach_sizeOfRA_PreamblesGroupA, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, "", NULL, 0, iptr:&rach_messageSizeGroupA, defintval:56, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, "", NULL, 0, strptr:&rach_messagePowerOffsetGroupB, defstrval:"minusinfinity", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, "", NULL, 0, iptr:&rach_powerRampingStep, defintval:4, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER,"", NULL, 0, iptr:&rach_preambleInitialReceivedTargetPower, defintval:-100, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, "", NULL, 0, iptr:&rach_preambleTransMax, defintval:10, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, "", NULL, 0, iptr:&rach_raResponseWindowSize, defintval:10, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, "", NULL, 0, iptr:&rach_macContentionResolutionTimer, defintval:48, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, "", NULL, 0, iptr:&rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, "", NULL, 0, iptr:&pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PCCH_NB, "", NULL, 0, strptr:&pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, "", NULL, 0, iptr:&bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T300, "", NULL, 0, iptr:&ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T301, "", NULL, 0, iptr:&ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T310, "", NULL, 0, iptr:&ue_TimersAndConstants_t310, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T311, "", NULL, 0, iptr:&ue_TimersAndConstants_t311, defintval:10000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_N310, "", NULL, 0, iptr:&ue_TimersAndConstants_n310, defintval:20, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_N311, "", NULL, 0, iptr:&ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, "", NULL, 0, iptr:&ue_TransmissionMode, defintval:1, TYPE_UINT, 0} \
}
#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"
#define SRB1PARAMS_DESC { \
{ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, "", NULL, 0, iptr:&srb1_timer_poll_retransmit, defintval:80, TYPE_UINT,0}, \
{ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, "", NULL, 0, iptr:&srb1_timer_reordering, defintval:35, TYPE_UINT,0}, \
{ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, "", NULL, 0, iptr:&srb1_timer_status_prohibit, defintval:0, TYPE_UINT,0}, \
{ENB_CONFIG_STRING_SRB1_POLL_PDU, "", NULL, 0, iptr:&srb1_poll_pdu, defintval:4, TYPE_UINT,0}, \
{ENB_CONFIG_STRING_SRB1_POLL_BYTE, "", NULL, 0, iptr:&srb1_poll_byte, defintval:99999, TYPE_UINT,0}, \
{ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, "", NULL, 0, iptr:&srb1_max_retx_threshold, defintval:4, TYPE_UINT,0} \
}
#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address"
#define ENB_MME_IPV4_ADDRESS_IDX 0
#define ENB_MME_IPV6_ADDRESS_IDX 1
#define ENB_MME_IP_ADDRESS_ACTIVE_IDX 2
#define ENB_MME_IP_ADDRESS_PREFERENCE_IDX 3
#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"
#define S1PARAMS_DESC { \
{ENB_CONFIG_STRING_MME_IPV4_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IPV6_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, "", NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
}
#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_SCTP_INSTREAMS_IDX 0
#define ENB_SCTP_OUTSTREAMS_IDX 1
#define SCTPPARAMS_DESC { \
{ENB_CONFIG_STRING_SCTP_INSTREAMS, "", NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_INSTREAMS, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, "", NULL, 0, strptr:NULL, defstrval:ENB_CONFIG_STRING_SCTP_OUTSTREAMS, TYPE_STRING, 0} \
}
#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES"
#define ENB_INTERFACE_NAME_FOR_S1_MME_IDX 0
#define ENB_IPV4_ADDRESS_FOR_S1_MME_IDX 1
#define ENB_INTERFACE_NAME_FOR_S1U_IDX 2
#define ENB_IPV4_ADDR_FOR_S1U_IDX 3
#define ENB_PORT_FOR_S1U_IDX 4
#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"
#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U"
#define NETPARAMS_DESC { \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, "", NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, "", NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \
}
#define GTPUPARAMS_DESC { \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, "", NULL, 0, strptr:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, "", NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, "", NULL, 0, uptr:&enb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \
}
#define ENB_CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME "FLEXRAN_AGENT_INTERFACE_NAME"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS "FLEXRAN_AGENT_IPV4_ADDRESS"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT "FLEXRAN_AGENT_PORT"
#define ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE "FLEXRAN_AGENT_CACHE"
#define CONFIG_STRING_L1_LIST "L1s"
#define CONFIG_STRING_L1_CONFIG "l1_config"
#define L1_CC_IDX 0
#define L1_TRANSPORT_N_PREFERENCE_IDX 1
#define L1_LOCAL_N_IF_NAME_IDX 2
#define L1_LOCAL_N_ADDRESS_IDX 3
#define L1_REMOTE_N_ADDRESS_IDX 4
#define L1_LOCAL_N_PORTC_IDX 5
#define L1_REMOTE_N_PORTC_IDX 6
#define L1_LOCAL_N_PORTD_IDX 7
#define L1_REMOTE_N_PORTD_IDX 8
#define CONFIG_STRING_L1_CC "num_cc"
#define CONFIG_STRING_L1_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_L1_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_L1_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_L1_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_L1_REMOTE_N_PORTC "remote_n_portc"
#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define L1PARAMS_DESC { \
{CONFIG_STRING_L1_CC, "", NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \
{CONFIG_STRING_L1_LOCAL_N_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_L1_LOCAL_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_L1_REMOTE_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{CONFIG_STRING_L1_LOCAL_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_REMOTE_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_LOCAL_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_REMOTE_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
}
#define FLEXRANPARAMS_DESC { \
{ENB_CONFIG_STRING_FLEXRAN_AGENT_INTERFACE_NAME, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_FLEXRAN_AGENT_IPV4_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_FLEXRAN_AGENT_PORT, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_FLEXRAN_AGENT_CACHE, "", NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0} \
}
#define CONFIG_STRING_MACRLC_LIST "MACRLCs"
#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config"
#define MACRLC_CC_IDX 0
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
#define MACRLC_LOCAL_N_IF_NAME_IDX 2
#define MACRLC_LOCAL_N_ADDRESS_IDX 3
#define MACRLC_REMOTE_N_ADDRESS_IDX 4
#define MACRLC_LOCAL_N_PORTC_IDX 5
#define MACRLC_REMOTE_N_PORTC_IDX 6
#define MACRLC_LOCAL_N_PORTD_IDX 7
#define MACRLC_REMOTE_N_PORTD_IDX 8
#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9
#define MACRLC_LOCAL_S_IF_NAME_IDX 10
#define MACRLC_LOCAL_S_ADDRESS_IDX 11
#define MACRLC_REMOTE_S_ADDRESS_IDX 12
#define MACRLC_LOCAL_S_PORTC_IDX 13
#define MACRLC_REMOTE_S_PORTC_IDX 14
#define MACRLC_LOCAL_S_PORTD_IDX 15
#define MACRLC_REMOTE_S_PORTD_IDX 16
#define CONFIG_STRING_MACRLC_CC "num_cc"
#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference"
#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address"
#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd"
#define MACRLCPARAMS_DESC { \
{CONFIG_STRING_MACRLC_CC, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_L1", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, "", NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_N_PORTC, "", NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_N_PORTD, "", NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, "", NULL, 0, strptr:NULL, defstrval:"local_RRC", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME, "", NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, "", NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_S_PORTC, "", NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_S_PORTC, "", NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, "", NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, "", NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment