yumapro  20.10-10
YumaPro SDK
CLI and .conf File Parameters

CLI utilities to process the CLI parameters at boot-time. More...

Collaboration diagram for CLI and .conf File Parameters:

Typedefs

typedef status_t(* agt_conf_write_fn_t) (FILE *conf_file, void *cookie)
 conf file writer function callback More...
 

Functions

status_t agt_cli_process_input (int argc, char *argv[], agt_profile_t *agt_profile, boolean *showver, help_mode_t *showhelpmode, boolean *no_watcher)
 Process the param line parameters against the hardwired parmset for the netconfd program. More...
 
val_value_tagt_cli_get_valset (void)
 Retrieve the command line parameter set from boot time. More...
 
const xmlChar * agt_cli_get_confspec (void)
 Retrieve the config file used or NULL if none. More...
 
void agt_cli_cleanup (void)
 Cleanup the module static data. More...
 
status_t agt_conf_load_files (const xmlChar *conf_filespec, val_value_t *valset, const xmlChar *conf_dirspec, boolean *skip_def_confdir)
 Default main loaded first: /etc/yumapro/netconfd-pro.conf. More...
 
status_t agt_conf_create_file (const xmlChar *confname, const xmlChar *revision, agt_conf_write_fn_t conf_write_fn, void *cookie)
 Create a module or bundle config in the confdir. More...
 
status_t agt_conf_delete_file (const xmlChar *confname, const xmlChar *revision)
 Delete a module or bundle config in the confdir. More...
 
status_t agt_conf_test_write_file (const xmlChar *confname, const xmlChar *revision)
 Test Append a conf dir. More...
 
void agt_profile_init_server_profile (agt_profile_t *agt_profile)
 Hardwire the initial server profile variables. More...
 
void agt_profile_clean_server_profile (agt_profile_t *agt_profile)
 Clean the server profile variables. More...
 

Detailed Description

CLI utilities to process the CLI parameters at boot-time.

Default conf file is stored in /etc/yumapro/netconfd-pro.conf.

Gathers all parameters and keeps them in an accessible val_value_t tree while the program is running. The parameters are applied to the system at boot-time.

Parameters entered at the command line will over-ride any value set in the .conf file. The 'config' parameter is not allowed in a .conf file.

Typedef Documentation

typedef status_t(* agt_conf_write_fn_t) (FILE *conf_file, void *cookie)

conf file writer function callback

Parameters
conf_fileopen file to write
cookiecaller parameter cookie
Returns
status:
  • NO_ERR file will be closed
  • else file will be removed

Function Documentation

void agt_cli_cleanup ( void  )

Cleanup the module static data.

Called by the server during shutdown.

Here is the call graph for this function:

const xmlChar* agt_cli_get_confspec ( void  )

Retrieve the config file used or NULL if none.

Returns
pointer to config filespec
val_value_t* agt_cli_get_valset ( void  )

Retrieve the command line parameter set from boot time.

Returns
pointer to parmset or NULL if none

Here is the caller graph for this function:

status_t agt_cli_process_input ( int  argc,
char *  argv[],
agt_profile_t agt_profile,
boolean *  showver,
help_mode_t showhelpmode,
boolean *  no_watcher 
)

Process the param line parameters against the hardwired parmset for the netconfd program.

Parameters
argcargument count
argvarray of command line argument strings
agt_profileserver profile struct to fill in
showveraddress of version return quick-exit status
showhelpmodeaddress of help return quick-exit status
no_watcherwatcher param to fill in
Return values
*agt_profileis filled in, with parms gathered or defaults
*showverTRUE if user requsted version quick-exit mode
*showhelpmoderequested help mode (none, breief, normal, full)
*no_watcherTRUE if user specified no-watcher param
Returns
NO_ERR if all goes well

Here is the call graph for this function:

status_t agt_conf_create_file ( const xmlChar *  confname,
const xmlChar *  revision,
agt_conf_write_fn_t  conf_write_fn,
void *  cookie 
)

Create a module or bundle config in the confdir.

Parameters
confnamemodule or bundle name
revisionrevision date string
conf_write_fncallback function to create the file
cookiecookie to pass to callback
Returns
NO_ERR if file created

Here is the call graph for this function:

status_t agt_conf_delete_file ( const xmlChar *  confname,
const xmlChar *  revision 
)

Delete a module or bundle config in the confdir.

Parameters
confnamemodule or bundle name
revisionrevision date string
Returns
NO_ERR if file found and deleted

Here is the call graph for this function:

status_t agt_conf_load_files ( const xmlChar *  conf_filespec,
val_value_t valset,
const xmlChar *  conf_dirspec,
boolean *  skip_def_confdir 
)

Default main loaded first: /etc/yumapro/netconfd-pro.conf.

Set with –config/path/to/myconf.conf

Also check for extra config files: Default conf-dir: /etc/yumapro/netconfd-pro.d/

Parameters
conf_filespecmain netconfd-pro.conf (may be NULL)
valsetvalue to add any found parameters
conf_dirspecdirectory to check for more foo.conf files
(may be NULL)
skip_def_confdiraddress of return flag
Return values
valsetfilled in with any found parameters
*skip_def_confdirTRUE if no default conf-dir found
Returns
NO_ERR if all goes well

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_conf_test_write_file ( const xmlChar *  confname,
const xmlChar *  revision 
)

Test Append a conf dir.

Parameters
confnamemodule or bundle name
revisionrevision date string (may be NULL)
Returns
NO_ERR if file created

Here is the call graph for this function:

void agt_profile_clean_server_profile ( agt_profile_t agt_profile)

Clean the server profile variables.

Parameters
agt_profileprofile struct to clean

Here is the call graph for this function:

void agt_profile_init_server_profile ( agt_profile_t agt_profile)

Hardwire the initial server profile variables.

Parameters
agt_profileprofile to initialize
Returns
*agt_profile is filled in with params of defaults

Here is the call graph for this function: