Configuration management. More...
Data Structures | |
struct | GNUNET_CONFIGURATION_ConfigSettings |
Closure for GNUNET_CONFIGURATION_config_tool_run() with settings for what should be done with the configuration. More... | |
Macros | |
#define | GNUNET_CONFIGURATION_CONFIG_OPTIONS(cs) |
Macro that expands to a set of GNUNET-getopt directives to initialize a struct GNUNET_CONFIGURATION_ConfigSettings from the command line. More... | |
Typedefs | |
typedef enum GNUNET_GenericReturnValue(* | GNUNET_CONFIGURATION_Callback) (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Signature of a function to be run with a configuration. More... | |
typedef void(* | GNUNET_CONFIGURATION_Iterator) (void *cls, const char *section, const char *option, const char *value) |
Function to iterate over options. More... | |
typedef void(* | GNUNET_CONFIGURATION_SectionIterator) (void *cls, const char *section) |
Function to iterate over section. More... | |
Functions | |
struct GNUNET_CONFIGURATION_Handle * | GNUNET_CONFIGURATION_create (const struct GNUNET_OS_ProjectData *pd) |
Create a new configuration object. More... | |
struct GNUNET_CONFIGURATION_Handle * | GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Duplicate an existing configuration object. More... | |
void | GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg) |
Destroy configuration object. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename) |
Load configuration. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, const char *defaults_d) |
Load default configuration. More... | |
char * | GNUNET_CONFIGURATION_default_filename (const struct GNUNET_OS_ProjectData *pd) |
Return the filename of the default configuration filename that is used when no explicit configuration entry point has been specified. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename) |
Parse a configuration file, add all of the options in the file to the configuration environment. More... | |
char * | GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, size_t *size) |
Serializes the given configuration. More... | |
char * | GNUNET_CONFIGURATION_serialize_diagnostics (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Serializes the given configuration with diagnostics information. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, const char *mem, size_t size, const char *source_filename) |
De-serializes configuration. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename) |
Write configuration file. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle *cfg_default, const struct GNUNET_CONFIGURATION_Handle *cfg_new, const char *filename) |
Write only configuration entries that have been changed to configuration file. More... | |
struct GNUNET_CONFIGURATION_Handle * | GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle *cfg_default, const struct GNUNET_CONFIGURATION_Handle *cfg_new) |
Compute configuration with only entries that have been changed. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Test if there are configuration options that were changed since the last save. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_parse_and_run (const struct GNUNET_OS_ProjectData *pd, const char *filename, GNUNET_CONFIGURATION_Callback cb, void *cb_cls) |
Parse a configuration file filename and run the function cb with the resulting configuration object. More... | |
void | GNUNET_CONFIGURATION_enable_diagnostics (struct GNUNET_CONFIGURATION_Handle *cfg) |
Enable extra diagnostics. More... | |
const struct GNUNET_OS_ProjectData * | GNUNET_CONFIGURATION_get_project_data (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Return the project data associated with this configuration. More... | |
void | GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_Iterator iter, void *iter_cls) |
Iterate over all options in the configuration. More... | |
void | GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_SectionIterator iter, void *iter_cls) |
Iterate over all sections in the configuration. More... | |
void | GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section) |
Remove the given section and all options in it. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number) |
Get a configuration value that should be a number. More... | |
void | GNUNET_CONFIGURATION_set_value_float (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, float number) |
Set a configuration value that should be a float. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_float (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, float *number) |
Get a configuration value that should be a floating point number. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time) |
Get a configuration value that should be a relative time. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *size) |
Get a configuration value that should be a size in bytes. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option) |
Test if we have a value for a particular option. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value) |
Get a configuration value that should be a string. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value) |
Get a configuration value that should be the name of a file or directory. More... | |
int | GNUNET_CONFIGURATION_iterate_value_filenames (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, GNUNET_FileNameCallback cb, void *cb_cls) |
Iterate over the set of filenames stored in a configuration value. More... | |
void | GNUNET_CONFIGURATION_iterate_section_values (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, GNUNET_CONFIGURATION_Iterator iter, void *iter_cls) |
Iterate over values of a section in the configuration. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *const *choices, const char **value) |
Get a configuration value that should be in a set of predefined strings. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option) |
Get a configuration value that should be in a set of "YES" or "NO". More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, void *buf, size_t buf_size) |
Get Crockford32-encoded fixed-size binary data from a configuration. More... | |
char * | GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, char *orig) |
Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or the environment "FOO" is set to "DIRECTORY". More... | |
void | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long number) |
Set a configuration value that should be a number. More... | |
void | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value) |
Set a configuration value that should be a string. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value) |
Remove a filename from a configuration value that represents a list of filenames. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value) |
Append a filename to a configuration value that represents a list of filenames. More... | |
void | GNUNET_CONFIGURATION_config_settings_free (struct GNUNET_CONFIGURATION_ConfigSettings *cs) |
Free resources associated with cs. More... | |
void | GNUNET_CONFIGURATION_config_tool_run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main task to run to perform operations typical for gnunet-config as per the configuration settings given in cls. More... | |
Configuration management.
#define GNUNET_CONFIGURATION_CONFIG_OPTIONS | ( | cs | ) |
Macro that expands to a set of GNUNET-getopt directives to initialize a struct GNUNET_CONFIGURATION_ConfigSettings
from the command line.
cs | configuration settings to initialize |
Definition at line 764 of file gnunet_configuration_lib.h.
typedef enum GNUNET_GenericReturnValue(* GNUNET_CONFIGURATION_Callback) (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Signature of a function to be run with a configuration.
cls | closure |
cfg | the configuration |
Definition at line 237 of file gnunet_configuration_lib.h.
typedef void(* GNUNET_CONFIGURATION_Iterator) (void *cls, const char *section, const char *option, const char *value) |
Function to iterate over options.
cls | closure |
section | name of the section |
option | name of the option |
value | value of the option |
Definition at line 303 of file gnunet_configuration_lib.h.
typedef void(* GNUNET_CONFIGURATION_SectionIterator) (void *cls, const char *section) |
Function to iterate over section.
cls | closure |
section | name of the section |
Definition at line 316 of file gnunet_configuration_lib.h.
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create | ( | const struct GNUNET_OS_ProjectData * | pd | ) |
Create a new configuration object.
pd | project data to use to determine paths |
Definition at line 227 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_set_value_string(), GNUNET_free, GNUNET_new, GNUNET_OS_installation_get_path(), GNUNET_OS_IPK_BINDIR, GNUNET_OS_IPK_DATADIR, GNUNET_OS_IPK_DOCDIR, GNUNET_OS_IPK_ICONDIR, GNUNET_OS_IPK_LIBDIR, GNUNET_OS_IPK_LIBEXECDIR, GNUNET_OS_IPK_LOCALEDIR, GNUNET_OS_IPK_PREFIX, p, and GNUNET_CONFIGURATION_Handle::pd.
Referenced by auto_config_cb(), create_unique_cfgs(), gg_load_configuration(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CONFIGURATION_dup(), GNUNET_CONFIGURATION_get_diff(), GNUNET_CONFIGURATION_parse_and_run(), GNUNET_PROGRAM_conf_and_options(), GNUNET_PROGRAM_run2(), GNUNET_SERVICE_run_(), GNUNET_TESTING_get_topo_from_string_(), GNUNET_TRANSPORT_TESTING_start_peer(), GNUNET_TRANSPORT_TESTING_transport_communicator_service_start(), handle_auto_result(), handle_autoconfig_request(), handle_inline(), iter_check_config(), load_member(), load_member_session(), load_member_session_next(), load_operation(), main(), run(), save_member(), save_member_session(), save_operation(), and start_peer_run().
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_dup | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Duplicate an existing configuration object.
cfg | configuration to duplicate |
Definition at line 1622 of file configuration.c.
References cfg, copy_entry(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_iterate(), GNUNET_CONFIGURATION_Handle::pd, and ret.
Referenced by auto_config_cb(), create_unique_cfgs(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_NAT_autoconfig_start(), handle_autoconfig_request(), run(), and set_cont().
void GNUNET_CONFIGURATION_destroy | ( | struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Destroy configuration object.
cfg | configuration to destroy |
Definition at line 321 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_remove_section(), GNUNET_CONTAINER_DLL_remove, GNUNET_free, ConfigFile::hint_restrict_section, GNUNET_CONFIGURATION_Handle::loaded_files_head, GNUNET_CONFIGURATION_Handle::loaded_files_tail, GNUNET_CONFIGURATION_Handle::main_filename, ConfigSection::name, GNUNET_CONFIGURATION_Handle::sections, and ConfigFile::source_filename.
Referenced by auto_config_cb(), clean_node(), conclude_autoconfig_request(), create_unique_cfgs(), do_shutdown(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CONFIGURATION_parse_and_run(), GNUNET_CONFIGURATION_write_diffs(), GNUNET_NAT_autoconfig_cancel(), GNUNET_PROGRAM_conf_and_options(), GNUNET_PROGRAM_run2(), GNUNET_SERVICE_run_(), GNUNET_TESTING_get_topo_from_string_(), GNUNET_TRANSPORT_TESTING_start_peer(), GNUNET_TRANSPORT_TESTING_stop_peer(), GNUNET_TRANSPORT_TESTING_transport_communicator_service_start(), GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop(), handle_auto_result(), handle_autoconfig_request(), handle_inline(), load_member(), load_member_session(), load_member_session_next(), load_operation(), main(), next_phase(), save_member(), save_member_session(), save_operation(), shutdown_task(), start_peer_cleanup(), and start_peer_run().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_load | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | filename | ||
) |
Load configuration.
This function will first parse the defaults and then parse the specific configuration file to overwrite the defaults.
[in,out] | cfg | configuration to update |
filename | name of the configuration file, NULL to load defaults |
Definition at line 2607 of file configuration.c.
References GNUNET_OS_ProjectData::base_config_varname, cfg, filename, getenv(), GNUNET_asprintf(), GNUNET_break, GNUNET_CONFIGURATION_have_value(), GNUNET_CONFIGURATION_load_from(), GNUNET_CONFIGURATION_parse(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_DISK_directory_test(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_OK, GNUNET_OS_installation_get_path(), GNUNET_OS_IPK_DATADIR, GNUNET_strdup, GNUNET_STRINGS_filename_expand(), GNUNET_SYSERR, GNUNET_YES, GNUNET_CONFIGURATION_Handle::load_called, LOG, GNUNET_CONFIGURATION_Handle::main_filename, and GNUNET_CONFIGURATION_Handle::pd.
Referenced by auto_config_cb(), create_unique_cfgs(), gg_load_configuration(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CONFIGURATION_parse_and_run(), GNUNET_PROGRAM_conf_and_options(), GNUNET_PROGRAM_run2(), GNUNET_SERVICE_run_(), GNUNET_TRANSPORT_TESTING_start_peer(), GNUNET_TRANSPORT_TESTING_transport_communicator_service_start(), iter_check_config(), main(), and start_peer_run().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_load_from | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | defaults_d | ||
) |
Load default configuration.
This function will parse the defaults from the given defaults_d directory.
cfg | configuration to update |
defaults_d | directory with the defaults |
Definition at line 2510 of file configuration.c.
References cfg, cleanup(), collect_files_cb(), filename, CollectFilesContext::files, CollectFilesContext::files_length, GNUNET_array_grow, GNUNET_CONFIGURATION_parse(), GNUNET_DISK_directory_scan(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_SYSERR, and pstrcmp().
Referenced by GNUNET_CONFIGURATION_load().
char * GNUNET_CONFIGURATION_default_filename | ( | const struct GNUNET_OS_ProjectData * | pd | ) |
Return the filename of the default configuration filename that is used when no explicit configuration entry point has been specified.
pd | project data to use to determine paths |
Definition at line 2563 of file configuration.c.
References GNUNET_OS_ProjectData::config_file, DIR_SEPARATOR_STR, getenv(), GNUNET_asprintf(), GNUNET_DISK_file_test_read(), GNUNET_free, GNUNET_OK, GNUNET_strdup, GNUNET_OS_ProjectData::project_dirname, and GNUNET_OS_ProjectData::user_config_file.
Referenced by GNUNET_PROGRAM_run2(), and main().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_parse | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | filename | ||
) |
Parse a configuration file, add all of the options in the file to the configuration environment.
cfg | configuration to update |
filename | name of the configuration file |
Definition at line 989 of file configuration.c.
References _, cfg, GNUNET_CONFIGURATION_Handle::current_nest_level, GNUNET_CONFIGURATION_Handle::dirty, filename, fs, GNUNET_break, GNUNET_CONFIGURATION_deserialize(), GNUNET_CONTAINER_DLL_insert_tail, GNUNET_DISK_file_size(), GNUNET_DISK_fn_read(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_new, GNUNET_strdup, GNUNET_STRINGS_filename_expand(), GNUNET_SYSERR, GNUNET_YES, ConfigFile::level, GNUNET_CONFIGURATION_Handle::loaded_files_head, GNUNET_CONFIGURATION_Handle::loaded_files_tail, LOG, ConfigFile::prev, ret, SIZE_MAX, and ConfigFile::source_filename.
Referenced by GNUNET_CONFIGURATION_load(), GNUNET_CONFIGURATION_load_from(), handle_inline(), load_member(), load_member_session(), load_member_session_next(), load_operation(), main(), and run().
char * GNUNET_CONFIGURATION_serialize | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
size_t * | size | ||
) |
Serializes the given configuration.
cfg | configuration to serialize |
size | will be set to the size of the serialized memory block |
Definition at line 1150 of file configuration.c.
References cfg, do_skip(), GNUNET_asprintf(), GNUNET_assert, GNUNET_free, GNUNET_malloc, GNUNET_memcpy, ConfigEntry::next, ConfigSection::next, GNUNET_CONFIGURATION_Handle::sections, and size.
Referenced by conclude_autoconfig_request(), GNUNET_CONFIGURATION_write(), and GNUNET_NAT_AUTO_autoconfig_start().
char * GNUNET_CONFIGURATION_serialize_diagnostics | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Serializes the given configuration with diagnostics information.
Diagnostics information will only be available if diagnostics have been enabled before parsing.
cfg | configuration to serialize |
Definition at line 1304 of file configuration.c.
References cfg, do_skip(), dump_os_ipk(), GNUNET_buffer_reap_str(), GNUNET_buffer_write_fstr(), GNUNET_buffer_write_str(), GNUNET_free, GNUNET_malloc, GNUNET_OS_IPK_BINDIR, GNUNET_OS_IPK_DATADIR, GNUNET_OS_IPK_DOCDIR, GNUNET_OS_IPK_ICONDIR, GNUNET_OS_IPK_LIBDIR, GNUNET_OS_IPK_LIBEXECDIR, GNUNET_OS_IPK_LOCALEDIR, GNUNET_OS_IPK_PREFIX, GNUNET_OS_IPK_SELF_PREFIX, GNUNET_CONFIGURATION_Handle::loaded_files_head, GNUNET_CONFIGURATION_Handle::main_filename, ConfigEntry::next, ConfigSection::next, ConfigFile::next, and GNUNET_CONFIGURATION_Handle::sections.
Referenced by GNUNET_CONFIGURATION_config_tool_run().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_deserialize | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | mem, | ||
size_t | size, | ||
const char * | source_filename | ||
) |
De-serializes configuration.
cfg | configuration to update |
mem | the memory block of serialized configuration |
size | the size of the memory block |
source_filename | source filename, will be used to resolve relative @INLINE@ statements |
Definition at line 724 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_Handle::diagnostics, end, GNUNET_assert, GNUNET_CONFIGURATION_set_value_string(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_NO, GNUNET_OK, GNUNET_strdup, GNUNET_strndup, GNUNET_SYSERR, GNUNET_YES, handle_inline(), line, LOG, GNUNET_CONFIGURATION_Handle::restrict_section, ret, set_entry_hint(), size, and value.
Referenced by GNUNET_CONFIGURATION_parse(), GNUNET_TESTING_get_topo_from_string_(), handle_auto_result(), handle_autoconfig_request(), and main().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_write | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | filename | ||
) |
Write configuration file.
cfg | configuration to write |
filename | where to write the configuration |
Definition at line 1429 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_Handle::dirty, filename, GNUNET_assert, GNUNET_CONFIGURATION_serialize(), GNUNET_DISK_directory_create_for_file(), GNUNET_DISK_directory_remove(), GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_write(), GNUNET_DISK_OPEN_CREATE, GNUNET_DISK_OPEN_TRUNCATE, GNUNET_DISK_OPEN_WRITE, GNUNET_DISK_PERM_GROUP_READ, GNUNET_DISK_PERM_GROUP_WRITE, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log_strerror_file, GNUNET_NO, GNUNET_OK, GNUNET_STRINGS_filename_expand(), GNUNET_SYSERR, h, and size.
Referenced by create_unique_cfgs(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CONFIGURATION_write_diffs(), handle_delete_message(), handle_rename_message(), save_member(), save_member_session(), save_operation(), set_cont(), and start_peer_run().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_write_diffs | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg_default, |
const struct GNUNET_CONFIGURATION_Handle * | cfg_new, | ||
const char * | filename | ||
) |
Write only configuration entries that have been changed to configuration file.
cfg_default | default configuration |
cfg_new | new configuration |
filename | where to write the configuration diff between default and new |
Definition at line 1683 of file configuration.c.
References filename, GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_diff(), GNUNET_CONFIGURATION_write(), and ret.
Referenced by auto_config_cb(), GNUNET_CONFIGURATION_config_tool_run(), and main().
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_get_diff | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg_default, |
const struct GNUNET_CONFIGURATION_Handle * | cfg_new | ||
) |
Compute configuration with only entries that have been changed.
cfg_default | original configuration |
cfg_new | new configuration |
Definition at line 1666 of file configuration.c.
References DiffHandle::cfg_default, DiffHandle::cfgDiff, compare_entries(), GNUNET_break, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_iterate(), and GNUNET_CONFIGURATION_Handle::pd.
Referenced by conclude_autoconfig_request(), GNUNET_CONFIGURATION_write_diffs(), and next_phase().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_is_dirty | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Test if there are configuration options that were changed since the last save.
cfg | configuration to inspect |
Definition at line 1108 of file configuration.c.
References cfg, and GNUNET_CONFIGURATION_Handle::dirty.
Referenced by auto_config_cb().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_parse_and_run | ( | const struct GNUNET_OS_ProjectData * | pd, |
const char * | filename, | ||
GNUNET_CONFIGURATION_Callback | cb, | ||
void * | cb_cls | ||
) |
Parse a configuration file filename and run the function cb with the resulting configuration object.
Then free the configuration object and return the status value from cb.
pd | project data to use to determine paths |
filename | configuration to parse, NULL for "default" |
cb | function to run |
cb_cls | closure for cb |
Definition at line 343 of file configuration.c.
References cfg, filename, GNUNET_break, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_load(), GNUNET_OK, GNUNET_SYSERR, GNUNET_CONFIGURATION_Handle::pd, and ret.
Referenced by GNUNET_DISK_purge_cfg_dir().
void GNUNET_CONFIGURATION_enable_diagnostics | ( | struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Enable extra diagnostics.
Will produce more log output and allocate more memory.
cfg | configuration handle |
Definition at line 219 of file configuration.c.
References cfg, and GNUNET_CONFIGURATION_Handle::diagnostics.
Referenced by GNUNET_CONFIGURATION_config_tool_run().
const struct GNUNET_OS_ProjectData * GNUNET_CONFIGURATION_get_project_data | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Return the project data associated with this configuration.
cfg | a configuration |
Definition at line 2977 of file configuration.c.
References cfg, and GNUNET_CONFIGURATION_Handle::pd.
Referenced by GNUNET_BLOCK_context_create(), and GNUNET_DATACACHE_create().
void GNUNET_CONFIGURATION_iterate | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
GNUNET_CONFIGURATION_Iterator | iter, | ||
void * | iter_cls | ||
) |
Iterate over all options in the configuration.
cfg | configuration to inspect |
iter | function to call on each option |
iter_cls | closure for iter |
Definition at line 1490 of file configuration.c.
References cfg, ConfigEntry::next, ConfigSection::next, and GNUNET_CONFIGURATION_Handle::sections.
Referenced by get_cont(), GNUNET_CONFIGURATION_dup(), GNUNET_CONFIGURATION_get_diff(), and GNUNET_TESTBED_configuration_create().
void GNUNET_CONFIGURATION_iterate_sections | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
GNUNET_CONFIGURATION_SectionIterator | iter, | ||
void * | iter_cls | ||
) |
Iterate over all sections in the configuration.
cfg | configuration to inspect |
iter | function to call on each section |
iter_cls | closure for iter |
Definition at line 1539 of file configuration.c.
References cfg, ConfigSection::name, ConfigSection::next, and GNUNET_CONFIGURATION_Handle::sections.
Referenced by GNUNET_CONFIGURATION_config_tool_run(), GNUNET_TESTBED_configuration_create(), handle_delete_message(), handle_rename_message(), and run().
void GNUNET_CONFIGURATION_remove_section | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section | ||
) |
Remove the given section and all options in it.
cfg | configuration to inspect |
section | name of the section to remove |
Definition at line 1558 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_Handle::dirty, ConfigSection::entries, GNUNET_free, GNUNET_YES, ConfigEntry::hint_filename, ConfigSection::hint_inlined_from_filename, ConfigSection::hint_secret_filename, ConfigSection::hint_secret_stat, ConfigEntry::key, ConfigSection::name, ConfigEntry::next, ConfigSection::next, GNUNET_CONFIGURATION_Handle::sections, and ConfigEntry::val.
Referenced by GNUNET_CONFIGURATION_destroy().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
unsigned long long * | number | ||
) |
Get a configuration value that should be a number.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
number | where to store the numeric value of the option |
Definition at line 1761 of file configuration.c.
References cfg, dummy, find_entry(), GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, number, and ConfigEntry::val.
Referenced by create_service(), create_subnets(), DHTU_ip_init(), GCD_init(), GCO_init(), GDS_NEIGHBOURS_init(), get_server_addresses(), GNUNET_CLIENT_connect(), GNUNET_CLIENT_test(), GNUNET_HOSTLIST_server_start(), GNUNET_NAT_AUTO_test_start(), GNUNET_PROGRAM_run2(), GNUNET_REVOCATION_revoke(), GNUNET_SERVICE_run_(), GNUNET_SOCKS_do_connect(), GNUNET_TESTING_get_topo_from_string_(), GNUNET_TRANSPORT_communicator_connect(), GSF_cadet_start_server(), GSF_pending_request_init_(), libgnunet_plugin_block_revocation_init(), libgnunet_plugin_datastore_heap_init(), load_member_session(), load_operation(), run(), setup_exit_helper_args(), test_service_configuration(), test_stun(), and update_config().
void GNUNET_CONFIGURATION_set_value_float | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
float | number | ||
) |
Set a configuration value that should be a float.
Note that this possibly truncates your float value.
cfg | configuration to update |
section | section of interest |
option | option of interest |
number | value to set |
Definition at line 1786 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_set_value_string(), GNUNET_snprintf(), and number.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_float | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
float * | number | ||
) |
Get a configuration value that should be a floating point number.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
number | where to store the floating value of the option |
Definition at line 1810 of file configuration.c.
References cfg, dummy, find_entry(), GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, number, and ConfigEntry::val.
Referenced by GNUNET_RPS_connect().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_time | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
struct GNUNET_TIME_Relative * | time | ||
) |
Get a configuration value that should be a relative time.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
time | set to the time value stored in the configuration |
Definition at line 1839 of file configuration.c.
References _, cfg, find_entry(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_invalid(), GNUNET_NO, GNUNET_OK, GNUNET_STRINGS_fancy_time_to_relative(), ret, and ConfigEntry::val.
Referenced by GCD_init(), GNUNET_REVOCATION_revoke(), GNUNET_SPEEDUP_start_(), GSF_push_init_(), libgnunet_plugin_block_revocation_init(), RECLAIM_TICKETS_init(), REST_openid_init(), run(), and token_endpoint().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_size | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
unsigned long long * | size | ||
) |
Get a configuration value that should be a size in bytes.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
size | set to the size in bytes as stored in the configuration |
Definition at line 1866 of file configuration.c.
References cfg, find_entry(), GNUNET_NO, GNUNET_STRINGS_fancy_size_to_bytes(), size, and ConfigEntry::val.
Referenced by GNUNET_DATACACHE_create(), and run().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_have_value | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option | ||
) |
Test if we have a value for a particular option.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
Definition at line 1989 of file configuration.c.
References cfg, find_entry(), GNUNET_NO, GNUNET_YES, and ConfigEntry::val.
Referenced by check_config(), get_server_addresses(), GNUNET_CLIENT_connect(), GNUNET_CLIENT_test(), GNUNET_CONFIGURATION_load(), GNUNET_HOSTLIST_server_start(), GNUNET_PROGRAM_run2(), GNUNET_SOCKS_check_service(), process_acl4(), process_acl6(), run(), setup_service(), start_arm_service(), test_service_configuration(), and update_config_sections().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
char ** | value | ||
) |
Get a configuration value that should be a string.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
value | will be set to a freshly allocated configuration value, or NULL if option is not specified |
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
value | will be set to a freshly allocated configuration value, or NULL if option is not specified |
Definition at line 1896 of file configuration.c.
References cfg, find_entry(), GNUNET_NO, GNUNET_OK, GNUNET_strdup, ConfigEntry::val, and value.
Referenced by advertise_dns_exit(), check_authorization(), check_config(), client_connect_cb(), communicator_start(), DHTU_ip_init(), expand_dollar(), get_bootstrap_server(), get_server_addresses(), gg_load_configuration(), GNUNET_CLIENT_connect(), GNUNET_CLIENT_test(), GNUNET_CONFIGURATION_append_value_filename(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CONFIGURATION_get_data(), GNUNET_CONFIGURATION_get_value_filename(), GNUNET_CONFIGURATION_iterate_value_filenames(), GNUNET_CONFIGURATION_remove_value_filename(), GNUNET_CONVERSATION_phone_create(), GNUNET_DATACACHE_create(), GNUNET_FS_unindex_do_extract_keywords_(), GNUNET_GNS_lookup_with_tld(), GNUNET_HOSTLIST_client_start(), GNUNET_HOSTLIST_server_start(), GNUNET_OS_get_suid_binary_path(), GNUNET_PQ_connect_with_cfg2(), GNUNET_SOCKS_do_connect(), GNUNET_TESTING_get_topo_from_string_(), handle_ego_delete(), handle_ego_rename(), handle_register(), handle_uri(), identity_continuation(), load_member_session(), load_member_session_next(), login_redirect(), mq_init(), process_acl4(), process_acl6(), read_service_conf(), run(), setup_exit_helper_args(), setup_service(), sock_read(), start_arm_service(), start_peer_run(), start_process(), test_icmp_client(), test_icmp_server(), test_service_configuration(), token_endpoint(), and update_config_sections().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
char ** | value | ||
) |
Get a configuration value that should be the name of a file or directory.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
value | will be set to a freshly allocated configuration value, or NULL if option is not specified |
Definition at line 2200 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_expand_dollar(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_OK, GNUNET_STRINGS_filename_expand(), GNUNET_SYSERR, LOG, ret, and value.
Referenced by create_service(), database_connect(), database_setup(), get_oidc_dir_path(), get_pid_file_name(), get_serialization_file_name(), get_serialization_file_name_in_dir(), get_server_addresses(), get_update_information_directory(), get_user_name(), GNUNET_CLIENT_test(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CRYPTO_eddsa_key_create_from_configuration(), GNUNET_HOSTLIST_client_start(), GNUNET_PQ_connect_with_cfg2(), GNUNET_TIME_absolute_get_monotonic(), load(), load_hostlist_file(), main_init(), new_sub(), print_filename_option(), purge_cfg_dir(), read_index_list(), run(), save(), save_hostlist_file(), setup_service(), start_arm_service(), start_peer_run(), test_service_configuration(), try_unixpath(), write_index_list(), and write_proof().
int GNUNET_CONFIGURATION_iterate_value_filenames | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
GNUNET_FileNameCallback | cb, | ||
void * | cb_cls | ||
) |
Iterate over the set of filenames stored in a configuration value.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
cb | function to call on each filename |
cb_cls | closure for cb |
Definition at line 2259 of file configuration.c.
References cfg, end, GNUNET_assert, GNUNET_CONFIGURATION_get_value_string(), GNUNET_free, GNUNET_OK, GNUNET_SYSERR, list, and ret.
Referenced by GNUNET_CONFIGURATION_append_value_filename().
void GNUNET_CONFIGURATION_iterate_section_values | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
GNUNET_CONFIGURATION_Iterator | iter, | ||
void * | iter_cls | ||
) |
Iterate over values of a section in the configuration.
cfg | configuration to inspect |
section | the section |
iter | function to call on each option |
iter_cls | closure for iter |
Definition at line 1510 of file configuration.c.
References cfg, ConfigSection::entries, GNUNET_ERROR_TYPE_WARNING, ConfigSection::inaccessible, ConfigEntry::key, LOG, ConfigSection::name, ConfigEntry::next, ConfigSection::next, GNUNET_CONFIGURATION_Handle::sections, and ConfigEntry::val.
Referenced by authorize_endpoint(), auto_config_cb(), get_cont(), GNUNET_CONFIGURATION_config_tool_run(), and run().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_choice | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
const char *const * | choices, | ||
const char ** | value | ||
) |
Get a configuration value that should be in a set of predefined strings.
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
choices | NULL-terminated list of legal values |
value | will be set to an entry in the legal list, or NULL if option is not specified and no default given |
Definition at line 1918 of file configuration.c.
References _, cfg, warningfilter::choices, find_entry(), GNUNET_ERROR_TYPE_ERROR, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, LOG, ConfigEntry::val, and value.
Referenced by GNUNET_CONFIGURATION_get_value_yesno(), and start_process().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_yesno | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option | ||
) |
Get a configuration value that should be in a set of "YES" or "NO".
cfg | configuration to inspect |
section | section of interest |
option | option of interest |
Definition at line 2231 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_get_value_choice(), GNUNET_NO, GNUNET_OK, GNUNET_YES, ret, and ConfigEntry::val.
Referenced by advertise_dns_exit(), create_listen_socket(), create_service(), database_connect(), GDS_NEIGHBOURS_init(), get_server_addresses(), gg_load_configuration(), GNS_resolver_init(), GNUNET_DATACACHE_create(), GNUNET_STATISTICS_create(), GNUNET_TRANSPORT_TESTING_transport_communicator_service_start(), GSF_pending_request_init_(), GSF_push_init_(), libgnunet_plugin_datacache_sqlite_init(), load_underlay(), main_init(), parse_ip_options(), run(), setup_service(), sign_ephemeral_key(), start_arm_service(), start_process(), test_icmp_client(), test_icmp_server(), test_master(), udp_address_to_sockaddr(), and update_config().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_data | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
void * | buf, | ||
size_t | buf_size | ||
) |
Get Crockford32-encoded fixed-size binary data from a configuration.
cfg | configuration to access |
section | section to access |
option | option to access |
buf | where to store the decoded binary result |
buf_size | exact number of bytes to store in buf |
Definition at line 1951 of file configuration.c.
References cfg, data_size, enc, GNUNET_CONFIGURATION_get_value_string(), GNUNET_free, GNUNET_OK, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, and res.
Referenced by load_member(), load_member_session_next(), and load_operation().
char * GNUNET_CONFIGURATION_expand_dollar | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
char * | orig | ||
) |
Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or the environment "FOO" is set to "DIRECTORY".
We also support default expansion, i.e. ${VARIABLE:-default} will expand to $VARIABLE if VARIABLE is set in PATHS or the environment, and otherwise to "default". Note that "default" itself can also be a $-expression, thus "${VAR1:-{$VAR2}}" will expand to VAR1 and if that is not defined to VAR2.
cfg | configuration to use for path expansion |
orig | string to $-expand (will be freed!) Note that multiple $-expressions can be present in this string. They will all be $-expanded. |
Definition at line 2175 of file configuration.c.
References cfg, expand_dollar(), GNUNET_assert, GNUNET_free, GNUNET_memcpy, GNUNET_realloc, and GNUNET_strdup.
Referenced by expand_dollar(), GNUNET_CONFIGURATION_get_value_filename(), run(), start_arm_service(), and start_process().
void GNUNET_CONFIGURATION_set_value_number | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
unsigned long long | number | ||
) |
Set a configuration value that should be a number.
cfg | configuration to update |
section | section of interest |
option | option of interest |
number | value to set |
Definition at line 1742 of file configuration.c.
References cfg, GNUNET_CONFIGURATION_set_value_string(), GNUNET_snprintf(), and number.
Referenced by next_phase(), run(), save_member_session(), save_operation(), and set_value().
void GNUNET_CONFIGURATION_set_value_string | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
const char * | value | ||
) |
Set a configuration value that should be a string.
cfg | configuration to update |
section | section of interest |
option | option of interest |
value | value to set |
Definition at line 1699 of file configuration.c.
References cfg, ConfigSection::entries, find_entry(), find_section(), GNUNET_free, GNUNET_new, GNUNET_strdup, ConfigEntry::key, ConfigSection::name, ConfigEntry::next, ConfigSection::next, GNUNET_CONFIGURATION_Handle::sections, ConfigEntry::val, and value.
Referenced by auto_conf_iter(), auto_config_cb(), compare_entries(), copy_entry(), GNUNET_CONFIGURATION_append_value_filename(), GNUNET_CONFIGURATION_config_tool_run(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_deserialize(), GNUNET_CONFIGURATION_load(), GNUNET_CONFIGURATION_remove_value_filename(), GNUNET_CONFIGURATION_set_value_float(), GNUNET_CONFIGURATION_set_value_number(), GNUNET_NAT_autoconfig_start(), GNUNET_PROGRAM_run2(), GNUNET_TESTBED_configuration_create(), handle_ego_delete(), handle_ego_rename(), handle_inline(), identity_cb(), next_phase(), process_if(), result_callback(), run(), save_member(), save_member_session(), save_operation(), set_external_ipv4(), set_value(), start_peer_run(), test_local_ip(), test_upnpc(), update_config(), update_config_sections(), and update_enable_upnpc_option().
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_remove_value_filename | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
const char * | value | ||
) |
Remove a filename from a configuration value that represents a list of filenames.
cfg | configuration to update |
section | section of interest |
option | option of interest |
value | filename to remove |
Definition at line 2426 of file configuration.c.
References cfg, end, escape_name(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_free, GNUNET_NO, GNUNET_OK, list, and value.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_append_value_filename | ( | struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | section, | ||
const char * | option, | ||
const char * | value | ||
) |
Append a filename to a configuration value that represents a list of filenames.
cfg | configuration to update |
section | section of interest |
option | option of interest |
value | filename to append |
Definition at line 2388 of file configuration.c.
References cfg, escape_name(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_iterate_value_filenames(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_free, GNUNET_malloc, GNUNET_NO, GNUNET_OK, GNUNET_strdup, GNUNET_SYSERR, test_match(), and value.
void GNUNET_CONFIGURATION_config_settings_free | ( | struct GNUNET_CONFIGURATION_ConfigSettings * | cs | ) |
Free resources associated with cs.
[in] | cs | settings to free (actual memory of cs itself is not released) |
Definition at line 2967 of file configuration.c.
References GNUNET_free, GNUNET_CONFIGURATION_ConfigSettings::option, GNUNET_CONFIGURATION_ConfigSettings::section, and GNUNET_CONFIGURATION_ConfigSettings::value.
Referenced by main().
void GNUNET_CONFIGURATION_config_tool_run | ( | void * | cls, |
char *const * | args, | ||
const char * | cfgfile, | ||
const struct GNUNET_CONFIGURATION_Handle * | cfg | ||
) |
Main task to run to perform operations typical for gnunet-config as per the configuration settings given in cls.
cls | closure with the struct GNUNET_CONFIGURATION_ConfigSettings |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 2775 of file configuration.c.
References _, consensus-simulation::args, cfg, GNUNET_OS_ProjectData::config_file, GNUNET_CONFIGURATION_ConfigSettings::diagnostics, DIR_SEPARATOR_STR, EXIT_INVALIDARGUMENT, EXIT_NOTCONFIGURED, GNUNET_CONFIGURATION_ConfigSettings::full, getenv(), GNUNET_CONFIGURATION_ConfigSettings::global_ret, GNUNET_asprintf(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_dup(), GNUNET_CONFIGURATION_enable_diagnostics(), GNUNET_CONFIGURATION_get_value_filename(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_iterate_section_values(), GNUNET_CONFIGURATION_iterate_sections(), GNUNET_CONFIGURATION_load(), GNUNET_CONFIGURATION_serialize_diagnostics(), GNUNET_CONFIGURATION_set_value_string(), GNUNET_CONFIGURATION_write(), GNUNET_CONFIGURATION_write_diffs(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log_config_missing(), GNUNET_OK, GNUNET_strdup, GNUNET_YES, GNUNET_CONFIGURATION_ConfigSettings::is_filename, GNUNET_CONFIGURATION_ConfigSettings::list_sections, GNUNET_CONFIGURATION_ConfigSettings::option, GNUNET_CONFIGURATION_Handle::pd, print_filename_option(), print_option(), print_section_name(), GNUNET_CONFIGURATION_ConfigSettings::rewrite, GNUNET_CONFIGURATION_ConfigSettings::section, GNUNET_OS_ProjectData::user_config_file, value, and GNUNET_CONFIGURATION_ConfigSettings::value.
Referenced by main().