OpenVAS Scanner 23.23.1
ipc_openvas.h File Reference
#include "ipc.h"
#include <glib.h>

Go to the source code of this file.

Typedefs

typedef struct ipc_data ipc_data_t

Enumerations

enum  ipc_data_type {
  IPC_DT_ERROR = -1 , IPC_DT_NO_DATA = 0 , IPC_DT_HOSTNAME = 1 , IPC_DT_USER_AGENT = 2 ,
  IPC_DT_LSC = 4
}

Functions

enum ipc_data_type ipc_get_data_type_from_data (ipc_data_t *data)
 Get the data type in data.
gchar * ipc_get_hostname_from_data (ipc_data_t *data)
 Get the hostname from IPC data.
gchar * ipc_get_hostname_source_from_data (ipc_data_t *data)
 Get the vhost hostname source from IPC data.
gchar * ipc_get_user_agent_from_data (ipc_data_t *data)
 Get the User-Agent from IPC data.
gboolean ipc_get_lsc_data_ready_flag (ipc_data_t *data)
 Get the package list from LSC IPC data.
gchar * ipc_get_lsc_os_release_from_data (ipc_data_t *data)
ipc_data_tipc_data_type_from_hostname (const char *source, size_t source_len, const char *hostname, size_t hostname_len)
 initializes ipc_data for a hostname data.
ipc_data_tipc_data_type_from_user_agent (const char *user_agent, size_t user_agent_len)
 initializes ipc_data for the User-Agent.
ipc_data_tipc_data_type_from_lsc (gboolean data_ready)
 initializes ipc_data for the table driven LSC.
void ipc_data_destroy (ipc_data_t **data)
 destroys ipc_data.
const char * ipc_data_to_json (ipc_data_t *data)
 transforms ipc_data to a json string
ipc_data_tipc_data_from_json (const char *json, size_t len)
 transforms json string to a ipc_data struct

Typedef Documentation

◆ ipc_data_t

typedef struct ipc_data ipc_data_t

Enumeration Type Documentation

◆ ipc_data_type

Enumerator
IPC_DT_ERROR 
IPC_DT_NO_DATA 
IPC_DT_HOSTNAME 
IPC_DT_USER_AGENT 
IPC_DT_LSC 

Function Documentation

◆ ipc_data_destroy()

void ipc_data_destroy ( ipc_data_t ** data)

destroys ipc_data.

Parameters
datathe ipc_data to be destroyed.

◆ ipc_data_from_json()

ipc_data_t * ipc_data_from_json ( const char * json,
size_t len )

transforms json string to a ipc_data struct

Parameters
jsonthe json representation to be transformed.
lenthe length of the json representation
Returns
a heap allocated ipc_data or NULL on failure.

◆ ipc_data_to_json()

const char * ipc_data_to_json ( ipc_data_t * data)

transforms ipc_data to a json string

Parameters
datathe ipc_data to be transformed.
Returns
a heap allocated achar array containing the json or NULL on failure.

◆ ipc_data_type_from_hostname()

ipc_data_t * ipc_data_type_from_hostname ( const char * source,
size_t source_len,
const char * hostname,
size_t hostname_len )

initializes ipc_data for a hostname data.

Parameters
sourcethe source of the hostname
hostnamethe name of the host
Returns
a heap initialized ipc_data or NULL on failure.

◆ ipc_data_type_from_lsc()

ipc_data_t * ipc_data_type_from_lsc ( gboolean data_ready)

initializes ipc_data for the table driven LSC.

Parameters
os_releaseThe OS release
Returns
a heap initialized ipc_data or NULL on failure.

◆ ipc_data_type_from_user_agent()

ipc_data_t * ipc_data_type_from_user_agent ( const char * user_agent,
size_t user_agent_len )

initializes ipc_data for the User-Agent.

Parameters
user_agentThe User-Agent
user_agent_lenLength of the user agent string.
Returns
a heap initialized ipc_data or NULL on failure.

◆ ipc_get_data_type_from_data()

enum ipc_data_type ipc_get_data_type_from_data ( ipc_data_t * data)

Get the data type in data.

Parameters
dataStructure containing the data and data type

@Return The corresponding ipc_data_type, IPC_DT_ERROR on error.

◆ ipc_get_hostname_from_data()

gchar * ipc_get_hostname_from_data ( ipc_data_t * data)

Get the hostname from IPC data.

Parameters
dataData structure of IPC_DT_HOSNAME type.

@Return a string containing the hostname, NULL on error.

◆ ipc_get_hostname_source_from_data()

gchar * ipc_get_hostname_source_from_data ( ipc_data_t * data)

Get the vhost hostname source from IPC data.

Parameters
dataData structure of IPC_DT_HOSNAME type.

@Return a string containing the vhost hostname source, NULL on error.

◆ ipc_get_lsc_data_ready_flag()

gboolean ipc_get_lsc_data_ready_flag ( ipc_data_t * data)

Get the package list from LSC IPC data.

Parameters
dataData structure of IPC_DT_LSC type.

@Return True if the data is ready for running with LSC, False otherwise.

◆ ipc_get_lsc_os_release_from_data()

gchar * ipc_get_lsc_os_release_from_data ( ipc_data_t * data)

◆ ipc_get_user_agent_from_data()

gchar * ipc_get_user_agent_from_data ( ipc_data_t * data)

Get the User-Agent from IPC data.

Parameters
dataData structure of IPC_DT_USER_AGENT type.

@Return a string containing the User-Agent, NULL on error.