Commit 4f0fd061 authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

Merge branch 'develop_integration_2018_w47' into 'develop'

Develop integration 2018 week 47

See merge request oai/openairinterface5g!456
parents 4fdccd3b 55732deb
...@@ -630,7 +630,6 @@ add_boolean_option(ENABLE_VCD True "always true now, time measurem ...@@ -630,7 +630,6 @@ add_boolean_option(ENABLE_VCD True "always true now, time measurem
add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)") add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)")
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???") add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False") add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
add_boolean_option(LOG_NO_THREAD True "Disable thread for log, seems always set to true")
add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true") add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
########################## ##########################
...@@ -1927,6 +1926,7 @@ add_executable(lte-softmodem ...@@ -1927,6 +1926,7 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
...@@ -1966,6 +1966,7 @@ add_executable(lte-softmodem-nos1 ...@@ -1966,6 +1966,7 @@ add_executable(lte-softmodem-nos1
${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
...@@ -2003,6 +2004,7 @@ add_executable(lte-uesoftmodem ...@@ -2003,6 +2004,7 @@ add_executable(lte-uesoftmodem
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c ${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
...@@ -2041,6 +2043,7 @@ add_executable(lte-uesoftmodem-nos1 ...@@ -2041,6 +2043,7 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c ${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
......
...@@ -651,6 +651,9 @@ function main() { ...@@ -651,6 +651,9 @@ function main() {
compilations \ compilations \
lte-simulators coding \ lte-simulators coding \
libcoding.so $dbin/libcoding.so libcoding.so $dbin/libcoding.so
# compilations \
# lte-simulators $config_libconfig_shlib \
# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi fi
# Core simulators # Core simulators
......
...@@ -39,40 +39,38 @@ ...@@ -39,40 +39,38 @@
#include "config_userapi.h" #include "config_userapi.h"
int parse_stringlist(paramdef_t *cfgoptions, char *val) int parse_stringlist(paramdef_t *cfgoptions, char *val) {
{ char *atoken;
char *atoken; char *tokctx;
char *tokctx; char *tmpval=strdup(val);
char *tmpval=strdup(val); int numelt=0;
int numelt=0;
cfgoptions->numelt=0; cfgoptions->numelt=0;
atoken=strtok_r(tmpval, ",",&tokctx); atoken=strtok_r(tmpval, ",",&tokctx);
while(atoken != NULL) { while(atoken != NULL) {
numelt++ ; numelt++ ;
atoken=strtok_r(NULL, ",",&tokctx); atoken=strtok_r(NULL, ",",&tokctx);
} }
free(tmpval); free(tmpval);
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt); config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
cfgoptions->numelt=numelt; cfgoptions->numelt=numelt;
atoken=strtok_r(val, ",",&tokctx); atoken=strtok_r(val, ",",&tokctx);
for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) { for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) {
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(atoken)+1); config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(atoken)+1);
sprintf(cfgoptions->strlistptr[i],"%s",atoken); sprintf(cfgoptions->strlistptr[i],"%s",atoken);
printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]); printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]);
atoken=strtok_r(NULL, ",",&tokctx); atoken=strtok_r(NULL, ",",&tokctx);
} }
return (cfgoptions->numelt > 0); return (cfgoptions->numelt > 0);
} }
int processoption(paramdef_t *cfgoptions, char *value) int processoption(paramdef_t *cfgoptions, char *value) {
{ char *tmpval = value;
char *tmpval = value; int optisset=0;
int optisset=0; char defbool[2]="1";
char defbool[2]="1";
if ( value == NULL) { if ( value == NULL) {
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */ if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
...@@ -82,8 +80,8 @@ char defbool[2]="1"; ...@@ -82,8 +80,8 @@ char defbool[2]="1";
tmpval = defbool; tmpval = defbool;
} }
} }
switch(cfgoptions->type)
{ switch(cfgoptions->type) {
case TYPE_STRING: case TYPE_STRING:
if (cfgoptions->numelt == 0 ) { if (cfgoptions->numelt == 0 ) {
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1); config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
...@@ -91,6 +89,7 @@ char defbool[2]="1"; ...@@ -91,6 +89,7 @@ char defbool[2]="1";
} else { } else {
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval); sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
} }
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval); printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
optisset=1; optisset=1;
break; break;
...@@ -98,6 +97,7 @@ char defbool[2]="1"; ...@@ -98,6 +97,7 @@ char defbool[2]="1";
case TYPE_STRINGLIST: case TYPE_STRINGLIST:
optisset=parse_stringlist(cfgoptions,tmpval); optisset=parse_stringlist(cfgoptions,tmpval);
break; break;
case TYPE_UINT32: case TYPE_UINT32:
case TYPE_INT32: case TYPE_INT32:
case TYPE_UINT16: case TYPE_UINT16:
...@@ -108,6 +108,7 @@ char defbool[2]="1"; ...@@ -108,6 +108,7 @@ char defbool[2]="1";
config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0)); config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0));
optisset=1; optisset=1;
break; break;
case TYPE_UINT64: case TYPE_UINT64:
case TYPE_INT64: case TYPE_INT64:
config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t)); config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t));
...@@ -115,10 +116,11 @@ char defbool[2]="1"; ...@@ -115,10 +116,11 @@ char defbool[2]="1";
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; optisset=1;
break; break;
case TYPE_UINTARRAY: case TYPE_UINTARRAY:
case TYPE_INTARRAY: case TYPE_INTARRAY:
break; break;
case TYPE_DOUBLE: case TYPE_DOUBLE:
config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double)); config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double));
*(cfgoptions->dblptr) = strtof(tmpval,NULL); *(cfgoptions->dblptr) = strtof(tmpval,NULL);
...@@ -127,45 +129,83 @@ char defbool[2]="1"; ...@@ -127,45 +129,83 @@ char defbool[2]="1";
break; break;
case TYPE_IPV4ADDR: case TYPE_IPV4ADDR:
break; break;
default: default:
fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type); fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type);
break; break;
} /* switch on param type */ } /* switch on param type */
if (optisset == 1) { if (optisset == 1) {
cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET; cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET;
} }
return optisset; return optisset;
} }
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) int config_check_cmdlineopt(char *prefix) {
{ int unknowndetected=0;
char testprefix[CONFIG_MAXOPTLENGTH]="";
int finalcheck = 0;
if (prefix != NULL) {
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
finalcheck = 1;
else if (strlen(prefix) > 0) {
sprintf(testprefix,"--%s.",prefix);
}
}
for (int i=1; i<config_get_if()->argc ; i++) {
if ( !finalcheck && strstr(config_get_if()->argv[i],testprefix) == NULL ) continue;
if ( !finalcheck && testprefix[0]==0 && index(config_get_if()->argv[i],'.') != NULL) continue;
if ( !finalcheck && config_get_if()->argv[i][0] == '-' && isdigit(config_get_if()->argv[i][1])) continue;
if ( (config_get_if()->argv_info[i] & CONFIG_CMDLINEOPT_PROCESSED) == 0 ) {
fprintf(stderr,"[CONFIG] unknown option: %s\n",
config_get_if()->argv[i] );
unknowndetected++;
}
}
printf_cmdl("[CONFIG] %i unknown option(s) in command line starting with %s (section %s)\n",
unknowndetected,testprefix,((prefix==NULL)?"":prefix));
return unknowndetected;
} /* parse_cmdline*/
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
int c = config_get_if()->argc; int c = config_get_if()->argc;
int i,j; int i,j;
char *pp; char *pp;
char cfgpath[512]; /* 512 should be enough for the sprintf below */ char cfgpath[CONFIG_MAXOPTLENGTH];
j = 0; j = 0;
i = 0; i = 0;
while (c > 0 ) { while (c > 0 ) {
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */ char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
/* first check help options, either --help, -h or --help_<section> */ /* first check help options, either --help, -h or --help_<section> */
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) { if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
char *tokctx; char *tokctx;
pp=strtok_r(oneargv, "_",&tokctx); pp=strtok_r(oneargv, "_",&tokctx);
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) { if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
if( prefix == NULL) { if( prefix == NULL) {
config_printhelp(cfgoptions,numoptions); config_printhelp(cfgoptions,numoptions);
if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP)))
exit_fun("[CONFIG] Exiting after displaying help\n"); exit_fun("[CONFIG] Exiting after displaying help\n");
} }
} else { } else {
pp=strtok_r(NULL, " ",&tokctx); pp=strtok_r(NULL, " ",&tokctx);
if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) { if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) {
printf ("Help for %s section:\n",prefix); printf ("Help for %s section:\n",prefix);
config_printhelp(cfgoptions,numoptions); config_printhelp(cfgoptions,numoptions);
if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) { if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) {
fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix); fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix);
exit_fun(" Exiting after displaying help\n"); exit_fun(" Exiting after displaying help\n");
...@@ -176,23 +216,29 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) ...@@ -176,23 +216,29 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
/* now, check for non help options */ /* now, check for non help options */
if (oneargv[0] == '-') { if (oneargv[0] == '-') {
for(int n=0;n<numoptions;n++) { for(int n=0; n<numoptions; n++) {
if ( ( cfgoptions[n].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) { if ( ( cfgoptions[n].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) {
continue; continue;
} }
if (prefix != NULL) { if (prefix != NULL) {
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[n].optname); sprintf(cfgpath,"%s.%s",prefix,cfgoptions[n].optname);
} else { } else {
sprintf(cfgpath,"%s",cfgoptions[n].optname); sprintf(cfgpath,"%s",cfgoptions[n].optname);
} }
if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */ if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) { ((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) {
char *valptr=NULL; char *valptr=NULL;
int ret; int ret;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
if (c > 0) { if (c > 0) {
pp = config_get_if()->argv[i+1]; pp = config_get_if()->argv[i+1];
if (pp != NULL ) { if (pp != NULL ) {
ret = strlen(pp); ret = strlen(pp);
if (ret > 0 ) { if (ret > 0 ) {
if (pp[0] != '-') if (pp[0] != '-')
valptr=pp; valptr=pp;
...@@ -201,19 +247,36 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) ...@@ -201,19 +247,36 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
} }
} }
} }
j += processoption(&(cfgoptions[n]), valptr); j += processoption(&(cfgoptions[n]), valptr);
if ( valptr != NULL ) { if ( valptr != NULL ) {
i++; i++;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
c--; c--;
} }
break; break;
} }
} /* for n... */ } /* for n... */
} /* if (oneargv[0] == '-') */ } /* if (oneargv[0] == '-') */
free(oneargv); free(oneargv);
i++; i++;
c--; c--;
} /* fin du while */ } /* fin du while */
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j); printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
if ( !(CONFIG_ISFLAGSET( CONFIG_NOCHECKUNKOPT )) ) {
i=config_check_cmdlineopt(prefix);
if (i > 0) {
fprintf(stderr,"[CONFIG] %i unknown options for section %s detected in command line\n",
i,((prefix==NULL)?"\"root section\"":prefix));
exit_fun(" Exiting after detecting errors in command line \n");
}
}
return j; return j;
} /* parse_cmdline*/ } /* parse_cmdline*/
...@@ -42,17 +42,15 @@ ...@@ -42,17 +42,15 @@
#include "config_userapi.h" #include "config_userapi.h"
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so" #define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
int load_config_sharedlib(configmodule_interface_t *cfgptr) int load_config_sharedlib(configmodule_interface_t *cfgptr) {
{ void *lib_handle;
void *lib_handle; char fname[128];
char fname[128]; char libname[FILENAME_MAX];
char libname[FILENAME_MAX]; int st;
int st;
st=0; st=0;
sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode); sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode);
lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE); lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
if (!lib_handle) { if (!lib_handle) {
fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror()); fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror());
st = -1; st = -1;
...@@ -71,6 +69,7 @@ int st; ...@@ -71,6 +69,7 @@ int st;
sprintf (fname,"config_%s_get",cfgptr->cfgmode); sprintf (fname,"config_%s_get",cfgptr->cfgmode);
cfgptr->get = dlsym(lib_handle,fname); cfgptr->get = dlsym(lib_handle,fname);
if (cfgptr->get == NULL ) { if (cfgptr->get == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n", printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode); __FILE__, __LINE__,fname, cfgptr->cfgmode);
...@@ -79,6 +78,7 @@ int st; ...@@ -79,6 +78,7 @@ int st;
sprintf (fname,"config_%s_getlist",cfgptr->cfgmode); sprintf (fname,"config_%s_getlist",cfgptr->cfgmode);
cfgptr->getlist = dlsym(lib_handle,fname); cfgptr->getlist = dlsym(lib_handle,fname);
if (cfgptr->getlist == NULL ) { if (cfgptr->getlist == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n", printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode); __FILE__, __LINE__,fname, cfgptr->cfgmode);
...@@ -87,6 +87,7 @@ int st; ...@@ -87,6 +87,7 @@ int st;
sprintf (fname,"config_%s_end",cfgptr->cfgmode); sprintf (fname,"config_%s_end",cfgptr->cfgmode);
cfgptr->end = dlsym(lib_handle,fname); cfgptr->end = dlsym(lib_handle,fname);
if (cfgptr->getlist == NULL ) { if (cfgptr->getlist == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n", printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode); __FILE__, __LINE__,fname, cfgptr->cfgmode);
...@@ -102,29 +103,29 @@ int nooptfunc(void) { ...@@ -102,29 +103,29 @@ int nooptfunc(void) {
}; };
int config_cmdlineonly_getlist(paramlist_def_t *ParamList, int config_cmdlineonly_getlist(paramlist_def_t *ParamList,
paramdef_t *params, int numparams, char *prefix) paramdef_t *params, int numparams, char *prefix) {
{
ParamList->numelt = 0; ParamList->numelt = 0;
return 0; return 0;
} }
int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
{
int defval; int defval;
int fatalerror=0; int fatalerror=0;
int numdefvals=0; int numdefvals=0;
for(int i=0; i<numoptions; i++) {
for(int i=0;i<numoptions;i++) {
defval=0; defval=0;
switch(cfgoptions[i].type) { switch(cfgoptions[i].type) {
case TYPE_STRING: case TYPE_STRING:
defval=config_setdefault_string(&(cfgoptions[i]), prefix); defval=config_setdefault_string(&(cfgoptions[i]), prefix);
break; break;
case TYPE_STRINGLIST: case TYPE_STRINGLIST:
defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix); defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix);
break; break;
case TYPE_UINT8: case TYPE_UINT8:
case TYPE_INT8: case TYPE_INT8:
case TYPE_UINT16: case TYPE_UINT16:
...@@ -134,96 +135,120 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) ...@@ -134,96 +135,120 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
case TYPE_MASK: case TYPE_MASK:
defval=config_setdefault_int(&(cfgoptions[i]), prefix); defval=config_setdefault_int(&(cfgoptions[i]), prefix);
break; break;
case TYPE_UINT64: case TYPE_UINT64:
case TYPE_INT64: case TYPE_INT64:
defval=config_setdefault_int64(&(cfgoptions[i]), prefix); defval=config_setdefault_int64(&(cfgoptions[i]), prefix);
break; break;
case TYPE_UINTARRAY: case TYPE_UINTARRAY:
case TYPE_INTARRAY: case TYPE_INTARRAY:
defval=config_setdefault_intlist(&(cfgoptions[i]), prefix); defval=config_setdefault_intlist(&(cfgoptions[i]), prefix);
break; break;
case TYPE_DOUBLE: case TYPE_DOUBLE:
defval=config_setdefault_double(&(cfgoptions[i]), prefix); defval=config_setdefault_double(&(cfgoptions[i]), prefix);
break; break;
case TYPE_IPV4ADDR: case TYPE_IPV4ADDR:
defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix); defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix);
break;