|
OpenVAS Scanner 23.23.1
|
glue between openvas and nasl scripts. More...
#include "nasl_scanner_glue.h"#include "../misc/ipc_openvas.h"#include "../misc/network.h"#include "../misc/plugutils.h"#include "../misc/support.h"#include "../misc/vendorversion.h"#include "nasl_debug.h"#include "nasl_func.h"#include "nasl_global_ctxt.h"#include "nasl_lex_ctxt.h"#include "nasl_tree.h"#include "nasl_var.h"#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <glib.h>#include <gvm/base/logging.h>#include <gvm/base/prefs.h>#include <gvm/util/kb.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <unistd.h>Macros | |
| #define | G_LOG_DOMAIN "lib nasl" |
| GLib logging domain. | |
Typedefs | |
| typedef void(* | proto_post_something_t) (const char *, struct script_infos *, int, const char *, const char *, const char *) |
| typedef void(* | post_something_t) (const char *, struct script_infos *, int, const char *, const char *) |
glue between openvas and nasl scripts.
This file contains all the functions that make the "glue" between as NASL script and openvas. (script_*(), kb(), scanner_*())
| #define G_LOG_DOMAIN "lib nasl" |
GLib logging domain.
| typedef void(* post_something_t) (const char *, struct script_infos *, int, const char *, const char *) |
Function is used when the script wants to report a problem back to openvas.
| typedef void(* proto_post_something_t) (const char *, struct script_infos *, int, const char *, const char *, const char *) |
Function is used when the script wants to report a problem back to openvas.
Get the kb index of the host running the current script.
| [in] | lexic | NASL lexer. |
Return the OID of the current script.
| [in] | lexic | NASL lexer. |
|
static |
If the plugin is a port scanner, it needs to report the list of open ports back to openvas scanner, and it also needs to know which ports are to be scanned.
Communicate to the parent process that LSC data is ready for use in the host kb.
| [in] | lexic | Lexical context of the NASL interpreter. |
Get a preferences of the current script.
Search the preference by preference name or by preferences id.
| [in] | lexic | NASL lexer. |
Add timeout preference to VT preferences.
VT timeout is handled as normal VT preference. Because of backward compatibility issues the timeout preference is always located at the VT pref location with id NVTPREF_TIMEOUT_ID.
| [in] | lexic | lexic |
| [in] | to | script timeout |
Add a cross reference to the meta data.
The parameter "name" of the command defines actually the type, for example "URL" or "OSVDB". The parameter "value" is the actual reference. Alternative to "value", "csv" can be used with a list of comma-separated values.
In fact, if name is "cve", it is equivalent to call script_cve_id(), for example script_cve_id ("CVE-2019-12345"); is identical to script_xref (name: "cve", value: "CVE-2019-12345");
This even works with multiple comma-separated elements like script_xref (name: "cve", csv: "CVE-2019-12345,CVE-2019-54321");
| lexic | The parser context. |
Send a security message to the client.
| [in] | lexic | NASL lexer. |
|
static |
Set a kb item.
If expire is set the key will be removed after it expired.
| [in] | lexic | NASL lexer. |
| [in] | name | Name of Item. |
| [in] | value | Value of Item. |
| [in] | expire | Optional expire for item in seconds. |