Protos and data structures for NVT Information Cache.
More...
#include <glib.h>
#include "nvti.h"
Go to the source code of this file.
Protos and data structures for NVT Information Cache.
This file contains the protos for nvticache.c
The structure for a NVTI Cache.
The elements of this structure should never be accessed directly. Only the functions corresponding to this module should be used.
Add a NVT Information to the cache.
- Parameters
-
cache | The NVTI Cache to use |
nvti | The NVT Information to add |
filename | The name of the original NVT without the path to the base location of NVTs (e.g. "scriptname1.nasl" or even "subdir1/subdir2/scriptname2.nasl" ) |
- Returns
- 0 in case of success, anything else indicates an error.
Free memory of a nvticache structure.
- Parameters
-
cache | The structure to be freed. |
Retrieve NVT Information from a cache for the given filename.
- Parameters
-
cache | The NVTI Cache to use |
filename | The name of the original NVT without the path to the base location of NVTs (e.g. "scriptname1.nasl" or even "subdir1/subdir2/scriptname2.nasl" ) |
- Returns
- NULL in case the data could not be delivered. Else a nvti structure which needs to be released using nvti_free .
Get a NVT Information from the cache by OID.
- Parameters
-
cache | The NVTI Cache to use |
oid | The OID to look up |
- Returns
- A copy of the NVTI object or NULL if not found.
gchar* nvticache_get_src_by_oid |
( |
const nvticache_t * |
cache, |
|
|
const gchar * |
oid |
|
) |
| |
Get the src element of a NVT Information from the cache by OID.
- Parameters
-
cache | The NVTI Cache to use |
oid | The OID to look up |
- Returns
- A copy of the src or NULL if not found. This needs to to be free'd.
nvticache_t* nvticache_new |
( |
const gchar * |
cache_path, |
|
|
const gchar * |
src_path |
|
) |
| |
Create a new nvticache structure initialized with a path.
- Parameters
-
path | The directory where the cache is to be stored. |
- Returns
- NULL in case the memory could not be allocated. Else a nvticache structure which needs to be released using nvticache_free .