OpenVAS Libraries
8.0.3
|
Implementation of API to handle NVT Info Cache. More...
#include <sys/stat.h>
#include "nvticache.h"
#include "../misc/openvas_logging.h"
#include <string.h>
#include <assert.h>
Functions | |
int | nvticache_initialized (void) |
Return whether the nvt cache is initialized. More... | |
void | nvticache_init (const gchar *cache_path, const gchar *src_path) |
Initializes the nvti cache. More... | |
void | nvticache_free (void) |
Free the nvti cache. More... | |
nvti_t * | nvticache_get (const gchar *filename) |
Retrieve NVT Information from the nvt cache for the given filename. More... | |
int | nvticache_add (const nvti_t *nvti, const char *filename) |
Add a NVT Information to the cache. More... | |
nvti_t * | nvticache_get_by_oid_full (const char *oid) |
Get a full NVTI from the cache by OID. More... | |
char * | nvticache_get_src (const char *oid) |
Get the full source filename of an OID. More... | |
const char * | nvticache_get_filename (const char *oid) |
Get the source filename of an OID without the NVT main directory path. More... | |
Variables | |
nvticache_t * | nvticache = NULL |
nvti cache variable. More... | |
Implementation of API to handle NVT Info Cache.
This file contains all methods to handle NVT Information Cache (nvticache_t).
The module consequently uses glib datatypes and api for memory management etc.
int nvticache_add | ( | const nvti_t * | nvti, |
const char * | filename | ||
) |
Add a NVT Information to the cache.
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" ) |
void nvticache_free | ( | void | ) |
Free the nvti cache.
nvti_t* nvticache_get | ( | const gchar * | filename | ) |
Retrieve NVT Information from the nvt cache for the given filename.
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" ) |
nvti_t* nvticache_get_by_oid_full | ( | const char * | oid | ) |
Get a full NVTI from the cache by OID.
oid | The OID to look up |
const char* nvticache_get_filename | ( | const char * | oid | ) |
Get the source filename of an OID without the NVT main directory path.
oid | The OID to look up. |
char* nvticache_get_src | ( | const char * | oid | ) |
Get the full source filename of an OID.
oid | The OID to look up. |
void nvticache_init | ( | const gchar * | cache_path, |
const gchar * | src_path | ||
) |
Initializes the nvti cache.
cache_path | The directory where the cache is to be stored. |
src_path | The directory that contains the nvt files. |
int nvticache_initialized | ( | void | ) |
Return whether the nvt cache is initialized.
nvticache_t* nvticache = NULL |
nvti cache variable.