|
OpenVAS Scanner 23.32.3
|
Basically creates a new process for each tested host. More...
#include "hosts.h"#include "../misc/network.h"#include "../misc/plugutils.h"#include "utils.h"#include <errno.h>#include <glib.h>#include <gvm/base/networking.h>#include <stdio.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. | |
Functions | |
| void | host_set_time (kb_t kb, char *ip, char *type) |
| Add star_scan and end_scan results to the main kb. | |
| static void | host_rm (struct host *h) |
| static int | hosts_num (void) |
| Returns the number of entries in the global hosts list. | |
| static struct host * | hosts_get (char *name) |
| Retrieves a host specified by its name from the global host list. | |
| int | hosts_init (int max_hosts) |
| int | hosts_new (char *name, kb_t kb, kb_t main_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. | |
| int | host_is_currently_scanned (gvm_host_t *host_to_check) |
| Returns 1 if the host is being scanned. 0 otherwise. | |
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.
| int host_is_currently_scanned | ( | gvm_host_t * | host_to_check | ) |
Returns 1 if the host is being scanned. 0 otherwise.
It checks not only the main IP of the host, but also the ips that a dns-lookup returns.
Definition at line 271 of file hosts.c.
References hosts, hosts_read(), host::name, and host::next.
Referenced by attack_network().


|
static |
Definition at line 88 of file hosts.c.
References host::host_kb, host::name, host::next, host::pid, host::prev, and host::results_kb.
Referenced by hosts_read_data().

| void host_set_time | ( | kb_t | kb, |
| char * | ip, | ||
| char * | type ) |
Add star_scan and end_scan results to the main kb.
| [in] | kb | Main KB where results are stored. |
| [in] | ip | List of vhosts to add new vhosts to. |
| [in] | type | If it is start or end message. |
Definition at line 64 of file hosts.c.
References host::ip, kb_item_push_str_with_main_kb_check(), and len.
Referenced by attack_host().


|
static |
Retrieves a host specified by its name from the global host list.
Definition at line 131 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 144 of file hosts.c.
References g_max_hosts.
Referenced by attack_network().

| int hosts_new | ( | char * | name, |
| kb_t | kb, | ||
| kb_t | main_kb ) |
Definition at line 151 of file hosts.c.
References g_max_hosts, global_scan_stop, host::host_kb, hosts, hosts_num(), hosts_read(), main_kb, host::name, name, host::next, host::pid, host::prev, and host::results_kb.
Referenced by attack_network().


|
static |
Returns the number of entries in the global hosts list.
Definition at line 116 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 253 of file hosts.c.
References hosts, and hosts_read_data().
Referenced by attack_network(), host_is_currently_scanned(), and hosts_new().


|
static |
Definition at line 218 of file hosts.c.
References host_rm(), hosts, host::next, host::pid, and host::prev.
Referenced by hosts_read().


| int hosts_set_pid | ( | char * | name, |
| pid_t | pid ) |
Definition at line 177 of file hosts.c.
References hosts_get(), name, host::pid, and pid.
Referenced by attack_network().


| void hosts_stop_all | ( | void | ) |
Definition at line 203 of file hosts.c.
References global_scan_stop, hosts, hosts_stop_host(), and host::next.
Referenced by scan_stop_cleanup().


|
static |
Definition at line 192 of file hosts.c.
References host::name, and host::pid.
Referenced by hosts_stop_all().

|
static |
Definition at line 50 of file hosts.c.
Referenced by hosts_init(), and hosts_new().
|
extern |
Definition at line 261 of file attack.c.
Referenced by handle_scan_stop_signal(), hosts_new(), hosts_stop_all(), and scan_is_stopped().
|
static |
Definition at line 49 of file hosts.c.
Referenced by apply_hosts_excluded(), apply_hosts_preferences_ordering(), apply_hosts_reverse_lookup_preferences(), attack_network(), host_is_currently_scanned(), hosts_get(), hosts_new(), hosts_num(), hosts_read(), hosts_read_data(), hosts_stop_all(), and main().