OpenVAS Manager
7.0.3~git
|
#include "types.h"
#include <openvas/misc/openvas_server.h>
#include <glib.h>
#include <netinet/in.h>
#include <gnutls/gnutls.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. More... | |
#define | FROM_BUFFER_SIZE 1048576 |
Size of from_client and from_scanner data buffers, in bytes. More... | |
Functions | |
int | init_ompd (GSList *, int, const gchar *, int, int, int, int, void(*)(), int(*)(openvas_connection_t *, gchar *), int) |
Initialise the OMP library for the OMP daemon. More... | |
void | init_ompd_process (const gchar *, gchar **) |
Initialise a process forked within the OMP daemon. More... | |
int | serve_omp (openvas_connection_t *, const gchar *, gchar **, void(*progress)()) |
Serve the OpenVAS Management Protocol (OMP). More... | |
Variables | |
buffer_size_t | from_buffer_size |
Size of from_client data buffer, in bytes. More... | |
char | from_client [] |
Buffer of input from the client. More... | |
buffer_size_t | from_client_start |
The start of the data in the from_client buffer. More... | |
buffer_size_t | from_client_end |
The end of the data in the from_client buffer. More... | |
char * | from_scanner |
Buffer of input from the scanner. More... | |
buffer_size_t | from_scanner_start |
The start of the data in the from_scanner buffer. More... | |
buffer_size_t | from_scanner_end |
The end of the data in the from_scanner buffer. More... | |
struct sockaddr_in | scanner_address |
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. More... | |
buffer_size_t | to_client_end |
The end of the data in the to_client buffer. More... | |
#define FROM_BUFFER_SIZE 1048576 |
Size of from_client and from_scanner data buffers, in bytes.
#define READ_PROTOCOL_TIMEOUT 300 |
int init_ompd | ( | GSList * | log_config, |
int | nvt_cache_mode, | ||
const gchar * | database, | ||
int | max_ips_per_target, | ||
int | max_email_attachment_size, | ||
int | max_email_include_size, | ||
int | max_email_message_size, | ||
void(*)() | progress, | ||
int(*)(openvas_connection_t *, gchar *) | fork_connection, | ||
int | skip_db_check | ||
) |
Initialise the OMP library for the OMP daemon.
[in] | log_config | Log configuration |
[in] | nvt_cache_mode | 0 operate normally, -1 just update NVT cache, -2 just rebuild NVT cache. |
[in] | database | Location of manage database. |
[in] | max_ips_per_target | Max number of IPs per target. |
[in] | max_email_attachment_size | Max size of email attachments. |
[in] | max_email_include_size | Max size of email inclusions. |
[in] | max_email_message_size | Max size of email user message text. |
[in] | progress | Function to update progress, or NULL. |
[in] | fork_connection | Function to fork a connection to the OMP daemon layer, or NULL. |
[in] | skip_db_check | Skip DB check. |
Definition at line 117 of file ompd.c.
void init_ompd_process | ( | const gchar * | database, |
gchar ** | disable | ||
) |
Initialise a process forked within the OMP daemon.
[in] | database | Location of manage database. |
[in] | disable | Commands to disable. |
Definition at line 137 of file ompd.c.
int serve_omp | ( | openvas_connection_t * | client_connection, |
const gchar * | database, | ||
gchar ** | disable, | ||
void(*)() | progress | ||
) |
Serve the OpenVAS Management Protocol (OMP).
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 and scanner. Process the input with process_omp_client_input and process_otp_scanner_input. Write the results to the client.
If compiled with logging (LOG) then log all input and output with logf.
If client_socket is 0 or less, then update the NVT cache and exit.
[in] | client_connection | Connection. |
[in] | database | Location of manage database. |
[in] | disable | Commands to disable. |
[in] | progress | Function to mark progress, or NULL. |
Definition at line 493 of file ompd.c.
buffer_size_t from_buffer_size |
Size of from_client data buffer, in bytes.
char from_client[] |
Buffer of input from the client.
buffer_size_t from_client_end |
The end of the data in the from_client buffer.
buffer_size_t from_client_start |
The start of the data in the from_client buffer.
buffer_size_t from_scanner_end |
The end of the data in the from_scanner buffer.
buffer_size_t from_scanner_start |
The start of the data in the from_scanner buffer.
struct sockaddr_in scanner_address |
char to_client[] |
buffer_size_t to_client_end |
The end of the data in the to_client buffer.
Definition at line 4988 of file omp.c.
Referenced by ompd_send_to_client().
buffer_size_t to_client_start |