utils.c headerfile.
More...
#include <sys/types.h>
Go to the source code of this file.
utils.c headerfile.
Definition in file utils.h.
◆ data_left()
Definition at line 216 of file utils.c.
219 ioctl (soc, FIONREAD, &data);
◆ get_max_checks_number()
int get_max_checks_number |
( |
void |
| ) |
|
Get the max number of plugins to launch against the remote host at the same time
Definition at line 174 of file utils.c.
References global_max_checks.
Referenced by attack_network(), and pluginlaunch_init().
177 if (prefs_get (
"max_checks"))
179 max_checks = atoi (prefs_get (
"max_checks"));
182 g_debug (
"Error ! max_hosts = %d -- check %s", max_checks,
183 (
char *) prefs_get (
"config_file"));
188 g_debug (
"Client tried to raise the maximum checks number - %d." 189 " Using %d. Change 'max_checks' in openvas.conf if you" 190 " believe this is incorrect",
◆ get_max_hosts_number()
int get_max_hosts_number |
( |
void |
| ) |
|
Get the max number of hosts to test at the same time.
Definition at line 143 of file utils.c.
References global_max_hosts.
Referenced by attack_network().
146 if (prefs_get (
"max_hosts"))
148 max_hosts = atoi (prefs_get (
"max_hosts"));
151 g_debug (
"Error ! max_hosts = %d -- check %s", max_hosts,
152 (
char *) prefs_get (
"config_file"));
157 g_debug (
"Client tried to raise the maximum hosts number - %d." 158 " Using %d. Change 'max_hosts' in openvas.conf if you" 159 " believe this is incorrect",
◆ is_scanner_only_pref()
int is_scanner_only_pref |
( |
const char * |
| ) |
|
Definition at line 243 of file utils.c.
247 if (!strcmp (pref,
"logfile") || !strcmp (pref,
"config_file")
248 || !strcmp (pref,
"plugins_folder")
252 || !strcmp (pref,
"db_address") || !strcmp (pref,
"negot_timeout")
253 || !strcmp (pref,
"force_pubkey_auth")
254 || !strcmp (pref,
"log_whole_attack")
255 || !strcmp (pref,
"log_plugins_name_at_load")
256 || !strcmp (pref,
"nasl_no_signature_check")
257 || !strcmp (pref,
"vendor_version")
259 || !strncmp (pref,
"sys_", 4))
◆ process_alive()
int process_alive |
( |
pid_t |
pid | ) |
|
◆ store_file()
int store_file |
( |
struct scan_globals * |
globals, |
|
|
const char * |
file, |
|
|
const char * |
file_hash |
|
) |
| |
Stores a file type preference in a hash table.
- Parameters
-
globals | Global struct. |
file | File content. |
file_hash | hash to reference the file. |
- Returns
- 0 if successful, -1 in case of errors.
Definition at line 110 of file utils.c.
References files_add_size_translation(), and files_add_translation().
Referenced by load_scan_preferences().
114 gchar *contents = NULL;
118 if (!file_hash && *file_hash ==
'\0')
121 origname = g_strdup (file_hash);
123 contents = (gchar *) g_base64_decode (file, &bytes);
125 if (contents == NULL)
127 g_debug (
"store_file: Failed to allocate memory for uploaded file.");
static void files_add_translation(struct scan_globals *globals, const char *file_hash, char *contents)
Adds a 'translation' entry for a file sent by the client.
static void files_add_size_translation(struct scan_globals *globals, const char *file_hash, const long filesize)
Adds a 'content size' entry for a file sent by the client.
◆ wait_for_children1()
void wait_for_children1 |
( |
void |
| ) |
|
Definition at line 224 of file utils.c.
230 e = waitpid (-1, NULL, WNOHANG);
233 while ((e > 0 || errno == EINTR) && n < 20);