OpenVAS Scanner 23.23.1
nasl_plugins.c File Reference

The nasl - plugin class. Loads or launches nasl- plugins. More...

#include "../misc/kb_cache.h"
#include "../misc/network.h"
#include "../misc/plugutils.h"
#include "../nasl/nasl.h"
#include "pluginlaunch.h"
#include "pluginload.h"
#include "pluginscheduler.h"
#include "processes.h"
#include <bsd/unistd.h>
#include <errno.h>
#include <glib.h>
#include <gvm/base/drop_privileges.h>
#include <gvm/base/networking.h>
#include <gvm/base/prefs.h>
#include <gvm/util/nvticache.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <utime.h>

Macros

#define G_LOG_DOMAIN   "sd main"
 GLib log domain.

Functions

static int check_nvti (const char *filename, nvti_t *nvt)
 Check that the nvt's data is valid.
int nasl_file_check (const char *folder, const char *filename)
 Check a single .nasl/.inc file.
int nasl_plugin_add (const char *folder, char *filename)
 Add one .nasl plugin to the plugin list.
static void nasl_thread (struct ipc_context *, struct script_infos *)
int nasl_plugin_launch (struct scan_globals *globals, struct in6_addr *ip, GSList *vhosts, kb_t kb, const char *oid)
 Launch a NASL plugin.

Detailed Description

The nasl - plugin class. Loads or launches nasl- plugins.

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "sd main"

GLib log domain.

Function Documentation

◆ check_nvti()

int check_nvti ( const char * filename,
nvti_t * nvt )
static

Check that the nvt's data is valid.

Parameters
filenameFilename of the NVT.
nvtNVT to check.
Returns
0 on success, -1 on error.

◆ nasl_file_check()

int nasl_file_check ( const char * folder,
const char * filename )

Check a single .nasl/.inc file.

Parameters
folderPath to the plugin folder.
filenameFile-name of the plugin
Returns
0 on success, -1 on error.

◆ nasl_plugin_add()

int nasl_plugin_add ( const char * folder,
char * filename )

Add one .nasl plugin to the plugin list.

It is parsed (via exec_nasl_script) and added to the cache

Parameters
folderPath to the plugin folder.
filenameFile-name of the plugin
Returns
0 on success, -1 on error.

◆ nasl_plugin_launch()

int nasl_plugin_launch ( struct scan_globals * globals,
struct in6_addr * ip,
GSList * vhosts,
kb_t kb,
const char * oid )

Launch a NASL plugin.

◆ nasl_thread()

void nasl_thread ( struct ipc_context * ipcc,
struct script_infos * args )
static