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
lizhongxiao
OpenXG-RAN
Commits
65b399fc
Commit
65b399fc
authored
Aug 12, 2022
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs in config module and config usage
fix bug from this MR fix bug from this MR stupid-mistake
parent
61312ca6
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
246 additions
and
235 deletions
+246
-235
common/config/config_cmdline.c
common/config/config_cmdline.c
+17
-14
common/config/config_load_configmodule.c
common/config/config_load_configmodule.c
+5
-4
common/config/config_load_configmodule.h
common/config/config_load_configmodule.h
+11
-3
common/config/config_paramdesc.h
common/config/config_paramdesc.h
+3
-1
common/config/config_userapi.c
common/config/config_userapi.c
+97
-61
common/config/config_userapi.h
common/config/config_userapi.h
+2
-2
common/config/libconfig/config_libconfig.c
common/config/libconfig/config_libconfig.c
+22
-46
common/utils/LOG/log.c
common/utils/LOG/log.c
+1
-0
common/utils/LOG/log.h
common/utils/LOG/log.h
+1
-1
common/utils/load_module_shlib.h
common/utils/load_module_shlib.h
+2
-2
doc/TESTING_5GSA_setup.md
doc/TESTING_5GSA_setup.md
+0
-15
executables/nr-softmodem.h
executables/nr-softmodem.h
+1
-1
executables/nr-uesoftmodem.h
executables/nr-uesoftmodem.h
+3
-3
executables/softmodem-common.h
executables/softmodem-common.h
+9
-9
openair1/SIMULATION/TOOLS/random_channel.c
openair1/SIMULATION/TOOLS/random_channel.c
+1
-1
openair1/SIMULATION/TOOLS/sim.h
openair1/SIMULATION/TOOLS/sim.h
+1
-1
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+4
-4
openair2/ENB_APP/enb_paramdef_emtc.h
openair2/ENB_APP/enb_paramdef_emtc.h
+1
-1
openair2/ENB_APP/enb_paramdef_sidelink.h
openair2/ENB_APP/enb_paramdef_sidelink.h
+42
-42
openair2/LAYER2/NR_MAC_gNB/main.c
openair2/LAYER2/NR_MAC_gNB/main.c
+1
-1
openair2/RRC/NAS/nas_config.c
openair2/RRC/NAS/nas_config.c
+3
-1
openair2/UTIL/OPT/opt.h
openair2/UTIL/OPT/opt.h
+3
-3
openair2/UTIL/OPT/probe.c
openair2/UTIL/OPT/probe.c
+0
-3
openair3/UICC/usim_interface.c
openair3/UICC/usim_interface.c
+10
-10
targets/ARCH/COMMON/record_player.h
targets/ARCH/COMMON/record_player.h
+2
-2
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+3
-3
targets/RT/USER/lte-softmodem.h
targets/RT/USER/lte-softmodem.h
+1
-1
No files found.
common/config/config_cmdline.c
View file @
65b399fc
...
...
@@ -53,13 +53,15 @@ int parse_stringlist(paramdef_t *cfgoptions, char *val) {
}
free
(
tmpval
);
config_check_valptr
(
cfgoptions
,(
char
**
)
&
(
cfgoptions
->
strlistptr
),
sizeof
(
char
*
)
*
numelt
);
AssertFatal
(
MAX_LIST_SIZE
>
numelt
,
""
);
config_check_valptr
(
cfgoptions
,
sizeof
(
char
*
),
numelt
);
cfgoptions
->
numelt
=
numelt
;
atoken
=
strtok_r
(
val
,
","
,
&
tokctx
);
for
(
int
i
=
0
;
i
<
cfgoptions
->
numelt
&&
atoken
!=
NULL
;
i
++
)
{
config_check_valptr
(
cfgoptions
,
&
(
cfgoptions
->
strlistptr
[
i
]),
strlen
(
atoken
)
+
1
);
sprintf
(
cfgoptions
->
strlistptr
[
i
],
"%s"
,
atoken
);
snprintf
(
cfgoptions
->
strlistptr
[
i
],
DEFAULT_EXTRA_SZ
,
"%s"
,
atoken
);
printf_params
(
"[LIBCONFIG] %s[%i]: %s
\n
"
,
cfgoptions
->
optname
,
i
,
cfgoptions
->
strlistptr
[
i
]);
atoken
=
strtok_r
(
NULL
,
","
,
&
tokctx
);
}
...
...
@@ -84,13 +86,14 @@ int processoption(paramdef_t *cfgoptions, char *value) {
char
*
charptr
;
case
TYPE_STRING
:
if
(
cfgoptions
->
numelt
==
0
)
{
config_check_valptr
(
cfgoptions
,
cfgoptions
->
strptr
,
strlen
(
tmpval
)
+
1
);
sprintf
(
*
(
cfgoptions
->
strptr
),
"%s"
,
tmpval
);
}
else
{
sprintf
(
(
char
*
)(
cfgoptions
->
strptr
),
"%s"
,
tmpval
);
if
(
cfgoptions
->
numelt
==
0
)
config_check_valptr
(
cfgoptions
,
1
,
strlen
(
tmpval
)
+
1
);
if
(
cfgoptions
->
numelt
<
(
strlen
(
tmpval
)
+
1
))
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] command line option %s value too long
\n
"
,
cfgoptions
->
optname
);
}
snprintf
(
*
cfgoptions
->
strptr
,
cfgoptions
->
numelt
,
"%s"
,
tmpval
);
printf_cmdl
(
"[CONFIG] %s set to %s from command line
\n
"
,
cfgoptions
->
optname
,
tmpval
);
optisset
=
1
;
break
;
...
...
@@ -105,7 +108,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
case
TYPE_INT16
:
case
TYPE_UINT8
:
case
TYPE_INT8
:
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
iptr
),
sizeof
(
int32_t
)
);
config_check_valptr
(
cfgoptions
,
sizeof
(
*
cfgoptions
->
iptr
),
1
);
config_assign_int
(
cfgoptions
,
cfgoptions
->
optname
,(
int32_t
)
strtol
(
tmpval
,
&
charptr
,
0
));
if
(
*
charptr
!=
0
)
{
...
...
@@ -117,14 +120,14 @@ int processoption(paramdef_t *cfgoptions, char *value) {
case
TYPE_UINT64
:
case
TYPE_INT64
:
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
i64ptr
),
sizeof
(
uint64_t
)
);
config_check_valptr
(
cfgoptions
,
sizeof
(
*
cfgoptions
->
i64ptr
),
1
);
*
(
cfgoptions
->
i64ptr
)
=
strtoll
(
tmpval
,
&
charptr
,
0
);
if
(
*
charptr
!=
0
)
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] command line, option %s requires an integer argument
\n
"
,
cfgoptions
->
optname
);
}
printf_cmdl
(
"[CONFIG] %s set to %lli from command line
\n
"
,
cfgoptions
->
optname
,
(
long
long
)
*
(
cfgoptions
->
i64ptr
)
);
printf_cmdl
(
"[CONFIG] %s set to %lli from command line
\n
"
,
cfgoptions
->
optname
,
(
long
long
)
*
cfgoptions
->
i64ptr
);
optisset
=
1
;
break
;
...
...
@@ -133,8 +136,8 @@ int processoption(paramdef_t *cfgoptions, char *value) {
break
;
case
TYPE_DOUBLE
:
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
dblptr
),
sizeof
(
double
)
);
*
(
cfgoptions
->
dblptr
)
=
strtof
(
tmpval
,
&
charptr
);
config_check_valptr
(
cfgoptions
,
sizeof
(
*
cfgoptions
->
dblptr
),
1
);
*
cfgoptions
->
dblptr
=
strtof
(
tmpval
,
&
charptr
);
if
(
*
charptr
!=
0
)
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] command line, option %s requires a double argument
\n
"
,
cfgoptions
->
optname
);
...
...
common/config/config_load_configmodule.c
View file @
65b399fc
...
...
@@ -336,17 +336,18 @@ void end_configmodule(void) {
cfgptr
->
end
();
}
pthread_mutex_lock
(
&
cfgptr
->
memBlocks_mutex
);
printf
(
"[CONFIG] free %u config value pointers
\n
"
,
cfgptr
->
numptrs
);
for
(
int
i
=
0
;
i
<
cfgptr
->
numptrs
;
i
++
)
{
if
(
cfgptr
->
ptrs
[
i
]
!=
NULL
&&
cfgptr
->
ptrsAllocated
[
i
]
==
true
)
{
free
(
cfgptr
->
ptrs
[
i
]);
cfgptr
->
ptrs
[
i
]
=
NULL
;
cfgptr
->
ptrsAllocated
[
i
]
=
false
;
if
(
cfgptr
->
oneBlock
[
i
].
ptrs
!=
NULL
&&
cfgptr
->
oneBlock
[
i
].
ptrsAllocated
==
true
&&
cfgptr
->
oneBlock
[
i
].
toFree
)
{
free
(
cfgptr
->
oneBlock
[
i
].
ptrs
);
memset
(
&
cfgptr
->
oneBlock
[
i
],
0
,
sizeof
(
cfgptr
->
oneBlock
[
i
]));
}
}
cfgptr
->
numptrs
=
0
;
pthread_mutex_unlock
(
&
cfgptr
->
memBlocks_mutex
);
}
}
...
...
common/config/config_load_configmodule.h
View file @
65b399fc
...
...
@@ -41,7 +41,7 @@
#include "common/config/config_paramdesc.h"
#include "common/utils/T/T.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 allocated in the config module
#define CONFIG_MAX_ALLOCATEDPTRS
2048
// maximum number of parameters that can be dynamicaly allocated in the config module
/* default values for configuration module parameters */
#define CONFIG_LIBCONFIGFILE "libconfig" // use libconfig file
...
...
@@ -62,6 +62,14 @@ 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
oneBlock_s
{
void
*
ptrs
;
int
sz
;
bool
toFree
;
bool
ptrsAllocated
;
}
oneBlock_t
;
typedef
struct
configmodule_interface
{
int
argc
;
char
**
argv
;
...
...
@@ -73,10 +81,10 @@ typedef struct configmodule_interface {
configmodule_getfunc_t
get
;
configmodule_getlistfunc_t
getlist
;
configmodule_endfunc_t
end
;
pthread_mutex_t
memBlocks_mutex
;
uint32_t
numptrs
;
uint32_t
rtflags
;
char
*
ptrs
[
CONFIG_MAX_ALLOCATEDPTRS
];
bool
ptrsAllocated
[
CONFIG_MAX_ALLOCATEDPTRS
];
oneBlock_t
oneBlock
[
CONFIG_MAX_ALLOCATEDPTRS
];
}
configmodule_interface_t
;
#ifdef CONFIG_LOADCONFIG_MAIN
...
...
common/config/config_paramdesc.h
View file @
65b399fc
...
...
@@ -96,11 +96,13 @@ typedef union checkedparam {
/* paramdef is used to describe a parameter, array of paramdef_t strustures is used as the main parameter in */
/* config apis used to retrieve parameters values */
#define MAX_LIST_SIZE 32
#define DEFAULT_EXTRA_SZ 256
typedef
struct
paramdef
{
char
optname
[
MAX_OPTNAME_SIZE
];
/* parameter name, can be used as long command line option */
char
*
helpstr
;
/* help string */
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 */
char
**
strptr
;
char
**
strlistptr
;
uint8_t
*
u8ptr
;
...
...
common/config/config_userapi.c
View file @
65b399fc
...
...
@@ -52,59 +52,95 @@ configmodule_interface_t *config_get_if(void) {
return
cfgptr
;
}
char
*
config_check_valptr
(
paramdef_t
*
cfgoptions
,
char
**
ptr
,
int
length
)
{
if
(
ptr
==
NULL
)
{
ptr
=
malloc
(
sizeof
(
char
*
));
if
(
ptr
!=
NULL
)
{
*
ptr
=
NULL
;
cfgoptions
->
strptr
=
ptr
;
if
(
(
cfgoptions
->
paramflags
&
PARAMFLAG_NOFREE
)
==
0
)
{
config_get_if
()
->
ptrs
[
config_get_if
()
->
numptrs
]
=
(
char
*
)
ptr
;
config_get_if
()
->
ptrsAllocated
[
config_get_if
()
->
numptrs
]
=
true
;
config_get_if
()
->
numptrs
++
;
}
}
else
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] %s %d option %s, cannot allocate pointer: %s
\n
"
,
__FILE__
,
__LINE__
,
cfgoptions
->
optname
,
strerror
(
errno
));
}
}
static
int
managed_ptr_sz
(
void
*
ptr
)
{
configmodule_interface_t
*
cfg
=
config_get_if
();
AssertFatal
(
cfg
->
numptrs
<
CONFIG_MAX_ALLOCATEDPTRS
,
""
);
int
i
;
pthread_mutex_lock
(
&
cfg
->
memBlocks_mutex
);
int
numptrs
=
cfg
->
numptrs
;
for
(
i
=
0
;
i
<
numptrs
;
i
++
)
if
(
cfg
->
oneBlock
[
i
].
ptrs
==
ptr
)
break
;
pthread_mutex_unlock
(
&
cfg
->
memBlocks_mutex
);
if
(
i
==
numptrs
)
return
-
1
;
else
return
cfg
->
oneBlock
[
i
].
sz
;
}
printf_ptrs
(
"[CONFIG] %s ptr: 0x%08lx requested size: %i
\n
"
,
cfgoptions
->
optname
,(
uintptr_t
)(
ptr
),
length
);
void
*
config_allocate_new
(
int
sz
,
bool
autoFree
)
{
void
*
ptr
=
calloc
(
sz
,
1
);
if
(
ptr
!=
NULL
)
{
configmodule_interface_t
*
cfg
=
config_get_if
();
// add the memory piece in the managed memory pieces list
pthread_mutex_lock
(
&
cfg
->
memBlocks_mutex
);
int
newBlockIdx
=
cfg
->
numptrs
++
;
oneBlock_t
*
tmp
=&
cfg
->
oneBlock
[
newBlockIdx
];
tmp
->
ptrs
=
(
char
*
)
ptr
;
tmp
->
ptrsAllocated
=
true
;
tmp
->
sz
=
sz
;
tmp
->
toFree
=
autoFree
;
pthread_mutex_unlock
(
&
cfg
->
memBlocks_mutex
);
}
else
AssertFatal
(
false
,
"calloc fails
\n
"
);
return
ptr
;
}
if
(
cfgoptions
->
numelt
>
0
&&
PARAM_ISSCALAR
(
cfgoptions
)
)
{
/* already allocated */
if
(
*
ptr
!=
NULL
)
{
return
*
ptr
;
}
else
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] %s %d option %s, definition error: value pointer is NULL, declared as %i bytes allocated
\n
"
,
__FILE__
,
__LINE__
,
cfgoptions
->
optname
,
cfgoptions
->
numelt
);
void
config_check_valptr
(
paramdef_t
*
cfgoptions
,
int
elt_sz
,
int
nb_elt
)
{
const
bool
toFree
=!
(
cfgoptions
->
paramflags
&
PARAMFLAG_NOFREE
);
// let's see if the value has been read
// the datamodel is more difficult than it should be
// and it is not thread safe
if
(
cfgoptions
->
voidptr
)
{
int
sz
;
if
(
cfgoptions
->
type
==
TYPE_STRING
)
sz
=
managed_ptr_sz
(
*
cfgoptions
->
strptr
);
else
sz
=
managed_ptr_sz
(
cfgoptions
->
voidptr
);
if
(
sz
!=
-
1
)
// the same variable pointer has been used!
cfgoptions
->
numelt
=
sz
;
}
if
(
cfgoptions
->
voidptr
!=
NULL
&&
(
cfgoptions
->
type
==
TYPE_INTARRAY
||
cfgoptions
->
type
==
TYPE_UINTARRAY
||
cfgoptions
->
type
==
TYPE_STRINGLIST
))
{
int
sz
;
if
(
cfgoptions
->
type
==
TYPE_STRING
||
cfgoptions
->
type
==
TYPE_STRINGLIST
)
sz
=
managed_ptr_sz
(
*
cfgoptions
->
strptr
);
else
sz
=
managed_ptr_sz
(
cfgoptions
->
voidptr
);
if
(
sz
!=
-
1
)
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] %s NOT SUPPORTED not NULL pointer with array types"
,
cfgoptions
->
optname
);
return
;
}
}
if
(
*
ptr
==
NULL
)
{
// LTS: dummy fix, waiting Francois full fix in 4G branch
// the issue is we don't know at this point the size we will get
// for parmeters on the command line,
// The length sould probably managed, in a later version
// 100 is a very large value for a string parameter of today OAI
if
(
length
<
100
)
length
=
100
;
*
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
++
;
}
if
(
cfgoptions
->
voidptr
==
NULL
)
{
if
(
cfgoptions
->
type
==
TYPE_STRING
)
{
// difficult datamodel
cfgoptions
->
strptr
=
config_allocate_new
(
sizeof
(
*
cfgoptions
->
strptr
),
toFree
);
}
else
if
(
cfgoptions
->
type
==
TYPE_STRINGLIST
)
{
AssertFatal
(
nb_elt
<
MAX_LIST_SIZE
,
""
);
cfgoptions
->
strlistptr
=
config_allocate_new
(
sizeof
(
char
*
)
*
MAX_LIST_SIZE
,
toFree
);
for
(
int
i
=
0
;
i
<
MAX_LIST_SIZE
;
i
++
)
cfgoptions
->
strlistptr
[
i
]
=
config_allocate_new
(
DEFAULT_EXTRA_SZ
,
toFree
);
}
else
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] %s %d malloc error
\n
"
,
__FILE__
,
__LINE__
);
if
(
cfgoptions
->
type
==
TYPE_INTARRAY
||
cfgoptions
->
type
==
TYPE_UINTARRAY
)
nb_elt
=
max
(
nb_elt
,
MAX_LIST_SIZE
);
// make room if the list is larger than the default one
cfgoptions
->
voidptr
=
config_allocate_new
(
elt_sz
*
nb_elt
,
toFree
);
}
}
return
*
ptr
;
if
(
cfgoptions
->
type
==
TYPE_STRING
&&
*
cfgoptions
->
strptr
==
NULL
)
{
*
cfgoptions
->
strptr
=
config_allocate_new
(
nb_elt
+
DEFAULT_EXTRA_SZ
,
toFree
);
cfgoptions
->
numelt
=
nb_elt
+
DEFAULT_EXTRA_SZ
;
}
printf_ptrs
(
"[CONFIG] %s ptr: %p requested size: elt_sz: %d, nb_elt: %d
\n
"
,
cfgoptions
->
optname
,
cfgoptions
->
voidptr
,
elt_sz
,
nb_elt
);
}
void
config_assign_int
(
paramdef_t
*
cfgoptions
,
char
*
fullname
,
int
val
)
{
...
...
@@ -156,7 +192,7 @@ void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val) {
}
}
void
config_assign_processedint
(
paramdef_t
*
cfgoption
,
int
val
)
{
cfgoption
->
processedvalue
=
malloc
(
sizeof
(
int
));
cfgoption
->
processedvalue
=
config_allocate_new
(
sizeof
(
int
),
!
(
cfgoption
->
paramflags
&
PARAMFLAG_NOFREE
));
if
(
cfgoption
->
processedvalue
!=
NULL
)
{
*
(
cfgoption
->
processedvalue
)
=
val
;
...
...
@@ -172,7 +208,7 @@ int config_get_processedint(paramdef_t *cfgoption) {
ret
=*
(
cfgoption
->
processedvalue
);
free
(
cfgoption
->
processedvalue
);
cfgoption
->
processedvalue
=
NULL
;
printf_params
(
"[CONFIG] %s: set from %s to %i
\n
"
,
cfgoption
->
optname
,
*
(
cfgoption
->
strptr
)
,
ret
);
printf_params
(
"[CONFIG] %s: set from %s to %i
\n
"
,
cfgoption
->
optname
,
*
cfgoption
->
strptr
,
ret
);
}
else
{
fprintf
(
stderr
,
"[CONFIG] %s %d %s has no processed integer availablle
\n
"
,
__FILE__
,
__LINE__
,
cfgoption
->
optname
);
ret
=
0
;
...
...
@@ -344,7 +380,7 @@ int config_check_intrange(paramdef_t *param) {
void
print_strvalueerror
(
paramdef_t
*
param
,
char
*
fname
,
char
**
okval
,
int
numokval
)
{
fprintf
(
stderr
,
"[CONFIG] %s: %s: %s invalid value, authorized values:
\n
"
,
fname
,
param
->
optname
,
*
(
param
->
strptr
)
);
fname
,
param
->
optname
,
*
param
->
strptr
);
for
(
int
i
=
0
;
i
<
numokval
;
i
++
)
{
fprintf
(
stderr
,
" %s"
,
okval
[
i
]);
...
...
@@ -360,7 +396,7 @@ int config_check_strval(paramdef_t *param) {
}
for
(
int
i
=
0
;
i
<
param
->
chkPptr
->
s3
.
num_okstrval
;
i
++
)
{
if
(
strcasecmp
(
*
(
param
->
strptr
)
,
param
->
chkPptr
->
s3
.
okstrval
[
i
]
)
==
0
)
{
if
(
strcasecmp
(
*
param
->
strptr
,
param
->
chkPptr
->
s3
.
okstrval
[
i
]
)
==
0
)
{
return
0
;
}
}
...
...
@@ -371,7 +407,7 @@ int config_check_strval(paramdef_t *param) {
int
config_checkstr_assign_integer
(
paramdef_t
*
param
)
{
for
(
int
i
=
0
;
i
<
param
->
chkPptr
->
s3a
.
num_okstrval
;
i
++
)
{
if
(
strcasecmp
(
*
(
param
->
strptr
)
,
param
->
chkPptr
->
s3a
.
okstrval
[
i
]
)
==
0
)
{
if
(
strcasecmp
(
*
param
->
strptr
,
param
->
chkPptr
->
s3a
.
okstrval
[
i
]
)
==
0
)
{
config_assign_processedint
(
param
,
param
->
chkPptr
->
s3a
.
setintval
[
i
]);
return
0
;
}
...
...
@@ -393,14 +429,14 @@ int config_setdefault_string(paramdef_t *cfgoptions, char *prefix) {
if
(
cfgoptions
->
defstrval
!=
NULL
)
{
status
=
1
;
if
(
cfgoptions
->
numelt
==
0
)
{
config_check_valptr
(
cfgoptions
,
cfgoptions
->
strptr
,
strlen
(
cfgoptions
->
defstrval
)
+
1
);
sprintf
(
*
(
cfgoptions
->
strptr
),
"%s"
,
cfgoptions
->
defstrval
);
printf_params
(
"[CONFIG] %s.%s set to default value
\"
%s
\"\n
"
,
((
prefix
==
NULL
)
?
""
:
prefix
),
cfgoptions
->
optname
,
*
(
cfgoptions
->
strptr
));
}
else
{
sprintf
((
char
*
)(
cfgoptions
->
strptr
),
"%s"
,
cfgoptions
->
defstrval
);
printf_params
(
"[CONFIG] %s.%s set to default value
\"
%s
\"\n
"
,
((
prefix
==
NULL
)
?
""
:
prefix
),
cfgoptions
->
optname
,
(
char
*
)(
cfgoptions
->
strptr
));
if
(
cfgoptions
->
numelt
==
0
)
config_check_valptr
(
cfgoptions
,
1
,
strlen
(
cfgoptions
->
defstrval
)
+
1
);
if
(
cfgoptions
->
numelt
<
strlen
(
cfgoptions
->
defstrval
)
+
1
)
{
CONFIG_PRINTF_ERROR
(
"[CONFIG] %s size too small
\n
"
,
cfgoptions
->
optname
);
}
snprintf
(
*
cfgoptions
->
strptr
,
cfgoptions
->
numelt
,
"%s"
,
cfgoptions
->
defstrval
);
printf_params
(
"[CONFIG] %s.%s set to default value
\"
%s
\"\n
"
,
((
prefix
==
NULL
)
?
""
:
prefix
),
cfgoptions
->
optname
,
*
cfgoptions
->
strptr
);
}
return
status
;
...
...
@@ -422,7 +458,7 @@ int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix) {
int
config_setdefault_int
(
paramdef_t
*
cfgoptions
,
char
*
prefix
)
{
int
status
=
0
;
config_check_valptr
(
cfgoptions
,
(
char
**
)(
&
(
cfgoptions
->
iptr
)),
sizeof
(
int32_t
)
);
config_check_valptr
(
cfgoptions
,
sizeof
(
*
cfgoptions
->
iptr
),
1
);
if
(
((
cfgoptions
->
paramflags
&
PARAMFLAG_MANDATORY
)
==
0
))
{
config_assign_int
(
cfgoptions
,
cfgoptions
->
optname
,
cfgoptions
->
defintval
);
...
...
@@ -435,7 +471,7 @@ int config_setdefault_int(paramdef_t *cfgoptions, char *prefix) {
int
config_setdefault_int64
(
paramdef_t
*
cfgoptions
,
char
*
prefix
)
{
int
status
=
0
;
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
i64ptr
),
sizeof
(
long
long
)
);
config_check_valptr
(
cfgoptions
,
sizeof
(
*
cfgoptions
->
i64ptr
),
1
);
if
(
((
cfgoptions
->
paramflags
&
PARAMFLAG_MANDATORY
)
==
0
))
{
*
(
cfgoptions
->
u64ptr
)
=
cfgoptions
->
defuintval
;
...
...
@@ -450,7 +486,7 @@ int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) {
int
status
=
0
;
if
(
cfgoptions
->
defintarrayval
!=
NULL
)
{
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
iptr
),
sizeof
(
int32_t
*
)
);
config_check_valptr
(
cfgoptions
,
sizeof
(
cfgoptions
->
iptr
),
cfgoptions
->
numelt
);
cfgoptions
->
iptr
=
cfgoptions
->
defintarrayval
;
status
=
1
;
...
...
@@ -464,7 +500,7 @@ int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) {
int
config_setdefault_double
(
paramdef_t
*
cfgoptions
,
char
*
prefix
)
{
int
status
=
0
;
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
dblptr
),
sizeof
(
double
)
);
config_check_valptr
(
cfgoptions
,
sizeof
(
*
cfgoptions
->
dblptr
),
1
);
if
(
((
cfgoptions
->
paramflags
&
PARAMFLAG_MANDATORY
)
==
0
))
{
*
(
cfgoptions
->
dblptr
)
=
cfgoptions
->
defdblval
;
...
...
@@ -476,7 +512,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
}
int
config_assign_ipv4addr
(
paramdef_t
*
cfgoptions
,
char
*
ipv4addr
)
{
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
uptr
),
sizeof
(
int
)
);
config_check_valptr
(
cfgoptions
,
sizeof
(
*
cfgoptions
->
uptr
),
1
);
int
rst
=
inet_pton
(
AF_INET
,
ipv4addr
,
cfgoptions
->
uptr
);
if
(
rst
==
1
&&
*
(
cfgoptions
->
uptr
)
>
0
)
{
...
...
common/config/config_userapi.h
View file @
65b399fc
...
...
@@ -51,7 +51,7 @@ extern int config_paramidx_fromname(paramdef_t *params,int numparams, char *name
/* utility functions, to be used by configuration module and/or configuration libraries */
extern
configmodule_interface_t
*
config_get_if
(
void
);
extern
char
*
config_check_valptr
(
paramdef_t
*
cfgoptions
,
char
**
ptr
,
int
length
)
;
void
config_check_valptr
(
paramdef_t
*
cfgoptions
,
int
elt_sz
,
int
nb_elt
)
;
extern
void
config_printhelp
(
paramdef_t
*
,
int
numparams
,
char
*
prefix
);
extern
int
config_process_cmdline
(
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
);
extern
void
config_assign_processedint
(
paramdef_t
*
cfgoption
,
int
val
);
...
...
@@ -86,7 +86,7 @@ extern int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix);
extern
int
config_setdefault_intlist
(
paramdef_t
*
cfgoptions
,
char
*
prefix
);
extern
int
config_setdefault_double
(
paramdef_t
*
cfgoptions
,
char
*
prefix
);
extern
int
config_setdefault_ipv4addr
(
paramdef_t
*
cfgoptions
,
char
*
prefix
);
void
*
config_allocate_new
(
int
sz
,
bool
autoFree
);
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
#ifdef __cplusplus
...
...
common/config/libconfig/config_libconfig.c
View file @
65b399fc
...
...
@@ -29,6 +29,7 @@
* \warning
*/
#define _GNU_SOURCE
#include <pthread.h>
#include <libconfig.h>
#include <string.h>
...
...
@@ -41,6 +42,7 @@
#include "config_libconfig_private.h"
#include "../config_userapi.h"
#include "errno.h"
#include "assertions.h"
#if ( LIBCONFIG_VER_MAJOR == 1 && LIBCONFIG_VER_MINOR < 5)
#define config_setting_lookup config_lookup_from
...
...
@@ -53,17 +55,16 @@ int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath
int
st
;
int
numelt
;
numelt
=
config_setting_length
(
setting
);
config_check_valptr
(
cfgoptions
,
(
char
**
)
&
(
cfgoptions
->
strlistptr
),
sizeof
(
char
*
)
*
numelt
);
config_check_valptr
(
cfgoptions
,
sizeof
(
char
*
),
numelt
);
st
=
0
;
AssertFatal
(
MAX_LIST_SIZE
>
numelt
,
""
);
for
(
int
i
=
0
;
i
<
numelt
;
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
{
config_check_valptr
(
cfgoptions
,
&
(
cfgoptions
->
strlistptr
[
i
]),
strlen
(
str
)
+
1
);
sprintf
(
cfgoptions
->
strlistptr
[
i
],
"%s"
,
str
);
snprintf
(
cfgoptions
->
strlistptr
[
i
],
DEFAULT_EXTRA_SZ
,
"%s"
,
str
);
st
++
;
printf_params
(
"[LIBCONFIG] %s%i: %s
\n
"
,
cfgpath
,
i
,
cfgoptions
->
strlistptr
[
i
]);
}
...
...
@@ -77,7 +78,8 @@ int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpat
cfgoptions
->
numelt
=
config_setting_length
(
setting
);
if
(
cfgoptions
->
numelt
>
0
)
{
cfgoptions
->
iptr
=
malloc
(
sizeof
(
int
)
*
(
cfgoptions
->
numelt
));
cfgoptions
->
iptr
=
config_allocate_new
(
cfgoptions
->
numelt
*
sizeof
(
*
cfgoptions
->
iptr
),
!
(
cfgoptions
->
paramflags
&
PARAMFLAG_NOFREE
)
);
for
(
int
i
=
0
;
i
<
cfgoptions
->
numelt
&&
cfgoptions
->
iptr
!=
NULL
;
i
++
)
{
cfgoptions
->
iptr
[
i
]
=
config_setting_get_int_elem
(
setting
,
i
);
...
...
@@ -123,23 +125,14 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
switch
(
cfgoptions
[
i
].
type
)
{
case
TYPE_STRING
:
if
(
config_lookup_string
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
(
const
char
**
)
&
str
))
{
if
(
cfgoptions
[
i
].
numelt
>
0
&&
str
!=
NULL
&&
strlen
(
str
)
>=
cfgoptions
[
i
].
numelt
)
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
1
,
strlen
(
str
)
+
1
);
if
(
strlen
(
str
)
+
1
>
cfgoptions
[
i
].
numelt
)
fprintf
(
stderr
,
"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated
\n
"
,
cfgpath
,
str
,
cfgoptions
[
i
].
numelt
);
str
[
strlen
(
str
)
-
1
]
=
0
;
}
if
(
cfgoptions
[
i
].
numelt
==
0
)
{
// config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
config_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
{
sprintf
(
(
char
*
)(
cfgoptions
[
i
].
strptr
)
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s:
\"
%s
\"\n
"
,
cfgpath
,(
char
*
)
cfgoptions
[
i
].
strptr
);
}
snprintf
(
*
cfgoptions
[
i
].
strptr
,
cfgoptions
[
i
].
numelt
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s:
\"
%s
\"\n
"
,
cfgpath
,
*
cfgoptions
[
i
].
strptr
);
}
else
{
defval
=
config_setdefault_string
(
&
(
cfgoptions
[
i
])
,
prefix
);
defval
=
config_setdefault_string
(
&
cfgoptions
[
i
]
,
prefix
);
}
break
;
...
...
@@ -163,7 +156,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
case
TYPE_INT32
:
case
TYPE_MASK
:
if
(
config_lookup_int
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
&
u
))
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
iptr
)),
sizeof
(
int32_t
)
);
config_check_valptr
(
&
(
cfgoptions
[
i
]),
sizeof
(
*
cfgoptions
[
i
].
iptr
),
1
);
config_assign_int
(
&
(
cfgoptions
[
i
]),
cfgpath
,
u
);
}
else
{
defval
=
config_setdefault_int
(
&
(
cfgoptions
[
i
]),
prefix
);
...
...
@@ -174,14 +167,14 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
case
TYPE_UINT64
:
case
TYPE_INT64
:
if
(
config_lookup_int64
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
&
llu
))
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)
&
(
cfgoptions
[
i
].
i64ptr
),
sizeof
(
long
long
)
);
config_check_valptr
(
&
cfgoptions
[
i
],
sizeof
(
*
cfgoptions
[
i
].
i64ptr
),
1
);
if
(
cfgoptions
[
i
].
type
==
TYPE_UINT64
)
{
*
(
cfgoptions
[
i
].
u64ptr
)
=
(
uint64_t
)
llu
;
printf_params
(
"[LIBCONFIG] %s: %l
lu
\n
"
,
cfgpath
,(
long
long
unsigned
)(
*
(
cfgoptions
[
i
].
u64ptr
))
);
printf_params
(
"[LIBCONFIG] %s: %l
u
\n
"
,
cfgpath
,
*
cfgoptions
[
i
].
u64ptr
);
}
else
{
*
(
cfgoptions
[
i
].
i64ptr
)
=
llu
;
printf_params
(
"[LIBCONFIG] %s: %l
ld
\n
"
,
cfgpath
,(
long
long
)(
*
(
cfgoptions
[
i
].
i64ptr
))
);
printf_params
(
"[LIBCONFIG] %s: %l
d
\n
"
,
cfgpath
,
*
cfgoptions
[
i
].
i64ptr
);
}
}
else
{
defval
=
config_setdefault_int64
(
&
(
cfgoptions
[
i
]),
prefix
);
...
...
@@ -203,8 +196,8 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
case
TYPE_DOUBLE
:
if
(
config_lookup_float
(
&
(
libconfig_privdata
.
cfg
),
cfgpath
,
&
dbl
))
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)
&
(
cfgoptions
[
i
].
dblptr
),
sizeof
(
double
)
);
*
(
cfgoptions
[
i
].
dblptr
)
=
dbl
;
config_check_valptr
(
&
cfgoptions
[
i
],
sizeof
(
*
cfgoptions
[
i
].
dblptr
),
1
);
*
cfgoptions
[
i
].
dblptr
=
dbl
;
printf_params
(
"[LIBCONFIG] %s: %lf
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
dblptr
)
);
}
else
{
defval
=
config_setdefault_double
(
&
(
cfgoptions
[
i
]),
prefix
);
...
...
@@ -304,27 +297,10 @@ int config_libconfig_getlist(paramlist_def_t *ParamList,
}
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
);
}
ParamList
->
paramarray
=
config_allocate_new
(
ParamList
->
numelt
*
sizeof
(
paramdef_t
*
),
true
);
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
);
}
ParamList
->
paramarray
[
i
]
=
config_allocate_new
(
numparams
*
sizeof
(
paramdef_t
),
true
);
memcpy
(
ParamList
->
paramarray
[
i
],
params
,
sizeof
(
paramdef_t
)
*
numparams
);
for
(
j
=
0
;
j
<
numparams
;
j
++
)
{
...
...
@@ -346,8 +322,8 @@ 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
);
memset
(
config_get_if
()
->
ptrsAllocated
,
0
,
sizeof
(
config_get_if
()
->
ptrsAllocated
));
pthread_mutex_init
(
&
config_get_if
()
->
memBlocks_mutex
,
NULL
);
memset
(
config_get_if
()
->
oneBlock
,
0
,
sizeof
(
config_get_if
()
->
oneBlock
));
/* search for include path parameter and set config file include path accordingly */
for
(
int
i
=
0
;
i
<
numP
;
i
++
)
{
if
(
strncmp
(
cfgP
[
i
],
"incp"
,
4
)
==
0
)
{
...
...
common/utils/LOG/log.c
View file @
65b399fc
...
...
@@ -325,6 +325,7 @@ void log_getconfig(log_t *g_log)
logparams_logfile
[
i
].
numelt
=
0
;
logparams_level
[
i
].
numelt
=
0
;
logparams_level
[
i
].
type
=
TYPE_STRING
;
logparams_level
[
i
].
defstrval
=
"error"
;
logparams_logfile
[
i
].
type
=
TYPE_UINT
;
logparams_logfile
[
i
].
paramflags
=
logparams_logfile
[
i
].
paramflags
|
PARAMFLAG_BOOL
;
}
...
...
common/utils/LOG/log.h
View file @
65b399fc
...
...
@@ -393,7 +393,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
/* optname help paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define LOG_GLOBALPARAMS_DESC { \
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:
(char **)
&gloglevel, defstrval:log_level_names[3].name, TYPE_STRING, 0}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:&gloglevel, defstrval:log_level_names[3].name, TYPE_STRING, 0}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0} \
}
...
...
common/utils/load_module_shlib.h
View file @
65b399fc
...
...
@@ -79,8 +79,8 @@ loader_data_t loader_data;
/* optname helpstr paramflags XXXptr defXXXval type numelt check func*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define LOADER_PARAMS_DESC { \
{"shlibpath", NULL, PARAMFLAG_NOFREE, strptr:
(char **)&(loader_data.shlibpath)
, defstrval:DEFAULT_PATH, TYPE_STRING, 0, NULL},\
{"maxshlibs", NULL, 0, uptr:&(loader_data.maxshlibs),
defintval:DEFAULT_MAXSHLIBS, TYPE_UINT32, 0, NULL}\
{"shlibpath", NULL, PARAMFLAG_NOFREE, strptr:
&loader_data.shlibpath
, defstrval:DEFAULT_PATH, TYPE_STRING, 0, NULL},\
{"maxshlibs", NULL, 0, uptr:&(loader_data.maxshlibs),defintval:DEFAULT_MAXSHLIBS, TYPE_UINT32, 0, NULL}\
}
/*-------------------------------------------------------------------------------------------------------------*/
...
...
doc/TESTING_5GSA_setup.md
View file @
65b399fc
...
...
@@ -181,21 +181,6 @@ nssai_sd=1;
}
```
Alternatively, the values can be hardcoded/edited in source file
***openair3/UICC/usim_interface.c**
*
through the following lines:
```
bash
#define UICC_PARAMS_DESC {\
{
"imsi"
,
"USIM IMSI
\n
"
, 0, strptr:&
(
uicc->imsiStr
)
, defstrval:
"2089900007487"
, TYPE_STRING, 0
}
,
\
{
"nmc_size"
"number of digits in NMC"
, 0, iptr:&
(
uicc->nmc_size
)
, defintval:2, TYPE_INT, 0
}
,
\
{
"key"
,
"USIM Ki
\n
"
, 0, strptr:&
(
uicc->keyStr
)
, defstrval:
"fec86ba6eb707ed08905757b1bb44b8f"
, TYPE_STRING, 0
}
,
\
{
"opc"
,
"USIM OPc
\n
"
, 0, strptr:&
(
uicc->opcStr
)
, defstrval:
"c42449363bbad02b66d16bc975d77cc1"
, TYPE_STRING, 0
}
,
\
{
"amf"
,
"USIM amf
\n
"
, 0, strptr:&
(
uicc->amfStr
)
, defstrval:
"8000"
, TYPE_STRING, 0
}
,
\
{
"sqn"
,
"USIM sqn
\n
"
, 0, strptr:&
(
uicc->sqnStr
)
, defstrval:
"000000"
, TYPE_STRING, 0
}
,
\
{
"dnn"
,
"UE dnn (apn)
\n
"
, 0, strptr:&
(
uicc->dnnStr
)
, defstrval:
"oai"
, TYPE_STRING, 0
}
,
\
{
"nssai_sst"
,
"UE nssai
\n
"
, 0, iptr:&
(
uicc->nssai_sst
)
, defintval:1, TYPE_INT, 0
}
,
\
{
"nssai_sd"
,
"UE nssai
\n
"
, 0, iptr:&
(
uicc->nssai_sd
)
, defintval:1, TYPE_INT, 0
}
,
\
}
;
```
For interoperability with OAI or other CNs, it should be ensured that the configuration of the aforementioned parameters match the configuration of the corresponding subscribed user at the core network.
...
...
executables/nr-softmodem.h
View file @
65b399fc
...
...
@@ -29,7 +29,7 @@
{"D" , CONFIG_HLP_DLBM_PHYTEST,0, u64ptr:&dlsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \
{"U" , CONFIG_HLP_ULBM_PHYTEST,0, u64ptr:&ulsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:
(char **)
&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
}
...
...
executables/nr-uesoftmodem.h
View file @
65b399fc
...
...
@@ -29,15 +29,15 @@
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_NRUEPARAMS_DESC { \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:
(char **)
&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, u8ptr:&nrUE_params.nr_dlsch_parallel, defintval:0, TYPE_UINT8, 0}, \
{"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:&nrUE_params.ofdm_offset_divisor, defuintval:8, TYPE_UINT32, 0}, \
{"max-ldpc-iterations", CONFIG_HLP_MAX_LDPC_ITERATIONS, 0, u8ptr:&nrUE_params.max_ldpc_iterations, defuintval:5, TYPE_UINT8, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:
(char **)
&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:
(char **)
&rrc_config_path, defstrval:"./", TYPE_STRING, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:&rrc_config_path, defstrval:"./", TYPE_STRING, 0}, \
{"ue-idx-standalone", NULL, 0, u16ptr:&ue_idx_standalone, defuintval:0xFFFF, TYPE_UINT16, 0} \
}
...
...
executables/softmodem-common.h
View file @
65b399fc
...
...
@@ -137,9 +137,9 @@ extern "C"
extern
int
usrp_tx_thread
;
#define CMDLINE_PARAMS_DESC { \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:
(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)
},\
{"split73", CONFIG_HLP_SPLIT73, 0, strptr:
(char **)&SPLIT73, defstrval:NULL, TYPE_STRING, sizeof(SPLIT73)
}, \
{"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:
(char **)&TP_CONFIG, defstrval:"n", TYPE_STRING, sizeof(TP_CONFIG)
}, \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:
&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, 0
},\
{"split73", CONFIG_HLP_SPLIT73, 0, strptr:
&SPLIT73, defstrval:NULL, TYPE_STRING, 0
}, \
{"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:
&TP_CONFIG, defstrval:"n", TYPE_STRING, 0
}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \
{"do-ra", CONFIG_HLP_DORA, PARAMFLAG_BOOL, iptr:&DO_RA, defintval:0, TYPE_INT, 0}, \
{"sa", CONFIG_HLP_SA, PARAMFLAG_BOOL, iptr:&SA, defintval:0, TYPE_INT, 0}, \
...
...
@@ -157,8 +157,8 @@ extern int usrp_tx_thread;
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:1, TYPE_INT, 0}, \
{"band" , CONFIG_HLP_BAND, PARAMFLAG_BOOL, iptr:&BAND, defintval:78, TYPE_INT, 0}, \
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&EMULATE_RF, defintval:0, TYPE_INT, 0}, \
{"parallel-config", CONFIG_HLP_PARALLEL_CMD, 0, strptr:
(char **)
¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:
(char **)
&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"parallel-config", CONFIG_HLP_PARALLEL_CMD, 0, strptr:¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \
{"rfsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&rfsim, defintval:0, TYPE_INT, 0}, \
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
...
...
@@ -189,7 +189,7 @@ extern int usrp_tx_thread;
{CONFIG_FLOG_OPT , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \
{CONFIG_LOGL_OPT , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \
{"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \
{"log-mem", NULL, 0, strptr:
(char **)
&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \
{"log-mem", NULL, 0, strptr:&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \
{"telnetclt", NULL, 0, uptr:&start_telnetclt, defstrval:NULL, TYPE_UINT, 0}, \
}
...
...
@@ -242,9 +242,9 @@ extern int usrp_tx_thread;
typedef
struct
{
uint64_t
optmask
;
//THREAD_STRUCT thread_struct;
char
rf_config_file
[
1024
]
;
char
split73
[
1024
]
;
char
threadPoolConfig
[
1024
]
;
char
*
rf_config_file
;
char
*
split73
;
char
*
threadPoolConfig
;
int
phy_test
;
int
do_ra
;
int
sa
;
...
...
openair1/SIMULATION/TOOLS/random_channel.c
View file @
65b399fc
...
...
@@ -62,7 +62,7 @@ static double snr_dB=25;
static
double
sinr_dB
=
0
;
static
unsigned
int
max_chan
;
static
channel_desc_t
**
defined_channels
;
static
char
modellist_name
[
MAX_OPTNAME_SIZE
]
=
{
0
}
;
static
char
*
modellist_name
;
void
fill_channel_desc
(
channel_desc_t
*
chan_desc
,
...
...
openair1/SIMULATION/TOOLS/sim.h
View file @
65b399fc
...
...
@@ -253,7 +253,7 @@ typedef enum {
{"s" , CONFIG_HLP_SNR, PARAMFLAG_CMDLINE_NOPREFIXENABLED, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0},\
{"sinr_dB", NULL, 0, dblptr:&sinr_dB, defdblval:0 , TYPE_DOUBLE, 0},\
{"max_chan", "Max number of runtime models", 0, uptr:&max_chan, defintval:10, TYPE_UINT, 0},\
{CHANNELMOD_MODELLIST_PARANAME, CHANNELMOD_HELP_MODELLIST, 0, strptr:
(char **)&modellist_name, defstrval:"DefaultChannelList", TYPE_STRING, 60
},\
{CHANNELMOD_MODELLIST_PARANAME, CHANNELMOD_HELP_MODELLIST, 0, strptr:
&modellist_name, defstrval:"DefaultChannelList", TYPE_STRING, 0
},\
}
/* parameters for one model */
...
...
openair2/ENB_APP/enb_config.c
View file @
65b399fc
...
...
@@ -323,7 +323,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
srb1_params_t
srb1_params
;
memset
((
void
*
)
&
srb1_params
,
0
,
sizeof
(
srb1_params_t
));
paramdef_t
SRB1Params
[]
=
SRB1PARAMS_DESC
(
srb1_params
);
paramdef_t
SLParams
[]
=
CCPARAMS_SIDELINK_DESC
(
SLconfig
);
paramdef_t
SLParams
[]
=
CCPARAMS_SIDELINK_DESC
(
SLconfig
);
/* map parameter checking array instances to parameter definition array instances */
for
(
int
I
=
0
;
I
<
(
sizeof
(
CCsParams
)
/
sizeof
(
paramdef_t
)
)
;
I
++
)
{
...
...
@@ -2860,9 +2860,9 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
X2AP_REGISTER_ENB_REQ
(
msg_p
).
enb_port_for_X2C
=
(
uint32_t
)
*
(
NETParams
[
ENB_PORT_FOR_X2C_IDX
].
uptr
);
if
((
NETParams
[
ENB_IPV4_ADDR_FOR_X2C_IDX
].
strptr
==
NULL
)
||
(
X2AP_REGISTER_ENB_REQ
(
msg_p
).
enb_port_for_X2C
==
0
))
{
LOG_E
(
RRC
,
"Add eNB IPv4 address and/or port for X2C in the CONF file!
\n
"
);
exit
(
1
);
}
LOG_E
(
RRC
,
"Add eNB IPv4 address and/or port for X2C in the CONF file!
\n
"
);
exit
(
1
);
}
cidr
=
*
(
NETParams
[
ENB_IPV4_ADDR_FOR_X2C_IDX
].
strptr
);
address
=
strtok
(
cidr
,
"/"
);
...
...
openair2/ENB_APP/enb_paramdef_emtc.h
View file @
65b399fc
...
...
@@ -220,7 +220,7 @@ typedef struct ccparams_eMTC_s {
{ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, NULL, 0, iptr:&eMTCconfig->ccparams.pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PCCH_NB, NULL, 0, strptr:&eMTCconfig->ccparams.pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, NULL, 0, iptr:&eMTCconfig->ccparams.bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, NULL, 0, strptr:&eMTCconfig->ccparams.rach_preamblesGroupAConfig, defstrval:"", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, NULL, 0, strptr:&eMTCconfig->ccparams.rach_preamblesGroupAConfig, defstrval:"
DISABLE
", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T300, NULL, 0, iptr:&eMTCconfig->ccparams.ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T301, NULL, 0, iptr:&eMTCconfig->ccparams.ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T310, NULL, 0, iptr:&eMTCconfig->ccparams.ue_TimersAndConstants_t310, defintval:1000, TYPE_UINT, 0}, \
...
...
openair2/ENB_APP/enb_paramdef_sidelink.h
View file @
65b399fc
...
...
@@ -119,15 +119,15 @@ typedef struct ccparams_sidelink_s {
libconfig_int
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused
;
//For discRxPoolPS
char
*
discRxPoolPS_cp_Len
;
c
onst
c
har
*
discRxPoolPS_discPeriod
;
char
*
discRxPoolPS_discPeriod
;
libconfig_int
discRxPoolPS_numRetx
;
libconfig_int
discRxPoolPS_numRepetition
;
libconfig_int
discRxPoolPS_ResourceConfig_prb_Num
;
libconfig_int
discRxPoolPS_ResourceConfig_prb_Start
;
libconfig_int
discRxPoolPS_ResourceConfig_prb_End
;
c
onst
c
har
*
discRxPoolPS_ResourceConfig_offsetIndicator_present
;
char
*
discRxPoolPS_ResourceConfig_offsetIndicator_present
;
libconfig_int
discRxPoolPS_ResourceConfig_offsetIndicator_choice
;
c
onst
c
har
*
discRxPoolPS_ResourceConfig_subframeBitmap_present
;
char
*
discRxPoolPS_ResourceConfig_subframeBitmap_present
;
char
*
discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf
;
libconfig_int
discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size
;
libconfig_int
discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused
;
...
...
@@ -139,44 +139,44 @@ typedef struct ccparams_sidelink_s {
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CCPARAMS_SIDELINK_DESC(SLparams) { \
{"sidelink_configured", NULL, 0, iptr:
(int*)
&SLparams.sidelink_configured, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_SC_CP_LEN, NULL, 0, strptr:
(char **)
&SLparams.rxPool_sc_CP_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_SC_PRIOD, NULL, 0, strptr:
(char **)
&SLparams.rxPool_sc_Period, defstrval:"sf40", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_DATA_CP_LEN, NULL, 0, strptr:
(char **)
&SLparams.rxPool_data_CP_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_PRB_NUM, NULL, 0, iptr:
(int32_t *)
&SLparams.rxPool_ResourceConfig_prb_Num, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_PRB_START, NULL, 0, iptr:
(int32_t *)
&SLparams.rxPool_ResourceConfig_prb_Start, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_PRB_END, NULL, 0, iptr:
(int32_t *)
&SLparams.rxPool_ResourceConfig_prb_End, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_OFFSETIND_PRESENT, NULL, 0, strptr:
(char **)
&SLparams.rxPool_ResourceConfig_offsetIndicator_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_OFFSETIND_CHOICE, NULL, 0, iptr:
(int32_t *)
&SLparams.rxPool_ResourceConfig_offsetIndicator_choice, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_PRESENT, NULL, 0, strptr:
(char **)
&SLparams.rxPool_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:
(char **)
&SLparams.rxPool_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:
(int32_t *)
&SLparams.rxPool_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED, NULL, 0, iptr:
(int32_t *)
&SLparams.rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_CP_LEN, NULL, 0, strptr:
(char **)
&SLparams.discRxPool_cp_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_DISCPERIOD, NULL, 0, strptr:
(char **)
&SLparams.discRxPool_discPeriod, defstrval:"rf32", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_NUMRETX, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_numRetx, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_NUMREPETITION, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_numRepetition, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_PRB_NUM, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_ResourceConfig_prb_Num, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_PRB_START, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_ResourceConfig_prb_Start, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_PRB_END, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_ResourceConfig_prb_End, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_OFFSETIND_PRESENT, NULL, 0, strptr:
(char **)
&SLparams.discRxPool_ResourceConfig_offsetIndicator_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_OFFSETIND_CHOICE, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_ResourceConfig_offsetIndicator_choice, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_PRESENT, NULL, 0, strptr:
(char **)
&SLparams.discRxPool_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:
(char **)
&SLparams.discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED,NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_CP_LEN, NULL, 0, strptr:
(char **)
&SLparams.discRxPoolPS_cp_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_DISCPERIOD, NULL, 0, strptr:
(char **)
&SLparams.discRxPoolPS_discPeriod, defstrval:"rf32", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_NUMRETX, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_numRetx, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_NUMREPETITION, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_numRepetition, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_NUM, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_ResourceConfig_prb_Num, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_START, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_ResourceConfig_prb_Start, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_END, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_ResourceConfig_prb_End, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_PRESENT, NULL, 0, strptr:
(char **)
&SLparams.discRxPoolPS_ResourceConfig_offsetIndicator_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_CHOICE, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_ResourceConfig_offsetIndicator_choice, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_PRESENT, NULL, 0, strptr:
(char **)
&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:
(char **)
&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED,NULL, 0, iptr:
(int32_t *)
&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0} \
{"sidelink_configured", NULL, 0, iptr:&SLparams.sidelink_configured, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_SC_CP_LEN, NULL, 0, strptr:&SLparams.rxPool_sc_CP_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_SC_PRIOD, NULL, 0, strptr:&SLparams.rxPool_sc_Period, defstrval:"sf40", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_DATA_CP_LEN, NULL, 0, strptr:&SLparams.rxPool_data_CP_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_PRB_NUM, NULL, 0, iptr:&SLparams.rxPool_ResourceConfig_prb_Num, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_PRB_START, NULL, 0, iptr:&SLparams.rxPool_ResourceConfig_prb_Start, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_PRB_END, NULL, 0, iptr:&SLparams.rxPool_ResourceConfig_prb_End, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_OFFSETIND_PRESENT, NULL, 0, strptr:&SLparams.rxPool_ResourceConfig_offsetIndicator_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_OFFSETIND_CHOICE, NULL, 0, iptr:&SLparams.rxPool_ResourceConfig_offsetIndicator_choice, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_PRESENT, NULL, 0, strptr:&SLparams.rxPool_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:&SLparams.rxPool_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:&SLparams.rxPool_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED, NULL, 0, iptr:&SLparams.rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_CP_LEN, NULL, 0, strptr:&SLparams.discRxPool_cp_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_DISCPERIOD, NULL, 0, strptr:&SLparams.discRxPool_discPeriod, defstrval:"rf32", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_NUMRETX, NULL, 0, iptr:&SLparams.discRxPool_numRetx, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_NUMREPETITION, NULL, 0, iptr:&SLparams.discRxPool_numRepetition, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_PRB_NUM, NULL, 0, iptr:&SLparams.discRxPool_ResourceConfig_prb_Num, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_PRB_START, NULL, 0, iptr:&SLparams.discRxPool_ResourceConfig_prb_Start, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_PRB_END, NULL, 0, iptr:&SLparams.discRxPool_ResourceConfig_prb_End, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_OFFSETIND_PRESENT, NULL, 0, strptr:&SLparams.discRxPool_ResourceConfig_offsetIndicator_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_OFFSETIND_CHOICE, NULL, 0, iptr:&SLparams.discRxPool_ResourceConfig_offsetIndicator_choice, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_PRESENT, NULL, 0, strptr:&SLparams.discRxPool_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:&SLparams.discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:&SLparams.discRxPool_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOL_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED,NULL, 0, iptr:&SLparams.discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_CP_LEN, NULL, 0, strptr:&SLparams.discRxPoolPS_cp_Len, defstrval:"normal", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_DISCPERIOD, NULL, 0, strptr:&SLparams.discRxPoolPS_discPeriod, defstrval:"rf32", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_NUMRETX, NULL, 0, iptr:&SLparams.discRxPoolPS_numRetx, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_NUMREPETITION, NULL, 0, iptr:&SLparams.discRxPoolPS_numRepetition, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_NUM, NULL, 0, iptr:&SLparams.discRxPoolPS_ResourceConfig_prb_Num, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_START, NULL, 0, iptr:&SLparams.discRxPoolPS_ResourceConfig_prb_Start, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_PRB_END, NULL, 0, iptr:&SLparams.discRxPoolPS_ResourceConfig_prb_End, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_PRESENT, NULL, 0, strptr:&SLparams.discRxPoolPS_ResourceConfig_offsetIndicator_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_OFFSETIND_CHOICE, NULL, 0, iptr:&SLparams.discRxPoolPS_ResourceConfig_offsetIndicator_choice, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_PRESENT, NULL, 0, strptr:&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_BUF, NULL, 0, strptr:&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf, defstrval:"001001", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_SIZE, NULL, 0, iptr:&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DISCRXPOOLPS_RC_SFBITMAP_CHOICE_BS_ASN_BITS_UNUSED,NULL, 0, iptr:&SLparams.discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused, defintval:1, TYPE_UINT, 0} \
}
#endif
openair2/LAYER2/NR_MAC_gNB/main.c
View file @
65b399fc
...
...
@@ -238,8 +238,8 @@ void mac_top_init_gNB(ngran_node_t node_type)
RC
.
nrmac
[
i
]
->
pre_processor_ul
=
nr_init_fr1_ulsch_preprocessor
(
i
,
0
);
}
if
(
!
IS_SOFTMODEM_NOSTATS_BIT
)
pthread_create
(
&
RC
.
nrmac
[
i
]
->
stats_thread
,
NULL
,
nrmac_stats_thread
,
(
void
*
)
RC
.
nrmac
[
i
]);
threadCreate
(
&
RC
.
nrmac
[
i
]
->
stats_thread
,
nrmac_stats_thread
,
(
void
*
)
RC
.
nrmac
[
i
],
"MAC_STATS"
,
-
1
,
sched_get_priority_min
(
SCHED_OAI
)
+
1
);
mac_rrc_init
(
RC
.
nrmac
[
i
],
node_type
);
}
//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
...
...
openair2/RRC/NAS/nas_config.c
View file @
65b399fc
...
...
@@ -56,7 +56,9 @@ char *broadcastAddr ;
#define NASHLP_NETMASK "<NAS network mask>\n"
#define NASHLP_BROADCASTADDR "<NAS network broadcast address>\n"
void
nas_getparams
(
void
)
{
paramdef_t
nasoptions
[]
=
{
// this datamodel require this static because we partially keep data like baseNetAddress (malloc on a global)
// but we loose the opther attributes in nasoptions between two calls if is is not static !
static
paramdef_t
nasoptions
[]
=
{
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* configuration parameters for netlink, includes network parameters when running in noS1 mode */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
...
...
openair2/UTIL/OPT/opt.h
View file @
65b399fc
...
...
@@ -74,9 +74,9 @@ typedef guint8 gboolean;
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*---------------------------------------------------------------------------------------------------------------------------------------------*/
#define OPT_PARAMS_DESC { \
{"type" , CONFIG_HLP_TYPEMON, 0, strptr:
(char**)
&in_type, defstrval:"none", TYPE_STRING, 0}, \
{"ip" , CONFIG_HLP_L2MONIP, 0, strptr:
(char**)
&in_ip, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{"path" , CONFIG_HLP_L2MONPATH, 0, strptr:
(char**)
&in_path,defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, 0}, \
{"type" , CONFIG_HLP_TYPEMON, 0, strptr:&in_type, defstrval:"none", TYPE_STRING, 0}, \
{"ip" , CONFIG_HLP_L2MONIP, 0, strptr:&in_ip, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{"path" , CONFIG_HLP_L2MONPATH, 0, strptr:&in_path,defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, 0}, \
}
#define OPTTYPE_IDX 0
...
...
openair2/UTIL/OPT/probe.c
View file @
65b399fc
...
...
@@ -540,9 +540,6 @@ void trace_pdu_implementation(int nr, int direction, uint8_t *pdu_buffer, unsign
/*---------------------------------------------------*/
int
init_opt
(
void
)
{
in_type
=
malloc
(
200
);
in_ip
=
malloc
(
200
);
in_path
=
malloc
(
200
);
paramdef_t
opt_params
[]
=
OPT_PARAMS_DESC
;
checkedparam_t
opt_checkParams
[]
=
OPTPARAMS_CHECK_DESC
;
config_set_checkfunctions
(
opt_params
,
opt_checkParams
,
...
...
openair3/UICC/usim_interface.c
View file @
65b399fc
...
...
@@ -35,16 +35,16 @@ extern uint16_t NB_UE_INST;
/* configuration parameters for the rfsimulator device */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define UICC_PARAMS_DESC {\
{"imsi", "USIM IMSI\n", 0, strptr:&
(uicc->imsiStr), defstrval:"2089900007487", TYPE_STRING, 0 },
\
{"nmc_size" "number of digits in NMC", 0, iptr:&(uicc->nmc_size), defintval:2, TYPE_INT, 0 },
\
{"key", "USIM Ki\n", 0, strptr:&(uicc->keyStr), defstrval:"fec86ba6eb707ed08905757b1bb44b8f", TYPE_STRING, 0 },
\
{"opc", "USIM OPc\n", 0, strptr:&(uicc->opcStr), defstrval:"c42449363bbad02b66d16bc975d77cc1", TYPE_STRING, 0 },
\
{"amf", "USIM amf\n", 0, strptr:&(uicc->amfStr), defstrval:"8000", TYPE_STRING, 0 },
\
{"sqn", "USIM sqn\n", 0, strptr:&(uicc->sqnStr), defstrval:"000000", TYPE_STRING, 0 },
\
{"dnn", "UE dnn (apn)\n", 0, strptr:&(uicc->dnnStr), defstrval:"oai", TYPE_STRING, 0 },
\
{"nssai_sst", "UE nssai\n", 0, iptr:&
(uicc->nssai_sst)
, defintval:1, TYPE_INT, 0 }, \
{"nssai_sd", "UE nssai\n", 0, iptr:&
(uicc->nssai_sd)
, defintval:1, TYPE_INT, 0 }, \
#define UICC_PARAMS_DESC {
\
{"imsi", "USIM IMSI\n", 0, strptr:&
uicc->imsiStr, defstrval:"2089900007487", TYPE_STRING, 0 },
\
{"nmc_size" "number of digits in NMC", 0, iptr:&uicc->nmc_size, defintval:2, TYPE_INT, 0 },
\
{"key", "USIM Ki\n", 0, strptr:&uicc->keyStr, defstrval:"fec86ba6eb707ed08905757b1bb44b8f", TYPE_STRING, 0 },
\
{"opc", "USIM OPc\n", 0, strptr:&uicc->opcStr, defstrval:"c42449363bbad02b66d16bc975d77cc1", TYPE_STRING, 0 },
\
{"amf", "USIM amf\n", 0, strptr:&uicc->amfStr, defstrval:"8000", TYPE_STRING, 0 },
\
{"sqn", "USIM sqn\n", 0, strptr:&uicc->sqnStr, defstrval:"000000", TYPE_STRING, 0 },
\
{"dnn", "UE dnn (apn)\n", 0, strptr:&uicc->dnnStr, defstrval:"oai", TYPE_STRING, 0 },
\
{"nssai_sst", "UE nssai\n", 0, iptr:&
uicc->nssai_sst
, defintval:1, TYPE_INT, 0 }, \
{"nssai_sd", "UE nssai\n", 0, iptr:&
uicc->nssai_sd
, defintval:1, TYPE_INT, 0 }, \
};
static
uicc_t
**
uiccArray
=
NULL
;
...
...
targets/ARCH/COMMON/record_player.h
View file @
65b399fc
...
...
@@ -95,7 +95,7 @@ typedef struct {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define DEVICE_RECPLAY_PARAMS_DESC { \
{CONFIG_OPT_SF_FILE, CONFIG_HLP_SF_FILE, 0, strptr:
(char **)((*recplay_conf)->u_sf_filename), defstrval:DEF_SF_FILE, TYPE_STRING, 1024
}, \
{CONFIG_OPT_SF_FILE, CONFIG_HLP_SF_FILE, 0, strptr:
&((*recplay_conf)->u_sf_filename), defstrval:DEF_SF_FILE, TYPE_STRING, 0
}, \
{CONFIG_OPT_SF_REC, CONFIG_HLP_SF_REC, PARAMFLAG_BOOL, uptr:&(u_sf_record), defuintval:0, TYPE_UINT, 0}, \
{CONFIG_OPT_SF_REP, CONFIG_HLP_SF_REP, PARAMFLAG_BOOL, uptr:&(u_sf_replay), defuintval:0, TYPE_UINT, 0}, \
{CONFIG_OPT_SF_MAX, CONFIG_HLP_SF_MAX, 0, uptr:&((*recplay_conf)->u_sf_max), defintval:DEF_NB_SF, TYPE_UINT, 0}, \
...
...
@@ -105,7 +105,7 @@ typedef struct {
{CONFIG_OPT_USE_MMAP, CONFIG_HLP_USE_MMAP, PARAMFLAG_BOOL, uptr:&((*recplay_conf)->use_mmap), defuintval:1, TYPE_UINT, 0}, \
}
/*! \brief Record Player Configuration and state */
typedef
struct
{
char
u_sf_filename
[
1024
]
;
// subframes file path
char
*
u_sf_filename
;
// subframes file path
unsigned
int
u_sf_max
;
// max number of recorded subframes
unsigned
int
u_sf_loops
;
// number of loops in replay mode
unsigned
int
u_sf_read_delay
;
// read delay in replay mode
...
...
targets/ARCH/rfsimulator/simulator.c
View file @
65b399fc
...
...
@@ -77,11 +77,11 @@
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define simOpt PARAMFLAG_NOFREE|PARAMFLAG_CMDLINE_NOPREFIXENABLED
#define RFSIMULATOR_PARAMS_DESC { \
{"serveraddr", "<ip address to connect to>\n", simOpt, strptr:&
(rfsimulator->ip)
, defstrval:"127.0.0.1", TYPE_STRING, 0 },\
{"serveraddr", "<ip address to connect to>\n", simOpt, strptr:&
rfsimulator->ip
, defstrval:"127.0.0.1", TYPE_STRING, 0 },\
{"serverport", "<port to connect to>\n", simOpt, u16ptr:&(rfsimulator->port), defuintval:PORT, TYPE_UINT16, 0 },\
{RFSIMU_OPTIONS_PARAMNAME, RFSIM_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0 },\
{"IQfile", "<file path to use when saving IQs>\n",simOpt, strptr:&
(saveF)
, defstrval:"/tmp/rfsimulator.iqs",TYPE_STRING, 0 },\
{"modelname", "<channel model name>\n", simOpt, strptr:&
(modelname)
, defstrval:"AWGN", TYPE_STRING, 0 },\
{"IQfile", "<file path to use when saving IQs>\n",simOpt, strptr:&
saveF
, defstrval:"/tmp/rfsimulator.iqs",TYPE_STRING, 0 },\
{"modelname", "<channel model name>\n", simOpt, strptr:&
modelname
, defstrval:"AWGN", TYPE_STRING, 0 },\
{"ploss", "<channel path loss in dB>\n", simOpt, dblptr:&(rfsimulator->chan_pathloss), defdblval:0, TYPE_DOUBLE, 0 },\
{"forgetfact", "<channel forget factor ((0 to 1)>\n", simOpt, dblptr:&(rfsimulator->chan_forgetfact), defdblval:0, TYPE_DOUBLE, 0 },\
{"offset", "<channel offset in samps>\n", simOpt, iptr:&(rfsimulator->chan_offset), defintval:0, TYPE_INT, 0 }\
...
...
targets/RT/USER/lte-softmodem.h
View file @
65b399fc
...
...
@@ -107,7 +107,7 @@
{"nums_ue_thread", NULL, 0, u16ptr:&(NB_THREAD_INST), defuintval:1, TYPE_UINT16, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:
(char **)
&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 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