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

Headers for the GMP daemon. More...

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

Go to the source code of this file.

Macros

#define READ_PROTOCOL_TIMEOUT   300
 Maximum number of seconds spent trying to read the protocol.
 
#define FROM_BUFFER_SIZE   1048576
 Size of from_client data buffers, in bytes.
 

Functions

int init_gmpd (GSList *, const db_conn_info_t *, int, int, int, int, manage_connection_forker_t, int)
 Initialise the GMP library for the GMP daemon. More...
 
void init_gmpd_process (const db_conn_info_t *, gchar **)
 Initialise a process forked within the GMP daemon. More...
 
int serve_gmp (gvm_connection_t *, const db_conn_info_t *, gchar **)
 Serve the Greenbone Management Protocol (GMP). More...
 

Detailed Description

Headers for the GMP daemon.

Function Documentation

◆ init_gmpd()

int init_gmpd ( 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 the GMP library for the GMP daemon.

Parameters
[in]log_configLog configuration
[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_gmpd_process()

void init_gmpd_process ( const db_conn_info_t database,
gchar **  disable 
)

Initialise a process forked within the GMP daemon.

Parameters
[in]databaseLocation of manage database.
[in]disableCommands to disable.

◆ serve_gmp()

int serve_gmp ( gvm_connection_t *  client_connection,
const db_conn_info_t database,
gchar **  disable 
)

Serve the Greenbone Management Protocol (GMP).

Loop reading input from the sockets, processing the input, and writing any results to the appropriate socket. Exit the loop on reaching end of file on the client socket.

Read input from the client. Process the input with process_gmp_client_input. Write the results to the client.

Parameters
[in]client_connectionConnection.
[in]databaseLocation of manage database.
[in]disableCommands to disable.
Returns
0 success, -1 error.
Todo:
Confirm and clarify complications, especially last one.
Todo:
nfds must only include a socket if it's in >= one set.
Todo:
Shutdown on failure (for example, if a read fails).