Greenbone Vulnerability Manager  9.0.1
manage_sql_nvts.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2019 Greenbone Networks GmbH
2  *
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
25 #ifndef _GVMD_MANAGE_SQL_NVTS_H
26 #define _GVMD_MANAGE_SQL_NVTS_H
27 
31 #define NVT_INFO_ITERATOR_FILTER_COLUMNS \
32  { GET_ITERATOR_FILTER_COLUMNS, "version", "cve", \
33  "family", "cvss_base", "severity", "cvss", "script_tags", "qod", \
34  "qod_type", "solution_type", NULL }
35 
39 #define NVT_ITERATOR_COLUMNS \
40  { \
41  GET_ITERATOR_COLUMNS_PREFIX (""), \
42  { "''", "_owner", KEYWORD_TYPE_STRING }, \
43  { "0", NULL, KEYWORD_TYPE_INTEGER }, \
44  { "oid", NULL, KEYWORD_TYPE_STRING }, \
45  { "modification_time", "version", KEYWORD_TYPE_INTEGER }, \
46  { "name", NULL, KEYWORD_TYPE_STRING }, \
47  { "cve", NULL, KEYWORD_TYPE_STRING }, \
48  { "tag", NULL, KEYWORD_TYPE_STRING }, \
49  { "category", NULL, KEYWORD_TYPE_STRING }, \
50  { "family", NULL, KEYWORD_TYPE_STRING }, \
51  { "cvss_base", NULL, KEYWORD_TYPE_DOUBLE }, \
52  { "cvss_base", "severity", KEYWORD_TYPE_DOUBLE }, \
53  { "cvss_base", "cvss", KEYWORD_TYPE_DOUBLE }, \
54  { "qod", NULL, KEYWORD_TYPE_INTEGER }, \
55  { "qod_type", NULL, KEYWORD_TYPE_STRING }, \
56  { "solution_type", NULL, KEYWORD_TYPE_STRING }, \
57  { "tag", "script_tags", KEYWORD_TYPE_STRING}, \
58  { "solution", NULL, KEYWORD_TYPE_STRING}, \
59  { "summary", NULL, KEYWORD_TYPE_STRING }, \
60  { "insight", NULL, KEYWORD_TYPE_STRING }, \
61  { "affected", NULL, KEYWORD_TYPE_STRING }, \
62  { "impact", NULL, KEYWORD_TYPE_STRING }, \
63  { "detection", NULL, KEYWORD_TYPE_STRING }, \
64  { NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
65  }
66 
70 #define NVT_ITERATOR_COLUMNS_NVTS \
71  { \
72  GET_ITERATOR_COLUMNS_PREFIX ("nvts."), \
73  { "''", "_owner", KEYWORD_TYPE_STRING }, \
74  { "0", NULL, KEYWORD_TYPE_STRING }, \
75  { "oid", NULL, KEYWORD_TYPE_STRING }, \
76  { "modification_time", "version", KEYWORD_TYPE_INTEGER }, \
77  { "nvts.name", NULL, KEYWORD_TYPE_STRING }, \
78  { "cve", NULL, KEYWORD_TYPE_STRING }, \
79  { "tag", NULL, KEYWORD_TYPE_STRING }, \
80  { "category", NULL, KEYWORD_TYPE_STRING }, \
81  { "nvts.family", NULL, KEYWORD_TYPE_STRING }, \
82  { "cvss_base", NULL, KEYWORD_TYPE_DOUBLE }, \
83  { "cvss_base", "severity", KEYWORD_TYPE_DOUBLE }, \
84  { "cvss_base", "cvss", KEYWORD_TYPE_DOUBLE }, \
85  { "qod", NULL, KEYWORD_TYPE_INTEGER }, \
86  { "qod_type", NULL, KEYWORD_TYPE_STRING }, \
87  { "solution_type", NULL, KEYWORD_TYPE_STRING }, \
88  { "tag", "script_tags", KEYWORD_TYPE_STRING }, \
89  { "solution", NULL, KEYWORD_TYPE_STRING }, \
90  { "summary", NULL, KEYWORD_TYPE_STRING }, \
91  { "insight", NULL, KEYWORD_TYPE_STRING }, \
92  { "affected", NULL, KEYWORD_TYPE_STRING }, \
93  { "impact", NULL, KEYWORD_TYPE_STRING }, \
94  { "detection", NULL, KEYWORD_TYPE_STRING }, \
95  { NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
96  }
97 
98 const char *
100 
101 void
102 set_osp_vt_update_socket (const char *new_socket);
103 
104 int
106 
107 void
108 check_db_nvts ();
109 
110 int
112 
113 void
114 manage_sync_nvts (int (*) ());
115 
116 int
117 manage_update_nvt_cache_osp (const gchar *);
118 
119 int
120 family_count ();
121 
122 #endif /* not _GVMD_MANAGE_SQL_NVTS_H */
int check_config_families()
Ensure that all configs refer to the right NVT families.
Definition: manage_sql_configs.c:1555
void set_osp_vt_update_socket(const char *new_socket)
Set the file socket for OSP NVT update.
Definition: manage_sql_nvts.c:76
int check_osp_vt_update_socket()
Check the files socket used for OSP NVT update.
Definition: manage_sql_nvts.c:91
int family_count()
Get the number of families.
Definition: manage_sql_nvts.c:975
const char * get_osp_vt_update_socket()
Get the current file socket for OSP NVT update.
Definition: manage_sql_nvts.c:65
void manage_sync_nvts(int(*)())
Sync NVTs if newer NVTs are available.
Definition: manage_sql_nvts.c:1712
int manage_update_nvt_cache_osp(const gchar *)
Update VTs via OSP.
Definition: manage_sql_nvts.c:1650
void check_db_nvts()
Ensures the sanity of nvts cache in DB.
Definition: manage_sql_nvts.c:121