OpenVAS Libraries  9.0.3
nvticache.h
Go to the documentation of this file.
1 /* openvas-libraries/base
2  * $Id$
3  * Description: API (structs and protos) for NVT Info Cache
4  *
5  * Authors:
6  * Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
7  *
8  * Copyright:
9  * Copyright (C) 2009 Greenbone Networks GmbH
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
33 #ifndef _NVTICACHE_H
34 #define _NVTICACHE_H
35 
36 /* for gchar */
37 #include <glib.h>
38 
39 /* for nvtis_t */
40 #include "nvti.h"
41 #include "kb.h"
42 
43 int
44 nvticache_init (const char *, const char *);
45 
46 kb_t
48 
49 void
51 
52 int
54 
55 int
56 nvticache_check (const gchar *);
57 
58 int
59 nvticache_add (const nvti_t *, const char *);
60 
61 nvti_t *
62 nvticache_get_by_oid_full (const char *);
63 
64 nvti_t *
65 nvticache_get_by_name_full (const char *);
66 
67 char *
68 nvticache_get_src (const char *);
69 
70 char *
71 nvticache_get_oid (const char *);
72 
73 char *
74 nvticache_get_name (const char *);
75 
76 char *
77 nvticache_get_tags (const char *);
78 
79 GSList *
80 nvticache_get_prefs (const char *);
81 
82 char *
83 nvticache_get_version (const char *);
84 
85 char *
86 nvticache_get_copyright (const char *);
87 
88 char *
89 nvticache_get_cves (const char *);
90 
91 char *
92 nvticache_get_bids (const char *);
93 
94 char *
95 nvticache_get_xrefs (const char *);
96 
97 char *
98 nvticache_get_family (const char *);
99 
100 char *
101 nvticache_get_filename (const char *);
102 
103 char *
104 nvticache_get_required_keys (const char *);
105 
106 char *
107 nvticache_get_mandatory_keys (const char *);
108 
109 char *
110 nvticache_get_excluded_keys (const char *);
111 
112 char *
113 nvticache_get_required_ports (const char *);
114 
115 char *
116 nvticache_get_required_udp_ports (const char *);
117 
118 int
119 nvticache_get_category (const char *);
120 
121 int
122 nvticache_get_timeout (const char *);
123 
124 char *
125 nvticache_get_dependencies (const char *);
126 
127 void
128 nvticache_free (void);
129 
130 GSList *
131 nvticache_get_names (void);
132 
133 GSList *
134 nvticache_get_oids (void);
135 
136 size_t
137 nvticache_count (void);
138 
139 void
140 nvticache_delete (const char *);
141 
142 #endif /* not _NVTICACHE_H */
kb.h
nvticache_free
void nvticache_free(void)
nvticache_get_tags
char * nvticache_get_tags(const char *)
Get the tags from a plugin OID.
Definition: nvticache.c:504
nvticache_get_category
int nvticache_get_category(const char *)
Get the Category from a plugin OID.
Definition: nvticache.c:366
nvticache_get_prefs
GSList * nvticache_get_prefs(const char *)
Get the prefs from a plugin OID.
Definition: nvticache.c:518
nvticache_get_by_oid_full
nvti_t * nvticache_get_by_oid_full(const char *)
nvticache_get_required_ports
char * nvticache_get_required_ports(const char *)
Get the Required ports from a plugin OID.
Definition: nvticache.c:338
nvticache_get_bids
char * nvticache_get_bids(const char *)
Get the bids from a plugin OID.
Definition: nvticache.c:462
nvticache_get_filename
char * nvticache_get_filename(const char *)
Get the filename from a plugin OID.
Definition: nvticache.c:268
nvticache_get_cves
char * nvticache_get_cves(const char *)
Get the cves from a plugin OID.
Definition: nvticache.c:448
nvticache_delete
void nvticache_delete(const char *)
Definition: nvticache.c:587
nvti
The structure of a information record that corresponds to a NVT.
Definition: nvti.h:64
nvticache_get_oids
GSList * nvticache_get_oids(void)
Get the list of nvti OIDs.
Definition: nvticache.c:553
nvticache_get_excluded_keys
char * nvticache_get_excluded_keys(const char *)
Get the Excluded Keys from a plugin OID.
Definition: nvticache.c:310
nvticache_get_xrefs
char * nvticache_get_xrefs(const char *)
Get the xrefs from a plugin OID.
Definition: nvticache.c:476
nvticache_get_mandatory_keys
char * nvticache_get_mandatory_keys(const char *)
Get the Mandatory Keys from a plugin OID.
Definition: nvticache.c:296
nvticache_get_oid
char * nvticache_get_oid(const char *)
Get the OID from a plugin filename.
Definition: nvticache.c:237
nvticache_get_family
char * nvticache_get_family(const char *)
Get the family from a plugin OID.
Definition: nvticache.c:490
kb
Top-level KB. This is to be inherited by KB implementations.
Definition: kb.h:102
nvticache_get_timeout
int nvticache_get_timeout(const char *)
Get the Timeout from a plugin OID.
Definition: nvticache.c:386
nvticache_get_name
char * nvticache_get_name(const char *)
Get the name from a plugin OID.
Definition: nvticache.c:406
nvticache_add
int nvticache_add(const nvti_t *, const char *)
Add a NVT Information to the cache.
Definition: nvticache.c:157
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:324
nvticache_count
size_t nvticache_count(void)
Get the number of nvt's in the cache.
Definition: nvticache.c:579
nvticache_check
int nvticache_check(const gchar *)
Check if the nvt for the given filename exists in cache.
Definition: nvticache.c:114
nvticache_initialized
int nvticache_initialized(void)
Return whether the nvt cache is initialized.
Definition: nvticache.c:60
nvticache_get_copyright
char * nvticache_get_copyright(const char *)
Get the copyright from a plugin OID.
Definition: nvticache.c:434
nvticache_get_dependencies
char * nvticache_get_dependencies(const char *)
Get the Dependencies from a plugin OID.
Definition: nvticache.c:352
nvticache_get_src
char * nvticache_get_src(const char *)
Get the full source filename of an OID.
Definition: nvticache.c:215
nvticache_reset
void nvticache_reset()
Reset connection to KB. To be called after a fork().
Definition: nvticache.c:138
nvticache_get_required_keys
char * nvticache_get_required_keys(const char *)
Get the Required Keys from a plugin OID.
Definition: nvticache.c:282
nvticache_get_names
GSList * nvticache_get_names(void)
nvti.h
Protos and data structures for NVT Information data sets.
nvticache_get_by_name_full
nvti_t * nvticache_get_by_name_full(const char *)
nvticache_get_kb
kb_t nvticache_get_kb()
Return the nvticache kb.
Definition: nvticache.c:97
nvticache_init
int nvticache_init(const char *, const char *)
Initializes the nvti cache.
Definition: nvticache.c:73
nvticache_get_version
char * nvticache_get_version(const char *)
Get the version from a plugin OID.
Definition: nvticache.c:420