OpenVAS Scanner
7.0.1~git
|
Go to the documentation of this file.
28 #include "../misc/network.h"
42 #define G_LOG_DOMAIN "sd main"
75 timestr[
sizeof (timestr) - 1] =
'\0';
76 strncpy (timestr, tmp,
sizeof (timestr) - 1);
77 len = strlen (timestr);
78 if (timestr[len - 1] ==
'\n')
79 timestr[len - 1] =
'\0';
81 kb_item_push_str (kb, key, timestr);
88 waitpid (h->
pid, NULL, WNOHANG);
93 char *scan_id = kb_item_get_str (h->
host_kb,
"internal/scan_id");
94 snprintf (key,
sizeof (key),
"internal/%s", scan_id);
95 kb_item_set_str (h->
host_kb, key,
"finished", 0);
130 for (num = 0; h != NULL; num++, h = h->
next)
172 h = g_malloc0 (
sizeof (
struct host));
190 g_debug (
"host_set_pid() failed!\n");
205 g_message (
"Stopping host %s scan", h->
name);
206 kill (h->
pid, SIGUSR1);
233 ret = waitpid (-1, NULL, WNOHANG);
235 g_debug (
"waitpid() failed. %s)", strerror (errno));
246 h->
ip = kb_item_get_str (h->
host_kb,
"internal/ip");
252 if (kill (h->
pid, 0) < 0)
else(PROJECT_BETA_RELEASE) set(NASL_VERSION_SUFFIX ".$
int hosts_read(void)
Returns -1 if client asked to stop all tests or connection was lost or error. 0 otherwise.
endif(PROJECT_BETA_RELEASE) set(NASL_VERSION_STRING "$
static struct host * hosts_get(char *name)
Retrieves a host specified by its name from the global host list.
set(NASL_VERSION_MAJOR 11) set(NASL_VERSION_MINOR 0) set(NASL_VERSION_PATCH 1) if(PROJECT_BETA_RELEASE) set(NASL_VERSION_SUFFIX "+beta$
static void host_rm(struct host *h)
static void hosts_read_data(void)
int hosts_init(int max_hosts)
static void host_set_time(kb_t kb, char *key)
int hosts_new(char *name, kb_t kb)
static int hosts_stop_host(struct host *h)
Host information, implemented as doubly linked list.
void hosts_stop_all(void)
int openvas(int argc, char *argv[])
openvas.
static int hosts_num(void)
Returns the number of entries in the global hosts list.
int hosts_set_pid(char *name, pid_t pid)
static struct host * hosts
static struct running processes[MAX_PROCESSES]