OpenVAS Scanner  6.0.0~git
Macros | Functions | Variables
pluginload.c File Reference

Loads plugins from disk into memory. More...

#include "pluginload.h"
#include "../nasl/nasl.h"
#include "processes.h"
#include "sighand.h"
#include "utils.h"
#include <errno.h>
#include <glib.h>
#include <gvm/base/prefs.h>
#include <gvm/base/proctitle.h>
#include <gvm/util/nvticache.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/shm.h>
#include <sys/time.h>
#include <sys/wait.h>

Macros

#define G_LOG_DOMAIN   "sd main"
 GLib log domain. More...
 

Functions

GSList * collect_nvts (const char *folder, const char *subdir, GSList *files)
 Collects all NVT files in a directory and recurses into subdirs. More...
 
int calculate_eta (struct timeval start_time, int loaded, int total)
 
void init_loading_shm (void)
 
void destroy_loading_shm (void)
 
int current_loading_plugins (void)
 
int total_loading_plugins (void)
 
void set_current_loading_plugins (int current)
 
void set_total_loading_plugins (int total)
 
static void cleanup_leftovers (int num_files)
 
static void plugins_reload_from_dir (void *folder)
 
static void include_dirs (void)
 
int plugins_init (void)
 

Variables

static int * loading_shm = NULL
 
static int loading_shmid = 0
 

Detailed Description

Loads plugins from disk into memory.

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "sd main"

GLib log domain.

Function Documentation

◆ calculate_eta()

int calculate_eta ( struct timeval  start_time,
int  loaded,
int  total 
)

◆ cleanup_leftovers()

static void cleanup_leftovers ( int  num_files)
static

◆ collect_nvts()

GSList* collect_nvts ( const char *  folder,
const char *  subdir,
GSList *  files 
)

Collects all NVT files in a directory and recurses into subdirs.

Parameters
folderThe main directory from where to descend and collect.
subdirA subdirectory to consider for the collection: "folder/subdir" is thus the effective directory to descend from. "subdir" can be "" to make "folder" the effective start.
filesA list that is extended with all found files. If it is NULL, a new list is created automatically.
Returns
Parameter "files", extended with all the NVT files found in "folder" and its subdirectories. Not added are directory names. NVT files are identified by the defined filename suffixes.

◆ current_loading_plugins()

int current_loading_plugins ( void  )

◆ destroy_loading_shm()

void destroy_loading_shm ( void  )

◆ include_dirs()

static void include_dirs ( void  )
static

◆ init_loading_shm()

void init_loading_shm ( void  )

◆ plugins_init()

int plugins_init ( void  )

◆ plugins_reload_from_dir()

static void plugins_reload_from_dir ( void *  folder)
static

◆ set_current_loading_plugins()

void set_current_loading_plugins ( int  current)

◆ set_total_loading_plugins()

void set_total_loading_plugins ( int  total)

◆ total_loading_plugins()

int total_loading_plugins ( void  )

Variable Documentation

◆ loading_shm

int* loading_shm = NULL
static

◆ loading_shmid

int loading_shmid = 0
static