#include <openvas/misc/arglists.h>
Go to the source code of this file.
◆ common()
int common |
( |
struct arglist * |
l1, |
|
|
struct arglist * |
l2 |
|
) |
| |
Returns 1 if the two arglists have a name in common.
- Returns
- 0 if l1 and l2 have a name in common, 0 otherwise.
Definition at line 54 of file utils.c.
57 struct arglist *l2_start = l2;
62 while (l1->next != NULL)
65 while (l2->next != NULL)
67 if (strcmp (l1->name, l2->name) == 0)
◆ data_left()
Definition at line 193 of file utils.c.
197 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 150 of file utils.c.
153 if (prefs_get (
"max_checks"))
155 max_checks = atoi (prefs_get (
"max_checks"));
158 log_write (
"Error ! max_hosts = %d -- check %s", max_checks,
159 (
char *) prefs_get (
"config_file"));
164 log_write (
"Client tried to raise the maximum checks number - %d." 165 " Using %d. Change 'max_checks' in openvassd.conf if you" void log_write(const char *str,...)
Write into the logfile / syslog.
References global_max_checks, and log_write().
◆ 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 120 of file utils.c.
123 if (prefs_get (
"max_hosts"))
125 max_hosts = atoi (prefs_get (
"max_hosts"));
128 log_write (
"Error ! max_hosts = %d -- check %s", max_hosts,
129 (
char *) prefs_get (
"config_file"));
134 log_write (
"Client tried to raise the maximum hosts number - %d." 135 " Using %d. Change 'max_hosts' in openvassd.conf if you" void log_write(const char *str,...)
Write into the logfile / syslog.
References global_max_hosts, and log_write().
◆ is_scanner_only_pref()
int is_scanner_only_pref |
( |
const char * |
| ) |
|
Definition at line 221 of file utils.c.
225 if (!strcmp (pref,
"logfile") || !strcmp (pref,
"config_file")
226 || !strcmp (pref,
"plugins_folder")
227 || !strcmp (pref,
"kb_location")
228 || !strcmp (pref,
"dumpfile")
229 || !strcmp (pref,
"negot_timeout")
230 || !strcmp (pref,
"force_pubkey_auth")
231 || !strcmp (pref,
"log_whole_attack")
232 || !strcmp (pref,
"be_nice")
233 || !strcmp (pref,
"log_plugins_name_at_load")
234 || !strcmp (pref,
"nasl_no_signature_check")
236 || !strncmp (pref,
"sys_", 4))
Referenced by comm_send_preferences().
◆ list2arglist()
struct arglist* list2arglist |
( |
char * |
list | ) |
|
Converts a user comma delimited input (1,2,3) into an arglist.
Definition at line 81 of file utils.c.
90 ret = g_malloc0 (
sizeof (
struct arglist));
92 while ((t = strchr (
list,
',')) != NULL)
95 while (
list[0] ==
' ')
99 arg_add_value (ret,
list, ARG_INT, (
void *) 1);
104 while (
list[0] ==
' ')
108 arg_add_value (ret,
list, ARG_INT, (
void *) 1);
◆ process_alive()
int process_alive |
( |
pid_t |
pid | ) |
|
Determines if a process is alive - as reliably as we can
Definition at line 180 of file utils.c.
186 for (i = 0, ret = 1; (i < 10) && (ret > 0); i++)
187 ret = waitpid (pid, NULL, WNOHANG);
189 return kill (pid, 0) == 0;
◆ send_printf()
void send_printf |
( |
int |
, |
|
|
char * |
, |
|
|
|
... |
|
) |
| |
◆ sort_plugins_by_type()
struct arglist* sort_plugins_by_type |
( |
struct arglist * |
| ) |
|
◆ wait_for_children1()
void wait_for_children1 |
( |
void |
| ) |
|
Definition at line 202 of file utils.c.
208 e = waitpid (-1, NULL, WNOHANG);
211 while ((e > 0 || errno == EINTR) && n < 20);