32 #include "../base/nvti.h" 40 #define KB_PATH_DEFAULT "/tmp/redis.sock" 127 char *(*kb_get_str) (
kb_t,
const char *);
163 static inline int kb_new (
kb_t *
kb,
const char *kb_path)
180 static inline kb_t kb_find (
const char *kb_path,
const char *key)
196 kb_nvt_add (
kb_t kb,
const nvti_t *nvt,
const char *filename)
313 kb_item_get_pattern (
kb_t kb,
const char *pattern)
331 kb_item_count (
kb_t kb,
const char *pattern)
348 kb_item_add_str (
kb_t kb,
const char *
name,
const char *str)
365 kb_item_set_str (
kb_t kb,
const char *
name,
const char *str)
430 static inline int kb_lnk_reset (
kb_t kb)
449 static inline int kb_flush (
kb_t kb,
const char *except)
kb_nvt_pos
Possible positions of nvt values in cache list.
const struct kb_operations * KBDefaultOperations
Default KB operations. No selection mechanism is provided yet since there's only one implementation (...
struct kb_item *(* kb_get_all)(kb_t, const char *)
void kb_item_free(struct kb_item *)
Release a KB item (or a list).
The structure of a information record that corresponds to a NVT.
Knowledge base item (defined by name, type (int/char*) and value). Implemented as a singly linked lis...
KB interface. Functions provided by an implementation. All functions have to be provided, there is no default/fallback. These functions should be called via the corresponding static inline wrappers below. See the wrappers for the documentation.
struct kb_item *(* kb_get_single)(kb_t, const char *, enum kb_item_type)
int(* kb_get_int)(kb_t, const char *)
int(* kb_set_str)(kb_t, const char *, const char *)
int(* kb_lnk_reset)(kb_t)
int(* kb_del_items)(kb_t, const char *)
int(* kb_flush)(kb_t, const char *)
Top-level KB. This is to be inherited by KB implementations.
const struct kb_operations * kb_ops
struct kb_item *(* kb_get_pattern)(kb_t, const char *)
int(* kb_add_int)(kb_t, const char *, int)
char *(* kb_get_nvt)(kb_t, const char *, enum kb_nvt_pos)
kb_item_type
Possible type of a kb_item.
int(* kb_add_nvt)(kb_t, const nvti_t *, const char *)
int(* kb_set_int)(kb_t, const char *, int)
kb_t(* kb_find)(const char *, const char *)
struct kb * kb_t
type abstraction to hide KB internals.
char *(* kb_get_str)(kb_t, const char *)
int(* kb_add_str)(kb_t, const char *, const char *)
size_t(* kb_count)(kb_t, const char *)
int(* kb_new)(kb_t *, const char *)