OpenVAS Libraries
9.0.3
|
Implementation of API to handle globally stored preferences. More...
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
#include "../base/settings.h"
#include "arglists.h"
Go to the source code of this file.
Functions | |
struct arglist * | preferences_get (void) |
Get the pointer to the global preferences structure. Eventually this function should not be used anywhere. More... | |
const gchar * | prefs_get (const gchar *key) |
Get a string preference value via a key. More... | |
int | prefs_get_bool (const gchar *key) |
Get a boolean expression of a preference value via a key. More... | |
void | prefs_set (const gchar *key, const gchar *value) |
Set a string preference value via a key. More... | |
void | prefs_config (const char *config) |
Apply the configs from given file as preferences. More... | |
void | prefs_dump (void) |
Dump the preferences to stdout. More... | |
int | prefs_nvt_timeout (const char *oid) |
Returns the timeout defined by the client or 0 if none was set. More... | |
Implementation of API to handle globally stored preferences.
A gloabl store of preferences to scanner and NVTs is handled by this module.
The module is currently using arglist, but eventually once the all of the Scanner uses the preferences via this module, it cann be replaced by a better technology and then be moved to base. Possibly a consolidation with the settings iterator make sense.
Definition in file prefs.c.
struct arglist* preferences_get | ( | void | ) |
Get the pointer to the global preferences structure. Eventually this function should not be used anywhere.
Definition at line 68 of file prefs.c.
Referenced by get_plugin_preference().
void prefs_config | ( | const char * | config | ) |
Apply the configs from given file as preferences.
config | Filename of the configuration file. |
Definition at line 155 of file prefs.c.
void prefs_dump | ( | void | ) |
const gchar* prefs_get | ( | const gchar * | key | ) |
Get a string preference value via a key.
key | The identifier for the preference. |
Definition at line 86 of file prefs.c.
Referenced by cgibin(), exec_nasl_script(), kb_get_port_state_proto(), nasl_get_preference(), nasl_scanner_get_port(), open_sock_tcp(), plug_get_host_fqdn(), plugin_run_openvas_tcp_scanner(), plugin_run_synscan(), prefs_nvt_timeout(), and proto_post_wrapped().
int prefs_get_bool | ( | const gchar * | key | ) |
Get a boolean expression of a preference value via a key.
key | The identifier for the preference. |
Definition at line 109 of file prefs.c.
Referenced by plugin_run_openvas_tcp_scanner(), and safe_checks().
int prefs_nvt_timeout | ( | const char * | oid | ) |
Returns the timeout defined by the client or 0 if none was set.
oid | OID of NVT to ask timeout value of. |
Definition at line 198 of file prefs.c.
References oid, prefs_get(), and val.
void prefs_set | ( | const gchar * | key, |
const gchar * | value | ||
) |
Set a string preference value via a key.
key | The identifier for the preference. A copy of this will be created if necessary. |
value | The value to set. A copy of this will be created. |
Definition at line 133 of file prefs.c.
Referenced by init(), and main().