Greenbone Vulnerability Management Libraries 22.4.0
nvticache.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2022 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
27#ifndef _GVM_NVTICACHE_H
28#define _GVM_NVTICACHE_H
29
30#include "../base/nvti.h" /* for nvti_t */
31#include "kb.h" /* for kb_t */
32
33#include <glib.h> /* for gchar */
34
35#ifndef NVTICACHE_STR
36#define NVTICACHE_STR "nvticache"
37#endif
38
39int
40nvticache_init (const char *, const char *);
41
42void
43nvticache_reset (void);
44
45kb_t
46nvticache_get_kb (void);
47
48void
49nvticache_save (void);
50
51int
53
54int
55nvticache_check (const gchar *);
56
57int
58nvticache_add (const nvti_t *, const char *);
59
60char *
61nvticache_get_src (const char *);
62
63char *
64nvticache_get_oid (const char *);
65
66char *
67nvticache_get_name (const char *);
68
69char *
70nvticache_get_tags (const char *);
71
72GSList *
73nvticache_get_prefs (const char *);
74
75char *
76nvticache_get_cves (const char *);
77
78char *
79nvticache_get_bids (const char *);
80
81char *
82nvticache_get_xrefs (const char *);
83
84char *
85nvticache_get_family (const char *);
86
87char *
88nvticache_get_filename (const char *);
89
90char *
91nvticache_get_required_keys (const char *);
92
93char *
94nvticache_get_mandatory_keys (const char *);
95
96char *
97nvticache_get_excluded_keys (const char *);
98
99char *
100nvticache_get_required_ports (const char *);
101
102char *
104
105int
106nvticache_get_category (const char *);
107
108char *
109nvticache_get_dependencies (const char *);
110
111nvti_t *
112nvticache_get_nvt (const char *);
113
114GSList *
115nvticache_get_oids (void);
116
117size_t
118nvticache_count (void);
119
120void
121nvticache_delete (const char *);
122
123char *
125
126int
128
129#endif /* not _GVM_NVTICACHE_H */
Knowledge base management API - Redis backend.
int nvticache_check(const gchar *)
Check if the nvt for the given filename exists in cache.
Definition: nvticache.c:115
int nvticache_get_category(const char *)
Get the Category from a plugin OID.
Definition: nvticache.c:401
char * nvticache_get_oid(const char *)
Get the OID from a plugin filename.
Definition: nvticache.c:288
nvti_t * nvticache_get_nvt(const char *)
Get the nvti from a plugin OID.
Definition: nvticache.c:505
char * nvticache_get_required_keys(const char *)
Get the Required Keys from a plugin OID.
Definition: nvticache.c:317
char * nvticache_get_excluded_keys(const char *)
Get the Excluded Keys from a plugin OID.
Definition: nvticache.c:345
char * nvticache_get_src(const char *)
Get the full source filename of an OID.
Definition: nvticache.c:266
char * nvticache_get_required_udp_ports(const char *)
Get the Required udp ports from a plugin OID.
Definition: nvticache.c:359
void nvticache_delete(const char *)
Delete NVT from the cache.
Definition: nvticache.c:578
char * nvticache_get_bids(const char *)
Get the bids from a plugin OID.
Definition: nvticache.c:449
char * nvticache_get_filename(const char *)
Get the filename from a plugin OID.
Definition: nvticache.c:303
char * nvticache_get_cves(const char *)
Get the cves from a plugin OID.
Definition: nvticache.c:435
int nvticache_init(const char *, const char *)
Initializes the nvti cache.
Definition: nvticache.c:73
GSList * nvticache_get_oids(void)
Get the list of nvti OIDs.
Definition: nvticache.c:552
int nvticache_add(const nvti_t *, const char *)
Add a NVT Information to the cache.
Definition: nvticache.c:225
char * nvticache_get_required_ports(const char *)
Get the Required ports from a plugin OID.
Definition: nvticache.c:373
char * nvticache_get_tags(const char *)
Get the tags from a plugin OID.
Definition: nvticache.c:491
char * nvticache_get_mandatory_keys(const char *)
Get the Mandatory Keys from a plugin OID.
Definition: nvticache.c:331
kb_t nvticache_get_kb(void)
Return the nvticache kb.
Definition: nvticache.c:98
void nvticache_save(void)
Save the nvticache to disk.
Definition: nvticache.c:192
void nvticache_reset(void)
Reset connection to KB. To be called after a fork().
Definition: nvticache.c:136
GSList * nvticache_get_prefs(const char *)
Get the prefs from a plugin OID.
Definition: nvticache.c:519
char * nvticache_get_dependencies(const char *)
Get the Dependencies from a plugin OID.
Definition: nvticache.c:387
size_t nvticache_count(void)
Get the number of nvt's in the cache.
Definition: nvticache.c:565
char * nvticache_get_family(const char *)
Get the family from a plugin OID.
Definition: nvticache.c:477
char * nvticache_feed_version(void)
Get the NVT feed version.
Definition: nvticache.c:606
char * nvticache_get_xrefs(const char *)
Get the xrefs from a plugin OID.
Definition: nvticache.c:463
int nvticache_check_feed(void)
Check if the plugins feed was newer than cached feed.
Definition: nvticache.c:617
char * nvticache_get_name(const char *)
Get the name from a plugin OID.
Definition: nvticache.c:421
int nvticache_initialized(void)
Return whether the nvt cache is initialized.
Definition: nvticache.c:59
Top-level KB. This is to be inherited by KB implementations.
Definition: kb.h:105
The structure of a information record that corresponds to a NVT.
Definition: nvti.c:408