OpenVAS Scanner
7.0.0~git
|
Basically creates a new process for each tested host. More...
#include "hosts.h"
#include "../misc/network.h"
#include "utils.h"
#include <errno.h>
#include <glib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | host |
Host information, implemented as doubly linked list. More... | |
Macros | |
#define | G_LOG_DOMAIN "sd main" |
GLib log domain. More... | |
Functions | |
static void | host_set_time (kb_t kb, char *key) |
static void | host_rm (struct host *h) |
static int | hosts_num (void) |
Returns the number of entries in the global hosts list. More... | |
static struct host * | hosts_get (char *name) |
Retrieves a host specified by its name from the global host list. More... | |
int | hosts_init (int max_hosts) |
int | hosts_new (char *name, kb_t kb) |
int | hosts_set_pid (char *name, pid_t pid) |
static int | hosts_stop_host (struct host *h) |
void | hosts_stop_all (void) |
static void | hosts_read_data (void) |
int | hosts_read (void) |
Returns -1 if client asked to stop all tests or connection was lost or error. 0 otherwise. More... | |
Variables | |
static struct host * | hosts = NULL |
static int | g_max_hosts = 15 |
int | global_scan_stop |
Basically creates a new process for each tested host.
Definition in file hosts.c.
|
static |
Definition at line 84 of file hosts.c.
References global_scan_stop, host::host_kb, host_set_time(), host::ip, host::name, host::next, host::pid, and host::prev.
Referenced by hosts_read_data().
|
static |
Definition at line 65 of file hosts.c.
Referenced by host_rm(), and hosts_read_data().
|
static |
Retrieves a host specified by its name from the global host list.
Definition at line 124 of file hosts.c.
References hosts, host::name, name, and host::next.
Referenced by hosts_set_pid().
int hosts_init | ( | int | max_hosts | ) |
Definition at line 137 of file hosts.c.
References g_max_hosts.
Referenced by attack_network().
int hosts_new | ( | char * | name, |
kb_t | kb | ||
) |
Definition at line 144 of file hosts.c.
References g_max_hosts, global_scan_stop, host::host_kb, hosts, hosts_num(), hosts_read(), host::name, name, host::next, host::pid, and host::prev.
Referenced by attack_network().
|
static |
Returns the number of entries in the global hosts list.
Definition at line 109 of file hosts.c.
References hosts, and host::next.
Referenced by hosts_new().
int hosts_read | ( | void | ) |
Returns -1 if client asked to stop all tests or connection was lost or error. 0 otherwise.
Definition at line 250 of file hosts.c.
References hosts, and hosts_read_data().
Referenced by attack_network(), and hosts_new().
|
static |
Definition at line 211 of file hosts.c.
References host::host_kb, host_rm(), host_set_time(), hosts, host::ip, host::next, host::pid, and host::prev.
Referenced by hosts_read().
int hosts_set_pid | ( | char * | name, |
pid_t | pid | ||
) |
Definition at line 169 of file hosts.c.
References hosts_get(), name, host::pid, and pid.
Referenced by attack_network().
void hosts_stop_all | ( | void | ) |
Definition at line 196 of file hosts.c.
References global_scan_stop, hosts, hosts_stop_host(), and host::next.
Referenced by handle_stop_all_scans_signal().
|
static |
Definition at line 184 of file hosts.c.
References host::host_kb, host::name, and host::pid.
Referenced by hosts_stop_all().
|
static |
Definition at line 59 of file hosts.c.
Referenced by hosts_init(), and hosts_new().
int global_scan_stop |
Definition at line 224 of file attack.c.
Referenced by handle_scan_stop_signal(), host_rm(), hosts_new(), hosts_stop_all(), and scan_is_stopped().
|
static |
Definition at line 58 of file hosts.c.
Referenced by apply_hosts_preferences(), attack_network(), hosts_get(), hosts_new(), hosts_num(), hosts_read(), hosts_read_data(), hosts_stop_all(), and main().