OpenVAS Scanner 23.23.1
nasl_scanner_glue.h File Reference
#include "nasl_lex_ctxt.h"

Go to the source code of this file.

Functions

tree_cellscript_timeout (lex_ctxt *)
 Add timeout preference to VT preferences.
tree_cellscript_oid (lex_ctxt *)
tree_cellscript_cve_id (lex_ctxt *)
tree_cellscript_xref (lex_ctxt *)
 Add a cross reference to the meta data.
tree_cellscript_tag (lex_ctxt *)
tree_cellscript_name (lex_ctxt *)
tree_cellscript_version (lex_ctxt *)
tree_cellscript_copyright (lex_ctxt *)
tree_cellscript_category (lex_ctxt *)
tree_cellscript_family (lex_ctxt *)
tree_cellscript_dependencies (lex_ctxt *)
tree_cellscript_require_keys (lex_ctxt *)
tree_cellscript_mandatory_keys (lex_ctxt *)
tree_cellscript_exclude_keys (lex_ctxt *)
tree_cellscript_require_ports (lex_ctxt *)
tree_cellscript_require_udp_ports (lex_ctxt *)
tree_cellnasl_get_preference (lex_ctxt *)
tree_cellscript_add_preference (lex_ctxt *)
tree_cellscript_get_preference (lex_ctxt *)
 Get a preferences of the current script.
tree_cellscript_get_preference_file_content (lex_ctxt *)
tree_cellscript_get_preference_file_location (lex_ctxt *)
tree_cellsafe_checks (lex_ctxt *)
tree_cellget_script_oid (lex_ctxt *)
 Return the OID of the current script.
tree_cellget_host_kb_index (lex_ctxt *)
 Get the kb index of the host running the current script.
tree_cellget_kb_item (lex_ctxt *)
tree_cellget_kb_list (lex_ctxt *)
tree_cellset_kb_item (lex_ctxt *)
 Set a kb item.
tree_cellreplace_kb_item (lex_ctxt *)
tree_cellsecurity_message (lex_ctxt *)
 Send a security message to the client.
tree_celllog_message (lex_ctxt *)
tree_cellerror_message2 (lex_ctxt *)
tree_cellnasl_scanner_get_port (lex_ctxt *)
tree_cellnasl_scanner_add_port (lex_ctxt *)
tree_cellnasl_scanner_status (lex_ctxt *)
tree_cellnasl_vendor_version (lex_ctxt *)
tree_cellnasl_update_table_driven_lsc_data (lex_ctxt *)
 Communicate to the parent process that LSC data is ready for use in the host kb.

Function Documentation

◆ error_message2()

tree_cell * error_message2 ( lex_ctxt * lexic)

◆ get_host_kb_index()

tree_cell * get_host_kb_index ( lex_ctxt * lexic)

Get the kb index of the host running the current script.

Parameters
[in]lexicNASL lexer.
Returns
lex cell containing the host kb index value as positive integer. NULL otherwise

◆ get_kb_item()

tree_cell * get_kb_item ( lex_ctxt * lexic)

◆ get_kb_list()

tree_cell * get_kb_list ( lex_ctxt * lexic)

◆ get_script_oid()

tree_cell * get_script_oid ( lex_ctxt * lexic)

Return the OID of the current script.

Parameters
[in]lexicNASL lexer.
Returns
lex cell containing the OID as a string.

◆ log_message()

tree_cell * log_message ( lex_ctxt * lexic)

◆ nasl_get_preference()

tree_cell * nasl_get_preference ( lex_ctxt * lexic)

◆ nasl_scanner_add_port()

tree_cell * nasl_scanner_add_port ( lex_ctxt * lexic)

◆ nasl_scanner_get_port()

tree_cell * nasl_scanner_get_port ( lex_ctxt * lexic)

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.

◆ nasl_scanner_status()

tree_cell * nasl_scanner_status ( lex_ctxt * lexic)

◆ nasl_update_table_driven_lsc_data()

tree_cell * nasl_update_table_driven_lsc_data ( lex_ctxt * lexic)

Communicate to the parent process that LSC data is ready for use in the host kb.

NASL Function: update_table_driven_lsc_data\n
NASL Named Parameters:\n
  • pkg_list String containing the gathered package list.
  • os_release The OS release.
Parameters
[in]lexicLexical context of the NASL interpreter.
Returns
NULL

◆ nasl_vendor_version()

tree_cell * nasl_vendor_version ( lex_ctxt * lexic)

◆ replace_kb_item()

tree_cell * replace_kb_item ( lex_ctxt * lexic)

◆ safe_checks()

tree_cell * safe_checks ( lex_ctxt * lexic)

◆ script_add_preference()

tree_cell * script_add_preference ( lex_ctxt * lexic)

◆ script_category()

tree_cell * script_category ( lex_ctxt * lexic)

◆ script_copyright()

tree_cell * script_copyright ( lex_ctxt * lexic)

◆ script_cve_id()

tree_cell * script_cve_id ( lex_ctxt * lexic)

◆ script_dependencies()

tree_cell * script_dependencies ( lex_ctxt * lexic)

◆ script_exclude_keys()

tree_cell * script_exclude_keys ( lex_ctxt * lexic)

◆ script_family()

tree_cell * script_family ( lex_ctxt * lexic)

◆ script_get_preference()

tree_cell * script_get_preference ( lex_ctxt * lexic)

Get a preferences of the current script.

Search the preference by preference name or by preferences id.

Parameters
[in]lexicNASL lexer.
Returns
lex cell containing the preferences value as a string. Fake cell otherwise

◆ script_get_preference_file_content()

tree_cell * script_get_preference_file_content ( lex_ctxt * lexic)

◆ script_get_preference_file_location()

tree_cell * script_get_preference_file_location ( lex_ctxt * lexic)

◆ script_mandatory_keys()

tree_cell * script_mandatory_keys ( lex_ctxt * lexic)

◆ script_name()

tree_cell * script_name ( lex_ctxt * lexic)

◆ script_oid()

tree_cell * script_oid ( lex_ctxt * lexic)

◆ script_require_keys()

tree_cell * script_require_keys ( lex_ctxt * lexic)

◆ script_require_ports()

tree_cell * script_require_ports ( lex_ctxt * lexic)

◆ script_require_udp_ports()

tree_cell * script_require_udp_ports ( lex_ctxt * lexic)

◆ script_tag()

tree_cell * script_tag ( lex_ctxt * lexic)

◆ script_timeout()

tree_cell * script_timeout ( lex_ctxt * lexic)

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.

Parameters
[in]lexiclexic
[in]toscript timeout
Returns
FAKE_CELL

◆ script_version()

tree_cell * script_version ( lex_ctxt * lexic)

◆ script_xref()

tree_cell * script_xref ( lex_ctxt * lexic)

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");

Parameters
lexicThe parser context.
Returns
Always FAKE_CELL.

◆ security_message()

tree_cell * security_message ( lex_ctxt * lexic)

Send a security message to the client.

Parameters
[in]lexicNASL lexer.
Returns
FAKE_CELL.

◆ set_kb_item()

tree_cell * set_kb_item ( lex_ctxt * lexic)

Set a kb item.

If expire is set the key will be removed after it expired.

Parameters
[in]lexicNASL lexer.
[in]nameName of Item.
[in]valueValue of Item.
[in]expireOptional expire for item in seconds.
Returns
FAKE_CELL