|
struct kb_item ** | kb_new () |
| Allocates memory for an array of kb_items with max length of HASH_MAX. More...
|
|
struct kb_item * | kb_item_get_single (struct kb_item **kb, char *name, int type) |
| READ the knowledge base. More...
|
|
char * | kb_item_get_str (struct kb_item **kb, char *name) |
| Get the value of a kb_item with type KB_TYPE_STR and name name. More...
|
|
int | kb_item_get_int (struct kb_item **kb, char *name) |
| Get the value of a kb_item with type KB_TYPE_INT and name name. More...
|
|
struct kb_item * | kb_item_get_all (struct kb_item **kb, char *name) |
| Returns a list of copies of kb_items with name name in a knowledge base. More...
|
|
struct kb_item * | kb_item_get_pattern (struct kb_item **kb, char *expr) |
| Returns a list of copies of kb_items that match a pattern. More...
|
|
void | kb_item_get_all_free (struct kb_item *items) |
| Frees a list of kb_items. More...
|
|
int | kb_item_add_str (struct kb_item **kb, char *name, char *value) |
| Adds a string to the knowledge base. In contrast to kb_item_set_str the item will not be replaced (useful for list creation). More...
|
|
int | kb_item_set_str (struct kb_item **kb, char *name, char *value) |
|
int | kb_item_set_int (struct kb_item **kb, char *name, int value) |
|
int | kb_item_add_int (struct kb_item **kb, char *name, int value) |
|
void | kb_item_rm_all (struct kb_item **kb, char *name) |
|
Knowledge base management API.
Knowledge bases collect information and can be used to share information between NVTs.
A knowledge base is an array of knowledge base items (kb_item). An item is defined by its name and has a value (either int or char*), a type flag (indicating whether the value shall be interpreted as int or char*) and a pointer to the "next" item.
A knowledge base (kb_item**) stores single items at a position according to a hash of the items name (function mkkey). Because of that, a knowledge base has a fixed size of 65537 items and kb_items are implemented as lists.