OpenVAS Libraries  7.0.6
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 modify
12  * it under the terms of the GNU General Public License version 2,
13  * or, at your option, any later version as published by the Free
14  * Software Foundation
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;
53 } nvticache_t;
54 
55 nvticache_t *nvticache_new (const gchar *, const gchar *);
56 void nvticache_free (const nvticache_t *);
57 nvti_t *nvticache_get (const nvticache_t *, const gchar *);
58 int nvticache_add (const nvticache_t *, nvti_t *, gchar *);
59 nvti_t * nvticache_get_by_oid (const nvticache_t *, const gchar *);
60 gchar * nvticache_get_src_by_oid (const nvticache_t *, const gchar *);
61 void nvticache_free (const nvticache_t *);
62 
63 #endif /* not _NVTICACHE_H */
gchar * cache_path
The directory where the cache is located.
Definition: nvticache.h:50
nvticache_t * nvticache_new(const gchar *, const gchar *)
Create a new nvticache structure initialized with a path.
Definition: nvticache.c:55
void nvticache_free(const nvticache_t *)
Free memory of a nvticache structure.
Definition: nvticache.c:78
The structure of a information record that corresponds to a NVT.
Definition: nvti.h:64
struct nvticache nvticache_t
The structure for a NVTI Cache.
nvti_t * nvticache_get(const nvticache_t *, const gchar *)
Retrieve NVT Information from a cache for the given filename.
Definition: nvticache.c:103
nvtis_t * nvtis
Collection of NVT Information cached in memory.
Definition: nvticache.h:52
gchar * nvticache_get_src_by_oid(const nvticache_t *, const gchar *)
Get the src element of a NVT Information from the cache by OID.
Definition: nvticache.c:221
nvti_t * nvticache_get_by_oid(const nvticache_t *, const gchar *)
Get a NVT Information from the cache by OID.
Definition: nvticache.c:182
Protos and data structures for NVT Information data sets.
int nvticache_add(const nvticache_t *, nvti_t *, gchar *)
Add a NVT Information to the cache.
Definition: nvticache.c:160
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
GHashTable nvtis_t
A collection of information records corresponding to NVTs.
Definition: nvti.h:165