OpenVAS Manager
7.0.3~git
|
#include <gnutls/gnutls.h>
Go to the source code of this file.
Functions | |
int | openvas_scanner_read () |
Read as much from the server as the from_scanner buffer will. More... | |
int | openvas_scanner_write (int) |
Write as much as possible from the to_scanner buffer to the scanner. More... | |
int | openvas_scanner_wait () |
Wait for the scanner socket to be writable. More... | |
int | openvas_scanner_close () |
Finish the connection to the Scanner and free internal buffers. More... | |
void | openvas_scanner_fork () |
Reset Scanner variables after a fork. More... | |
int | openvas_scanner_connect () |
Create a new connection to the scanner and set it as current scanner. More... | |
void | openvas_scanner_free () |
Free the scanner allocated data. Doesn't close socket and terminate the session. More... | |
int | openvas_scanner_fd_isset (fd_set *) |
Check if connected to Scanner is set in an fd_set. More... | |
void | openvas_scanner_fd_set (fd_set *) |
Add connected to Scanner's socket to an fd_set. More... | |
int | openvas_scanner_peek () |
Check if there is any data to receive from connected Scanner socket. More... | |
int | openvas_scanner_get_nfds (int) |
Get the nfds value to use for a select() call. More... | |
int | openvas_scanner_session_peek () |
Check if there is any data to receive from connected Scanner session. More... | |
int | openvas_scanner_full () |
Check whether the buffer for data from Scanner is full. More... | |
int | openvas_scanner_realloc () |
Reallocates the from_scanner buffer to a higher size. More... | |
int | openvas_scanner_connected () |
Whether we have started a connection to the Scanner using openvas_scanner_connect(). More... | |
int | openvas_scanner_init (int) |
Initializes the already setup connection with the Scanner. More... | |
int | openvas_scanner_is_loading () |
Checks whether the connected to OpenVAS Scanner is still loading plugins. To be called right after openvas_scanner_init(). More... | |
int | openvas_scanner_set_address (const char *, int) |
Set the scanner's address and port. Will try to resolve addr if it is a hostname. More... | |
int | openvas_scanner_set_unix (const char *) |
Set the scanner's unix socket path. More... | |
void | openvas_scanner_set_certs (const char *, const char *, const char *) |
Set the scanner's CA Certificate, and public/private key pair. More... | |
int openvas_scanner_close | ( | ) |
Finish the connection to the Scanner and free internal buffers.
Definition at line 551 of file scanner.c.
References from_scanner, openvas_scanner_credentials, openvas_scanner_session, openvas_scanner_socket, and openvas_scanner_unix_path.
int openvas_scanner_connect | ( | ) |
Create a new connection to the scanner and set it as current scanner.
Definition at line 619 of file scanner.c.
References openvas_scanner_ca_pub, openvas_scanner_connect_unix(), openvas_scanner_credentials, openvas_scanner_key_priv, openvas_scanner_key_pub, openvas_scanner_session, openvas_scanner_socket, and openvas_scanner_unix_path.
int openvas_scanner_connected | ( | ) |
Whether we have started a connection to the Scanner using openvas_scanner_connect().
Definition at line 764 of file scanner.c.
References openvas_scanner_socket.
int openvas_scanner_fd_isset | ( | fd_set * | fd | ) |
Check if connected to Scanner is set in an fd_set.
[in] | fd | File descriptor set. |
Definition at line 688 of file scanner.c.
References openvas_scanner_socket.
void openvas_scanner_fd_set | ( | fd_set * | fd | ) |
Add connected to Scanner's socket to an fd_set.
[in] | fd | File Descriptor set. |
Definition at line 701 of file scanner.c.
References openvas_scanner_socket.
void openvas_scanner_fork | ( | ) |
Reset Scanner variables after a fork.
This other side of the fork will do the actual cleanup.
Definition at line 575 of file scanner.c.
References from_scanner_end, from_scanner_start, openvas_scanner_credentials, openvas_scanner_session, openvas_scanner_socket, and reset_scanner_states().
void openvas_scanner_free | ( | ) |
Free the scanner allocated data. Doesn't close socket and terminate the session.
Definition at line 659 of file scanner.c.
References openvas_scanner_address, openvas_scanner_ca_pub, openvas_scanner_credentials, openvas_scanner_key_priv, openvas_scanner_key_pub, openvas_scanner_session, openvas_scanner_socket, and openvas_scanner_unix_path.
Referenced by openvas_scanner_init(), and openvas_scanner_set_unix().
int openvas_scanner_full | ( | ) |
Check whether the buffer for data from Scanner is full.
Definition at line 310 of file scanner.c.
References from_scanner_end, and from_scanner_size.
Referenced by openvas_scanner_read().
int openvas_scanner_get_nfds | ( | int | socket | ) |
Get the nfds value to use for a select() call.
[in] | socket | Socket to compare to. |
Definition at line 732 of file scanner.c.
References openvas_scanner_socket.
int openvas_scanner_init | ( | int | cache_mode | ) |
Initializes the already setup connection with the Scanner.
[in] | cache_mode | NVT Cache mode if true, which means sending NVT_INFO command to scanner in initial negotiation. |
Definition at line 778 of file scanner.c.
References from_scanner, from_scanner_size, openvas_scanner_free(), openvas_scanner_socket, openvas_scanner_wait(), and openvas_scanner_write().
int openvas_scanner_is_loading | ( | ) |
Checks whether the connected to OpenVAS Scanner is still loading plugins. To be called right after openvas_scanner_init().
Definition at line 876 of file scanner.c.
References openvas_scanner_read(), openvas_usleep(), and process_otp_scanner_input().
int openvas_scanner_peek | ( | ) |
Check if there is any data to receive from connected Scanner socket.
Definition at line 715 of file scanner.c.
References openvas_scanner_socket.
int openvas_scanner_read | ( | ) |
Read as much from the server as the from_scanner buffer will.
hold.
Definition at line 233 of file scanner.c.
References openvas_scanner_full(), and openvas_scanner_socket.
Referenced by openvas_scanner_is_loading().
int openvas_scanner_realloc | ( | ) |
Reallocates the from_scanner buffer to a higher size.
Definition at line 321 of file scanner.c.
References from_scanner, from_scanner_max_size, and from_scanner_size.
int openvas_scanner_session_peek | ( | ) |
Check if there is any data to receive from connected Scanner session.
Definition at line 747 of file scanner.c.
References openvas_scanner_session, openvas_scanner_socket, and openvas_scanner_unix_path.
int openvas_scanner_set_address | ( | const char * | addr, |
int | port | ||
) |
Set the scanner's address and port. Will try to resolve addr if it is a hostname.
[in] | addr | Scanner address string. |
[in] | port | Scanner port. |
Definition at line 807 of file scanner.c.
References openvas_scanner_address, and openvas_scanner_unix_path.
Referenced by manage_scanner_set().
void openvas_scanner_set_certs | ( | const char * | ca_pub, |
const char * | key_pub, | ||
const char * | key_priv | ||
) |
Set the scanner's CA Certificate, and public/private key pair.
[in] | ca_pub | CA Certificate. |
[in] | key_pub | Scanner Certificate. |
[in] | key_priv | Scanner private key. |
Definition at line 853 of file scanner.c.
References openvas_scanner_ca_pub, openvas_scanner_key_priv, openvas_scanner_key_pub, and openvas_scanner_unix_path.
Referenced by set_certs().
int openvas_scanner_set_unix | ( | const char * | path | ) |
Set the scanner's unix socket path.
[in] | path | Path to scanner unix socket. |
Definition at line 833 of file scanner.c.
References openvas_scanner_address, openvas_scanner_free(), and openvas_scanner_unix_path.
Referenced by manage_scanner_set().
int openvas_scanner_wait | ( | ) |
Wait for the scanner socket to be writable.
Definition at line 463 of file scanner.c.
References openvas_scanner_socket.
Referenced by openvas_scanner_init().
int openvas_scanner_write | ( | int | nvt_cache_mode | ) |
Write as much as possible from the to_scanner buffer to the scanner.
Definition at line 338 of file scanner.c.
References openvas_scanner_address, openvas_scanner_session, openvas_scanner_socket, openvas_scanner_unix_path, SCANNER_INIT_CONNECTED, scanner_init_offset, scanner_init_state, SCANNER_INIT_TOP, and set_scanner_init_state().
Referenced by openvas_scanner_init().