Commit 14321bfe authored by frtabu's avatar frtabu

fix config file generation to sip command line only options

parent 1fee616d
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function #define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function
#define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1 #define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1
#define PARAMFLAG_CMDLINE_NOPREFIXENABLED (1 << 5) // on the command line, allow a parameter to be specified without the prefix #define PARAMFLAG_CMDLINE_NOPREFIXENABLED (1 << 5) // on the command line, allow a parameter to be specified without the prefix
#define PARAMFLAG_CMDLINEONLY (1 << 6) // this parameter cannot be specified in config file
/* Flags used by config modules to return info to calling modules and/or to for internal usage*/ /* Flags used by config modules to return info to calling modules and/or to for internal usage*/
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module #define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module
......
...@@ -95,10 +95,14 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se ...@@ -95,10 +95,14 @@ int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_se
#define LIBCONFIG_NOTUSED_PARAMS "Not used? (NULL value ptr)" #define LIBCONFIG_NOTUSED_PARAMS "Not used? (NULL value ptr)"
for(int i=0; i<numoptions; i++) { for(int i=0; i<numoptions; i++) {
if (cfgoptions[i].paramflags & PARAMFLAG_CMDLINEONLY) {
continue;
printf_params("[LIBCONFIG] setting %s.%s skipped (command line only) \n",(prefix==NULL)?"":prefix,cfgoptions[i].optname);
}
status=CONFIG_FALSE; status=CONFIG_FALSE;
config_setting_t * psetting; config_setting_t * psetting;
char *spath=malloc(((prefix==NULL)?0:strlen(prefix))+strlen(cfgoptions[i].optname)+10); char *spath=malloc(((prefix==NULL)?0:strlen(prefix))+strlen(cfgoptions[i].optname)+10);
sprintf(spath,"%s.%s",prefix,cfgoptions[i].optname); sprintf(spath,"%s%s%s",(prefix==NULL)?"":prefix, (prefix==NULL)?"":".", cfgoptions[i].optname);
psetting = config_lookup(&(libconfig_privdata.runtcfg),spath); psetting = config_lookup(&(libconfig_privdata.runtcfg),spath);
free(spath); free(spath);
if (psetting != NULL) { if (psetting != NULL) {
......
...@@ -173,17 +173,17 @@ extern int usrp_tx_thread; ...@@ -173,17 +173,17 @@ extern int usrp_tx_thread;
#define CONFIG_HLP_WEB "Start embedded web server \n" #define CONFIG_HLP_WEB "Start embedded web server \n"
#define CONFIG_FLOG_OPT "R" #define CONFIG_FLOG_OPT "R"
#define CONFIG_LOGL_OPT "g" #define CONFIG_LOGL_OPT "g"
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */ /* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_LOGPARAMS_DESC { \ #define CMDLINE_LOGPARAMS_DESC { \
{CONFIG_FLOG_OPT , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ {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}, \ {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}, \ {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL|PARAMFLAG_CMDLINEONLY, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \
{"websrv", CONFIG_HLP_WEB, PARAMFLAG_BOOL, uptr:&start_websrv, defintval:0, TYPE_UINT, 0}, \ {"websrv", CONFIG_HLP_WEB, PARAMFLAG_BOOL|PARAMFLAG_CMDLINEONLY, uptr:&start_websrv, defintval:0, TYPE_UINT, 0}, \
{"log-mem", NULL, 0, strptr:(char **)&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \ {"log-mem", NULL, 0, strptr:(char **)&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \
{"telnetclt", NULL, 0, uptr:&start_telnetclt, defstrval:NULL, TYPE_UINT, 0}, \ {"telnetclt", NULL, 0, uptr:&start_telnetclt, defstrval:NULL, TYPE_UINT, 0}, \
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment