OpenVAS Libraries  9.0.1
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 
42 int
43 nvticache_init (const char *, const char *, const char *);
44 
45 void
47 
48 int
50 
51 void
52 nvticache_free (void);
53 
54 nvti_t *
55 nvticache_get (const gchar *);
56 
57 int
58 nvticache_add (const nvti_t *, const char *);
59 
60 nvti_t *
61 nvticache_get_by_oid_full (const char *);
62 
63 nvti_t *
64 nvticache_get_by_name_full (const char *);
65 
66 char *
67 nvticache_get_src (const char *);
68 
69 char *
70 nvticache_get_oid (const char *);
71 
72 char *
73 nvticache_get_name (const char *);
74 
75 char *
76 nvticache_get_required_keys (const char *);
77 
78 char *
79 nvticache_get_mandatory_keys (const char *);
80 
81 char *
82 nvticache_get_excluded_keys (const char *);
83 
84 char *
85 nvticache_get_required_ports (const char *);
86 
87 char *
89 
90 int
91 nvticache_get_category (const char *);
92 
93 int
94 nvticache_get_timeout (const char *);
95 
96 char *
97 nvticache_get_dependencies (const char *);
98 
99 void
100 nvticache_free (void);
101 
102 GSList *
103 nvticache_get_names (void);
104 
105 GSList *
106 nvticache_get_oids (void);
107 
108 #endif /* not _NVTICACHE_H */
int nvticache_get_category(const char *)
Get the Category from a plugin OID.
Definition: nvticache.c:488
int nvticache_init(const char *, const char *, const char *)
Initializes the nvti cache.
Definition: nvticache.c:73
char * nvticache_get_required_keys(const char *)
Get the Required Keys from a plugin OID.
Definition: nvticache.c:380
The structure of a information record that corresponds to a NVT.
Definition: nvti.h:64
int nvticache_get_timeout(const char *)
Get the Timeout from a plugin OID.
Definition: nvticache.c:506
char * nvticache_get_dependencies(const char *)
Get the Dependencies from a plugin OID.
Definition: nvticache.c:470
GSList * nvticache_get_oids(void)
Get the list of nvti OIDs.
Definition: nvticache.c:548
nvti_t * nvticache_get(const gchar *)
Retrieve NVT Information from the nvt cache for the given filename.
Definition: nvticache.c:111
char * nvticache_get_oid(const char *)
Get the OID from a plugin filename.
Definition: nvticache.c:331
int nvticache_add(const nvti_t *, const char *)
Add a NVT Information to the cache.
Definition: nvticache.c:232
char * nvticache_get_required_ports(const char *)
Get the Required ports from a plugin OID.
Definition: nvticache.c:452
char * nvticache_get_src(const char *)
Get the full source filename of an OID.
Definition: nvticache.c:308
Protos and data structures for NVT Information data sets.
nvti_t * nvticache_get_by_oid_full(const char *)
Get a full NVTI from the cache by OID.
Definition: nvticache.c:283
char * nvticache_get_excluded_keys(const char *)
Get the Excluded Keys from a plugin OID.
Definition: nvticache.c:416
char * nvticache_get_required_udp_ports(const char *)
Get the Required udp ports from a plugin OID.
Definition: nvticache.c:434
int nvticache_initialized(void)
Return whether the nvt cache is initialized.
Definition: nvticache.c:60
void nvticache_free(void)
Free the nvti cache.
Definition: nvticache.c:91
char * nvticache_get_name(const char *)
Get the name from a plugin OID.
Definition: nvticache.c:362
GSList * nvticache_get_names(void)
Get the list of nvti filenames.
Definition: nvticache.c:522
nvti_t * nvticache_get_by_name_full(const char *)
Get a full NVTI from the cache file by filename.
Definition: nvticache.c:258
char * nvticache_get_mandatory_keys(const char *)
Get the Mandatory Keys from a plugin OID.
Definition: nvticache.c:398
void nvticache_reset()
Reset connection to KB. To be called after a fork().
Definition: nvticache.c:213