OpenVAS Libraries  8.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 
48 typedef struct nvticache
49 {
50  gchar *cache_path;
51  gchar *src_path;
52  GHashTable *nvtis;
53 } nvticache_t;
54 
55 void
56 nvticache_init (const gchar *, const gchar *);
57 
58 int
60 
61 void
62 nvticache_free (void);
63 
64 nvti_t *
65 nvticache_get (const gchar *);
66 
67 int
68 nvticache_add (const nvti_t *, const char *);
69 
70 nvti_t *
71 nvticache_get_by_oid_full (const char *);
72 
73 char *
74 nvticache_get_src (const char *);
75 
76 const char * nvticache_get_filename (const char *);
77 
78 void
79 nvticache_free (void);
80 
81 #endif /* not _NVTICACHE_H */
gchar * cache_path
The directory where the cache is located.
Definition: nvticache.h:50
The structure of a information record that corresponds to a NVT.
Definition: nvti.h:64
void nvticache_init(const gchar *, const gchar *)
Initializes the nvti cache.
Definition: nvticache.c:70
struct nvticache nvticache_t
The structure for a NVTI Cache.
nvti_t * nvticache_get(const gchar *)
Retrieve NVT Information from the nvt cache for the given filename.
Definition: nvticache.c:112
int nvticache_add(const nvti_t *, const char *)
Add a NVT Information to the cache.
Definition: nvticache.c:162
char * nvticache_get_src(const char *)
Get the full source filename of an OID.
Definition: nvticache.c:218
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:188
GHashTable * nvtis
Collection of NVT Information cached in memory.
Definition: nvticache.h:52
int nvticache_initialized(void)
Return whether the nvt cache is initialized.
Definition: nvticache.c:58
const char * nvticache_get_filename(const char *)
Get the source filename of an OID without the NVT main directory path.
Definition: nvticache.c:238
void nvticache_free(void)
Free the nvti cache.
Definition: nvticache.c:88
The structure for a NVTI Cache.
Definition: nvticache.h:48
gchar * src_path
The directory where the primary source is located.
Definition: nvticache.h:51