OpenVAS Scanner 23.32.3
kb_cache.h File Reference

Header file to cache main_kb. More...

#include <gvm/util/kb.h>
Include dependency graph for kb_cache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void set_main_kb (kb_t)
 sets the shared database between ospd and openvas as a main_kb for further usage. @description this sets the given kb as a main_kb global variable. It is NOT threadsafe and must be called after each reconnect or fork.
kb_t get_main_kb (void)
 gets the main_kb. @description returns the previously set main_kb; when asserts are enabled it will abort when main_kb is not set. However each usage must check if the return is NULL or not.

Detailed Description

Header file to cache main_kb.

Definition in file kb_cache.h.

Function Documentation

◆ get_main_kb()

kb_t get_main_kb ( void )

gets the main_kb. @description returns the previously set main_kb; when asserts are enabled it will abort when main_kb is not set. However each usage must check if the return is NULL or not.

Returns
the set main_kb

Definition at line 41 of file kb_cache.c.

42{
43 assert (main_kb);
44 return main_kb;
45}
kb_t main_kb
Definition kb_cache.c:15

References main_kb.

Referenced by attack_host(), attack_start(), call_lsc(), call_rs_notus(), check_kb_inconsistency_log(), launch_plugin(), nasl_thread(), open_sock_tcp(), plug_fork_child(), plugin_run_find_service(), proto_post_wrapped(), and security_notus().

Here is the caller graph for this function:

◆ set_main_kb()

void set_main_kb ( kb_t kb)

sets the shared database between ospd and openvas as a main_kb for further usage. @description this sets the given kb as a main_kb global variable. It is NOT threadsafe and must be called after each reconnect or fork.

Parameters
main_kbCurrent main kb.

Definition at line 27 of file kb_cache.c.

28{
29 main_kb = kb;
30}

References main_kb.

Referenced by Ensure(), main(), and overwrite_openvas_prefs_with_prefs_from_client().

Here is the caller graph for this function: