Greenbone Vulnerability Manager  22.4.0~dev1
Macros | Functions | Variables
gmp.h File Reference

Headers for the GMP library. More...

#include "manage.h"
#include "types.h"
#include <glib.h>
#include <gnutls/gnutls.h>
#include <gvm/util/serverutils.h>
#include <sys/types.h>

Go to the source code of this file.

Macros

#define TO_CLIENT_BUFFER_SIZE   26214400
 The size of the to_client data buffer, in bytes.
 
#define TRUNCATE_TEXT_LENGTH   10000000
 The maximum length in bytes for long result text like the description.
 
#define TRUNCATE_TEXT_SUFFIX   "[...]\n(text truncated)"
 The text to append when text is truncated.
 

Functions

int init_gmp (GSList *, const db_conn_info_t *, int, int, int, int, manage_connection_forker_t, int)
 Initialise GMP library. More...
 
void init_gmp_process (const db_conn_info_t *, int(*)(const char *, void *), void *, gchar **)
 Initialise GMP library data for a process. More...
 
int process_gmp_client_input ()
 Process any XML available in from_client. More...
 

Variables

char to_client []
 Buffer of output to the client. More...
 
buffer_size_t to_client_start
 The start of the data in the to_client buffer.
 
buffer_size_t to_client_end
 The end of the data in the to_client buffer.
 

Detailed Description

Headers for the GMP library.

Function Documentation

◆ init_gmp()

int init_gmp ( GSList *  log_config,
const db_conn_info_t database,
int  max_ips_per_target,
int  max_email_attachment_size,
int  max_email_include_size,
int  max_email_message_size,
manage_connection_forker_t  fork_connection,
int  skip_db_check 
)

Initialise GMP library.

Parameters
[in]log_configLogging configuration list.
[in]databaseLocation of manage database.
[in]max_ips_per_targetMax number of IPs per target.
[in]max_email_attachment_sizeMax size of email attachments.
[in]max_email_include_sizeMax size of email inclusions.
[in]max_email_message_sizeMax size of email user message text.
[in]fork_connectionFunction to fork a connection to the GMP daemon layer, or NULL.
[in]skip_db_checkSkip DB check.
Returns
0 success, -1 error, -2 database is wrong version, -4 max_ips_per_target out of range.

◆ init_gmp_process()

void init_gmp_process ( const db_conn_info_t database,
int(*)(const char *, void *)  write_to_client,
void *  write_to_client_data,
gchar **  disable 
)

Initialise GMP library data for a process.

Parameters
[in]databaseLocation of manage database.
[in]write_to_clientFunction to write to client.
[in]write_to_client_dataArgument to write_to_client.
[in]disableCommands to disable.

This should run once per process, before the first call to process_gmp_client_input.

◆ process_gmp_client_input()

int process_gmp_client_input ( )

Process any XML available in from_client.

Returns
0 success, -1 error, -4 XML syntax error.

Variable Documentation

◆ to_client

char to_client[]
extern

Buffer of output to the client.

Todo:
As described in gmp.c, probably should be replaced by gmp_parser_t.