|
OpenVAS Manager
7.0.3~git
|
The OpenVAS Manager OTP library. More...
#include "otp.h"#include "manage.h"#include "scanner.h"#include "types.h"#include <assert.h>#include <ctype.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <openvas/base/openvas_string.h>#include <openvas/misc/nvt_categories.h>
Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "md otp" |
| GLib log domain. More... | |
Functions | |
| void | init_otp_data () |
| Initialise OTP library data. More... | |
| void | set_scanner_init_state (scanner_init_state_t state) |
| Set the scanner initialisation state, scanner_init_state. More... | |
| void | reset_scanner_states () |
| Set the scanner initialisation state, scanner_init_state. More... | |
| int | process_otp_scanner_input (void(*progress)()) |
| Process any lines available in from_scanner. More... | |
Variables | |
| buffer_size_t | from_buffer_size |
| Size of from_client data buffer, in bytes. More... | |
| GList * | scanner_plugins_list = NULL |
| The full plugins list, during reading of scanner plugin list. More... | |
| GList * | scanner_preferences_list = NULL |
| The full preferences list, during reading of scanner plugin list. More... | |
| scanner_init_state_t | scanner_init_state = SCANNER_INIT_TOP |
| The initialisation state of the scanner. More... | |
| int | scanner_init_offset = 0 |
| Offset into initialisation string being sent to scanner. More... | |
| int | scanner_current_loading = 0 |
| Scanner current number of loaded plugins, when still loading. More... | |
| int | scanner_total_loading = 0 |
| Scanner total number of plugins to be loaded, when still loading. 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... | |
The OpenVAS Manager OTP library.
This file defines an OpenVAS Transfer Protocol (OTP) library, for implementing OpenVAS managers such as the OpenVAS Manager daemon.
The library provides a single function, process_otp_scanner_input. This function parses a given string of OTP text and adjusts local task records according to the OTP messages in the string.
Definition in file otp.c.
| #define G_LOG_DOMAIN "md otp" |
GLib log domain.
Definition at line 65 of file otp.c.
Referenced by process_otp_scanner_input().
| enum scanner_state_t |
Possible states of the scanner.
Definition at line 350 of file otp.c.
| void init_otp_data | ( | ) |
Initialise OTP library data.
This must run once, before the first call to process_otp_scanner_input.
Definition at line 342 of file otp.c.
Referenced by openvas_scanner_connect(), and openvas_scanner_connect_unix().

| int process_otp_scanner_input | ( | void(*)() | progress | ) |
Process any lines available in from_scanner.
Update scanner information according to the input from the scanner.
This function simply records input from the scanner. Output to the scanner or client is almost always done via process_omp_client_input in reaction to client requests, the only exception being stop requests initiated in other processes.
| [in] | progress | Function to mark progress, or NULL. |
Definition at line 781 of file otp.c.
References acknowledge_bye(), acknowledge_feed_version_info(), clear_duration_schedules(), current_report, current_scanner_task, delete_task_lock(), from_scanner_end, from_scanner_start, G_LOG_DOMAIN, host_notice(), hosts_set_details(), hosts_set_identifiers(), hosts_set_max_severity(), manage_check_current_task(), manage_complete_nvt_cache_update(), manage_nvt_preferences_enable(), manage_transaction_stop(), port_name_formatted(), progress, report_host_noticeable(), report_uuid(), scan_start_time_epoch(), SCANNER_ALARM_DESCRIPTION, SCANNER_ALARM_HOST, SCANNER_ALARM_NUMBER, SCANNER_ALARM_OID, SCANNER_BYE, SCANNER_DONE, SCANNER_ERRMSG_DESCRIPTION, SCANNER_ERRMSG_HOST, SCANNER_ERRMSG_NUMBER, SCANNER_ERRMSG_OID, SCANNER_INIT_CONNECTED, SCANNER_INIT_DONE, SCANNER_INIT_DONE_CACHE_MODE, SCANNER_INIT_DONE_CACHE_MODE_UPDATE, SCANNER_INIT_GOT_FEED_VERSION, SCANNER_INIT_GOT_PLUGINS, SCANNER_INIT_SENT_COMPLETE_LIST, SCANNER_INIT_SENT_COMPLETE_LIST_UPDATE, SCANNER_INIT_SENT_VERSION, SCANNER_INIT_TOP, SCANNER_LOG_DESCRIPTION, SCANNER_LOG_HOST, SCANNER_LOG_NUMBER, SCANNER_LOG_OID, SCANNER_NVT_INFO, SCANNER_PLUGIN_LIST_BUGTRAQ_ID, SCANNER_PLUGIN_LIST_CATEGORY, SCANNER_PLUGIN_LIST_COPYRIGHT, SCANNER_PLUGIN_LIST_CVE_ID, SCANNER_PLUGIN_LIST_FAMILY, SCANNER_PLUGIN_LIST_NAME, SCANNER_PLUGIN_LIST_OID, SCANNER_PLUGIN_LIST_PLUGIN_VERSION, SCANNER_PLUGIN_LIST_TAGS, SCANNER_PLUGIN_LIST_XREFS, SCANNER_PREFERENCE_NAME, SCANNER_PREFERENCE_VALUE, SCANNER_SERVER, SCANNER_STATUS_HOST, SCANNER_STATUS_PROGRESS, SCANNER_TIME, SCANNER_TIME_HOST_END_HOST, SCANNER_TIME_HOST_END_TIME, SCANNER_TIME_HOST_START_HOST, SCANNER_TIME_HOST_START_TIME, SCANNER_TIME_SCAN_END, SCANNER_TIME_SCAN_START, SCANNER_TOP, set_nvts_feed_version(), set_scan_end_time_otp(), set_scan_host_end_time_otp(), set_scan_host_start_time_otp(), set_scan_ports(), set_scan_start_time_otp(), set_scanner_init_state(), set_task_end_time(), set_task_run_status(), set_task_start_time_otp(), task_run_status(), TASK_STATUS_DELETE_REQUESTED, TASK_STATUS_DELETE_ULTIMATE_REQUESTED, TASK_STATUS_DELETE_ULTIMATE_WAITING, TASK_STATUS_DELETE_WAITING, TASK_STATUS_DONE, TASK_STATUS_INTERNAL_ERROR, TASK_STATUS_REQUESTED, TASK_STATUS_RUNNING, TASK_STATUS_STOP_REQUESTED, TASK_STATUS_STOP_WAITING, TASK_STATUS_STOPPED, and update_duration_schedule_periods().
Referenced by openvas_scanner_is_loading(), and serve_omp().


| void reset_scanner_states | ( | ) |
Set the scanner initialisation state, scanner_init_state.
Definition at line 442 of file otp.c.
References SCANNER_INIT_TOP, SCANNER_TOP, and set_scanner_init_state().
Referenced by openvas_scanner_fork().


| void set_scanner_init_state | ( | scanner_init_state_t | state | ) |
Set the scanner initialisation state, scanner_init_state.
Definition at line 432 of file otp.c.
Referenced by openvas_scanner_write(), process_otp_scanner_input(), reset_scanner_states(), and serve_omp().

| buffer_size_t from_buffer_size |
Size of from_client data buffer, in bytes.
Definition at line 79 of file ompd.c.
Referenced by serve_omp().
| char* from_scanner |
| 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.
| int scanner_current_loading = 0 |
| int scanner_init_offset = 0 |
Offset into initialisation string being sent to scanner.
Definition at line 416 of file otp.c.
Referenced by openvas_scanner_write().
| scanner_init_state_t scanner_init_state = SCANNER_INIT_TOP |
The initialisation state of the scanner.
Definition at line 411 of file otp.c.
Referenced by openvas_scanner_write(), and serve_omp().
| GList* scanner_plugins_list = NULL |
| GList* scanner_preferences_list = NULL |