OpenVAS Scanner 21.4.1
|
Manages the launching of plugins within processes. More...
#include "pluginlaunch.h"
#include "../misc/network.h"
#include "../misc/nvt_categories.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. More... | |
#define | MAX_PROCESSES 32 |
'Hard' limit of the max. number of concurrent plugins per host. More... | |
Functions | |
static void | update_running_processes (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 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 () |
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) |
void | pluginlaunch_wait (kb_t kb) |
Waits and 'pushes' processes until num_running_processes is 0. More... | |
static int | timeout_running_processes (void) |
Return shortest timeout of the running processes. More... | |
void | pluginlaunch_wait_for_free_process (kb_t kb) |
Waits and 'pushes' processes until the number of running processes has changed. More... | |
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 |
int check_sysload | ( | ) |
|
static |
|
static |
|
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 | ||
) |
|
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 | kb | ) |
Waits and 'pushes' processes until num_running_processes is 0.
void pluginlaunch_wait_for_free_process | ( | 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 |