OpenVAS Libraries  9.0.1
Data Structures | Macros | Functions | Variables
kb_redis.c File Reference

Contains specialized structures and functions to use redis as a KB server. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <hiredis/hiredis.h>
#include <glib.h>
#include "kb.h"

Data Structures

struct  kb_redis
 Subclass of struct kb, it contains the redis-specific fields, such as the redis context, current DB (namespace) id and the server socket path. More...
 
struct  redis_tx
 Redis transaction handle. More...
 

Macros

#define _GNU_SOURCE
 
#define G_LOG_DOMAIN   "lib kb_redis"
 
#define GLOBAL_DBINDEX_NAME   "OpenVAS.__GlobalDBIndex"
 Name of the namespace usage bitmap in redis. More...
 
#define KB_RETRY_DELAY   60
 Number of seconds to wait for between two attempts to acquire a KB namespace. More...
 
#define redis_kb(__kb)   ((struct kb_redis *)(__kb))
 
#define MAX_DB_INDEX__24   1000
 

Functions

void kb_item_free (struct kb_item *item)
 Release a KB item (or a list). More...
 

Variables

const struct kb_operationsKBDefaultOperations = &KBRedisOperations
 Default KB operations. No selection mechanism is provided yet since there's only one implementation (redis-based). More...
 

Detailed Description

Contains specialized structures and functions to use redis as a KB server.

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib kb_redis"

◆ GLOBAL_DBINDEX_NAME

#define GLOBAL_DBINDEX_NAME   "OpenVAS.__GlobalDBIndex"

Name of the namespace usage bitmap in redis.

◆ KB_RETRY_DELAY

#define KB_RETRY_DELAY   60

Number of seconds to wait for between two attempts to acquire a KB namespace.

◆ MAX_DB_INDEX__24

#define MAX_DB_INDEX__24   1000

◆ redis_kb

#define redis_kb (   __kb)    ((struct kb_redis *)(__kb))

Function Documentation

◆ kb_item_free()

void kb_item_free ( struct kb_item item)

Release a KB item (or a list).

Variable Documentation

◆ KBDefaultOperations

const struct kb_operations* KBDefaultOperations = &KBRedisOperations

Default KB operations. No selection mechanism is provided yet since there's only one implementation (redis-based).