Greenbone Vulnerability Manager  9.0.1
Macros | Functions
manage_sql_nvts.h File Reference

Manager Manage library: SQL backend headers. More...

Go to the source code of this file.

Macros

#define NVT_INFO_ITERATOR_FILTER_COLUMNS
 Filter columns for NVT info iterator. More...
 
#define NVT_ITERATOR_COLUMNS
 NVT iterator columns. More...
 
#define NVT_ITERATOR_COLUMNS_NVTS
 NVT iterator columns. More...
 

Functions

const char * get_osp_vt_update_socket ()
 Get the current file socket for OSP NVT update. More...
 
void set_osp_vt_update_socket (const char *new_socket)
 Set the file socket for OSP NVT update. More...
 
int check_osp_vt_update_socket ()
 Check the files socket used for OSP NVT update. More...
 
void check_db_nvts ()
 Ensures the sanity of nvts cache in DB.
 
int check_config_families ()
 Ensure that all configs refer to the right NVT families. More...
 
void manage_sync_nvts (int(*)())
 Sync NVTs if newer NVTs are available. More...
 
int manage_update_nvt_cache_osp (const gchar *)
 Update VTs via OSP. More...
 
int family_count ()
 Get the number of families. More...
 

Detailed Description

Manager Manage library: SQL backend headers.

Macro Definition Documentation

◆ NVT_INFO_ITERATOR_FILTER_COLUMNS

#define NVT_INFO_ITERATOR_FILTER_COLUMNS
Value:
{ GET_ITERATOR_FILTER_COLUMNS, "version", "cve", \
"family", "cvss_base", "severity", "cvss", "script_tags", "qod", \
"qod_type", "solution_type", NULL }

Filter columns for NVT info iterator.

◆ NVT_ITERATOR_COLUMNS

#define NVT_ITERATOR_COLUMNS
Value:
{ \
GET_ITERATOR_COLUMNS_PREFIX (""), \
{ "''", "_owner", KEYWORD_TYPE_STRING }, \
{ "0", NULL, KEYWORD_TYPE_INTEGER }, \
{ "oid", NULL, KEYWORD_TYPE_STRING }, \
{ "modification_time", "version", KEYWORD_TYPE_INTEGER }, \
{ "name", NULL, KEYWORD_TYPE_STRING }, \
{ "cve", NULL, KEYWORD_TYPE_STRING }, \
{ "tag", NULL, KEYWORD_TYPE_STRING }, \
{ "category", NULL, KEYWORD_TYPE_STRING }, \
{ "family", NULL, KEYWORD_TYPE_STRING }, \
{ "cvss_base", NULL, KEYWORD_TYPE_DOUBLE }, \
{ "cvss_base", "severity", KEYWORD_TYPE_DOUBLE }, \
{ "cvss_base", "cvss", KEYWORD_TYPE_DOUBLE }, \
{ "qod", NULL, KEYWORD_TYPE_INTEGER }, \
{ "qod_type", NULL, KEYWORD_TYPE_STRING }, \
{ "solution_type", NULL, KEYWORD_TYPE_STRING }, \
{ "tag", "script_tags", KEYWORD_TYPE_STRING}, \
{ "solution", NULL, KEYWORD_TYPE_STRING}, \
{ "summary", NULL, KEYWORD_TYPE_STRING }, \
{ "insight", NULL, KEYWORD_TYPE_STRING }, \
{ "affected", NULL, KEYWORD_TYPE_STRING }, \
{ "impact", NULL, KEYWORD_TYPE_STRING }, \
{ "detection", NULL, KEYWORD_TYPE_STRING }, \
{ NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
}

NVT iterator columns.

◆ NVT_ITERATOR_COLUMNS_NVTS

#define NVT_ITERATOR_COLUMNS_NVTS
Value:
{ \
GET_ITERATOR_COLUMNS_PREFIX ("nvts."), \
{ "''", "_owner", KEYWORD_TYPE_STRING }, \
{ "0", NULL, KEYWORD_TYPE_STRING }, \
{ "oid", NULL, KEYWORD_TYPE_STRING }, \
{ "modification_time", "version", KEYWORD_TYPE_INTEGER }, \
{ "nvts.name", NULL, KEYWORD_TYPE_STRING }, \
{ "cve", NULL, KEYWORD_TYPE_STRING }, \
{ "tag", NULL, KEYWORD_TYPE_STRING }, \
{ "category", NULL, KEYWORD_TYPE_STRING }, \
{ "nvts.family", NULL, KEYWORD_TYPE_STRING }, \
{ "cvss_base", NULL, KEYWORD_TYPE_DOUBLE }, \
{ "cvss_base", "severity", KEYWORD_TYPE_DOUBLE }, \
{ "cvss_base", "cvss", KEYWORD_TYPE_DOUBLE }, \
{ "qod", NULL, KEYWORD_TYPE_INTEGER }, \
{ "qod_type", NULL, KEYWORD_TYPE_STRING }, \
{ "solution_type", NULL, KEYWORD_TYPE_STRING }, \
{ "tag", "script_tags", KEYWORD_TYPE_STRING }, \
{ "solution", NULL, KEYWORD_TYPE_STRING }, \
{ "summary", NULL, KEYWORD_TYPE_STRING }, \
{ "insight", NULL, KEYWORD_TYPE_STRING }, \
{ "affected", NULL, KEYWORD_TYPE_STRING }, \
{ "impact", NULL, KEYWORD_TYPE_STRING }, \
{ "detection", NULL, KEYWORD_TYPE_STRING }, \
{ NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
}

NVT iterator columns.

Function Documentation

◆ check_config_families()

int check_config_families ( )

Ensure that all configs refer to the right NVT families.

When the family of an NVT is changed in the feed, then the config refers to the wrong family.

Returns
0 success, -1 error.

◆ check_osp_vt_update_socket()

int check_osp_vt_update_socket ( )

Check the files socket used for OSP NVT update.

Returns
0 success, 1 no socket found.

◆ family_count()

int family_count ( )

Get the number of families.

Returns
Total number of families.

◆ get_osp_vt_update_socket()

const char* get_osp_vt_update_socket ( )

Get the current file socket for OSP NVT update.

Returns
The path of the file socket for OSP NVT update.

◆ manage_sync_nvts()

void manage_sync_nvts ( int(*)()  fork_update_nvt_cache)

Sync NVTs if newer NVTs are available.

Parameters
[in]fork_update_nvt_cacheFunction to do the update.

◆ manage_update_nvt_cache_osp()

int manage_update_nvt_cache_osp ( const gchar *  update_socket)

Update VTs via OSP.

Expect to be called in the child after a fork.

Parameters
[in]update_socketSocket to use to contact ospd-openvas scanner.
Returns
0 success, -1 error, 2 scanner still loading.

◆ set_osp_vt_update_socket()

void set_osp_vt_update_socket ( const char *  new_socket)

Set the file socket for OSP NVT update.

Parameters
new_socketThe new path of the file socket for OSP NVT update.