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
wangjie
OpenXG-RAN
Commits
c1dae3d3
Commit
c1dae3d3
authored
Sep 24, 2017
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'RU-RAU-split' of
https://gitlab.eurecom.fr/oai/openairinterface5g
into RU-RAU-split
parents
e7502482
6c00bd1a
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
442 additions
and
332 deletions
+442
-332
common/config/config_cmdline.c
common/config/config_cmdline.c
+1
-1
common/config/config_load_configmodule.c
common/config/config_load_configmodule.c
+16
-11
common/config/config_load_configmodule.h
common/config/config_load_configmodule.h
+14
-9
common/config/config_paramdesc.h
common/config/config_paramdesc.h
+1
-2
common/config/config_userapi.c
common/config/config_userapi.c
+4
-1
openair2/ENB_APP/enb_paramdef.h
openair2/ENB_APP/enb_paramdef.h
+306
-237
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+22
-17
targets/RT/USER/lte-softmodem.h
targets/RT/USER/lte-softmodem.h
+78
-54
No files found.
common/config/config_cmdline.c
View file @
c1dae3d3
...
@@ -136,7 +136,7 @@ char *cfgpath;
...
@@ -136,7 +136,7 @@ char *cfgpath;
}
else
{
}
else
{
sprintf
(
cfgpath
,
"%s"
,
cfgoptions
[
i
].
optname
);
sprintf
(
cfgpath
,
"%s"
,
cfgoptions
[
i
].
optname
);
}
}
if
(
((
strlen
(
*
p
)
>
1
)
&&
(
strcmp
(
*
p
+
1
,
cfgoptions
[
i
].
shortopt
)
==
0
))
||
if
(
((
strlen
(
*
p
)
==
2
)
&&
(
strcmp
(
*
p
+
1
,
cfgpath
)
==
0
))
||
((
strlen
(
*
p
)
>
2
)
&&
(
strcmp
(
*
p
+
2
,
cfgpath
)
==
0
))
)
{
((
strlen
(
*
p
)
>
2
)
&&
(
strcmp
(
*
p
+
2
,
cfgpath
)
==
0
))
)
{
p
++
;
p
++
;
j
=+
processoption
(
&
(
cfgoptions
[
i
]),
*
p
);
j
=+
processoption
(
&
(
cfgoptions
[
i
]),
*
p
);
...
...
common/config/config_load_configmodule.c
View file @
c1dae3d3
...
@@ -106,16 +106,19 @@ char *modeparams=NULL;
...
@@ -106,16 +106,19 @@ char *modeparams=NULL;
char
*
cfgmode
=
NULL
;
char
*
cfgmode
=
NULL
;
char
*
strtokctx
=
NULL
;
char
*
strtokctx
=
NULL
;
char
*
atoken
;
char
*
atoken
;
uint32_t
tmpflags
=
0
;
int
i
;
int
i
;
/* first parse the command line to look for the -O option */
/* first parse the command line to look for the -O option */
opterr
=
0
;
opterr
=
0
;
while
((
i
=
getopt
(
argc
,
argv
,
"O:"
))
!=
-
1
)
{
while
((
i
=
getopt
(
argc
,
argv
,
"O:
h
"
))
!=
-
1
)
{
if
(
i
==
'O'
)
{
if
(
i
==
'O'
)
{
cfgparam
=
optarg
;
cfgparam
=
optarg
;
}
}
if
(
i
==
'h'
)
{
tmpflags
=
CONFIG_HELP
;
}
}
}
optind
=
1
;
optind
=
1
;
...
@@ -132,20 +135,21 @@ int i;
...
@@ -132,20 +135,21 @@ int i;
i
=
sscanf
(
cfgparam
,
"%m[^':']:%ms"
,
&
cfgmode
,
&
modeparams
);
i
=
sscanf
(
cfgparam
,
"%m[^':']:%ms"
,
&
cfgmode
,
&
modeparams
);
if
(
i
<
0
)
{
if
(
i
<
0
)
{
fprintf
(
stderr
,
"[CONFIG] %s, %d, sscanf error parsing config source %s: %s
\n
"
,
__FILE__
,
__LINE__
,
cfgparam
,
strerror
(
errno
));
fprintf
(
stderr
,
"[CONFIG] %s, %d, sscanf error parsing config source %s: %s
\n
"
,
__FILE__
,
__LINE__
,
cfgparam
,
strerror
(
errno
));
return
NULL
;
cfgmode
=
strdup
(
"libconfig"
);
modeparams
=
strdup
(
"oaisoftmodem.conf"
);
}
}
else
if
(
i
==
1
)
{
else
if
(
i
==
1
)
{
/* -O argument doesn't contain ":" separator, legacy -O <conf file> option, default cfgmode to libconfig
/* -O argument doesn't contain ":" separator, legacy -O <conf file> option, default cfgmode to libconfig
with one parameter, the path to the configuration file */
with one parameter, the path to the configuration file */
modeparams
=
cfgmode
;
modeparams
=
cfgmode
;
cfgmode
=
strdup
(
"libconfig"
);
cfgmode
=
strdup
(
"libconfig"
);
tmpflags
=
tmpflags
|
CONFIG_LEGACY
;
/* temporary, legacy mode */
}
}
cfgptr
=
malloc
(
sizeof
(
configmodule_interface_t
));
cfgptr
=
malloc
(
sizeof
(
configmodule_interface_t
));
memset
(
cfgptr
,
0
,
sizeof
(
configmodule_interface_t
));
memset
(
cfgptr
,
0
,
sizeof
(
configmodule_interface_t
));
/* temporary, legacy mode */
if
(
i
==
1
)
cfgptr
->
rtflags
=
cfgptr
->
rtflags
|
CONFIG_LEGACY
;
cfgptr
->
rtflags
=
cfgptr
->
rtflags
|
tmpflags
;
/*--*/
cfgptr
->
argc
=
argc
;
cfgptr
->
argc
=
argc
;
cfgptr
->
argv
=
argv
;
cfgptr
->
argv
=
argv
;
cfgptr
->
cfgmode
=
strdup
(
cfgmode
);
cfgptr
->
cfgmode
=
strdup
(
cfgmode
);
...
@@ -178,17 +182,18 @@ int i;
...
@@ -178,17 +182,18 @@ int i;
i
=
load_config_sharedlib
(
cfgptr
);
i
=
load_config_sharedlib
(
cfgptr
);
if
(
i
<
0
)
{
if
(
i
<
0
)
{
fprintf
(
stderr
,
"[CONFIG] %s %d config module %s couldn't be loaded
\n
"
,
__FILE__
,
__LINE__
,
cfgmode
);
fprintf
(
stderr
,
"[CONFIG] %s %d config module %s couldn't be loaded
\n
"
,
__FILE__
,
__LINE__
,
cfgmode
);
return
NULL
;
cfgptr
->
rtflags
=
cfgptr
->
rtflags
|
CONFIG_HELP
|
CONFIG_ABORT
;
}
else
{
}
else
{
printf
(
"[CONFIG] config module %s loaded
\n
"
,
cfgmode
);
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
);
}
}
Config_Params
[
CONFIGPARAM_DEBUGFLAGS_IDX
].
uptr
=&
(
cfgptr
->
rtflags
);
config_get
(
Config_Params
,
CONFIG_PARAMLENGTH
(
Config_Params
),
CONFIG_SECTIONNAME
);
if
(
modeparams
!=
NULL
)
free
(
modeparams
);
if
(
modeparams
!=
NULL
)
free
(
modeparams
);
if
(
cfgmode
!=
NULL
)
free
(
cfgmode
);
if
(
cfgmode
!=
NULL
)
free
(
cfgmode
);
if
(
CONFIG_ISFLAGSET
(
CONFIG_ABORT
))
config_printhelp
(
Config_Params
,
CONFIG_PARAMLENGTH
(
Config_Params
));
return
cfgptr
;
return
cfgptr
;
}
}
...
...
common/config/config_load_configmodule.h
View file @
c1dae3d3
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
#define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages
#define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
#define CONFIG_HELP 8 // print help message
#define CONFIG_ABORT 16 // config failed,abort execution
/* temporary flag to be able to use legacy config mechanism */
/* temporary flag to be able to use legacy config mechanism */
#define CONFIG_LEGACY (1 << 10)
#define CONFIG_LEGACY (1 << 10)
...
@@ -71,17 +72,21 @@ typedef struct configmodule_interface
...
@@ -71,17 +72,21 @@ typedef struct configmodule_interface
#ifdef CONFIG_LOADCONFIG_MAIN
#ifdef CONFIG_LOADCONFIG_MAIN
configmodule_interface_t
*
cfgptr
=
NULL
;
configmodule_interface_t
*
cfgptr
=
NULL
;
static
char
config_helpstr
[]
=
" \
static
char
config_helpstr
[]
=
"
\n
lte-softmodem -O [config mode]<:dbg[debugflags]>
\n
\
config debugflags: mask, 1->print parameters, 2->print memory allocations debug messages \
debugflags can also be defined in the config_libconfig section of the config file
\n
\
4->print command line processing debug messages \
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages
\n
\
-O <config mode><:dbg> \
4->print command line processing debug messages
\n
"
;
debugflags can also be defined in the config_libconfig section of the config file \
"
;
#define CONFIG_SECTIONNAME "config"
#define CONFIG_SECTIONNAME "config"
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
static
paramdef_t
Config_Params
[]
=
{
static
paramdef_t
Config_Params
[]
=
{
{
"debugflags"
,
""
,
config_helpstr
,
0
,
uptr
:
NULL
,
defintval
:
0
,
TYPE_MASK
,
0
},
/*-----------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------*/
{
"debugflags"
,
config_helpstr
,
0
,
uptr
:
NULL
,
defintval
:
0
,
TYPE_MASK
,
0
},
};
};
#else
#else
...
...
common/config/config_paramdesc.h
View file @
c1dae3d3
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
#define MAX_OPTNAME_SIZE 64
#define MAX_OPTNAME_SIZE 64
#define MAX_SHORTOPT_SIZE 8
/* parameter flags definitions */
/* parameter flags definitions */
...
@@ -58,7 +58,6 @@
...
@@ -58,7 +58,6 @@
typedef
struct
paramdef
typedef
struct
paramdef
{
{
char
optname
[
MAX_OPTNAME_SIZE
];
/* parameter name, can be used as long command line option */
char
optname
[
MAX_OPTNAME_SIZE
];
/* parameter name, can be used as long command line option */
char
shortopt
[
MAX_SHORTOPT_SIZE
];
/* short command line option */
char
*
helpstr
;
/* help string */
char
*
helpstr
;
/* help string */
unsigned
int
paramflags
;
/* value is a "ored" combination of above PARAMFLAG_XXXX values */
unsigned
int
paramflags
;
/* value is a "ored" combination of above PARAMFLAG_XXXX values */
union
{
/* pointer to the parameter value, completed by the config module */
union
{
/* pointer to the parameter value, completed by the config module */
...
...
common/config/config_userapi.c
View file @
c1dae3d3
...
@@ -112,7 +112,10 @@ void config_printhelp(paramdef_t *params,int numparams)
...
@@ -112,7 +112,10 @@ void config_printhelp(paramdef_t *params,int numparams)
{
{
for
(
int
i
=
0
;
i
<
numparams
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numparams
;
i
++
)
{
if
(
params
[
i
].
helpstr
!=
NULL
)
{
if
(
params
[
i
].
helpstr
!=
NULL
)
{
printf
(
"%s"
,
params
[
i
].
helpstr
);
printf
(
"%s%s: %s"
,
(
strlen
(
params
[
i
].
optname
)
<=
1
)
?
"-"
:
"--"
,
params
[
i
].
optname
,
params
[
i
].
helpstr
);
}
}
}
}
}
}
...
...
openair2/ENB_APP/enb_paramdef.h
View file @
c1dae3d3
This diff is collapsed.
Click to expand it.
targets/RT/USER/lte-softmodem.c
View file @
c1dae3d3
...
@@ -715,26 +715,27 @@ static void get_options(void) {
...
@@ -715,26 +715,27 @@ static void get_options(void) {
config_process_cmdline
(
cmdline_ttraceparams
,
sizeof
(
cmdline_ttraceparams
)
/
sizeof
(
paramdef_t
),
NULL
);
config_process_cmdline
(
cmdline_ttraceparams
,
sizeof
(
cmdline_ttraceparams
)
/
sizeof
(
paramdef_t
),
NULL
);
#endif
#endif
if
(
!
(
CONFIG_ISFLAGSET
(
CONFIG_ABORT
))
)
{
if
(
UE_flag
==
0
)
{
memset
((
void
*
)
&
RC
,
0
,
sizeof
(
RC
));
/* Read RC configuration file */
RCConfig
(
NULL
);
NB_eNB_INST
=
RC
.
nb_inst
;
NB_RU
=
RC
.
nb_RU
;
printf
(
"Configuration: nb_inst %d, nb_ru %d
\n
"
,
NB_eNB_INST
,
NB_RU
);
if
(
UE_flag
==
0
)
{
memset
((
void
*
)
&
RC
,
0
,
sizeof
(
RC
));
/* Read RC configuration file */
RCConfig
(
NULL
);
NB_eNB_INST
=
RC
.
nb_inst
;
NB_RU
=
RC
.
nb_RU
;
printf
(
"Configuration: nb_inst %d, nb_ru %d
\n
"
,
NB_eNB_INST
,
NB_RU
);
}
else
if
(
UE_flag
==
1
)
{
if
(
conf_config_file_name
!=
NULL
)
{
// Here the configuration file is the XER encoded UE capabilities
}
else
if
(
UE_flag
==
1
)
{
// Read it in and store in asn1c data structures
if
(
conf_config_file_name
!=
NULL
)
{
strcpy
(
uecap_xer
,
conf_config_file_name
);
uecap_xer_in
=
1
;
// Here the configuration file is the XER encoded UE capabilities
// Read it in and store in asn1c data structures
strcpy
(
uecap_xer
,
conf_config_file_name
);
uecap_xer_in
=
1
;
}
}
}
}
}
/* CONFIG_ABORT not set */
}
}
...
@@ -1429,7 +1430,11 @@ int main( int argc, char **argv )
...
@@ -1429,7 +1430,11 @@ int main( int argc, char **argv )
if
(
CONFIG_ISFLAGSET
(
CONFIG_LEGACY
)
==
0
)
{
if
(
CONFIG_ISFLAGSET
(
CONFIG_LEGACY
)
==
0
)
{
printf
(
"configuration via the configuration module
\n
"
);
printf
(
"configuration via the configuration module
\n
"
);
get_options
();
//Command-line options, enb_properties
get_options
();
if
(
CONFIG_ISFLAGSET
(
CONFIG_ABORT
))
{
fprintf
(
stderr
,
"Getting configuration failed
\n
"
);
exit
(
-
1
);
}
}
else
{
}
else
{
printf
(
"Legacy configuration mode
\n
"
);
printf
(
"Legacy configuration mode
\n
"
);
old_get_options
(
argc
,
argv
);
old_get_options
(
argc
,
argv
);
...
...
targets/RT/USER/lte-softmodem.h
View file @
c1dae3d3
This diff is collapsed.
Click to expand it.
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