Greenbone Vulnerability Management Libraries  22.8.0
nvticache.h
Go to the documentation of this file.
1 /* SPDX-FileCopyrightText: 2009-2023 Greenbone AG
2  *
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  */
5 
13 #ifndef _GVM_NVTICACHE_H
14 #define _GVM_NVTICACHE_H
15 
16 #include "../base/nvti.h" /* for nvti_t */
17 #include "kb.h" /* for kb_t */
18 
19 #include <glib.h> /* for gchar */
20 
21 #ifndef NVTICACHE_STR
22 #define NVTICACHE_STR "nvticache"
23 #endif
24 
25 int
26 nvticache_init (const char *, const char *);
27 
28 void
29 nvticache_reset (void);
30 
31 kb_t
32 nvticache_get_kb (void);
33 
34 void
35 nvticache_save (void);
36 
37 int
39 
40 int
41 nvticache_check (const gchar *);
42 
43 int
44 nvticache_add (const nvti_t *, const char *);
45 
46 char *
47 nvticache_get_src (const char *);
48 
49 char *
50 nvticache_get_oid (const char *);
51 
52 char *
53 nvticache_get_name (const char *);
54 
55 char *
56 nvticache_get_tags (const char *);
57 
58 GSList *
59 nvticache_get_prefs (const char *);
60 
61 char *
62 nvticache_get_cves (const char *);
63 
64 char *
65 nvticache_get_bids (const char *);
66 
67 char *
68 nvticache_get_xrefs (const char *);
69 
70 char *
71 nvticache_get_family (const char *);
72 
73 char *
74 nvticache_get_filename (const char *);
75 
76 char *
77 nvticache_get_required_keys (const char *);
78 
79 char *
80 nvticache_get_mandatory_keys (const char *);
81 
82 char *
83 nvticache_get_excluded_keys (const char *);
84 
85 char *
86 nvticache_get_required_ports (const char *);
87 
88 char *
90 
91 int
92 nvticache_get_category (const char *);
93 
94 char *
95 nvticache_get_dependencies (const char *);
96 
97 nvti_t *
98 nvticache_get_nvt (const char *);
99 
100 GSList *
101 nvticache_get_oids (void);
102 
103 size_t
104 nvticache_count (void);
105 
106 void
107 nvticache_delete (const char *);
108 
109 char *
111 
112 int
113 nvticache_check_feed (void);
114 
115 #endif /* not _GVM_NVTICACHE_H */
kb.h
Knowledge base management API - Redis backend.
nvticache_save
void nvticache_save(void)
Save the nvticache to disk.
Definition: nvticache.c:178
nvticache_get_tags
char * nvticache_get_tags(const char *)
Get the tags from a plugin OID.
Definition: nvticache.c:473
nvticache_get_category
int nvticache_get_category(const char *)
Get the Category from a plugin OID.
Definition: nvticache.c:383
nvticache_get_prefs
GSList * nvticache_get_prefs(const char *)
Get the prefs from a plugin OID.
Definition: nvticache.c:501
nvticache_get_required_ports
char * nvticache_get_required_ports(const char *)
Get the Required ports from a plugin OID.
Definition: nvticache.c:355
nvticache_get_bids
char * nvticache_get_bids(const char *)
Get the bids from a plugin OID.
Definition: nvticache.c:431
nvticache_get_kb
kb_t nvticache_get_kb(void)
Return the nvticache kb.
Definition: nvticache.c:84
nvticache_get_filename
char * nvticache_get_filename(const char *)
Get the filename from a plugin OID.
Definition: nvticache.c:285
nvticache_get_cves
char * nvticache_get_cves(const char *)
Get the cves from a plugin OID.
Definition: nvticache.c:417
nvticache_delete
void nvticache_delete(const char *)
Delete NVT from the cache.
Definition: nvticache.c:560
nvti
The structure of a information record that corresponds to a NVT.
Definition: nvti.c:394
nvticache_get_oids
GSList * nvticache_get_oids(void)
Get the list of nvti OIDs.
Definition: nvticache.c:534
nvticache_get_excluded_keys
char * nvticache_get_excluded_keys(const char *)
Get the Excluded Keys from a plugin OID.
Definition: nvticache.c:327
nvticache_get_xrefs
char * nvticache_get_xrefs(const char *)
Get the xrefs from a plugin OID.
Definition: nvticache.c:445
nvticache_get_mandatory_keys
char * nvticache_get_mandatory_keys(const char *)
Get the Mandatory Keys from a plugin OID.
Definition: nvticache.c:313
nvticache_feed_version
char * nvticache_feed_version(void)
Get the NVT feed version.
Definition: nvticache.c:588
nvticache_get_oid
char * nvticache_get_oid(const char *)
Get the OID from a plugin filename.
Definition: nvticache.c:270
nvticache_get_family
char * nvticache_get_family(const char *)
Get the family from a plugin OID.
Definition: nvticache.c:459
nvticache_get_nvt
nvti_t * nvticache_get_nvt(const char *)
Get the nvti from a plugin OID.
Definition: nvticache.c:487
kb
Top-level KB. This is to be inherited by KB implementations.
Definition: kb.h:91
nvticache_reset
void nvticache_reset(void)
Reset connection to KB. To be called after a fork().
Definition: nvticache.c:122
nvticache_get_name
char * nvticache_get_name(const char *)
Get the name from a plugin OID.
Definition: nvticache.c:403
nvticache_add
int nvticache_add(const nvti_t *, const char *)
Add a NVT Information to the cache.
Definition: nvticache.c:207
nvticache_get_required_udp_ports
char * nvticache_get_required_udp_ports(const char *)
Get the Required udp ports from a plugin OID.
Definition: nvticache.c:341
nvticache_count
size_t nvticache_count(void)
Get the number of nvt's in the cache.
Definition: nvticache.c:547
nvticache_check
int nvticache_check(const gchar *)
Check if the nvt for the given filename exists in cache.
Definition: nvticache.c:101
nvticache_initialized
int nvticache_initialized(void)
Return whether the nvt cache is initialized.
Definition: nvticache.c:45
nvticache_check_feed
int nvticache_check_feed(void)
Check if the plugins feed was newer than cached feed.
Definition: nvticache.c:599
nvticache_get_dependencies
char * nvticache_get_dependencies(const char *)
Get the Dependencies from a plugin OID.
Definition: nvticache.c:369
nvticache_get_src
char * nvticache_get_src(const char *)
Get the full source filename of an OID.
Definition: nvticache.c:248
nvticache_get_required_keys
char * nvticache_get_required_keys(const char *)
Get the Required Keys from a plugin OID.
Definition: nvticache.c:299
nvticache_init
int nvticache_init(const char *, const char *)
Initializes the nvti cache.
Definition: nvticache.c:59