|
OpenVAS Scanner 23.23.1
|
Manages the launching of plugins within processes. More...
#include "pluginlaunch.h"#include "../misc/heartbeat.h"#include "../misc/network.h"#include "../misc/nvt_categories.h"#include "../misc/plugutils.h"#include "pluginload.h"#include "pluginscheduler.h"#include "plugs_req.h"#include "processes.h"#include "sighand.h"#include "utils.h"#include <errno.h>#include <gvm/base/prefs.h>#include <gvm/util/nvticache.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <sys/time.h>#include <sys/wait.h>#include <unistd.h>Data Structures | |
| struct | running |
| Structure to represent a process in the sense of a running NVT. More... | |
Macros | |
| #define | G_LOG_DOMAIN "sd main" |
| GLib log domain. | |
| #define | MAX_PROCESSES 32 |
| 'Hard' limit of the max. number of concurrent plugins per host. | |
Functions | |
| static int | max_nvt_timeouts_reached (void) |
| Check if max_nvt_timeouts is set and if has been reached. | |
| static void | update_running_processes (kb_t main_kb, kb_t kb) |
| static int | common (GSList *list1, GSList *list2) |
| static GSList * | required_ports_in_list (const char *oid, GSList *list) |
| static int | simult_ports (const char *oid, const char *next_oid) |
| static int | next_free_process (kb_t main_kb, kb_t kb, struct scheduler_plugin *upcoming) |
| void | pluginlaunch_init (const char *host) |
| void | pluginlaunch_disable_parallel_checks (void) |
| void | pluginlaunch_enable_parallel_checks (void) |
| void | pluginlaunch_stop (void) |
| static int | plugin_timeout (nvti_t *nvti) |
| static int | get_available_memory () |
| static int | check_memory () |
| static int | check_sysload () |
| int | plugin_launch (struct scan_globals *globals, struct scheduler_plugin *plugin, struct in6_addr *ip, GSList *vhosts, kb_t kb, kb_t main_kb, nvti_t *nvti, int *error) |
| Start a plugin. | |
| void | pluginlaunch_wait (kb_t main_kb, kb_t kb) |
| Waits and 'pushes' processes until num_running_processes is 0. | |
| static int | timeout_running_processes (void) |
| Return shortest timeout of the running processes. | |
| void | pluginlaunch_wait_for_free_process (kb_t main_kb, kb_t kb) |
| Waits and 'pushes' processes until the number of running processes has changed. | |
Variables | |
| int | global_min_memory |
| int | global_max_sysload |
| static struct running | processes [MAX_PROCESSES] |
| static int | num_running_processes |
| static int | max_running_processes |
| static int | old_max_running_processes |
| static GSList * | non_simult_ports = NULL |
| const char * | hostname = NULL |
Manages the launching of plugins within processes.
| #define G_LOG_DOMAIN "sd main" |
GLib log domain.
| #define MAX_PROCESSES 32 |
'Hard' limit of the max. number of concurrent plugins per host.
|
static |
|
static |
|
static |
|
static |
|
static |
Check if max_nvt_timeouts is set and if has been reached.
|
static |
If another NVT with same port requirements is running, wait.
| int plugin_launch | ( | struct scan_globals * | globals, |
| struct scheduler_plugin * | plugin, | ||
| struct in6_addr * | ip, | ||
| GSList * | vhosts, | ||
| kb_t | kb, | ||
| kb_t | main_kb, | ||
| nvti_t * | nvti, | ||
| int * | error ) |
Start a plugin.
Check for free slots available in the process table. Set error with ERR_NO_FREE_SLOT if the process table is full. Set error with ERR_CANT_FORK if was not possible to fork() a new child.
|
static |
| void pluginlaunch_disable_parallel_checks | ( | void | ) |
| void pluginlaunch_enable_parallel_checks | ( | void | ) |
| void pluginlaunch_init | ( | const char * | host | ) |
| void pluginlaunch_stop | ( | void | ) |
| void pluginlaunch_wait | ( | kb_t | main_kb, |
| kb_t | kb ) |
Waits and 'pushes' processes until num_running_processes is 0.
| void pluginlaunch_wait_for_free_process | ( | kb_t | main_kb, |
| kb_t | kb ) |
Waits and 'pushes' processes until the number of running processes has changed.
|
static |
|
static |
|
static |
Return shortest timeout of the running processes.
|
static |
|
extern |
|
extern |
| const char* hostname = NULL |
|
static |
|
static |
|
static |
|
static |
|
static |