OpenVAS Manager  7.0.3~git
omp.c File Reference

The OpenVAS Manager OMP library. More...

#include "omp.h"
#include "manage.h"
#include "manage_acl.h"
#include "otp.h"
#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <glib/gstdio.h>
#include <math.h>
#include <netinet/in.h>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <gnutls/x509.h>
#include <openvas/base/nvti.h>
#include <openvas/osp/osp.h>
#include <openvas/base/openvas_string.h>
#include <openvas/base/openvas_file.h>
#include <openvas/base/pwpolicy.h>
#include <openvas/misc/openvas_auth.h>
#include <openvas/misc/openvas_logging.h>
#include <openvas/misc/openvas_ssh.h>
#include <openvas/omp/xml.h>
Include dependency graph for omp.c:

Go to the source code of this file.

Data Structures

struct  auth_conf_setting_t
 A simple key/value-pair. More...
 
struct  omp_parser_t
 A handle on an OMP parser. More...
 
struct  create_agent_data_t
 Command data for the create_agent command. More...
 
struct  create_asset_data_t
 Command data for the create_asset command. More...
 
struct  import_config_data_t
 Command data for the import part of the create_config command. More...
 
struct  create_config_data_t
 Command data for the create_config command. More...
 
struct  create_alert_data_t
 Command data for the create_alert command. More...
 
struct  create_credential_data_t
 Command data for the create_credential command. More...
 
struct  create_filter_data_t
 Command data for the create_filter command. More...
 
struct  create_group_data_t
 Command data for the create_group command. More...
 
struct  create_note_data_t
 Command data for the create_note command. More...
 
struct  create_override_data_t
 Command data for the create_override command. More...
 
struct  create_permission_data_t
 Command data for the create_permission command. More...
 
struct  create_port_list_range
 A port range. More...
 
struct  create_port_list_data_t
 Command data for the create_port_list command. More...
 
struct  create_port_range_data_t
 Command data for the create_port_range command. More...
 
struct  create_report_data_t
 Command data for the create_report command. More...
 
struct  create_report_format_data_t
 Command data for the create_report_format command. More...
 
struct  create_role_data_t
 Command data for the create_role command. More...
 
struct  create_scanner_data_t
 Command data for the create_scanner command. More...
 
struct  create_schedule_data_t
 Command data for the create_schedule command. More...
 
struct  create_target_data_t
 Command data for the create_target command. More...
 
struct  create_tag_data_t
 Command data for the create_tag command. More...
 
struct  create_task_data_t
 Command data for the create_task command. More...
 
struct  create_user_data_t
 
struct  delete_agent_data_t
 Command data for the delete_agent command. More...
 
struct  delete_asset_data_t
 Command data for the delete_asset command. More...
 
struct  delete_config_data_t
 Command data for the delete_config command. More...
 
struct  delete_alert_data_t
 Command data for the delete_alert command. More...
 
struct  delete_credential_data_t
 Command data for the delete_credential command. More...
 
struct  delete_filter_data_t
 Command data for the delete_filter command. More...
 
struct  delete_group_data_t
 Command data for the delete_group command. More...
 
struct  delete_note_data_t
 Command data for the delete_note command. More...
 
struct  delete_override_data_t
 Command data for the delete_override command. More...
 
struct  delete_permission_data_t
 Command data for the delete_permission command. More...
 
struct  delete_port_list_data_t
 Command data for the delete_port_list command. More...
 
struct  delete_port_range_data_t
 Command data for the delete_port_range command. More...
 
struct  delete_report_data_t
 Command data for the delete_report command. More...
 
struct  delete_report_format_data_t
 Command data for the delete_report_format command. More...
 
struct  delete_role_data_t
 Command data for the delete_role command. More...
 
struct  delete_schedule_data_t
 Command data for the delete_schedule command. More...
 
struct  delete_scanner_data_t
 Command data for the delete_scanner command. More...
 
struct  delete_tag_data_t
 Command data for the delete_tag command. More...
 
struct  delete_target_data_t
 Command data for the delete_target command. More...
 
struct  delete_task_data_t
 Command data for the delete_task command. More...
 
struct  delete_user_data_t
 Command data for the delete_user command. More...
 
struct  get_feeds_data_t
 Command data for the get_feeds command. More...
 
struct  get_agents_data_t
 Command data for the get_agents command. More...
 
struct  get_aggregates_data_t
 Command data for the get_aggregates command. More...
 
struct  get_assets_data_t
 Command data for the get_assets command. More...
 
struct  get_configs_data_t
 Command data for the get_configs command. More...
 
struct  get_alerts_data_t
 Command data for the get_alerts command. More...
 
struct  get_credentials_data_t
 Command data for the get_credentials command. More...
 
struct  get_filters_data_t
 Command data for the get_filters command. More...
 
struct  get_groups_data_t
 Command data for the get_groups command. More...
 
struct  get_info_data_t
 Command data for the get_info command. More...
 
struct  get_notes_data_t
 Command data for the get_notes command. More...
 
struct  get_nvts_data_t
 Command data for the get_nvts command. More...
 
struct  get_nvt_families_data_t
 Command data for the get_nvt_families command. More...
 
struct  get_overrides_data_t
 Command data for the get_overrides command. More...
 
struct  get_permissions_data_t
 Command data for the get_permissions command. More...
 
struct  get_port_lists_data_t
 Command data for the get_port_lists command. More...
 
struct  get_preferences_data_t
 Command data for the get_preferences command. More...
 
struct  get_reports_data_t
 Command data for the get_reports command. More...
 
struct  get_report_formats_data_t
 Command data for the get_report_formats command. More...
 
struct  get_results_data_t
 Command data for the get_results command. More...
 
struct  get_roles_data_t
 Command data for the get_roles command. More...
 
struct  get_schedules_data_t
 Command data for the get_schedules command. More...
 
struct  get_scanners_data_t
 Command data for the get_scanners command. More...
 
struct  get_settings_data_t
 Command data. More...
 
struct  get_system_reports_data_t
 Command data for the get_system_reports command. More...
 
struct  get_tags_data_t
 Command data for the get_tags command. More...
 
struct  get_targets_data_t
 Command data for the get_targets command. More...
 
struct  get_users_data_t
 Command data for the get_users command. More...
 
struct  modify_config_data_t
 Command data for the modify_config command. More...
 
struct  get_tasks_data_t
 Command data for the get_tasks command. More...
 
struct  help_data_t
 Command data for the help command. More...
 
struct  modify_agent_data_t
 Command data for the modify_agent command. More...
 
struct  modify_alert_data_t
 Command data for the modify_alert command. More...
 
struct  modify_asset_data_t
 Command data for the modify_asset command. More...
 
struct  auth_group_t
 Authentication method settings. More...
 
struct  modify_auth_data_t
 Command data for the modify_auth command. More...
 
struct  modify_credential_data_t
 Command data for the modify_credential command. More...
 
struct  modify_filter_data_t
 Command data for the modify_filter command. More...
 
struct  modify_group_data_t
 Command data for the modify_group command. More...
 
struct  modify_permission_data_t
 Command data for the modify_permission command. More...
 
struct  modify_port_list_data_t
 Command data for the modify_port_list command. More...
 
struct  modify_report_data_t
 Command data for the modify_report command. More...
 
struct  modify_report_format_data_t
 Command data for the modify_report_format command. More...
 
struct  modify_role_data_t
 Command data for the modify_role command. More...
 
struct  modify_scanner_data_t
 Command data for the modify_scanner command. More...
 
struct  modify_schedule_data_t
 Command data for the modify_schedule command. More...
 
struct  modify_tag_data_t
 Command data for the modify_tag command. More...
 
struct  modify_setting_data_t
 Command data for the modify_setting command. More...
 
struct  modify_target_data_t
 Command data for the modify_target command. More...
 
struct  modify_task_data_t
 Command data for the modify_task command. More...
 
struct  modify_note_data_t
 Command data for the modify_note command. More...
 
struct  modify_override_data_t
 Command data for the modify_override command. More...
 
struct  modify_user_data_t
 Command data for the modify_user command. More...
 
struct  move_task_data_t
 Command data for the move_task command. More...
 
struct  restore_data_t
 Command data for the restore command. More...
 
struct  resume_task_data_t
 Command data for the resume_task command. More...
 
struct  start_task_data_t
 Command data for the start_task command. More...
 
struct  stop_task_data_t
 Command data for the stop_task command. More...
 
struct  sync_config_data_t
 Command data for the modify_target command. More...
 
struct  test_alert_data_t
 Command data for the test_alert command. More...
 
struct  verify_agent_data_t
 Command data for the verify_agent command. More...
 
struct  verify_report_format_data_t
 Command data for the verify_report_format command. More...
 
struct  verify_scanner_data_t
 Command data for the verify_scanner command. More...
 
struct  run_wizard_data_t
 Command data for the wizard command. More...
 
union  command_data_t
 Command data, as passed between OMP parser callbacks. More...
 
struct  count_data_t
 Helper data structure for word counts. More...
 
struct  buffer_counts_data_t
 Helper data structure for buffering word counts. More...
 

Macros

#define G_LOG_DOMAIN   "md omp"
 GLib log domain. More...
 
#define STATUS_ERROR_SYNTAX   "400"
 Response code for a syntax error. More...
 
#define STATUS_ERROR_MUST_AUTH   "401"
 Response code when authorisation is required. More...
 
#define STATUS_ERROR_MUST_AUTH_TEXT   "Authenticate first"
 Response code when authorisation is required. More...
 
#define STATUS_ERROR_ACCESS   "403"
 Response code for forbidden access. More...
 
#define STATUS_ERROR_ACCESS_TEXT   "Access to resource forbidden"
 Response code text for forbidden access. More...
 
#define STATUS_ERROR_MISSING   "404"
 Response code for a missing resource. More...
 
#define STATUS_ERROR_MISSING_TEXT   "Resource missing"
 Response code text for a missing resource. More...
 
#define STATUS_ERROR_BUSY   "409"
 Response code for a busy resource. More...
 
#define STATUS_ERROR_BUSY_TEXT   "Resource busy"
 Response code text for a busy resource. More...
 
#define STATUS_ERROR_AUTH_FAILED   "400"
 Response code when authorisation failed. More...
 
#define STATUS_ERROR_AUTH_FAILED_TEXT   "Authentication failed"
 Response code text when authorisation failed. More...
 
#define STATUS_OK   "200"
 Response code on success. More...
 
#define STATUS_OK_TEXT   "OK"
 Response code text on success. More...
 
#define STATUS_OK_CREATED   "201"
 Response code on success, when a resource is created. More...
 
#define STATUS_OK_CREATED_TEXT   "OK, resource created"
 Response code on success, when a resource is created. More...
 
#define STATUS_OK_REQUESTED   "202"
 Response code on success, when the operation will finish later. More...
 
#define STATUS_OK_REQUESTED_TEXT   "OK, request submitted"
 Response code text on success, when the operation will finish later. More...
 
#define STATUS_INTERNAL_ERROR   "500"
 Response code for an internal error. More...
 
#define STATUS_INTERNAL_ERROR_TEXT   "Internal error"
 Response code text for an internal error. More...
 
#define STATUS_SERVICE_UNAVAILABLE   "503"
 Response code when a service is unavailable. More...
 
#define STATUS_SERVICE_DOWN   "503"
 Response code when a service is down. More...
 
#define STATUS_SERVICE_DOWN_TEXT   "Service temporarily down"
 Response code text when a service is down. More...
 
#define XML_ERROR_SYNTAX(tag, text)
 Expand to XML for a STATUS_ERROR_SYNTAX response. More...
 
#define XML_ERROR_ACCESS(tag)
 Expand to XML for a STATUS_ERROR_ACCESS response. More...
 
#define XML_ERROR_UNAVAILABLE(tag, text)
 Expand to XML for a STATUS_SERVICE_UNAVAILABLE response. More...
 
#define XML_ERROR_MISSING(tag)
 Expand to XML for a STATUS_ERROR_MISSING response. More...
 
#define XML_ERROR_AUTH_FAILED(tag)
 Expand to XML for a STATUS_ERROR_AUTH_FAILED response. More...
 
#define XML_ERROR_BUSY(tag)
 Expand to XML for a STATUS_ERROR_BUSY response. More...
 
#define XML_OK(tag)
 Expand to XML for a STATUS_OK response. More...
 
#define XML_OK_CREATED(tag)
 Expand to XML for a STATUS_OK_CREATED response. More...
 
#define XML_OK_CREATED_ID(tag)
 Expand to XML for a STATUS_OK_CREATED response with s for ID. More...
 
#define XML_OK_REQUESTED(tag)
 Expand to XML for a STATUS_OK_REQUESTED response. More...
 
#define XML_INTERNAL_ERROR(tag)
 Expand to XML for a STATUS_INTERNAL_ERROR response. More...
 
#define SEND_XML_SERVICE_DOWN(tag)
 Sends XML for a STATUS_SERVICE_DOWN response. More...
 
#define ELSE_ERROR(op)
 Insert else clause for omp_xml_handle_start_element. More...
 
#define ELSE_ERROR_CREATE_TASK()
 Insert else clause for omp_xml_handle_start_element in create_task. More...
 
#define CLOSE(parent, element)
 Insert else clause for omp_xml_handle_start_element. More...
 
#define CLOSE_READ_OVER(parent, element)
 Insert else clause for omp_xml_handle_start_element. More...
 
#define CASE_DELETE(upper, type, capital)
 Insert DELETE case for omp_xml_handle_end_element. More...
 
#define INIT_GET(type, capital)
 Call init_get for a GET end handler. More...
 
#define APPEND(state, dest)
 Append text to a var for a case in omp_xml_hand_text. More...
 

Typedefs

typedef struct create_port_list_range create_port_list_range_t
 Port range type. More...
 

Enumerations

enum  client_state_t {
  CLIENT_TOP, CLIENT_AUTHENTIC, CLIENT_AUTHENTICATE, CLIENT_AUTHENTICATE_CREDENTIALS,
  CLIENT_AUTHENTICATE_CREDENTIALS_PASSWORD, CLIENT_AUTHENTICATE_CREDENTIALS_USERNAME, CLIENT_AUTHENTIC_COMMANDS, CLIENT_COMMANDS,
  CLIENT_CREATE_AGENT, CLIENT_CREATE_AGENT_COMMENT, CLIENT_CREATE_AGENT_COPY, CLIENT_CREATE_AGENT_HOWTO_INSTALL,
  CLIENT_CREATE_AGENT_HOWTO_USE, CLIENT_CREATE_AGENT_INSTALLER, CLIENT_CREATE_AGENT_INSTALLER_FILENAME, CLIENT_CREATE_AGENT_INSTALLER_SIGNATURE,
  CLIENT_CREATE_AGENT_NAME, CLIENT_CREATE_ALERT, CLIENT_CREATE_ALERT_COMMENT, CLIENT_CREATE_ALERT_CONDITION,
  CLIENT_CREATE_ALERT_CONDITION_DATA, CLIENT_CREATE_ALERT_CONDITION_DATA_NAME, CLIENT_CREATE_ALERT_COPY, CLIENT_CREATE_ALERT_EVENT,
  CLIENT_CREATE_ALERT_EVENT_DATA, CLIENT_CREATE_ALERT_EVENT_DATA_NAME, CLIENT_CREATE_ALERT_FILTER, CLIENT_CREATE_ALERT_METHOD,
  CLIENT_CREATE_ALERT_METHOD_DATA, CLIENT_CREATE_ALERT_METHOD_DATA_NAME, CLIENT_CREATE_ALERT_NAME, CLIENT_CREATE_ASSET,
  CLIENT_CREATE_ASSET_REPORT, CLIENT_CREATE_ASSET_REPORT_FILTER, CLIENT_CREATE_ASSET_REPORT_FILTER_TERM, CLIENT_CREATE_ASSET_ASSET,
  CLIENT_CREATE_ASSET_ASSET_COMMENT, CLIENT_CREATE_ASSET_ASSET_NAME, CLIENT_CREATE_ASSET_ASSET_TYPE, CLIENT_CREATE_CREDENTIAL,
  CLIENT_CREATE_CREDENTIAL_ALLOW_INSECURE, CLIENT_CREATE_CREDENTIAL_AUTH_ALGORITHM, CLIENT_CREATE_CREDENTIAL_CERTIFICATE, CLIENT_CREATE_CREDENTIAL_COMMENT,
  CLIENT_CREATE_CREDENTIAL_COMMUNITY, CLIENT_CREATE_CREDENTIAL_COPY, CLIENT_CREATE_CREDENTIAL_KEY, CLIENT_CREATE_CREDENTIAL_KEY_PHRASE,
  CLIENT_CREATE_CREDENTIAL_KEY_PRIVATE, CLIENT_CREATE_CREDENTIAL_LOGIN, CLIENT_CREATE_CREDENTIAL_NAME, CLIENT_CREATE_CREDENTIAL_PASSWORD,
  CLIENT_CREATE_CREDENTIAL_PRIVACY, CLIENT_CREATE_CREDENTIAL_PRIVACY_ALGORITHM, CLIENT_CREATE_CREDENTIAL_PRIVACY_PASSWORD, CLIENT_CREATE_CREDENTIAL_TYPE,
  CLIENT_CREATE_CONFIG, CLIENT_CREATE_CONFIG_COMMENT, CLIENT_CREATE_CONFIG_COPY, CLIENT_CREATE_CONFIG_SCANNER,
  CLIENT_CREATE_CONFIG_NAME, CLIENT_C_C_GCR, CLIENT_C_C_GCR_CONFIG, CLIENT_C_C_GCR_CONFIG_COMMENT,
  CLIENT_C_C_GCR_CONFIG_NAME, CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS, CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR, CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_FAMILY_OR_NVT,
  CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_INCLUDE, CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_NAME, CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_TYPE, CLIENT_C_C_GCR_CONFIG_PREFERENCES,
  CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE, CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_ALT, CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_DEFAULT, CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_HR_NAME,
  CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_NAME, CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_NVT, CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_NVT_NAME, CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_TYPE,
  CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_VALUE, CLIENT_C_C_GCR_CONFIG_TYPE, CLIENT_CREATE_FILTER, CLIENT_CREATE_FILTER_COMMENT,
  CLIENT_CREATE_FILTER_COPY, CLIENT_CREATE_FILTER_NAME, CLIENT_CREATE_FILTER_NAME_MAKE_UNIQUE, CLIENT_CREATE_FILTER_TERM,
  CLIENT_CREATE_FILTER_TYPE, CLIENT_CREATE_GROUP, CLIENT_CREATE_GROUP_COMMENT, CLIENT_CREATE_GROUP_COPY,
  CLIENT_CREATE_GROUP_NAME, CLIENT_CREATE_GROUP_USERS, CLIENT_CREATE_GROUP_SPECIALS, CLIENT_CREATE_GROUP_SPECIALS_FULL,
  CLIENT_CREATE_NOTE, CLIENT_CREATE_NOTE_ACTIVE, CLIENT_CREATE_NOTE_COPY, CLIENT_CREATE_NOTE_HOSTS,
  CLIENT_CREATE_NOTE_NVT, CLIENT_CREATE_NOTE_PORT, CLIENT_CREATE_NOTE_RESULT, CLIENT_CREATE_NOTE_SEVERITY,
  CLIENT_CREATE_NOTE_TASK, CLIENT_CREATE_NOTE_TEXT, CLIENT_CREATE_NOTE_THREAT, CLIENT_CREATE_OVERRIDE,
  CLIENT_CREATE_OVERRIDE_ACTIVE, CLIENT_CREATE_OVERRIDE_COPY, CLIENT_CREATE_OVERRIDE_HOSTS, CLIENT_CREATE_OVERRIDE_NEW_SEVERITY,
  CLIENT_CREATE_OVERRIDE_NEW_THREAT, CLIENT_CREATE_OVERRIDE_NVT, CLIENT_CREATE_OVERRIDE_PORT, CLIENT_CREATE_OVERRIDE_RESULT,
  CLIENT_CREATE_OVERRIDE_SEVERITY, CLIENT_CREATE_OVERRIDE_TASK, CLIENT_CREATE_OVERRIDE_TEXT, CLIENT_CREATE_OVERRIDE_THREAT,
  CLIENT_CREATE_PERMISSION, CLIENT_CREATE_PERMISSION_COMMENT, CLIENT_CREATE_PERMISSION_COPY, CLIENT_CREATE_PERMISSION_NAME,
  CLIENT_CREATE_PERMISSION_RESOURCE, CLIENT_CREATE_PERMISSION_RESOURCE_TYPE, CLIENT_CREATE_PERMISSION_SUBJECT, CLIENT_CREATE_PERMISSION_SUBJECT_TYPE,
  CLIENT_CREATE_PORT_LIST, CLIENT_CREATE_PORT_LIST_COMMENT, CLIENT_CREATE_PORT_LIST_COPY, CLIENT_CREATE_PORT_LIST_NAME,
  CLIENT_CREATE_PORT_LIST_PORT_RANGE, CLIENT_CPL_GPLR, CLIENT_CPL_GPLR_PORT_LIST, CLIENT_CPL_GPLR_PORT_LIST_COMMENT,
  CLIENT_CPL_GPLR_PORT_LIST_IN_USE, CLIENT_CPL_GPLR_PORT_LIST_NAME, CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGE, CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES,
  CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE, CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_COMMENT, CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_END, CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_START,
  CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_TYPE, CLIENT_CPL_GPLR_PORT_LIST_TARGETS, CLIENT_CREATE_PORT_RANGE, CLIENT_CREATE_PORT_RANGE_COMMENT,
  CLIENT_CREATE_PORT_RANGE_END, CLIENT_CREATE_PORT_RANGE_PORT_LIST, CLIENT_CREATE_PORT_RANGE_START, CLIENT_CREATE_PORT_RANGE_TYPE,
  CLIENT_CREATE_REPORT_FORMAT, CLIENT_CREATE_REPORT_FORMAT_COPY, CLIENT_CRF_GRFR, CLIENT_CRF_GRFR_REPORT_FORMAT,
  CLIENT_CRF_GRFR_REPORT_FORMAT_CONTENT_TYPE, CLIENT_CRF_GRFR_REPORT_FORMAT_DESCRIPTION, CLIENT_CRF_GRFR_REPORT_FORMAT_EXTENSION, CLIENT_CRF_GRFR_REPORT_FORMAT_FILE,
  CLIENT_CRF_GRFR_REPORT_FORMAT_GLOBAL, CLIENT_CRF_GRFR_REPORT_FORMAT_NAME, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_DEFAULT,
  CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_DEFAULT_REPORT_FORMAT, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_NAME, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_OPTIONS, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_OPTIONS_OPTION,
  CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_TYPE, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_TYPE_MAX, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_TYPE_MIN, CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_VALUE,
  CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_VALUE_REPORT_FORMAT, CLIENT_CRF_GRFR_REPORT_FORMAT_PREDEFINED, CLIENT_CRF_GRFR_REPORT_FORMAT_SIGNATURE, CLIENT_CRF_GRFR_REPORT_FORMAT_SUMMARY,
  CLIENT_CRF_GRFR_REPORT_FORMAT_TRUST, CLIENT_CREATE_REPORT, CLIENT_CREATE_REPORT_IN_ASSETS, CLIENT_CREATE_REPORT_REPORT,
  CLIENT_CREATE_REPORT_RR, CLIENT_CREATE_REPORT_RR_FILTERS, CLIENT_CREATE_REPORT_RR_H, CLIENT_CREATE_REPORT_RR_HOSTS,
  CLIENT_CREATE_REPORT_RR_HOST_COUNT, CLIENT_CREATE_REPORT_RR_HOST_END, CLIENT_CREATE_REPORT_RR_HOST_END_HOST, CLIENT_CREATE_REPORT_RR_HOST_START,
  CLIENT_CREATE_REPORT_RR_HOST_START_HOST, CLIENT_CREATE_REPORT_RR_H_DETAIL, CLIENT_CREATE_REPORT_RR_H_DETAIL_NAME, CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE,
  CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE_DESC, CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE_NAME, CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE_TYPE, CLIENT_CREATE_REPORT_RR_H_DETAIL_VALUE,
  CLIENT_CREATE_REPORT_RR_H_END, CLIENT_CREATE_REPORT_RR_H_IP, CLIENT_CREATE_REPORT_RR_H_START, CLIENT_CREATE_REPORT_RR_PORTS,
  CLIENT_CREATE_REPORT_RR_REPORT_FORMAT, CLIENT_CREATE_REPORT_RR_RESULTS, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_COMMENT,
  CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_CREATION_TIME, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DESCRIPTION, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DETECTION, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_HOST,
  CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_MODIFICATION_TIME, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NAME, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NOTES, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT,
  CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_BID, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CERT, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CERT_CERT_REF, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CVE,
  CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CVSS_BASE, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_FAMILY, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_NAME, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_XREF,
  CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_OWNER, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_ORIGINAL_SEVERITY, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_ORIGINAL_THREAT, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_OVERRIDES,
  CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_PORT, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_TYPE, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_VALUE,
  CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_SCAN_NVT_VERSION, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_SEVERITY, CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_THREAT, CLIENT_CREATE_REPORT_RR_RESULT_COUNT,
  CLIENT_CREATE_REPORT_RR_SCAN_END, CLIENT_CREATE_REPORT_RR_SCAN_RUN_STATUS, CLIENT_CREATE_REPORT_RR_SCAN_START, CLIENT_CREATE_REPORT_RR_SORT,
  CLIENT_CREATE_REPORT_RR_TASK, CLIENT_CREATE_REPORT_TASK, CLIENT_CREATE_REPORT_TASK_COMMENT, CLIENT_CREATE_REPORT_TASK_NAME,
  CLIENT_CREATE_ROLE, CLIENT_CREATE_ROLE_COMMENT, CLIENT_CREATE_ROLE_COPY, CLIENT_CREATE_ROLE_NAME,
  CLIENT_CREATE_ROLE_USERS, CLIENT_CREATE_SCANNER, CLIENT_CREATE_SCANNER_COMMENT, CLIENT_CREATE_SCANNER_COPY,
  CLIENT_CREATE_SCANNER_NAME, CLIENT_CREATE_SCANNER_HOST, CLIENT_CREATE_SCANNER_PORT, CLIENT_CREATE_SCANNER_TYPE,
  CLIENT_CREATE_SCANNER_CA_PUB, CLIENT_CREATE_SCANNER_CREDENTIAL, CLIENT_CREATE_SCHEDULE, CLIENT_CREATE_SCHEDULE_COMMENT,
  CLIENT_CREATE_SCHEDULE_COPY, CLIENT_CREATE_SCHEDULE_DURATION, CLIENT_CREATE_SCHEDULE_DURATION_UNIT, CLIENT_CREATE_SCHEDULE_FIRST_TIME,
  CLIENT_CREATE_SCHEDULE_FIRST_TIME_DAY_OF_MONTH, CLIENT_CREATE_SCHEDULE_FIRST_TIME_HOUR, CLIENT_CREATE_SCHEDULE_FIRST_TIME_MINUTE, CLIENT_CREATE_SCHEDULE_FIRST_TIME_MONTH,
  CLIENT_CREATE_SCHEDULE_FIRST_TIME_YEAR, CLIENT_CREATE_SCHEDULE_NAME, CLIENT_CREATE_SCHEDULE_PERIOD, CLIENT_CREATE_SCHEDULE_PERIOD_UNIT,
  CLIENT_CREATE_SCHEDULE_TIMEZONE, CLIENT_CREATE_TAG, CLIENT_CREATE_TAG_ACTIVE, CLIENT_CREATE_TAG_COMMENT,
  CLIENT_CREATE_TAG_COPY, CLIENT_CREATE_TAG_NAME, CLIENT_CREATE_TAG_RESOURCE, CLIENT_CREATE_TAG_RESOURCE_TYPE,
  CLIENT_CREATE_TAG_VALUE, CLIENT_CREATE_TARGET, CLIENT_CREATE_TARGET_ALIVE_TESTS, CLIENT_CREATE_TARGET_ASSET_HOSTS,
  CLIENT_CREATE_TARGET_EXCLUDE_HOSTS, CLIENT_CREATE_TARGET_REVERSE_LOOKUP_ONLY, CLIENT_CREATE_TARGET_REVERSE_LOOKUP_UNIFY, CLIENT_CREATE_TARGET_COMMENT,
  CLIENT_CREATE_TARGET_COPY, CLIENT_CREATE_TARGET_ESXI_CREDENTIAL, CLIENT_CREATE_TARGET_ESXI_LSC_CREDENTIAL, CLIENT_CREATE_TARGET_HOSTS,
  CLIENT_CREATE_TARGET_NAME, CLIENT_CREATE_TARGET_NAME_MAKE_UNIQUE, CLIENT_CREATE_TARGET_PORT_LIST, CLIENT_CREATE_TARGET_PORT_RANGE,
  CLIENT_CREATE_TARGET_SMB_CREDENTIAL, CLIENT_CREATE_TARGET_SNMP_CREDENTIAL, CLIENT_CREATE_TARGET_SSH_CREDENTIAL, CLIENT_CREATE_TARGET_SSH_CREDENTIAL_PORT,
  CLIENT_CREATE_TARGET_SMB_LSC_CREDENTIAL, CLIENT_CREATE_TARGET_SSH_LSC_CREDENTIAL, CLIENT_CREATE_TARGET_SSH_LSC_CREDENTIAL_PORT, CLIENT_CREATE_TASK,
  CLIENT_CREATE_TASK_ALERT, CLIENT_CREATE_TASK_ALTERABLE, CLIENT_CREATE_TASK_COMMENT, CLIENT_CREATE_TASK_CONFIG,
  CLIENT_CREATE_TASK_COPY, CLIENT_CREATE_TASK_HOSTS_ORDERING, CLIENT_CREATE_TASK_NAME, CLIENT_CREATE_TASK_OBSERVERS,
  CLIENT_CREATE_TASK_OBSERVERS_GROUP, CLIENT_CREATE_TASK_PREFERENCES, CLIENT_CREATE_TASK_PREFERENCES_PREFERENCE, CLIENT_CREATE_TASK_PREFERENCES_PREFERENCE_NAME,
  CLIENT_CREATE_TASK_PREFERENCES_PREFERENCE_VALUE, CLIENT_CREATE_TASK_SCANNER, CLIENT_CREATE_TASK_SCHEDULE, CLIENT_CREATE_TASK_SCHEDULE_PERIODS,
  CLIENT_CREATE_TASK_TARGET, CLIENT_CREATE_USER, CLIENT_CREATE_USER_COPY, CLIENT_CREATE_USER_GROUPS,
  CLIENT_CREATE_USER_GROUPS_GROUP, CLIENT_CREATE_USER_HOSTS, CLIENT_CREATE_USER_IFACES, CLIENT_CREATE_USER_NAME,
  CLIENT_CREATE_USER_PASSWORD, CLIENT_CREATE_USER_ROLE, CLIENT_CREATE_USER_SOURCES, CLIENT_CREATE_USER_SOURCES_SOURCE,
  CLIENT_DELETE_AGENT, CLIENT_DELETE_ALERT, CLIENT_DELETE_ASSET, CLIENT_DELETE_CONFIG,
  CLIENT_DELETE_CREDENTIAL, CLIENT_DELETE_FILTER, CLIENT_DELETE_GROUP, CLIENT_DELETE_NOTE,
  CLIENT_DELETE_OVERRIDE, CLIENT_DELETE_PERMISSION, CLIENT_DELETE_PORT_LIST, CLIENT_DELETE_PORT_RANGE,
  CLIENT_DELETE_REPORT, CLIENT_DELETE_REPORT_FORMAT, CLIENT_DELETE_ROLE, CLIENT_DELETE_SCANNER,
  CLIENT_DELETE_SCHEDULE, CLIENT_DELETE_TAG, CLIENT_DELETE_TARGET, CLIENT_DELETE_TASK,
  CLIENT_DELETE_USER, CLIENT_DESCRIBE_AUTH, CLIENT_EMPTY_TRASHCAN, CLIENT_GET_AGENTS,
  CLIENT_GET_AGGREGATES, CLIENT_GET_AGGREGATES_DATA_COLUMN, CLIENT_GET_AGGREGATES_SORT, CLIENT_GET_AGGREGATES_TEXT_COLUMN,
  CLIENT_GET_ALERTS, CLIENT_GET_ASSETS, CLIENT_GET_CONFIGS, CLIENT_GET_CREDENTIALS,
  CLIENT_GET_FEEDS, CLIENT_GET_FILTERS, CLIENT_GET_GROUPS, CLIENT_GET_INFO,
  CLIENT_GET_NOTES, CLIENT_GET_NVTS, CLIENT_GET_NVT_FAMILIES, CLIENT_GET_OVERRIDES,
  CLIENT_GET_PERMISSIONS, CLIENT_GET_PORT_LISTS, CLIENT_GET_PREFERENCES, CLIENT_GET_REPORTS,
  CLIENT_GET_REPORT_FORMATS, CLIENT_GET_RESULTS, CLIENT_GET_ROLES, CLIENT_GET_SCANNERS,
  CLIENT_GET_SCHEDULES, CLIENT_GET_SETTINGS, CLIENT_GET_SYSTEM_REPORTS, CLIENT_GET_TAGS,
  CLIENT_GET_TARGETS, CLIENT_GET_TASKS, CLIENT_GET_USERS, CLIENT_GET_VERSION,
  CLIENT_GET_VERSION_AUTHENTIC, CLIENT_HELP, CLIENT_MODIFY_AGENT, CLIENT_MODIFY_AGENT_COMMENT,
  CLIENT_MODIFY_AGENT_NAME, CLIENT_MODIFY_ALERT, CLIENT_MODIFY_ALERT_COMMENT, CLIENT_MODIFY_ALERT_CONDITION,
  CLIENT_MODIFY_ALERT_CONDITION_DATA, CLIENT_MODIFY_ALERT_CONDITION_DATA_NAME, CLIENT_MODIFY_ALERT_EVENT, CLIENT_MODIFY_ALERT_EVENT_DATA,
  CLIENT_MODIFY_ALERT_EVENT_DATA_NAME, CLIENT_MODIFY_ALERT_FILTER, CLIENT_MODIFY_ALERT_METHOD, CLIENT_MODIFY_ALERT_METHOD_DATA,
  CLIENT_MODIFY_ALERT_METHOD_DATA_NAME, CLIENT_MODIFY_ALERT_NAME, CLIENT_MODIFY_ASSET, CLIENT_MODIFY_ASSET_COMMENT,
  CLIENT_MODIFY_AUTH, CLIENT_MODIFY_AUTH_GROUP, CLIENT_MODIFY_AUTH_GROUP_AUTH_CONF_SETTING, CLIENT_MODIFY_AUTH_GROUP_AUTH_CONF_SETTING_KEY,
  CLIENT_MODIFY_AUTH_GROUP_AUTH_CONF_SETTING_VALUE, CLIENT_MODIFY_CONFIG, CLIENT_MODIFY_CONFIG_COMMENT, CLIENT_MODIFY_CONFIG_FAMILY_SELECTION,
  CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY, CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY_ALL, CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY_GROWING, CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY_NAME,
  CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_GROWING, CLIENT_MODIFY_CONFIG_NAME, CLIENT_MODIFY_CONFIG_SCANNER, CLIENT_MODIFY_CONFIG_NVT_SELECTION,
  CLIENT_MODIFY_CONFIG_NVT_SELECTION_FAMILY, CLIENT_MODIFY_CONFIG_NVT_SELECTION_NVT, CLIENT_MODIFY_CONFIG_PREFERENCE, CLIENT_MODIFY_CONFIG_PREFERENCE_NAME,
  CLIENT_MODIFY_CONFIG_PREFERENCE_NVT, CLIENT_MODIFY_CONFIG_PREFERENCE_VALUE, CLIENT_MODIFY_CREDENTIAL, CLIENT_MODIFY_CREDENTIAL_ALLOW_INSECURE,
  CLIENT_MODIFY_CREDENTIAL_AUTH_ALGORITHM, CLIENT_MODIFY_CREDENTIAL_CERTIFICATE, CLIENT_MODIFY_CREDENTIAL_COMMENT, CLIENT_MODIFY_CREDENTIAL_COMMUNITY,
  CLIENT_MODIFY_CREDENTIAL_KEY, CLIENT_MODIFY_CREDENTIAL_KEY_PHRASE, CLIENT_MODIFY_CREDENTIAL_KEY_PRIVATE, CLIENT_MODIFY_CREDENTIAL_LOGIN,
  CLIENT_MODIFY_CREDENTIAL_NAME, CLIENT_MODIFY_CREDENTIAL_PASSWORD, CLIENT_MODIFY_CREDENTIAL_PRIVACY, CLIENT_MODIFY_CREDENTIAL_PRIVACY_ALGORITHM,
  CLIENT_MODIFY_CREDENTIAL_PRIVACY_PASSWORD, CLIENT_MODIFY_FILTER, CLIENT_MODIFY_FILTER_COMMENT, CLIENT_MODIFY_FILTER_NAME,
  CLIENT_MODIFY_FILTER_TERM, CLIENT_MODIFY_FILTER_TYPE, CLIENT_MODIFY_GROUP, CLIENT_MODIFY_GROUP_COMMENT,
  CLIENT_MODIFY_GROUP_NAME, CLIENT_MODIFY_GROUP_USERS, CLIENT_MODIFY_NOTE, CLIENT_MODIFY_NOTE_ACTIVE,
  CLIENT_MODIFY_NOTE_HOSTS, CLIENT_MODIFY_NOTE_PORT, CLIENT_MODIFY_NOTE_RESULT, CLIENT_MODIFY_NOTE_SEVERITY,
  CLIENT_MODIFY_NOTE_TASK, CLIENT_MODIFY_NOTE_TEXT, CLIENT_MODIFY_NOTE_THREAT, CLIENT_MODIFY_OVERRIDE,
  CLIENT_MODIFY_OVERRIDE_ACTIVE, CLIENT_MODIFY_OVERRIDE_HOSTS, CLIENT_MODIFY_OVERRIDE_NEW_SEVERITY, CLIENT_MODIFY_OVERRIDE_NEW_THREAT,
  CLIENT_MODIFY_OVERRIDE_PORT, CLIENT_MODIFY_OVERRIDE_RESULT, CLIENT_MODIFY_OVERRIDE_SEVERITY, CLIENT_MODIFY_OVERRIDE_TASK,
  CLIENT_MODIFY_OVERRIDE_TEXT, CLIENT_MODIFY_OVERRIDE_THREAT, CLIENT_MODIFY_PERMISSION, CLIENT_MODIFY_PERMISSION_COMMENT,
  CLIENT_MODIFY_PERMISSION_NAME, CLIENT_MODIFY_PERMISSION_RESOURCE, CLIENT_MODIFY_PERMISSION_RESOURCE_TYPE, CLIENT_MODIFY_PERMISSION_SUBJECT,
  CLIENT_MODIFY_PERMISSION_SUBJECT_TYPE, CLIENT_MODIFY_PORT_LIST, CLIENT_MODIFY_PORT_LIST_COMMENT, CLIENT_MODIFY_PORT_LIST_NAME,
  CLIENT_MODIFY_REPORT, CLIENT_MODIFY_REPORT_COMMENT, CLIENT_MODIFY_REPORT_FORMAT, CLIENT_MODIFY_REPORT_FORMAT_ACTIVE,
  CLIENT_MODIFY_REPORT_FORMAT_NAME, CLIENT_MODIFY_REPORT_FORMAT_PARAM, CLIENT_MODIFY_REPORT_FORMAT_PARAM_NAME, CLIENT_MODIFY_REPORT_FORMAT_PARAM_VALUE,
  CLIENT_MODIFY_REPORT_FORMAT_SUMMARY, CLIENT_MODIFY_ROLE, CLIENT_MODIFY_ROLE_COMMENT, CLIENT_MODIFY_ROLE_NAME,
  CLIENT_MODIFY_ROLE_USERS, CLIENT_MODIFY_SCANNER, CLIENT_MODIFY_SCANNER_COMMENT, CLIENT_MODIFY_SCANNER_NAME,
  CLIENT_MODIFY_SCANNER_HOST, CLIENT_MODIFY_SCANNER_PORT, CLIENT_MODIFY_SCANNER_TYPE, CLIENT_MODIFY_SCANNER_CA_PUB,
  CLIENT_MODIFY_SCANNER_CREDENTIAL, CLIENT_MODIFY_SCHEDULE, CLIENT_MODIFY_SCHEDULE_COMMENT, CLIENT_MODIFY_SCHEDULE_DURATION,
  CLIENT_MODIFY_SCHEDULE_DURATION_UNIT, CLIENT_MODIFY_SCHEDULE_FIRST_TIME, CLIENT_MODIFY_SCHEDULE_FIRST_TIME_DAY_OF_MONTH, CLIENT_MODIFY_SCHEDULE_FIRST_TIME_HOUR,
  CLIENT_MODIFY_SCHEDULE_FIRST_TIME_MINUTE, CLIENT_MODIFY_SCHEDULE_FIRST_TIME_MONTH, CLIENT_MODIFY_SCHEDULE_FIRST_TIME_YEAR, CLIENT_MODIFY_SCHEDULE_NAME,
  CLIENT_MODIFY_SCHEDULE_PERIOD, CLIENT_MODIFY_SCHEDULE_PERIOD_UNIT, CLIENT_MODIFY_SCHEDULE_TIMEZONE, CLIENT_MODIFY_SETTING,
  CLIENT_MODIFY_SETTING_NAME, CLIENT_MODIFY_SETTING_VALUE, CLIENT_MODIFY_TAG, CLIENT_MODIFY_TAG_ACTIVE,
  CLIENT_MODIFY_TAG_COMMENT, CLIENT_MODIFY_TAG_NAME, CLIENT_MODIFY_TAG_RESOURCE, CLIENT_MODIFY_TAG_RESOURCE_TYPE,
  CLIENT_MODIFY_TAG_VALUE, CLIENT_MODIFY_TARGET, CLIENT_MODIFY_TARGET_ALIVE_TESTS, CLIENT_MODIFY_TARGET_COMMENT,
  CLIENT_MODIFY_TARGET_ESXI_CREDENTIAL, CLIENT_MODIFY_TARGET_ESXI_LSC_CREDENTIAL, CLIENT_MODIFY_TARGET_HOSTS, CLIENT_MODIFY_TARGET_EXCLUDE_HOSTS,
  CLIENT_MODIFY_TARGET_REVERSE_LOOKUP_ONLY, CLIENT_MODIFY_TARGET_REVERSE_LOOKUP_UNIFY, CLIENT_MODIFY_TARGET_NAME, CLIENT_MODIFY_TARGET_PORT_LIST,
  CLIENT_MODIFY_TARGET_SMB_CREDENTIAL, CLIENT_MODIFY_TARGET_SNMP_CREDENTIAL, CLIENT_MODIFY_TARGET_SSH_CREDENTIAL, CLIENT_MODIFY_TARGET_SSH_CREDENTIAL_PORT,
  CLIENT_MODIFY_TARGET_SMB_LSC_CREDENTIAL, CLIENT_MODIFY_TARGET_SSH_LSC_CREDENTIAL, CLIENT_MODIFY_TARGET_SSH_LSC_CREDENTIAL_PORT, CLIENT_MODIFY_TASK,
  CLIENT_MODIFY_TASK_ALERT, CLIENT_MODIFY_TASK_ALTERABLE, CLIENT_MODIFY_TASK_COMMENT, CLIENT_MODIFY_TASK_CONFIG,
  CLIENT_MODIFY_TASK_FILE, CLIENT_MODIFY_TASK_NAME, CLIENT_MODIFY_TASK_OBSERVERS, CLIENT_MODIFY_TASK_OBSERVERS_GROUP,
  CLIENT_MODIFY_TASK_PREFERENCES, CLIENT_MODIFY_TASK_PREFERENCES_PREFERENCE, CLIENT_MODIFY_TASK_PREFERENCES_PREFERENCE_NAME, CLIENT_MODIFY_TASK_PREFERENCES_PREFERENCE_VALUE,
  CLIENT_MODIFY_TASK_SCHEDULE, CLIENT_MODIFY_TASK_SCHEDULE_PERIODS, CLIENT_MODIFY_TASK_TARGET, CLIENT_MODIFY_TASK_HOSTS_ORDERING,
  CLIENT_MODIFY_TASK_SCANNER, CLIENT_MODIFY_USER, CLIENT_MODIFY_USER_GROUPS, CLIENT_MODIFY_USER_GROUPS_GROUP,
  CLIENT_MODIFY_USER_HOSTS, CLIENT_MODIFY_USER_IFACES, CLIENT_MODIFY_USER_NAME, CLIENT_MODIFY_USER_NEW_NAME,
  CLIENT_MODIFY_USER_PASSWORD, CLIENT_MODIFY_USER_ROLE, CLIENT_MODIFY_USER_SOURCES, CLIENT_MODIFY_USER_SOURCES_SOURCE,
  CLIENT_MOVE_TASK, CLIENT_RESTORE, CLIENT_RESUME_TASK, CLIENT_RUN_WIZARD,
  CLIENT_RUN_WIZARD_MODE, CLIENT_RUN_WIZARD_NAME, CLIENT_RUN_WIZARD_PARAMS, CLIENT_RUN_WIZARD_PARAMS_PARAM,
  CLIENT_RUN_WIZARD_PARAMS_PARAM_NAME, CLIENT_RUN_WIZARD_PARAMS_PARAM_VALUE, CLIENT_START_TASK, CLIENT_STOP_TASK,
  CLIENT_SYNC_CERT, CLIENT_SYNC_CONFIG, CLIENT_SYNC_FEED, CLIENT_SYNC_SCAP,
  CLIENT_TEST_ALERT, CLIENT_VERIFY_AGENT, CLIENT_VERIFY_REPORT_FORMAT, CLIENT_VERIFY_SCANNER
}
 Possible states of the client. More...
 

Functions

void buffer_results_xml (GString *buffer, iterator_t *results, task_t task, int include_notes, int include_notes_details, int include_overrides, int include_overrides_details, int include_tags, int include_tags_details, int include_details, const char *delta_state, iterator_t *delta_results, int changed)
 Buffer XML for some results. More...
 
int find_attribute (const gchar **attribute_names, const gchar **attribute_values, const char *attribute_name, const gchar **attribute_value)
 Find an attribute in a parser callback list of attributes. More...
 
int append_attribute (const gchar **attribute_names, const gchar **attribute_values, const char *attribute_name, gchar **string)
 Find an attribute in a parser callback list of attributes and append. More...
 
int init_get (gchar *command, get_data_t *get, const gchar *setting_name, int *first)
 Init for a GET handler. More...
 
omp_parser_tomp_parser_new (int(*write_to_client)(const char *, void *), void *write_to_client_data, gchar **disable)
 Create an OMP parser. More...
 
void omp_parser_free (omp_parser_t *omp_parser)
 Free an OMP parser. More...
 
void get_data_reset (get_data_t *data)
 Reset command data. More...
 
void modify_auth_data_reset (modify_auth_data_t *data)
 Reset command data. More...
 
void buffer_config_preference_xml (GString *buffer, iterator_t *prefs, config_t config, int hide_passwords)
 Buffer XML for the NVT preference of a config. More...
 
gchar * strdiff (const gchar *one, const gchar *two)
 Compare two string with the "diff" command. More...
 
void init_aggregate_lists (const gchar *group_column, const gchar *subgroup_column, GList *data_column_list, GList *text_column_list, GList *sort_data_list, gchar **group_column_type, gchar **subgroup_column_type, GArray **data_column_types, GArray **data_columns, GArray **text_column_types, GArray **text_columns, GArray **sort_data, GArray **c_sums)
 Initialize lists for aggregates. More...
 
void buffer_aggregate_wc_xml (GString *xml, iterator_t *aggregate, const gchar *type, const char *group_column, GArray *sort_data, int first_group, int max_groups)
 Count words of an aggregate and buffer as XML. More...
 
void buffer_aggregate_xml (GString *xml, iterator_t *aggregate, const gchar *type, const char *group_column, const char *group_column_type, const char *subgroup_column, const char *subgroup_column_type, GArray *data_columns, GArray *data_column_types, GArray *text_columns, GArray *text_column_types, GArray *c_sums)
 Buffer XML for an aggregate. More...
 
char * get_ovaldi_files ()
 Get list of ovaldi definitions files using the values in ovaldefs table in scap.db. More...
 
int init_omp (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(*fork_connection)(openvas_connection_t *, gchar *), int skip_db_check)
 Initialise OMP library. More...
 
void init_omp_process (int update_nvt_cache, const gchar *database, int(*write_to_client)(const char *, void *), void *write_to_client_data, gchar **disable)
 Initialise OMP library data for a process. More...
 
int process_omp_client_input ()
 Process any XML available in from_client. More...
 
int process_omp_write (const char *msg, void *buffer)
 Buffer the response for process_omp. More...
 
int process_omp_change ()
 Deal with any changes caused by other processes. More...
 

Variables

command_data_t command_data
 Parser callback data. More...
 
create_agent_data_tcreate_agent_data = (create_agent_data_t*) &(command_data.create_agent)
 Parser callback data for CREATE_AGENT. More...
 
create_asset_data_tcreate_asset_data = (create_asset_data_t*) &(command_data.create_asset)
 Parser callback data for CREATE_ASSET. More...
 
create_config_data_tcreate_config_data = (create_config_data_t*) &(command_data.create_config)
 Parser callback data for CREATE_CONFIG. More...
 
create_alert_data_tcreate_alert_data = (create_alert_data_t*) &(command_data.create_alert)
 Parser callback data for CREATE_ALERT. More...
 
create_credential_data_tcreate_credential_data = (create_credential_data_t*) &(command_data.create_credential)
 Parser callback data for CREATE_CREDENTIAL. More...
 
create_filter_data_tcreate_filter_data = (create_filter_data_t*) &(command_data.create_filter)
 Parser callback data for CREATE_FILTER. More...
 
create_group_data_tcreate_group_data = (create_group_data_t*) &(command_data.create_group)
 Parser callback data for CREATE_GROUP. More...
 
create_note_data_tcreate_note_data = (create_note_data_t*) &(command_data.create_note)
 Parser callback data for CREATE_NOTE. More...
 
create_override_data_tcreate_override_data = (create_override_data_t*) &(command_data.create_override)
 Parser callback data for CREATE_OVERRIDE. More...
 
create_permission_data_tcreate_permission_data = (create_permission_data_t*) &(command_data.create_permission)
 Parser callback data for CREATE_PERMISSION. More...
 
create_port_list_data_tcreate_port_list_data = (create_port_list_data_t*) &(command_data.create_port_list)
 Parser callback data for CREATE_PORT_LIST. More...
 
create_port_range_data_tcreate_port_range_data = (create_port_range_data_t*) &(command_data.create_port_range)
 Parser callback data for CREATE_PORT_RANGE. More...
 
create_role_data_tcreate_role_data = (create_role_data_t*) &(command_data.create_role)
 Parser callback data for CREATE_ROLE. More...
 
create_report_data_tcreate_report_data = (create_report_data_t*) &(command_data.create_report)
 Parser callback data for CREATE_REPORT. More...
 
create_report_format_data_tcreate_report_format_data = (create_report_format_data_t*) &(command_data.create_report_format)
 Parser callback data for CREATE_REPORT_FORMAT. More...
 
create_scanner_data_tcreate_scanner_data = (create_scanner_data_t*) &(command_data.create_scanner)
 Parser callback data for CREATE_SCANNER. More...
 
create_schedule_data_tcreate_schedule_data = (create_schedule_data_t*) &(command_data.create_schedule)
 Parser callback data for CREATE_SCHEDULE. More...
 
create_tag_data_tcreate_tag_data = (create_tag_data_t*) &(command_data.create_tag)
 Parser callback data for CREATE_TAG. More...
 
create_target_data_tcreate_target_data = (create_target_data_t*) &(command_data.create_target)
 Parser callback data for CREATE_TARGET. More...
 
create_task_data_tcreate_task_data = (create_task_data_t*) &(command_data.create_task)
 Parser callback data for CREATE_TASK. More...
 
create_user_data_tcreate_user_data = &(command_data.create_user)
 Parser callback data for CREATE_USER. More...
 
delete_agent_data_tdelete_agent_data = (delete_agent_data_t*) &(command_data.delete_agent)
 Parser callback data for DELETE_AGENT. More...
 
delete_asset_data_tdelete_asset_data = (delete_asset_data_t*) &(command_data.delete_asset)
 Parser callback data for DELETE_ASSET. More...
 
delete_config_data_tdelete_config_data = (delete_config_data_t*) &(command_data.delete_config)
 Parser callback data for DELETE_CONFIG. More...
 
delete_alert_data_tdelete_alert_data = (delete_alert_data_t*) &(command_data.delete_alert)
 Parser callback data for DELETE_ALERT. More...
 
delete_credential_data_tdelete_credential_data = (delete_credential_data_t*) &(command_data.delete_credential)
 Parser callback data for DELETE_CREDENTIAL. More...
 
delete_filter_data_tdelete_filter_data = (delete_filter_data_t*) &(command_data.delete_filter)
 Parser callback data for DELETE_FILTER. More...
 
delete_group_data_tdelete_group_data = (delete_group_data_t*) &(command_data.delete_group)
 Parser callback data for DELETE_GROUP. More...
 
delete_note_data_tdelete_note_data = (delete_note_data_t*) &(command_data.delete_note)
 Parser callback data for DELETE_NOTE. More...
 
delete_override_data_tdelete_override_data = (delete_override_data_t*) &(command_data.delete_override)
 Parser callback data for DELETE_OVERRIDE. More...
 
delete_permission_data_tdelete_permission_data = (delete_permission_data_t*) &(command_data.delete_permission)
 Parser callback data for DELETE_PERMISSION. More...
 
delete_port_list_data_tdelete_port_list_data = (delete_port_list_data_t*) &(command_data.delete_port_list)
 Parser callback data for DELETE_PORT_LIST. More...
 
delete_port_range_data_tdelete_port_range_data = (delete_port_range_data_t*) &(command_data.delete_port_range)
 Parser callback data for DELETE_PORT_RANGE. More...
 
delete_report_data_tdelete_report_data = (delete_report_data_t*) &(command_data.delete_report)
 Parser callback data for DELETE_REPORT. More...
 
delete_report_format_data_tdelete_report_format_data = (delete_report_format_data_t*) &(command_data.delete_report_format)
 Parser callback data for DELETE_REPORT_FORMAT. More...
 
delete_role_data_tdelete_role_data = (delete_role_data_t*) &(command_data.delete_role)
 Parser callback data for DELETE_ROLE. More...
 
delete_scanner_data_tdelete_scanner_data = (delete_scanner_data_t*) &(command_data.delete_scanner)
 Parser callback data for DELETE_SCANNER. More...
 
delete_schedule_data_tdelete_schedule_data = (delete_schedule_data_t*) &(command_data.delete_schedule)
 Parser callback data for DELETE_SCHEDULE. More...
 
delete_tag_data_tdelete_tag_data = (delete_tag_data_t*) &(command_data.delete_tag)
 Parser callback data for DELETE_TAG. More...
 
delete_target_data_tdelete_target_data = (delete_target_data_t*) &(command_data.delete_target)
 Parser callback data for DELETE_TARGET. More...
 
delete_task_data_tdelete_task_data = (delete_task_data_t*) &(command_data.delete_task)
 Parser callback data for DELETE_TASK. More...
 
delete_user_data_tdelete_user_data = (delete_user_data_t*) &(command_data.delete_user)
 Parser callback data for DELETE_USER. More...
 
get_agents_data_tget_agents_data = &(command_data.get_agents)
 Parser callback data for GET_AGENTS. More...
 
get_aggregates_data_tget_aggregates_data = &(command_data.get_aggregates)
 Parser callback data for GET_AGGREGATES. More...
 
get_configs_data_tget_configs_data = &(command_data.get_configs)
 Parser callback data for GET_CONFIGS. More...
 
get_alerts_data_tget_alerts_data = &(command_data.get_alerts)
 Parser callback data for GET_ALERTS. More...
 
get_assets_data_tget_assets_data = &(command_data.get_assets)
 Parser callback data for GET_ASSETS. More...
 
get_credentials_data_tget_credentials_data = &(command_data.get_credentials)
 Parser callback data for GET_CREDENTIALS. More...
 
get_feeds_data_tget_feeds_data = &(command_data.get_feeds)
 Parser callback data for GET_FEEDS. More...
 
get_filters_data_tget_filters_data = &(command_data.get_filters)
 Parser callback data for GET_FILTERS. More...
 
get_groups_data_tget_groups_data = &(command_data.get_groups)
 Parser callback data for GET_GROUPS. More...
 
get_info_data_tget_info_data = &(command_data.get_info)
 Parser callback data for GET_INFO. More...
 
get_notes_data_tget_notes_data = &(command_data.get_notes)
 Parser callback data for GET_NOTES. More...
 
get_nvts_data_tget_nvts_data = &(command_data.get_nvts)
 Parser callback data for GET_NVTS. More...
 
get_nvt_families_data_tget_nvt_families_data = &(command_data.get_nvt_families)
 Parser callback data for GET_NVT_FAMILIES. More...
 
get_overrides_data_tget_overrides_data = &(command_data.get_overrides)
 Parser callback data for GET_OVERRIDES. More...
 
get_permissions_data_tget_permissions_data = &(command_data.get_permissions)
 Parser callback data for GET_PERMISSIONS. More...
 
get_port_lists_data_tget_port_lists_data = &(command_data.get_port_lists)
 Parser callback data for GET_PORT_LISTS. More...
 
get_preferences_data_tget_preferences_data = &(command_data.get_preferences)
 Parser callback data for GET_PREFERENCES. More...
 
get_reports_data_tget_reports_data = &(command_data.get_reports)
 Parser callback data for GET_REPORTS. More...
 
get_report_formats_data_tget_report_formats_data = &(command_data.get_report_formats)
 Parser callback data for GET_REPORT_FORMATS. More...
 
get_results_data_tget_results_data = &(command_data.get_results)
 Parser callback data for GET_RESULTS. More...
 
get_roles_data_tget_roles_data = &(command_data.get_roles)
 Parser callback data for GET_ROLES. More...
 
get_scanners_data_tget_scanners_data = &(command_data.get_scanners)
 Parser callback data for GET_scannerS. More...
 
get_schedules_data_tget_schedules_data = &(command_data.get_schedules)
 Parser callback data for GET_SCHEDULES. More...
 
get_settings_data_tget_settings_data = &(command_data.get_settings)
 Parser callback data for GET_SETTINGS. More...
 
get_system_reports_data_tget_system_reports_data = &(command_data.get_system_reports)
 Parser callback data for GET_SYSTEM_REPORTS. More...
 
get_tags_data_tget_tags_data = &(command_data.get_tags)
 Parser callback data for GET_TAGS. More...
 
get_targets_data_tget_targets_data = &(command_data.get_targets)
 Parser callback data for GET_TARGETS. More...
 
get_tasks_data_tget_tasks_data = &(command_data.get_tasks)
 Parser callback data for GET_TASKS. More...
 
get_users_data_tget_users_data = &(command_data.get_users)
 Parser callback data for GET_USERS. More...
 
help_data_thelp_data = &(command_data.help)
 Parser callback data for HELP. More...
 
import_config_data_timport_config_data = (import_config_data_t*) &(command_data.create_config.import)
 Parser callback data for CREATE_CONFIG (import). More...
 
modify_config_data_tmodify_config_data = &(command_data.modify_config)
 Parser callback data for MODIFY_CONFIG. More...
 
modify_agent_data_tmodify_agent_data = &(command_data.modify_agent)
 Parser callback data for MODIFY_AGENT. More...
 
modify_alert_data_tmodify_alert_data = &(command_data.modify_alert)
 Parser callback data for MODIFY_ALERT. More...
 
modify_asset_data_tmodify_asset_data = &(command_data.modify_asset)
 Parser callback data for MODIFY_ASSET. More...
 
modify_auth_data_tmodify_auth_data = &(command_data.modify_auth)
 Parser callback data for MODIFY_AUTH. More...
 
modify_credential_data_tmodify_credential_data = &(command_data.modify_credential)
 Parser callback data for MODIFY_CREDENTIAL. More...
 
modify_filter_data_tmodify_filter_data = &(command_data.modify_filter)
 Parser callback data for MODIFY_FILTER. More...
 
modify_group_data_tmodify_group_data = &(command_data.modify_group)
 Parser callback data for MODIFY_GROUP. More...
 
modify_note_data_tmodify_note_data = (modify_note_data_t*) &(command_data.create_note)
 Parser callback data for MODIFY_NOTE. More...
 
modify_override_data_tmodify_override_data = (modify_override_data_t*) &(command_data.create_override)
 Parser callback data for MODIFY_OVERRIDE. More...
 
modify_permission_data_tmodify_permission_data = &(command_data.modify_permission)
 Parser callback data for MODIFY_PERMISSION. More...
 
modify_port_list_data_tmodify_port_list_data = &(command_data.modify_port_list)
 Parser callback data for MODIFY_PORT_LIST. More...
 
modify_report_data_tmodify_report_data = &(command_data.modify_report)
 Parser callback data for MODIFY_REPORT. More...
 
modify_report_format_data_tmodify_report_format_data = &(command_data.modify_report_format)
 Parser callback data for MODIFY_REPORT_FORMAT. More...
 
modify_role_data_tmodify_role_data = &(command_data.modify_role)
 Parser callback data for MODIFY_ROLE. More...
 
modify_scanner_data_tmodify_scanner_data = &(command_data.modify_scanner)
 Parser callback data for MODIFY_SCANNER. More...
 
modify_schedule_data_tmodify_schedule_data = &(command_data.modify_schedule)
 Parser callback data for MODIFY_SCHEDULE. More...
 
modify_setting_data_tmodify_setting_data = &(command_data.modify_setting)
 Parser callback data for MODIFY_SETTING. More...
 
modify_tag_data_tmodify_tag_data = (modify_tag_data_t*) &(command_data.modify_tag)
 Parser callback data for MODIFY_TAG. More...
 
modify_target_data_tmodify_target_data = &(command_data.modify_target)
 Parser callback data for MODIFY_TARGET. More...
 
modify_task_data_tmodify_task_data = &(command_data.modify_task)
 Parser callback data for MODIFY_TASK. More...
 
modify_user_data_tmodify_user_data = &(command_data.modify_user)
 Parser callback data for MODIFY_USER. More...
 
move_task_data_tmove_task_data = &(command_data.move_task)
 Parser callback data for MOVE_TASK. More...
 
restore_data_trestore_data = (restore_data_t*) &(command_data.restore)
 Parser callback data for RESTORE. More...
 
resume_task_data_tresume_task_data = (resume_task_data_t*) &(command_data.resume_task)
 Parser callback data for RESUME_TASK. More...
 
start_task_data_tstart_task_data = (start_task_data_t*) &(command_data.start_task)
 Parser callback data for START_TASK. More...
 
stop_task_data_tstop_task_data = (stop_task_data_t*) &(command_data.stop_task)
 Parser callback data for STOP_TASK. More...
 
sync_config_data_tsync_config_data = (sync_config_data_t*) &(command_data.delete_target)
 Parser callback data for SYNC_CONFIG. More...
 
test_alert_data_ttest_alert_data = (test_alert_data_t*) &(command_data.test_alert)
 Parser callback data for TEST_ALERT. More...
 
verify_agent_data_tverify_agent_data = (verify_agent_data_t*) &(command_data.verify_agent)
 Parser callback data for VERIFY_AGENT. More...
 
verify_report_format_data_tverify_report_format_data = (verify_report_format_data_t*) &(command_data.verify_report_format)
 Parser callback data for VERIFY_REPORT_FORMAT. More...
 
verify_scanner_data_tverify_scanner_data = (verify_scanner_data_t*) &(command_data.verify_scanner)
 Parser callback data for VERIFY_SCANNER. More...
 
run_wizard_data_trun_wizard_data = (run_wizard_data_t*) &(command_data.wizard)
 Parser callback data for WIZARD. More...
 
int current_error
 Hack for returning forked process status from the callbacks. More...
 
int forked
 Hack for returning fork status to caller. More...
 
char to_client [TO_CLIENT_BUFFER_SIZE]
 Buffer of output to the client. More...
 
buffer_size_t to_client_start = 0
 The start of the data in the to_client buffer. More...
 
buffer_size_t to_client_end = 0
 The end of the data in the to_client buffer. More...
 
char client_address []
 The OMP client's address. 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...
 

Detailed Description

The OpenVAS Manager OMP library.

This file defines an OpenVAS Management Protocol (OMP) library, for implementing OpenVAS managers such as the OpenVAS Manager daemon.

The library provides process_omp_client_input. This function parses a given string of OMP XML and tracks and manipulates tasks in reaction to the OMP commands in the string.

Definition in file omp.c.

Macro Definition Documentation

◆ APPEND

#define APPEND (   state,
  dest 
)
Value:
case state: \
openvas_append_text (dest, text, text_len); \
break;

Append text to a var for a case in omp_xml_hand_text.

Parameters
[in]stateParser state.
[in]destAppend destination.

Definition at line 29678 of file omp.c.

◆ CASE_DELETE

#define CASE_DELETE (   upper,
  type,
  capital 
)

Insert DELETE case for omp_xml_handle_end_element.

Parameters
[in]upperResource type in uppercase.
[in]typeResource type.
[in]capitalResource type capitalised.

Definition at line 13087 of file omp.c.

◆ CLOSE

#define CLOSE (   parent,
  element 
)
Value:
case parent ## _ ## element: \
assert (strcasecmp (G_STRINGIFY (element), element_name) == 0); \
set_client_state (parent); \
break

Insert else clause for omp_xml_handle_start_element.

Parameters
[in]parentParent element.
[in]elementElement.

Definition at line 13008 of file omp.c.

◆ CLOSE_READ_OVER

#define CLOSE_READ_OVER (   parent,
  element 
)
Value:
case parent ## _ ## element: \
assert (strcasecmp (G_STRINGIFY (element), element_name) == 0); \
omp_parser->read_over = 0; \
set_client_state (parent); \
break

Insert else clause for omp_xml_handle_start_element.

Stop the parser from reading over elements at the same time.

Parameters
[in]parentParent element.
[in]elementElement.

Definition at line 13022 of file omp.c.

◆ ELSE_ERROR

#define ELSE_ERROR (   op)
Value:
else if (omp_parser->importing) \
{ \
if (omp_parser->read_over == 0) \
{ \
omp_parser->read_over = 1; \
omp_parser->parent_state = client_state; \
} \
} \
else \
{ \
if (send_element_error_to_client (op, element_name, \
write_to_client, \
write_to_client_data)) \
{ \
error_send_to_client (error); \
return; \
} \
set_client_state (CLIENT_AUTHENTIC); \
g_set_error (error, \
G_MARKUP_ERROR, \
G_MARKUP_ERROR_UNKNOWN_ELEMENT, \
"Error"); \
} \
break

Insert else clause for omp_xml_handle_start_element.

Parameters
[in]opOperation.

Definition at line 6500 of file omp.c.

◆ ELSE_ERROR_CREATE_TASK

#define ELSE_ERROR_CREATE_TASK ( )
Value:
else if (omp_parser->importing) \
{ \
if (omp_parser->read_over == 0) \
{ \
omp_parser->read_over = 1; \
omp_parser->parent_state = client_state; \
} \
} \
else \
{ \
request_delete_task (&create_task_data->task); \
if (send_element_error_to_client ("create_task", element_name, \
write_to_client, \
write_to_client_data)) \
{ \
error_send_to_client (error); \
return; \
} \
set_client_state (CLIENT_AUTHENTIC); \
g_set_error (error, \
G_MARKUP_ERROR, \
G_MARKUP_ERROR_UNKNOWN_ELEMENT, \
"Error"); \
} \
break
task_t task
ID of new task.
Definition: omp.c:1743
create_task_data_t * create_task_data
Parser callback data for CREATE_TASK.
Definition: omp.c:4450

Insert else clause for omp_xml_handle_start_element in create_task.

Definition at line 6530 of file omp.c.

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "md omp"

GLib log domain.

Todo:
For access to scanner_t scanner.

Definition at line 130 of file omp.c.

◆ INIT_GET

#define INIT_GET (   type,
  capital 
)
Value:
count = 0; \
ret = init_get ("get_" G_STRINGIFY (type) "s", \
&get_ ## type ## s_data->get, \
G_STRINGIFY (capital) "s", \
&first); \
if (ret) \
{ \
switch (ret) \
{ \
case 99: \
SEND_TO_CLIENT_OR_FAIL \
(XML_ERROR_SYNTAX ("get_" G_STRINGIFY (type) "s", \
"Permission denied")); \
break; \
default: \
internal_error_send_to_client (error); \
return; \
} \
get_ ## type ## s_data_reset (get_ ## type ## s_data); \
set_client_state (CLIENT_AUTHENTIC); \
return; \
}
#define XML_ERROR_SYNTAX(tag, text)
Expand to XML for a STATUS_ERROR_SYNTAX response.
Definition: omp.c:5754
int init_get(gchar *command, get_data_t *get, const gchar *setting_name, int *first)
Init for a GET handler.
Definition: omp.c:396

Call init_get for a GET end handler.

Parameters
[in]typeResource type.
[in]capitalResource type, capitalised.

Definition at line 13157 of file omp.c.

◆ SEND_XML_SERVICE_DOWN

#define SEND_XML_SERVICE_DOWN (   tag)
Value:
do { \
char *str; \
str = g_strdup_printf ("<%s_response status='%s' " \
"status_text='Scanner loading nvts (%d/%d)'/>", \
else \
str = g_strdup_printf ("<%s_response status='%s' status_text='%s'/>", \
SEND_TO_CLIENT_OR_FAIL(str); \
g_free (str); \
} while (0);
int scanner_total_loading
Scanner total number of plugins to be loaded, when still loading.
Definition: otp.c:426
#define STATUS_SERVICE_DOWN_TEXT
Response code text when a service is down.
Definition: omp.c:697
int scanner_current_loading
Scanner current number of loaded plugins, when still loading.
Definition: otp.c:421
#define STATUS_SERVICE_DOWN
Response code when a service is down.
Definition: omp.c:692

Sends XML for a STATUS_SERVICE_DOWN response.

Parameters
tagName of the command generating the response.

Definition at line 5893 of file omp.c.

◆ STATUS_ERROR_ACCESS

#define STATUS_ERROR_ACCESS   "403"

Response code for forbidden access.

Definition at line 607 of file omp.c.

◆ STATUS_ERROR_ACCESS_TEXT

#define STATUS_ERROR_ACCESS_TEXT   "Access to resource forbidden"

Response code text for forbidden access.

Definition at line 612 of file omp.c.

◆ STATUS_ERROR_AUTH_FAILED

#define STATUS_ERROR_AUTH_FAILED   "400"

Response code when authorisation failed.

Definition at line 637 of file omp.c.

◆ STATUS_ERROR_AUTH_FAILED_TEXT

#define STATUS_ERROR_AUTH_FAILED_TEXT   "Authentication failed"

Response code text when authorisation failed.

Definition at line 642 of file omp.c.

◆ STATUS_ERROR_BUSY

#define STATUS_ERROR_BUSY   "409"

Response code for a busy resource.

Definition at line 627 of file omp.c.

◆ STATUS_ERROR_BUSY_TEXT

#define STATUS_ERROR_BUSY_TEXT   "Resource busy"

Response code text for a busy resource.

Definition at line 632 of file omp.c.

◆ STATUS_ERROR_MISSING

#define STATUS_ERROR_MISSING   "404"

Response code for a missing resource.

Definition at line 617 of file omp.c.

◆ STATUS_ERROR_MISSING_TEXT

#define STATUS_ERROR_MISSING_TEXT   "Resource missing"

Response code text for a missing resource.

Definition at line 622 of file omp.c.

◆ STATUS_ERROR_MUST_AUTH

#define STATUS_ERROR_MUST_AUTH   "401"

Response code when authorisation is required.

Definition at line 597 of file omp.c.

◆ STATUS_ERROR_MUST_AUTH_TEXT

#define STATUS_ERROR_MUST_AUTH_TEXT   "Authenticate first"

Response code when authorisation is required.

Definition at line 602 of file omp.c.

◆ STATUS_ERROR_SYNTAX

#define STATUS_ERROR_SYNTAX   "400"

Response code for a syntax error.

Definition at line 592 of file omp.c.

◆ STATUS_INTERNAL_ERROR

#define STATUS_INTERNAL_ERROR   "500"

Response code for an internal error.

Definition at line 677 of file omp.c.

◆ STATUS_INTERNAL_ERROR_TEXT

#define STATUS_INTERNAL_ERROR_TEXT   "Internal error"

Response code text for an internal error.

Definition at line 682 of file omp.c.

◆ STATUS_OK

#define STATUS_OK   "200"

Response code on success.

Definition at line 647 of file omp.c.

◆ STATUS_OK_CREATED

#define STATUS_OK_CREATED   "201"

Response code on success, when a resource is created.

Definition at line 657 of file omp.c.

◆ STATUS_OK_CREATED_TEXT

#define STATUS_OK_CREATED_TEXT   "OK, resource created"

Response code on success, when a resource is created.

Definition at line 662 of file omp.c.

◆ STATUS_OK_REQUESTED

#define STATUS_OK_REQUESTED   "202"

Response code on success, when the operation will finish later.

Definition at line 667 of file omp.c.

◆ STATUS_OK_REQUESTED_TEXT

#define STATUS_OK_REQUESTED_TEXT   "OK, request submitted"

Response code text on success, when the operation will finish later.

Definition at line 672 of file omp.c.

◆ STATUS_OK_TEXT

#define STATUS_OK_TEXT   "OK"

Response code text on success.

Definition at line 652 of file omp.c.

◆ STATUS_SERVICE_DOWN

#define STATUS_SERVICE_DOWN   "503"

Response code when a service is down.

Definition at line 692 of file omp.c.

◆ STATUS_SERVICE_DOWN_TEXT

#define STATUS_SERVICE_DOWN_TEXT   "Service temporarily down"

Response code text when a service is down.

Definition at line 697 of file omp.c.

◆ STATUS_SERVICE_UNAVAILABLE

#define STATUS_SERVICE_UNAVAILABLE   "503"

Response code when a service is unavailable.

Definition at line 687 of file omp.c.

◆ XML_ERROR_ACCESS

#define XML_ERROR_ACCESS (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_ERROR_ACCESS "\"" \
" status_text=\"" STATUS_ERROR_ACCESS_TEXT "\"/>"
#define STATUS_ERROR_ACCESS
Response code for forbidden access.
Definition: omp.c:607
#define STATUS_ERROR_ACCESS_TEXT
Response code text for forbidden access.
Definition: omp.c:612

Expand to XML for a STATUS_ERROR_ACCESS response.

Parameters
tagName of the command generating the response.

Definition at line 5791 of file omp.c.

◆ XML_ERROR_AUTH_FAILED

#define XML_ERROR_AUTH_FAILED (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_ERROR_AUTH_FAILED "\"" \
" status_text=\"" STATUS_ERROR_AUTH_FAILED_TEXT "\"/>"
#define STATUS_ERROR_AUTH_FAILED_TEXT
Response code text when authorisation failed.
Definition: omp.c:642
#define STATUS_ERROR_AUTH_FAILED
Response code when authorisation failed.
Definition: omp.c:637

Expand to XML for a STATUS_ERROR_AUTH_FAILED response.

Parameters
tagName of the command generating the response.

Definition at line 5822 of file omp.c.

◆ XML_ERROR_BUSY

#define XML_ERROR_BUSY (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_ERROR_BUSY "\"" \
" status_text=\"" STATUS_ERROR_BUSY_TEXT "\"/>"
#define STATUS_ERROR_BUSY
Response code for a busy resource.
Definition: omp.c:627
#define STATUS_ERROR_BUSY_TEXT
Response code text for a busy resource.
Definition: omp.c:632

Expand to XML for a STATUS_ERROR_BUSY response.

Parameters
tagName of the command generating the response.

Definition at line 5832 of file omp.c.

◆ XML_ERROR_MISSING

#define XML_ERROR_MISSING (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_ERROR_MISSING "\"" \
" status_text=\"" STATUS_ERROR_MISSING_TEXT "\"/>"
#define STATUS_ERROR_MISSING_TEXT
Response code text for a missing resource.
Definition: omp.c:622
#define STATUS_ERROR_MISSING
Response code for a missing resource.
Definition: omp.c:617

Expand to XML for a STATUS_ERROR_MISSING response.

Parameters
tagName of the command generating the response.

Definition at line 5812 of file omp.c.

◆ XML_ERROR_SYNTAX

#define XML_ERROR_SYNTAX (   tag,
  text 
)
Value:
"<" tag "_response" \
" status=\"" STATUS_ERROR_SYNTAX "\"" \
" status_text=\"" text "\"/>"
#define STATUS_ERROR_SYNTAX
Response code for a syntax error.
Definition: omp.c:592

Expand to XML for a STATUS_ERROR_SYNTAX response.

Parameters
tagName of the command generating the response.
textText for the status_text attribute of the response.

Definition at line 5754 of file omp.c.

◆ XML_ERROR_UNAVAILABLE

#define XML_ERROR_UNAVAILABLE (   tag,
  text 
)
Value:
"<" tag "_response" \
" status=\"" STATUS_SERVICE_UNAVAILABLE "\"" \
" status_text=\"" text "\"/>"
#define STATUS_SERVICE_UNAVAILABLE
Response code when a service is unavailable.
Definition: omp.c:687

Expand to XML for a STATUS_SERVICE_UNAVAILABLE response.

Parameters
tagName of the command generating the response.
textStatus text.

Definition at line 5802 of file omp.c.

◆ XML_INTERNAL_ERROR

#define XML_INTERNAL_ERROR (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_INTERNAL_ERROR "\"" \
" status_text=\"" STATUS_INTERNAL_ERROR_TEXT "\"/>"
#define STATUS_INTERNAL_ERROR
Response code for an internal error.
Definition: omp.c:677
#define STATUS_INTERNAL_ERROR_TEXT
Response code text for an internal error.
Definition: omp.c:682

Expand to XML for a STATUS_INTERNAL_ERROR response.

Parameters
tagName of the command generating the response.

Definition at line 5883 of file omp.c.

◆ XML_OK

#define XML_OK (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_OK "\"" \
" status_text=\"" STATUS_OK_TEXT "\"/>"
#define STATUS_OK_TEXT
Response code text on success.
Definition: omp.c:652
#define STATUS_OK
Response code on success.
Definition: omp.c:647

Expand to XML for a STATUS_OK response.

Parameters
tagName of the command generating the response.

Definition at line 5842 of file omp.c.

◆ XML_OK_CREATED

#define XML_OK_CREATED (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_OK_CREATED "\"" \
" status_text=\"" STATUS_OK_CREATED_TEXT "\"/>"
#define STATUS_OK_CREATED
Response code on success, when a resource is created.
Definition: omp.c:657
#define STATUS_OK_CREATED_TEXT
Response code on success, when a resource is created.
Definition: omp.c:662

Expand to XML for a STATUS_OK_CREATED response.

Parameters
tagName of the command generating the response.

Definition at line 5852 of file omp.c.

◆ XML_OK_CREATED_ID

#define XML_OK_CREATED_ID (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_OK_CREATED "\"" \
" status_text=\"" STATUS_OK_CREATED_TEXT "\"" \
" id=\"%s\"/>"
#define STATUS_OK_CREATED
Response code on success, when a resource is created.
Definition: omp.c:657
#define STATUS_OK_CREATED_TEXT
Response code on success, when a resource is created.
Definition: omp.c:662

Expand to XML for a STATUS_OK_CREATED response with s for ID.

Parameters
tagName of the command generating the response.

Definition at line 5862 of file omp.c.

◆ XML_OK_REQUESTED

#define XML_OK_REQUESTED (   tag)
Value:
"<" tag "_response" \
" status=\"" STATUS_OK_REQUESTED "\"" \
" status_text=\"" STATUS_OK_REQUESTED_TEXT "\"/>"
#define STATUS_OK_REQUESTED
Response code on success, when the operation will finish later.
Definition: omp.c:667
#define STATUS_OK_REQUESTED_TEXT
Response code text on success, when the operation will finish later.
Definition: omp.c:672

Expand to XML for a STATUS_OK_REQUESTED response.

Parameters
tagName of the command generating the response.

Definition at line 5873 of file omp.c.

Typedef Documentation

◆ create_port_list_range_t

Port range type.

Definition at line 1270 of file omp.c.

Enumeration Type Documentation

◆ client_state_t

Possible states of the client.

Enumerator
CLIENT_TOP 
CLIENT_AUTHENTIC 
CLIENT_AUTHENTICATE 
CLIENT_AUTHENTICATE_CREDENTIALS 
CLIENT_AUTHENTICATE_CREDENTIALS_PASSWORD 
CLIENT_AUTHENTICATE_CREDENTIALS_USERNAME 
CLIENT_AUTHENTIC_COMMANDS 
CLIENT_COMMANDS 
CLIENT_CREATE_AGENT 
CLIENT_CREATE_AGENT_COMMENT 
CLIENT_CREATE_AGENT_COPY 
CLIENT_CREATE_AGENT_HOWTO_INSTALL 
CLIENT_CREATE_AGENT_HOWTO_USE 
CLIENT_CREATE_AGENT_INSTALLER 
CLIENT_CREATE_AGENT_INSTALLER_FILENAME 
CLIENT_CREATE_AGENT_INSTALLER_SIGNATURE 
CLIENT_CREATE_AGENT_NAME 
CLIENT_CREATE_ALERT 
CLIENT_CREATE_ALERT_COMMENT 
CLIENT_CREATE_ALERT_CONDITION 
CLIENT_CREATE_ALERT_CONDITION_DATA 
CLIENT_CREATE_ALERT_CONDITION_DATA_NAME 
CLIENT_CREATE_ALERT_COPY 
CLIENT_CREATE_ALERT_EVENT 
CLIENT_CREATE_ALERT_EVENT_DATA 
CLIENT_CREATE_ALERT_EVENT_DATA_NAME 
CLIENT_CREATE_ALERT_FILTER 
CLIENT_CREATE_ALERT_METHOD 
CLIENT_CREATE_ALERT_METHOD_DATA 
CLIENT_CREATE_ALERT_METHOD_DATA_NAME 
CLIENT_CREATE_ALERT_NAME 
CLIENT_CREATE_ASSET 
CLIENT_CREATE_ASSET_REPORT 
CLIENT_CREATE_ASSET_REPORT_FILTER 
CLIENT_CREATE_ASSET_REPORT_FILTER_TERM 
CLIENT_CREATE_ASSET_ASSET 
CLIENT_CREATE_ASSET_ASSET_COMMENT 
CLIENT_CREATE_ASSET_ASSET_NAME 
CLIENT_CREATE_ASSET_ASSET_TYPE 
CLIENT_CREATE_CREDENTIAL 
CLIENT_CREATE_CREDENTIAL_ALLOW_INSECURE 
CLIENT_CREATE_CREDENTIAL_AUTH_ALGORITHM 
CLIENT_CREATE_CREDENTIAL_CERTIFICATE 
CLIENT_CREATE_CREDENTIAL_COMMENT 
CLIENT_CREATE_CREDENTIAL_COMMUNITY 
CLIENT_CREATE_CREDENTIAL_COPY 
CLIENT_CREATE_CREDENTIAL_KEY 
CLIENT_CREATE_CREDENTIAL_KEY_PHRASE 
CLIENT_CREATE_CREDENTIAL_KEY_PRIVATE 
CLIENT_CREATE_CREDENTIAL_LOGIN 
CLIENT_CREATE_CREDENTIAL_NAME 
CLIENT_CREATE_CREDENTIAL_PASSWORD 
CLIENT_CREATE_CREDENTIAL_PRIVACY 
CLIENT_CREATE_CREDENTIAL_PRIVACY_ALGORITHM 
CLIENT_CREATE_CREDENTIAL_PRIVACY_PASSWORD 
CLIENT_CREATE_CREDENTIAL_TYPE 
CLIENT_CREATE_CONFIG 
CLIENT_CREATE_CONFIG_COMMENT 
CLIENT_CREATE_CONFIG_COPY 
CLIENT_CREATE_CONFIG_SCANNER 
CLIENT_CREATE_CONFIG_NAME 
CLIENT_C_C_GCR 
CLIENT_C_C_GCR_CONFIG 
CLIENT_C_C_GCR_CONFIG_COMMENT 
CLIENT_C_C_GCR_CONFIG_NAME 
CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS 
CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR 
CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_FAMILY_OR_NVT 
CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_INCLUDE 
CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_NAME 
CLIENT_C_C_GCR_CONFIG_NVT_SELECTORS_NVT_SELECTOR_TYPE 
CLIENT_C_C_GCR_CONFIG_PREFERENCES 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_ALT 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_DEFAULT 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_HR_NAME 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_NAME 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_NVT 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_NVT_NAME 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_TYPE 
CLIENT_C_C_GCR_CONFIG_PREFERENCES_PREFERENCE_VALUE 
CLIENT_C_C_GCR_CONFIG_TYPE 
CLIENT_CREATE_FILTER 
CLIENT_CREATE_FILTER_COMMENT 
CLIENT_CREATE_FILTER_COPY 
CLIENT_CREATE_FILTER_NAME 
CLIENT_CREATE_FILTER_NAME_MAKE_UNIQUE 
CLIENT_CREATE_FILTER_TERM 
CLIENT_CREATE_FILTER_TYPE 
CLIENT_CREATE_GROUP 
CLIENT_CREATE_GROUP_COMMENT 
CLIENT_CREATE_GROUP_COPY 
CLIENT_CREATE_GROUP_NAME 
CLIENT_CREATE_GROUP_USERS 
CLIENT_CREATE_GROUP_SPECIALS 
CLIENT_CREATE_GROUP_SPECIALS_FULL 
CLIENT_CREATE_NOTE 
CLIENT_CREATE_NOTE_ACTIVE 
CLIENT_CREATE_NOTE_COPY 
CLIENT_CREATE_NOTE_HOSTS 
CLIENT_CREATE_NOTE_NVT 
CLIENT_CREATE_NOTE_PORT 
CLIENT_CREATE_NOTE_RESULT 
CLIENT_CREATE_NOTE_SEVERITY 
CLIENT_CREATE_NOTE_TASK 
CLIENT_CREATE_NOTE_TEXT 
CLIENT_CREATE_NOTE_THREAT 
CLIENT_CREATE_OVERRIDE 
CLIENT_CREATE_OVERRIDE_ACTIVE 
CLIENT_CREATE_OVERRIDE_COPY 
CLIENT_CREATE_OVERRIDE_HOSTS 
CLIENT_CREATE_OVERRIDE_NEW_SEVERITY 
CLIENT_CREATE_OVERRIDE_NEW_THREAT 
CLIENT_CREATE_OVERRIDE_NVT 
CLIENT_CREATE_OVERRIDE_PORT 
CLIENT_CREATE_OVERRIDE_RESULT 
CLIENT_CREATE_OVERRIDE_SEVERITY 
CLIENT_CREATE_OVERRIDE_TASK 
CLIENT_CREATE_OVERRIDE_TEXT 
CLIENT_CREATE_OVERRIDE_THREAT 
CLIENT_CREATE_PERMISSION 
CLIENT_CREATE_PERMISSION_COMMENT 
CLIENT_CREATE_PERMISSION_COPY 
CLIENT_CREATE_PERMISSION_NAME 
CLIENT_CREATE_PERMISSION_RESOURCE 
CLIENT_CREATE_PERMISSION_RESOURCE_TYPE 
CLIENT_CREATE_PERMISSION_SUBJECT 
CLIENT_CREATE_PERMISSION_SUBJECT_TYPE 
CLIENT_CREATE_PORT_LIST 
CLIENT_CREATE_PORT_LIST_COMMENT 
CLIENT_CREATE_PORT_LIST_COPY 
CLIENT_CREATE_PORT_LIST_NAME 
CLIENT_CREATE_PORT_LIST_PORT_RANGE 
CLIENT_CPL_GPLR 
CLIENT_CPL_GPLR_PORT_LIST 
CLIENT_CPL_GPLR_PORT_LIST_COMMENT 
CLIENT_CPL_GPLR_PORT_LIST_IN_USE 
CLIENT_CPL_GPLR_PORT_LIST_NAME 
CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGE 
CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES 
CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE 
CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_COMMENT 
CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_END 
CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_START 
CLIENT_CPL_GPLR_PORT_LIST_PORT_RANGES_PORT_RANGE_TYPE 
CLIENT_CPL_GPLR_PORT_LIST_TARGETS 
CLIENT_CREATE_PORT_RANGE 
CLIENT_CREATE_PORT_RANGE_COMMENT 
CLIENT_CREATE_PORT_RANGE_END 
CLIENT_CREATE_PORT_RANGE_PORT_LIST 
CLIENT_CREATE_PORT_RANGE_START 
CLIENT_CREATE_PORT_RANGE_TYPE 
CLIENT_CREATE_REPORT_FORMAT 
CLIENT_CREATE_REPORT_FORMAT_COPY 
CLIENT_CRF_GRFR 
CLIENT_CRF_GRFR_REPORT_FORMAT 
CLIENT_CRF_GRFR_REPORT_FORMAT_CONTENT_TYPE 
CLIENT_CRF_GRFR_REPORT_FORMAT_DESCRIPTION 
CLIENT_CRF_GRFR_REPORT_FORMAT_EXTENSION 
CLIENT_CRF_GRFR_REPORT_FORMAT_FILE 
CLIENT_CRF_GRFR_REPORT_FORMAT_GLOBAL 
CLIENT_CRF_GRFR_REPORT_FORMAT_NAME 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_DEFAULT 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_DEFAULT_REPORT_FORMAT 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_NAME 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_OPTIONS 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_OPTIONS_OPTION 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_TYPE 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_TYPE_MAX 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_TYPE_MIN 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_VALUE 
CLIENT_CRF_GRFR_REPORT_FORMAT_PARAM_VALUE_REPORT_FORMAT 
CLIENT_CRF_GRFR_REPORT_FORMAT_PREDEFINED 
CLIENT_CRF_GRFR_REPORT_FORMAT_SIGNATURE 
CLIENT_CRF_GRFR_REPORT_FORMAT_SUMMARY 
CLIENT_CRF_GRFR_REPORT_FORMAT_TRUST 
CLIENT_CREATE_REPORT 
CLIENT_CREATE_REPORT_IN_ASSETS 
CLIENT_CREATE_REPORT_REPORT 
CLIENT_CREATE_REPORT_RR 
CLIENT_CREATE_REPORT_RR_FILTERS 
CLIENT_CREATE_REPORT_RR_H 
CLIENT_CREATE_REPORT_RR_HOSTS 
CLIENT_CREATE_REPORT_RR_HOST_COUNT 
CLIENT_CREATE_REPORT_RR_HOST_END 
CLIENT_CREATE_REPORT_RR_HOST_END_HOST 
CLIENT_CREATE_REPORT_RR_HOST_START 
CLIENT_CREATE_REPORT_RR_HOST_START_HOST 
CLIENT_CREATE_REPORT_RR_H_DETAIL 
CLIENT_CREATE_REPORT_RR_H_DETAIL_NAME 
CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE 
CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE_DESC 
CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE_NAME 
CLIENT_CREATE_REPORT_RR_H_DETAIL_SOURCE_TYPE 
CLIENT_CREATE_REPORT_RR_H_DETAIL_VALUE 
CLIENT_CREATE_REPORT_RR_H_END 
CLIENT_CREATE_REPORT_RR_H_IP 
CLIENT_CREATE_REPORT_RR_H_START 
CLIENT_CREATE_REPORT_RR_PORTS 
CLIENT_CREATE_REPORT_RR_REPORT_FORMAT 
CLIENT_CREATE_REPORT_RR_RESULTS 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_COMMENT 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_CREATION_TIME 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DESCRIPTION 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_DETECTION 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_HOST 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_MODIFICATION_TIME 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NAME 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NOTES 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_BID 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CERT 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CERT_CERT_REF 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CVE 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_CVSS_BASE 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_FAMILY 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_NAME 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_NVT_XREF 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_OWNER 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_ORIGINAL_SEVERITY 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_ORIGINAL_THREAT 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_OVERRIDES 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_PORT 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_TYPE 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_QOD_VALUE 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_SCAN_NVT_VERSION 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_SEVERITY 
CLIENT_CREATE_REPORT_RR_RESULTS_RESULT_THREAT 
CLIENT_CREATE_REPORT_RR_RESULT_COUNT 
CLIENT_CREATE_REPORT_RR_SCAN_END 
CLIENT_CREATE_REPORT_RR_SCAN_RUN_STATUS 
CLIENT_CREATE_REPORT_RR_SCAN_START 
CLIENT_CREATE_REPORT_RR_SORT 
CLIENT_CREATE_REPORT_RR_TASK 
CLIENT_CREATE_REPORT_TASK 
CLIENT_CREATE_REPORT_TASK_COMMENT 
CLIENT_CREATE_REPORT_TASK_NAME 
CLIENT_CREATE_ROLE 
CLIENT_CREATE_ROLE_COMMENT 
CLIENT_CREATE_ROLE_COPY 
CLIENT_CREATE_ROLE_NAME 
CLIENT_CREATE_ROLE_USERS 
CLIENT_CREATE_SCANNER 
CLIENT_CREATE_SCANNER_COMMENT 
CLIENT_CREATE_SCANNER_COPY 
CLIENT_CREATE_SCANNER_NAME 
CLIENT_CREATE_SCANNER_HOST 
CLIENT_CREATE_SCANNER_PORT 
CLIENT_CREATE_SCANNER_TYPE 
CLIENT_CREATE_SCANNER_CA_PUB 
CLIENT_CREATE_SCANNER_CREDENTIAL 
CLIENT_CREATE_SCHEDULE 
CLIENT_CREATE_SCHEDULE_COMMENT 
CLIENT_CREATE_SCHEDULE_COPY 
CLIENT_CREATE_SCHEDULE_DURATION 
CLIENT_CREATE_SCHEDULE_DURATION_UNIT 
CLIENT_CREATE_SCHEDULE_FIRST_TIME 
CLIENT_CREATE_SCHEDULE_FIRST_TIME_DAY_OF_MONTH 
CLIENT_CREATE_SCHEDULE_FIRST_TIME_HOUR 
CLIENT_CREATE_SCHEDULE_FIRST_TIME_MINUTE 
CLIENT_CREATE_SCHEDULE_FIRST_TIME_MONTH 
CLIENT_CREATE_SCHEDULE_FIRST_TIME_YEAR 
CLIENT_CREATE_SCHEDULE_NAME 
CLIENT_CREATE_SCHEDULE_PERIOD 
CLIENT_CREATE_SCHEDULE_PERIOD_UNIT 
CLIENT_CREATE_SCHEDULE_TIMEZONE 
CLIENT_CREATE_TAG 
CLIENT_CREATE_TAG_ACTIVE 
CLIENT_CREATE_TAG_COMMENT 
CLIENT_CREATE_TAG_COPY 
CLIENT_CREATE_TAG_NAME 
CLIENT_CREATE_TAG_RESOURCE 
CLIENT_CREATE_TAG_RESOURCE_TYPE 
CLIENT_CREATE_TAG_VALUE 
CLIENT_CREATE_TARGET 
CLIENT_CREATE_TARGET_ALIVE_TESTS 
CLIENT_CREATE_TARGET_ASSET_HOSTS 
CLIENT_CREATE_TARGET_EXCLUDE_HOSTS 
CLIENT_CREATE_TARGET_REVERSE_LOOKUP_ONLY 
CLIENT_CREATE_TARGET_REVERSE_LOOKUP_UNIFY 
CLIENT_CREATE_TARGET_COMMENT 
CLIENT_CREATE_TARGET_COPY 
CLIENT_CREATE_TARGET_ESXI_CREDENTIAL 
CLIENT_CREATE_TARGET_ESXI_LSC_CREDENTIAL 
CLIENT_CREATE_TARGET_HOSTS 
CLIENT_CREATE_TARGET_NAME 
CLIENT_CREATE_TARGET_NAME_MAKE_UNIQUE 
CLIENT_CREATE_TARGET_PORT_LIST 
CLIENT_CREATE_TARGET_PORT_RANGE 
CLIENT_CREATE_TARGET_SMB_CREDENTIAL 
CLIENT_CREATE_TARGET_SNMP_CREDENTIAL 
CLIENT_CREATE_TARGET_SSH_CREDENTIAL 
CLIENT_CREATE_TARGET_SSH_CREDENTIAL_PORT 
CLIENT_CREATE_TARGET_SMB_LSC_CREDENTIAL 
CLIENT_CREATE_TARGET_SSH_LSC_CREDENTIAL 
CLIENT_CREATE_TARGET_SSH_LSC_CREDENTIAL_PORT 
CLIENT_CREATE_TASK 
CLIENT_CREATE_TASK_ALERT 
CLIENT_CREATE_TASK_ALTERABLE 
CLIENT_CREATE_TASK_COMMENT 
CLIENT_CREATE_TASK_CONFIG 
CLIENT_CREATE_TASK_COPY 
CLIENT_CREATE_TASK_HOSTS_ORDERING 
CLIENT_CREATE_TASK_NAME 
CLIENT_CREATE_TASK_OBSERVERS 
CLIENT_CREATE_TASK_OBSERVERS_GROUP 
CLIENT_CREATE_TASK_PREFERENCES 
CLIENT_CREATE_TASK_PREFERENCES_PREFERENCE 
CLIENT_CREATE_TASK_PREFERENCES_PREFERENCE_NAME 
CLIENT_CREATE_TASK_PREFERENCES_PREFERENCE_VALUE 
CLIENT_CREATE_TASK_SCANNER 
CLIENT_CREATE_TASK_SCHEDULE 
CLIENT_CREATE_TASK_SCHEDULE_PERIODS 
CLIENT_CREATE_TASK_TARGET 
CLIENT_CREATE_USER 
CLIENT_CREATE_USER_COPY 
CLIENT_CREATE_USER_GROUPS 
CLIENT_CREATE_USER_GROUPS_GROUP 
CLIENT_CREATE_USER_HOSTS 
CLIENT_CREATE_USER_IFACES 
CLIENT_CREATE_USER_NAME 
CLIENT_CREATE_USER_PASSWORD 
CLIENT_CREATE_USER_ROLE 
CLIENT_CREATE_USER_SOURCES 
CLIENT_CREATE_USER_SOURCES_SOURCE 
CLIENT_DELETE_AGENT 
CLIENT_DELETE_ALERT 
CLIENT_DELETE_ASSET 
CLIENT_DELETE_CONFIG 
CLIENT_DELETE_CREDENTIAL 
CLIENT_DELETE_FILTER 
CLIENT_DELETE_GROUP 
CLIENT_DELETE_NOTE 
CLIENT_DELETE_OVERRIDE 
CLIENT_DELETE_PERMISSION 
CLIENT_DELETE_PORT_LIST 
CLIENT_DELETE_PORT_RANGE 
CLIENT_DELETE_REPORT 
CLIENT_DELETE_REPORT_FORMAT 
CLIENT_DELETE_ROLE 
CLIENT_DELETE_SCANNER 
CLIENT_DELETE_SCHEDULE 
CLIENT_DELETE_TAG 
CLIENT_DELETE_TARGET 
CLIENT_DELETE_TASK 
CLIENT_DELETE_USER 
CLIENT_DESCRIBE_AUTH 
CLIENT_EMPTY_TRASHCAN 
CLIENT_GET_AGENTS 
CLIENT_GET_AGGREGATES 
CLIENT_GET_AGGREGATES_DATA_COLUMN 
CLIENT_GET_AGGREGATES_SORT 
CLIENT_GET_AGGREGATES_TEXT_COLUMN 
CLIENT_GET_ALERTS 
CLIENT_GET_ASSETS 
CLIENT_GET_CONFIGS 
CLIENT_GET_CREDENTIALS 
CLIENT_GET_FEEDS 
CLIENT_GET_FILTERS 
CLIENT_GET_GROUPS 
CLIENT_GET_INFO 
CLIENT_GET_NOTES 
CLIENT_GET_NVTS 
CLIENT_GET_NVT_FAMILIES 
CLIENT_GET_OVERRIDES 
CLIENT_GET_PERMISSIONS 
CLIENT_GET_PORT_LISTS 
CLIENT_GET_PREFERENCES 
CLIENT_GET_REPORTS 
CLIENT_GET_REPORT_FORMATS 
CLIENT_GET_RESULTS 
CLIENT_GET_ROLES 
CLIENT_GET_SCANNERS 
CLIENT_GET_SCHEDULES 
CLIENT_GET_SETTINGS 
CLIENT_GET_SYSTEM_REPORTS 
CLIENT_GET_TAGS 
CLIENT_GET_TARGETS 
CLIENT_GET_TASKS 
CLIENT_GET_USERS 
CLIENT_GET_VERSION 
CLIENT_GET_VERSION_AUTHENTIC 
CLIENT_HELP 
CLIENT_MODIFY_AGENT 
CLIENT_MODIFY_AGENT_COMMENT 
CLIENT_MODIFY_AGENT_NAME 
CLIENT_MODIFY_ALERT 
CLIENT_MODIFY_ALERT_COMMENT 
CLIENT_MODIFY_ALERT_CONDITION 
CLIENT_MODIFY_ALERT_CONDITION_DATA 
CLIENT_MODIFY_ALERT_CONDITION_DATA_NAME 
CLIENT_MODIFY_ALERT_EVENT 
CLIENT_MODIFY_ALERT_EVENT_DATA 
CLIENT_MODIFY_ALERT_EVENT_DATA_NAME 
CLIENT_MODIFY_ALERT_FILTER 
CLIENT_MODIFY_ALERT_METHOD 
CLIENT_MODIFY_ALERT_METHOD_DATA 
CLIENT_MODIFY_ALERT_METHOD_DATA_NAME 
CLIENT_MODIFY_ALERT_NAME 
CLIENT_MODIFY_ASSET 
CLIENT_MODIFY_ASSET_COMMENT 
CLIENT_MODIFY_AUTH 
CLIENT_MODIFY_AUTH_GROUP 
CLIENT_MODIFY_AUTH_GROUP_AUTH_CONF_SETTING 
CLIENT_MODIFY_AUTH_GROUP_AUTH_CONF_SETTING_KEY 
CLIENT_MODIFY_AUTH_GROUP_AUTH_CONF_SETTING_VALUE 
CLIENT_MODIFY_CONFIG 
CLIENT_MODIFY_CONFIG_COMMENT 
CLIENT_MODIFY_CONFIG_FAMILY_SELECTION 
CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY 
CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY_ALL 
CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY_GROWING 
CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_FAMILY_NAME 
CLIENT_MODIFY_CONFIG_FAMILY_SELECTION_GROWING 
CLIENT_MODIFY_CONFIG_NAME 
CLIENT_MODIFY_CONFIG_SCANNER 
CLIENT_MODIFY_CONFIG_NVT_SELECTION 
CLIENT_MODIFY_CONFIG_NVT_SELECTION_FAMILY 
CLIENT_MODIFY_CONFIG_NVT_SELECTION_NVT 
CLIENT_MODIFY_CONFIG_PREFERENCE 
CLIENT_MODIFY_CONFIG_PREFERENCE_NAME 
CLIENT_MODIFY_CONFIG_PREFERENCE_NVT 
CLIENT_MODIFY_CONFIG_PREFERENCE_VALUE 
CLIENT_MODIFY_CREDENTIAL 
CLIENT_MODIFY_CREDENTIAL_ALLOW_INSECURE 
CLIENT_MODIFY_CREDENTIAL_AUTH_ALGORITHM 
CLIENT_MODIFY_CREDENTIAL_CERTIFICATE 
CLIENT_MODIFY_CREDENTIAL_COMMENT 
CLIENT_MODIFY_CREDENTIAL_COMMUNITY 
CLIENT_MODIFY_CREDENTIAL_KEY 
CLIENT_MODIFY_CREDENTIAL_KEY_PHRASE 
CLIENT_MODIFY_CREDENTIAL_KEY_PRIVATE 
CLIENT_MODIFY_CREDENTIAL_LOGIN 
CLIENT_MODIFY_CREDENTIAL_NAME 
CLIENT_MODIFY_CREDENTIAL_PASSWORD 
CLIENT_MODIFY_CREDENTIAL_PRIVACY 
CLIENT_MODIFY_CREDENTIAL_PRIVACY_ALGORITHM 
CLIENT_MODIFY_CREDENTIAL_PRIVACY_PASSWORD 
CLIENT_MODIFY_FILTER 
CLIENT_MODIFY_FILTER_COMMENT 
CLIENT_MODIFY_FILTER_NAME 
CLIENT_MODIFY_FILTER_TERM 
CLIENT_MODIFY_FILTER_TYPE 
CLIENT_MODIFY_GROUP 
CLIENT_MODIFY_GROUP_COMMENT 
CLIENT_MODIFY_GROUP_NAME 
CLIENT_MODIFY_GROUP_USERS 
CLIENT_MODIFY_NOTE 
CLIENT_MODIFY_NOTE_ACTIVE 
CLIENT_MODIFY_NOTE_HOSTS 
CLIENT_MODIFY_NOTE_PORT 
CLIENT_MODIFY_NOTE_RESULT 
CLIENT_MODIFY_NOTE_SEVERITY 
CLIENT_MODIFY_NOTE_TASK 
CLIENT_MODIFY_NOTE_TEXT 
CLIENT_MODIFY_NOTE_THREAT 
CLIENT_MODIFY_OVERRIDE 
CLIENT_MODIFY_OVERRIDE_ACTIVE 
CLIENT_MODIFY_OVERRIDE_HOSTS 
CLIENT_MODIFY_OVERRIDE_NEW_SEVERITY 
CLIENT_MODIFY_OVERRIDE_NEW_THREAT 
CLIENT_MODIFY_OVERRIDE_PORT 
CLIENT_MODIFY_OVERRIDE_RESULT 
CLIENT_MODIFY_OVERRIDE_SEVERITY 
CLIENT_MODIFY_OVERRIDE_TASK 
CLIENT_MODIFY_OVERRIDE_TEXT 
CLIENT_MODIFY_OVERRIDE_THREAT 
CLIENT_MODIFY_PERMISSION 
CLIENT_MODIFY_PERMISSION_COMMENT 
CLIENT_MODIFY_PERMISSION_NAME 
CLIENT_MODIFY_PERMISSION_RESOURCE 
CLIENT_MODIFY_PERMISSION_RESOURCE_TYPE 
CLIENT_MODIFY_PERMISSION_SUBJECT 
CLIENT_MODIFY_PERMISSION_SUBJECT_TYPE 
CLIENT_MODIFY_PORT_LIST 
CLIENT_MODIFY_PORT_LIST_COMMENT 
CLIENT_MODIFY_PORT_LIST_NAME 
CLIENT_MODIFY_REPORT 
CLIENT_MODIFY_REPORT_COMMENT 
CLIENT_MODIFY_REPORT_FORMAT 
CLIENT_MODIFY_REPORT_FORMAT_ACTIVE 
CLIENT_MODIFY_REPORT_FORMAT_NAME 
CLIENT_MODIFY_REPORT_FORMAT_PARAM 
CLIENT_MODIFY_REPORT_FORMAT_PARAM_NAME 
CLIENT_MODIFY_REPORT_FORMAT_PARAM_VALUE 
CLIENT_MODIFY_REPORT_FORMAT_SUMMARY 
CLIENT_MODIFY_ROLE 
CLIENT_MODIFY_ROLE_COMMENT 
CLIENT_MODIFY_ROLE_NAME 
CLIENT_MODIFY_ROLE_USERS 
CLIENT_MODIFY_SCANNER 
CLIENT_MODIFY_SCANNER_COMMENT 
CLIENT_MODIFY_SCANNER_NAME 
CLIENT_MODIFY_SCANNER_HOST 
CLIENT_MODIFY_SCANNER_PORT 
CLIENT_MODIFY_SCANNER_TYPE 
CLIENT_MODIFY_SCANNER_CA_PUB 
CLIENT_MODIFY_SCANNER_CREDENTIAL 
CLIENT_MODIFY_SCHEDULE 
CLIENT_MODIFY_SCHEDULE_COMMENT 
CLIENT_MODIFY_SCHEDULE_DURATION 
CLIENT_MODIFY_SCHEDULE_DURATION_UNIT 
CLIENT_MODIFY_SCHEDULE_FIRST_TIME 
CLIENT_MODIFY_SCHEDULE_FIRST_TIME_DAY_OF_MONTH 
CLIENT_MODIFY_SCHEDULE_FIRST_TIME_HOUR 
CLIENT_MODIFY_SCHEDULE_FIRST_TIME_MINUTE 
CLIENT_MODIFY_SCHEDULE_FIRST_TIME_MONTH 
CLIENT_MODIFY_SCHEDULE_FIRST_TIME_YEAR 
CLIENT_MODIFY_SCHEDULE_NAME 
CLIENT_MODIFY_SCHEDULE_PERIOD 
CLIENT_MODIFY_SCHEDULE_PERIOD_UNIT 
CLIENT_MODIFY_SCHEDULE_TIMEZONE 
CLIENT_MODIFY_SETTING 
CLIENT_MODIFY_SETTING_NAME 
CLIENT_MODIFY_SETTING_VALUE 
CLIENT_MODIFY_TAG 
CLIENT_MODIFY_TAG_ACTIVE 
CLIENT_MODIFY_TAG_COMMENT 
CLIENT_MODIFY_TAG_NAME 
CLIENT_MODIFY_TAG_RESOURCE 
CLIENT_MODIFY_TAG_RESOURCE_TYPE 
CLIENT_MODIFY_TAG_VALUE 
CLIENT_MODIFY_TARGET 
CLIENT_MODIFY_TARGET_ALIVE_TESTS 
CLIENT_MODIFY_TARGET_COMMENT 
CLIENT_MODIFY_TARGET_ESXI_CREDENTIAL 
CLIENT_MODIFY_TARGET_ESXI_LSC_CREDENTIAL 
CLIENT_MODIFY_TARGET_HOSTS 
CLIENT_MODIFY_TARGET_EXCLUDE_HOSTS 
CLIENT_MODIFY_TARGET_REVERSE_LOOKUP_ONLY 
CLIENT_MODIFY_TARGET_REVERSE_LOOKUP_UNIFY 
CLIENT_MODIFY_TARGET_NAME 
CLIENT_MODIFY_TARGET_PORT_LIST 
CLIENT_MODIFY_TARGET_SMB_CREDENTIAL 
CLIENT_MODIFY_TARGET_SNMP_CREDENTIAL 
CLIENT_MODIFY_TARGET_SSH_CREDENTIAL 
CLIENT_MODIFY_TARGET_SSH_CREDENTIAL_PORT 
CLIENT_MODIFY_TARGET_SMB_LSC_CREDENTIAL 
CLIENT_MODIFY_TARGET_SSH_LSC_CREDENTIAL 
CLIENT_MODIFY_TARGET_SSH_LSC_CREDENTIAL_PORT 
CLIENT_MODIFY_TASK 
CLIENT_MODIFY_TASK_ALERT 
CLIENT_MODIFY_TASK_ALTERABLE 
CLIENT_MODIFY_TASK_COMMENT 
CLIENT_MODIFY_TASK_CONFIG 
CLIENT_MODIFY_TASK_FILE 
CLIENT_MODIFY_TASK_NAME 
CLIENT_MODIFY_TASK_OBSERVERS 
CLIENT_MODIFY_TASK_OBSERVERS_GROUP 
CLIENT_MODIFY_TASK_PREFERENCES 
CLIENT_MODIFY_TASK_PREFERENCES_PREFERENCE 
CLIENT_MODIFY_TASK_PREFERENCES_PREFERENCE_NAME 
CLIENT_MODIFY_TASK_PREFERENCES_PREFERENCE_VALUE 
CLIENT_MODIFY_TASK_SCHEDULE 
CLIENT_MODIFY_TASK_SCHEDULE_PERIODS 
CLIENT_MODIFY_TASK_TARGET 
CLIENT_MODIFY_TASK_HOSTS_ORDERING 
CLIENT_MODIFY_TASK_SCANNER 
CLIENT_MODIFY_USER 
CLIENT_MODIFY_USER_GROUPS 
CLIENT_MODIFY_USER_GROUPS_GROUP 
CLIENT_MODIFY_USER_HOSTS 
CLIENT_MODIFY_USER_IFACES 
CLIENT_MODIFY_USER_NAME 
CLIENT_MODIFY_USER_NEW_NAME 
CLIENT_MODIFY_USER_PASSWORD 
CLIENT_MODIFY_USER_ROLE 
CLIENT_MODIFY_USER_SOURCES 
CLIENT_MODIFY_USER_SOURCES_SOURCE 
CLIENT_MOVE_TASK 
CLIENT_RESTORE 
CLIENT_RESUME_TASK 
CLIENT_RUN_WIZARD 
CLIENT_RUN_WIZARD_MODE 
CLIENT_RUN_WIZARD_NAME 
CLIENT_RUN_WIZARD_PARAMS 
CLIENT_RUN_WIZARD_PARAMS_PARAM 
CLIENT_RUN_WIZARD_PARAMS_PARAM_NAME 
CLIENT_RUN_WIZARD_PARAMS_PARAM_VALUE 
CLIENT_START_TASK 
CLIENT_STOP_TASK 
CLIENT_SYNC_CERT 
CLIENT_SYNC_CONFIG 
CLIENT_SYNC_FEED 
CLIENT_SYNC_SCAP 
CLIENT_TEST_ALERT 
CLIENT_VERIFY_AGENT 
CLIENT_VERIFY_REPORT_FORMAT 
CLIENT_VERIFY_SCANNER 

Definition at line 5022 of file omp.c.

5023 {
5024  CLIENT_TOP,
5026 
5086  /* get_configs_response (GCR) is used for config export. CLIENT_C_C is
5087  * for CLIENT_CREATE_CONFIG. */
5160  /* get_port_lists (GPL) is used for port lists export. CLIENT_CPL is
5161  * for CLIENT_CREATE_PORT_LIST. */
5181  /* CREATE_REPORT_FORMAT. */
5190  /* This is here to support importing of older report formats. */
5208  /* CREATE_REPORT. */
5214  /* RR_H is for RR_HOST because it clashes with entities like HOST_START. */
5418  CLIENT_HELP,
5625 } client_state_t;
client_state_t
Possible states of the client.
Definition: omp.c:5022

Function Documentation

◆ append_attribute()

int append_attribute ( const gchar **  attribute_names,
const gchar **  attribute_values,
const char *  attribute_name,
gchar **  string 
)

Find an attribute in a parser callback list of attributes and append.

it to a string using openvas_append_string.

Parameters
[in]attribute_namesList of names.
[in]attribute_valuesList of values.
[in]attribute_nameName of sought attribute.
[out]stringString to append attribute value to, if found.
Returns
1 if found and appended, else 0.

Definition at line 361 of file omp.c.

References find_attribute().

365 {
366  const gchar* attribute;
367  if (find_attribute (attribute_names, attribute_values, attribute_name,
368  &attribute))
369  {
370  openvas_append_string (string, attribute);
371  return 1;
372  }
373  return 0;
374 }
int find_attribute(const gchar **attribute_names, const gchar **attribute_values, const char *attribute_name, const gchar **attribute_value)
Find an attribute in a parser callback list of attributes.
Definition: omp.c:332
Here is the call graph for this function:

◆ buffer_aggregate_wc_xml()

void buffer_aggregate_wc_xml ( GString *  xml,
iterator_t aggregate,
const gchar *  type,
const char *  group_column,
GArray *  sort_data,
int  first_group,
int  max_groups 
)

Count words of an aggregate and buffer as XML.

Parameters
[in]xmlBuffer into which to buffer aggregate.
[in]aggregateThe aggregate iterator.
[in]typeThe aggregated type.
[in]group_columnColumn the data are grouped by.
[in]sort_dataSort data.
[in]first_groupIndex of the first word to output, starting at 0.
[in]max_groupsMaximum number of words to output or -1 for all.

Definition at line 12125 of file omp.c.

References sort_data_t::order, and sort_data_t::stat.

12129 {
12130  sort_data_t *first_sort_data;
12131  const char *sort_stat;
12132  int sort_order;
12133 
12134  if (sort_data && sort_data->len)
12135  {
12136  first_sort_data = g_array_index (sort_data, sort_data_t*, 0);
12137  sort_stat = first_sort_data->stat;
12138  sort_order = first_sort_data->order;
12139  }
12140  else
12141  {
12142  sort_stat = "value";
12143  sort_order = 0;
12144  }
12145 
12146  GTree *word_counts, *ignore_words;
12147  GRegex *word_regex;
12148 
12149  // Word regex: Words must contain at least 1 letter
12150  word_regex = g_regex_new ("[[:alpha:]]", 0, 0, NULL);
12151 
12152  ignore_words = g_tree_new_full ((GCompareDataFunc) g_ascii_strcasecmp, NULL,
12153  g_free, NULL);
12154  g_tree_insert (ignore_words, g_strdup ("an"), GINT_TO_POINTER (1));
12155  g_tree_insert (ignore_words, g_strdup ("the"), GINT_TO_POINTER (1));
12156  g_tree_insert (ignore_words, g_strdup ("and"), GINT_TO_POINTER (1));
12157  g_tree_insert (ignore_words, g_strdup ("or"), GINT_TO_POINTER (1));
12158  g_tree_insert (ignore_words, g_strdup ("not"), GINT_TO_POINTER (1));
12159  g_tree_insert (ignore_words, g_strdup ("is"), GINT_TO_POINTER (1));
12160  g_tree_insert (ignore_words, g_strdup ("are"), GINT_TO_POINTER (1));
12161  g_tree_insert (ignore_words, g_strdup ("was"), GINT_TO_POINTER (1));
12162  g_tree_insert (ignore_words, g_strdup ("were"), GINT_TO_POINTER (1));
12163  g_tree_insert (ignore_words, g_strdup ("you"), GINT_TO_POINTER (1));
12164  g_tree_insert (ignore_words, g_strdup ("your"), GINT_TO_POINTER (1));
12165  g_tree_insert (ignore_words, g_strdup ("it"), GINT_TO_POINTER (1));
12166  g_tree_insert (ignore_words, g_strdup ("its"), GINT_TO_POINTER (1));
12167  g_tree_insert (ignore_words, g_strdup ("they"), GINT_TO_POINTER (1));
12168  g_tree_insert (ignore_words, g_strdup ("this"), GINT_TO_POINTER (1));
12169  g_tree_insert (ignore_words, g_strdup ("that"), GINT_TO_POINTER (1));
12170  g_tree_insert (ignore_words, g_strdup ("which"), GINT_TO_POINTER (1));
12171  g_tree_insert (ignore_words, g_strdup ("when"), GINT_TO_POINTER (1));
12172  g_tree_insert (ignore_words, g_strdup ("if"), GINT_TO_POINTER (1));
12173  g_tree_insert (ignore_words, g_strdup ("do"), GINT_TO_POINTER (1));
12174  g_tree_insert (ignore_words, g_strdup ("does"), GINT_TO_POINTER (1));
12175  g_tree_insert (ignore_words, g_strdup ("did"), GINT_TO_POINTER (1));
12176  g_tree_insert (ignore_words, g_strdup ("at"), GINT_TO_POINTER (1));
12177  g_tree_insert (ignore_words, g_strdup ("where"), GINT_TO_POINTER (1));
12178  g_tree_insert (ignore_words, g_strdup ("in"), GINT_TO_POINTER (1));
12179  g_tree_insert (ignore_words, g_strdup ("will"), GINT_TO_POINTER (1));
12180  g_tree_insert (ignore_words, g_strdup ("as"), GINT_TO_POINTER (1));
12181  g_tree_insert (ignore_words, g_strdup ("has"), GINT_TO_POINTER (1));
12182  g_tree_insert (ignore_words, g_strdup ("have"), GINT_TO_POINTER (1));
12183  g_tree_insert (ignore_words, g_strdup ("can"), GINT_TO_POINTER (1));
12184  g_tree_insert (ignore_words, g_strdup ("cannot"), GINT_TO_POINTER (1));
12185  g_tree_insert (ignore_words, g_strdup ("been"), GINT_TO_POINTER (1));
12186  g_tree_insert (ignore_words, g_strdup ("with"), GINT_TO_POINTER (1));
12187  g_tree_insert (ignore_words, g_strdup ("under"), GINT_TO_POINTER (1));
12188  g_tree_insert (ignore_words, g_strdup ("for"), GINT_TO_POINTER (1));
12189  g_tree_insert (ignore_words, g_strdup ("than"), GINT_TO_POINTER (1));
12190  g_tree_insert (ignore_words, g_strdup ("seen"), GINT_TO_POINTER (1));
12191  g_tree_insert (ignore_words, g_strdup ("full"), GINT_TO_POINTER (1));
12192  g_tree_insert (ignore_words, g_strdup ("use"), GINT_TO_POINTER (1));
12193  g_tree_insert (ignore_words, g_strdup ("see"), GINT_TO_POINTER (1));
12194  g_tree_insert (ignore_words, g_strdup ("more"), GINT_TO_POINTER (1));
12195 
12196  if (sort_order)
12197  word_counts = g_tree_new_full ((GCompareDataFunc) g_ascii_strcasecmp, NULL,
12198  g_free, NULL);
12199  else
12200  word_counts = g_tree_new_full ((GCompareDataFunc) strcasecmp_reverse, NULL,
12201  g_free, NULL);
12202 
12203  g_string_append_printf (xml, "<aggregate>");
12204 
12205  g_string_append_printf (xml,
12206  "<group_column>%s</group_column>",
12207  group_column);
12208 
12209  while (next (aggregate))
12210  {
12211  const gchar *value = aggregate_iterator_value (aggregate);
12212  int count = aggregate_iterator_count (aggregate);
12213 
12214  int current_index = 0;
12215  gchar **split_string;
12216 
12217  if (!value)
12218  continue;
12219 
12220  split_string = g_strsplit_set (value, " \t\n.,:;\"'()[]{}<>&", -1);
12221  while (split_string [current_index])
12222  {
12223  gchar *word = split_string [current_index];
12224  if (strlen (word) >= 3
12225  && g_regex_match (word_regex, word, 0, NULL)
12226  && g_tree_lookup (ignore_words, word) == 0)
12227  {
12228  int word_count
12229  = GPOINTER_TO_INT (g_tree_lookup (word_counts, word));
12230  if (word_count)
12231  {
12232  g_tree_insert (word_counts, word,
12233  GINT_TO_POINTER (word_count + count));
12234  }
12235  else
12236  {
12237  g_tree_insert (word_counts, g_strdup (word),
12238  GINT_TO_POINTER (count));
12239  }
12240  }
12241  current_index++;
12242  }
12243  }
12244 
12245  if (sort_stat && strcasecmp (sort_stat, "count") == 0)
12246  {
12247  GSequence *word_counts_sorted;
12248  GSequenceIter *start, *end;
12249  word_counts_sorted = g_sequence_new (g_free);
12250  g_tree_foreach (word_counts,
12251  sort_order
12252  ? copy_word_counts_asc
12253  : copy_word_counts_desc,
12254  word_counts_sorted);
12255 
12256  start = g_sequence_get_iter_at_pos (word_counts_sorted, first_group);
12257  if (max_groups < 0)
12258  end = g_sequence_get_end_iter (word_counts_sorted);
12259  else
12260  end = g_sequence_get_iter_at_pos (word_counts_sorted,
12261  first_group + max_groups);
12262 
12263  g_sequence_foreach_range (start, end, buffer_word_counts_seq, xml);
12264 
12265  g_sequence_free (word_counts_sorted);
12266  }
12267  else
12268  {
12269  // value: use default alphabetical sorting
12270  buffer_counts_data_t counts_data;
12271  counts_data.buffer = xml;
12272  counts_data.skip = first_group;
12273  counts_data.limit = max_groups;
12274  g_tree_foreach (word_counts, buffer_word_counts_tree, &counts_data);
12275  }
12276 
12277  g_tree_destroy (word_counts);
12278  g_tree_destroy (ignore_words);
12279 
12280  g_string_append (xml, "<column_info>");
12281 
12282  g_string_append_printf (xml,
12283  "<aggregate_column>"
12284  "<name>value</name>"
12285  "<stat>value</stat>"
12286  "<type>%s</type>"
12287  "<column>%s</column>"
12288  "<data_type>text</data_type>"
12289  "</aggregate_column>",
12290  type,
12291  group_column);
12292 
12293  g_string_append_printf (xml,
12294  "<aggregate_column>"
12295  "<name>count</name>"
12296  "<stat>count</stat>"
12297  "<type>%s</type>"
12298  "<column></column>"
12299  "<data_type>integer</data_type>"
12300  "</aggregate_column>",
12301  type);
12302 
12303  g_string_append (xml, "</column_info>");
12304 
12305  g_string_append_printf (xml, "</aggregate>");
12306 }
int skip
The amount of entries to skip at start.
Definition: omp.c:11964
int order
The sort order.
Definition: manage.h:4102
gchar * stat
The statistic to sort by.
Definition: manage.h:4101
int aggregate_iterator_count(iterator_t *)
Get the count from an aggregate iterator.
Definition: manage_sql.c:5923
Helper data structure for buffering word counts.
Definition: omp.c:11961
int limit
The maximum number of entries to output or -1 for all.
Definition: omp.c:11965
GString * buffer
The GString buffer to write to.
Definition: omp.c:11963
gboolean next(iterator_t *)
Increment an iterator.
Definition: sql.c:689
const char * aggregate_iterator_value(iterator_t *)
Get the value of the group column from a statistics iterator.
Definition: manage_sql.c:6025

◆ buffer_aggregate_xml()

void buffer_aggregate_xml ( GString *  xml,
iterator_t aggregate,
const gchar *  type,
const char *  group_column,
const char *  group_column_type,
const char *  subgroup_column,
const char *  subgroup_column_type,
GArray *  data_columns,
GArray *  data_column_types,
GArray *  text_columns,
GArray *  text_column_types,
GArray *  c_sums 
)

Buffer XML for an aggregate.

Parameters
[in]xmlBuffer into which to buffer aggregate.
[in]aggregateThe aggregate iterator.
[in]typeThe aggregated type.
[in]group_columnColumn the data are grouped by.
[in]group_column_typeType of the group_column.
[in]subgroup_columnColumn the data are further grouped by.
[in]subgroup_column_type
[in]data_columnsColumns statistics are calculated for.
[in]data_column_typesTypes of the data_columns.
[in]text_columnsColumns used for labels.
[in]text_column_typesTypes of the text_columns.
[in]c_sumsArray for calculating cumulative sums.

Definition at line 12341 of file omp.c.

References aggregate_iterator_count(), aggregate_iterator_max(), aggregate_iterator_mean(), aggregate_iterator_min(), aggregate_iterator_subgroup_value(), aggregate_iterator_sum(), aggregate_iterator_text(), aggregate_iterator_value(), column_is_timestamp(), iso_time(), and next().

12348 {
12349  int index;
12350  long c_count, previous_c_count;
12351  gchar *previous_group_value;
12352  long int aggregate_group_count;
12353  GArray *group_mins, *group_maxs, *group_mean_sums, *group_sums, *group_c_sums;
12354  GTree *subgroup_c_counts;
12355  int has_groups = 0;
12356 
12357  g_string_append_printf (xml, "<aggregate>");
12358 
12359  for (index = 0; index < data_columns->len ;index ++)
12360  {
12361  gchar *column_name = g_array_index (data_columns, gchar*, index);
12362  if (column_name && strcmp (column_name, ""))
12363  {
12364  g_string_append_printf (xml,
12365  "<data_column>%s</data_column>",
12366  column_name);
12367  }
12368  }
12369 
12370  for (index = 0; index < text_columns->len ;index ++)
12371  {
12372  gchar *column_name = g_array_index (text_columns, gchar*, index);
12373  if (column_name && strcmp (column_name, ""))
12374  {
12375  g_string_append_printf (xml,
12376  "<text_column>%s</text_column>",
12377  column_name);
12378  }
12379  }
12380 
12381  if (group_column)
12382  g_string_append_printf (xml,
12383  "<group_column>%s</group_column>",
12384  group_column);
12385 
12386  if (subgroup_column)
12387  g_string_append_printf (xml,
12388  "<subgroup_column>%s</subgroup_column>",
12389  subgroup_column);
12390 
12391  previous_group_value = NULL;
12392  aggregate_group_count = 0L;
12393  c_count = 0L;
12394  previous_c_count = 0L;
12395 
12396  if (subgroup_column)
12397  {
12398  group_mins = g_array_new (TRUE, TRUE, sizeof (double));
12399  group_maxs = g_array_new (TRUE, TRUE, sizeof (double));
12400  group_mean_sums = g_array_new (TRUE, TRUE, sizeof (double));
12401  group_sums = g_array_new (TRUE, TRUE, sizeof (double));
12402 
12403  group_c_sums = g_array_new (TRUE, TRUE, sizeof (GTree*));
12404  for (index = 0; index < data_columns->len; index++)
12405  {
12406  g_array_index (group_c_sums, GTree*, index)
12407  = g_tree_new_full ((GCompareDataFunc) g_strcmp0, NULL,
12408  g_free, g_free);
12409  }
12410 
12411  subgroup_c_counts = g_tree_new_full ((GCompareDataFunc) g_strcmp0, NULL,
12412  g_free, g_free);
12413  }
12414  else
12415  {
12416  group_mins = NULL;
12417  group_maxs = NULL;
12418  group_mean_sums = NULL;
12419  group_sums = NULL;
12420  group_c_sums = NULL;
12421  subgroup_c_counts = NULL;
12422  }
12423 
12424  while (next (aggregate))
12425  {
12426  const char *value = aggregate_iterator_value (aggregate);
12427  const char *subgroup_value
12428  = aggregate_iterator_subgroup_value (aggregate);
12429  gchar *value_escaped, *subgroup_value_escaped;
12430 
12431  has_groups = 1;
12432 
12433  c_count += aggregate_iterator_count (aggregate);
12434 
12435  if (value && column_is_timestamp (group_column))
12436  {
12437  time_t value_int;
12438  if (sscanf (value, "%ld", &value_int) == 1)
12439  value_escaped = g_strdup (iso_time (&value_int));
12440  else
12441  value_escaped = g_markup_escape_text (value, -1);
12442  }
12443  else if (value && group_column_type
12444  && strcmp (group_column_type, "cvss") == 0)
12445  {
12446  double dbl_value;
12447  sscanf (value, "%lf", &dbl_value);
12448  value_escaped = g_strdup_printf ("%0.1lf", dbl_value);
12449  }
12450  else if (group_column && value)
12451  value_escaped = g_markup_escape_text (value, -1);
12452  else
12453  value_escaped = NULL;
12454 
12455  if (subgroup_column && column_is_timestamp (subgroup_column))
12456  {
12457  time_t value_int;
12458  if (sscanf (subgroup_value, "%ld", &value_int) == 1)
12459  subgroup_value_escaped = g_strdup (iso_time (&value_int));
12460  else
12461  subgroup_value_escaped = g_markup_escape_text (subgroup_value, -1);
12462  }
12463  else if (subgroup_value && subgroup_column_type
12464  && strcmp (subgroup_column_type, "cvss") == 0)
12465  {
12466  double dbl_value;
12467  sscanf (subgroup_value, "%lf", &dbl_value);
12468  subgroup_value_escaped = g_strdup_printf ("%0.1lf", dbl_value);
12469  }
12470  else if (subgroup_column && subgroup_value)
12471  subgroup_value_escaped = g_markup_escape_text (subgroup_value, -1);
12472  else
12473  subgroup_value_escaped = NULL;
12474 
12475  if (group_column)
12476  {
12477  if (subgroup_column)
12478  {
12479  long int *subgroup_c_count;
12480 
12481  // Update cumulative count for subgroup value
12482  subgroup_c_count
12483  = g_tree_lookup (subgroup_c_counts, subgroup_value);
12484  if (subgroup_c_count == NULL)
12485  {
12486  subgroup_c_count = g_malloc0 (sizeof (long int*));
12487  g_tree_insert (subgroup_c_counts,
12488  g_strdup (subgroup_value),
12489  subgroup_c_count);
12490  }
12491  *subgroup_c_count += aggregate_iterator_count (aggregate);
12492 
12493  // Output of group elements
12494  if (previous_group_value == NULL)
12495  {
12496  // Output start of first group
12497  g_string_append_printf (xml,
12498  "<group>"
12499  "<value>%s</value>",
12500  value_escaped);
12501  }
12502  else if (strcmp (previous_group_value, value))
12503  {
12504  // First subgroup of a new group:
12505  // output collected data of previous group and close it, ...
12506  g_string_append_printf (xml,
12507  "<count>%ld</count>"
12508  "<c_count>%ld</c_count>",
12509  aggregate_group_count,
12510  previous_c_count);
12511 
12512  for (index = 0; index < data_columns->len; index++)
12513  {
12514  gchar *data_column = g_array_index (data_columns,
12515  gchar*, index);
12516  double c_sum = g_array_index (c_sums, double, index);
12517 
12518  if (column_is_timestamp (data_column))
12519  {
12520  time_t min, max, mean;
12521  min = (time_t)(g_array_index (group_mins,
12522  double, index));
12523  max = (time_t)(g_array_index (group_maxs,
12524  double, index));
12525  mean = (time_t)(g_array_index (group_mean_sums,
12526  double, index)
12527  / aggregate_group_count);
12528 
12529  g_string_append_printf (xml,
12530  "<stats column=\"%s\">"
12531  "<min>%s</min>"
12532  "<max>%s</max>"
12533  "<mean>%s</mean>"
12534  "<sum></sum>"
12535  "<c_sum></c_sum>"
12536  "</stats>",
12537  data_column,
12538  iso_time (&min),
12539  iso_time (&max),
12540  iso_time (&mean));
12541  }
12542  else
12543  g_string_append_printf (xml,
12544  "<stats column=\"%s\">"
12545  "<min>%g</min>"
12546  "<max>%g</max>"
12547  "<mean>%g</mean>"
12548  "<sum>%g</sum>"
12549  "<c_sum>%g</c_sum>"
12550  "</stats>",
12551  data_column,
12552  g_array_index (group_mins,
12553  double, index),
12554  g_array_index (group_maxs,
12555  double, index),
12556  (g_array_index (group_mean_sums,
12557  double, index)
12558  / aggregate_group_count),
12559  g_array_index (group_sums,
12560  double, index),
12561  c_sum);
12562  }
12563 
12564  g_string_append_printf (xml,
12565  "</group>");
12566 
12567  // ... then start new group
12568  g_string_append_printf (xml,
12569  "<group>"
12570  "<value>%s</value>",
12571  value_escaped);
12572  }
12573 
12574  // Update group statistics using current subgroup after output
12575  if (previous_group_value == NULL
12576  || strcmp (previous_group_value, value))
12577  {
12578  // First subgroup of any group:
12579  // Reset group statistics using current subgroup data
12580  aggregate_group_count = aggregate_iterator_count (aggregate);
12581 
12582  for (index = 0; index < data_columns->len; index++)
12583  {
12584  g_array_index (group_mins, double, index)
12585  = aggregate_iterator_min (aggregate, index);
12586  g_array_index (group_maxs, double, index)
12587  = aggregate_iterator_max (aggregate, index);
12588  g_array_index (group_mean_sums, double, index)
12589  = (aggregate_iterator_mean (aggregate, index)
12590  * aggregate_iterator_count (aggregate));
12591  g_array_index (group_sums, double, index)
12592  = aggregate_iterator_sum (aggregate, index);
12593  }
12594  }
12595  else
12596  {
12597  // Subgroup, but no new group: Update statistics
12598  aggregate_group_count += aggregate_iterator_count (aggregate);
12599 
12600  for (index = 0; index < data_columns->len; index++)
12601  {
12602  g_array_index (group_mins, double, index)
12603  = fmin (aggregate_iterator_min (aggregate, index),
12604  g_array_index (group_mins, double, index));
12605  g_array_index (group_maxs, double, index)
12606  = fmax (aggregate_iterator_max (aggregate, index),
12607  g_array_index (group_maxs, double, index));
12608  g_array_index (group_mean_sums, double, index)
12609  += (aggregate_iterator_mean (aggregate, index)
12610  * aggregate_iterator_count (aggregate));
12611  g_array_index (group_sums, double, index)
12612  += aggregate_iterator_sum (aggregate, index);
12613  }
12614  }
12615 
12616  g_free (previous_group_value);
12617  previous_group_value = g_strdup (value);
12618 
12619  // Add subgroup values
12620  g_string_append_printf (xml,
12621  "<subgroup>"
12622  "<value>%s</value>"
12623  "<count>%d</count>"
12624  "<c_count>%ld</c_count>",
12625  subgroup_value_escaped
12626  ? subgroup_value_escaped : "",
12627  aggregate_iterator_count (aggregate),
12628  *subgroup_c_count);
12629  }
12630  else
12631  {
12632  // No subgrouping
12633  g_string_append_printf (xml,
12634  "<group>"
12635  "<value>%s</value>"
12636  "<count>%d</count>"
12637  "<c_count>%ld</c_count>",
12638  value_escaped ? value_escaped : "",
12639  aggregate_iterator_count (aggregate),
12640  c_count);
12641  }
12642 
12643  previous_c_count = c_count;
12644  }
12645  else
12646  {
12647  g_string_append_printf (xml,
12648  "<overall>"
12649  "<count>%d</count>"
12650  "<c_count>%ld</c_count>",
12651  aggregate_iterator_count (aggregate),
12652  c_count);
12653  }
12654 
12655  for (index = 0; index < data_columns->len; index++)
12656  {
12657  gchar *data_column = g_array_index (data_columns, gchar*, index);;
12658  double c_sum;
12659  double *subgroup_c_sum = NULL;
12660 
12661  if (subgroup_column && column_is_timestamp (data_column) == FALSE)
12662  {
12663  GTree *c_sum_tree;
12664  const gchar *subgroup_value;
12665 
12666 
12667  subgroup_value = aggregate_iterator_subgroup_value (aggregate);
12668  c_sum_tree = g_array_index (group_c_sums, GTree*, index);
12669  subgroup_c_sum = g_tree_lookup (c_sum_tree, subgroup_value);
12670 
12671  if (subgroup_c_sum == NULL)
12672  {
12673  subgroup_c_sum = g_malloc (sizeof (double *));
12674  *subgroup_c_sum = 0;
12675 
12676  g_tree_insert (c_sum_tree,
12677  g_strdup (subgroup_value),
12678  subgroup_c_sum);
12679  }
12680 
12681  *subgroup_c_sum += aggregate_iterator_sum (aggregate, index);
12682  }
12683 
12684  c_sum = g_array_index (c_sums, double, index);
12685  c_sum += aggregate_iterator_sum (aggregate, index);
12686  g_array_index (c_sums, double, index) = c_sum;
12687 
12688  if (column_is_timestamp (data_column))
12689  {
12690  time_t min, max, mean;
12691  min = (time_t)(aggregate_iterator_min (aggregate, index));
12692  max = (time_t)(aggregate_iterator_max (aggregate, index));
12693  mean = (time_t)(aggregate_iterator_mean (aggregate, index));
12694 
12695  g_string_append_printf (xml,
12696  "<stats column=\"%s\">"
12697  "<min>%s</min>"
12698  "<max>%s</max>"
12699  "<mean>%s</mean>"
12700  "<sum></sum>"
12701  "<c_sum></c_sum>"
12702  "</stats>",
12703  data_column,
12704  iso_time (&min),
12705  iso_time (&max),
12706  iso_time (&mean));
12707  }
12708  else
12709  g_string_append_printf (xml,
12710  "<stats column=\"%s\">"
12711  "<min>%g</min>"
12712  "<max>%g</max>"
12713  "<mean>%g</mean>"
12714  "<sum>%g</sum>"
12715  "<c_sum>%g</c_sum>"
12716  "</stats>",
12717  data_column,
12718  aggregate_iterator_min (aggregate, index),
12719  aggregate_iterator_max (aggregate, index),
12720  aggregate_iterator_mean (aggregate, index),
12721  aggregate_iterator_sum (aggregate, index),
12722  subgroup_column
12723  ? *subgroup_c_sum : c_sum);
12724  }
12725 
12726  for (index = 0; index < text_columns->len; index++)
12727  {
12728  const char *text = aggregate_iterator_text (aggregate, index,
12729  data_columns->len);
12730  gchar *text_escaped;
12731  gchar *text_column = g_array_index (text_columns, gchar*, index);
12732 
12733  if (text && column_is_timestamp (text_column))
12734  {
12735  time_t text_int;
12736  if (sscanf (text, "%ld", &text_int) == 1)
12737  text_escaped = g_strdup (iso_time (&text_int));
12738  else
12739  text_escaped = g_markup_escape_text (text, -1);
12740  }
12741  else if (text)
12742  text_escaped = g_markup_escape_text (text, -1);
12743  else
12744  text_escaped = NULL;
12745 
12746  g_string_append_printf (xml,
12747  "<text column=\"%s\">%s</text>",
12748  text_column,
12749  text_escaped ? text_escaped : "");
12750  g_free (text_escaped);
12751  }
12752 
12753  if (subgroup_column)
12754  {
12755  g_string_append_printf (xml, "</subgroup>");
12756  }
12757  else if (group_column)
12758  {
12759  g_string_append_printf (xml, "</group>");
12760  }
12761  else
12762  {
12763  g_string_append_printf (xml, "</overall>");
12764  }
12765  g_free (value_escaped);
12766  g_free (subgroup_value_escaped);
12767  }
12768 
12769  if (subgroup_column)
12770  {
12771  // Add elements for last group in case subgroups are used
12772  if (has_groups)
12773  {
12774  g_string_append_printf (xml,
12775  "<count>%ld</count>"
12776  "<c_count>%ld</c_count>"
12777  "</group>",
12778  aggregate_group_count,
12779  previous_c_count);
12780  }
12781 
12782  // Also add overview of all subgroup values
12783  g_string_append_printf (xml,
12784  "<subgroups>");
12785 
12786  g_tree_foreach (subgroup_c_counts,
12787  (GTraverseFunc) buffer_aggregate_subgroup_value,
12788  xml);
12789 
12790  g_string_append_printf (xml,
12791  "</subgroups>");
12792  }
12793 
12794  g_string_append (xml, "<column_info>");
12795 
12796  if (group_column)
12797  {
12798  g_string_append_printf (xml,
12799  "<aggregate_column>"
12800  "<name>value</name>"
12801  "<stat>value</stat>"
12802  "<type>%s</type>"
12803  "<column>%s</column>"
12804  "<data_type>%s</data_type>"
12805  "</aggregate_column>",
12806  type,
12807  group_column,
12808  group_column_type);
12809  }
12810 
12811  if (subgroup_column)
12812  {
12813  g_string_append_printf (xml,
12814  "<aggregate_column>"
12815  "<name>subgroup_value</name>"
12816  "<stat>value</stat>"
12817  "<type>%s</type>"
12818  "<column>%s</column>"
12819  "<data_type>%s</data_type>"
12820  "</aggregate_column>",
12821  type,
12822  subgroup_column,
12823  subgroup_column_type);
12824  }
12825 
12826  g_string_append_printf (xml,
12827  "<aggregate_column>"
12828  "<name>count</name>"
12829  "<stat>count</stat>"
12830  "<type>%s</type>"
12831  "<column></column>"
12832  "<data_type>integer</data_type>"
12833  "</aggregate_column>",
12834  type);
12835 
12836  g_string_append_printf (xml,
12837  "<aggregate_column>"
12838  "<name>c_count</name>"
12839  "<stat>c_count</stat>"
12840  "<type>%s</type>"
12841  "<column></column>"
12842  "<data_type>integer</data_type>"
12843  "</aggregate_column>",
12844  type);
12845 
12846  for (index = 0; index < data_columns->len; index++)
12847  {
12848  gchar *column_name, *column_type;
12849  column_name = g_array_index (data_columns, gchar*, index);
12850  column_type = g_array_index (data_column_types, gchar*, index);
12851  g_string_append_printf (xml,
12852  "<aggregate_column>"
12853  "<name>%s_min</name>"
12854  "<stat>min</stat>"
12855  "<type>%s</type>"
12856  "<column>%s</column>"
12857  "<data_type>%s</data_type>"
12858  "</aggregate_column>",
12859  column_name,
12860  type,
12861  column_name,
12862  column_type);
12863  g_string_append_printf (xml,
12864  "<aggregate_column>"
12865  "<name>%s_max</name>"
12866  "<stat>max</stat>"
12867  "<type>%s</type>"
12868  "<column>%s</column>"
12869  "<data_type>%s</data_type>"
12870  "</aggregate_column>",
12871  column_name,
12872  type,
12873  column_name,
12874  column_type);
12875  g_string_append_printf (xml,
12876  "<aggregate_column>"
12877  "<name>%s_mean</name>"
12878  "<stat>mean</stat>"
12879  "<type>%s</type>"
12880  "<column>%s</column>"
12881  "<data_type>%s</data_type>"
12882  "</aggregate_column>",
12883  column_name,
12884  type,
12885  column_name,
12886  column_type);
12887  g_string_append_printf (xml,
12888  "<aggregate_column>"
12889  "<name>%s_sum</name>"
12890  "<stat>sum</stat>"
12891  "<type>%s</type>"
12892  "<column>%s</column>"
12893  "<data_type>%s</data_type>"
12894  "</aggregate_column>",
12895  column_name,
12896  type,
12897  column_name,
12898  column_type);
12899  g_string_append_printf (xml,
12900  "<aggregate_column>"
12901  "<name>%s_c_sum</name>"
12902  "<stat>c_sum</stat>"
12903  "<type>%s</type>"
12904  "<column>%s</column>"
12905  "<data_type>%s</data_type>"
12906  "</aggregate_column>",
12907  column_name,
12908  type,
12909  column_name,
12910  column_type);
12911  }
12912 
12913  for (index = 0; index < text_columns->len; index++)
12914  {
12915  gchar *column_name, *column_type;
12916  column_name = g_array_index (text_columns, gchar*, index);
12917  column_type = g_array_index (text_column_types, gchar*, index);
12918  g_string_append_printf (xml,
12919  "<aggregate_column>"
12920  "<name>%s</name>"
12921  "<stat>text</stat>"
12922  "<type>%s</type>"
12923  "<column>%s</column>"
12924  "<data_type>%s</data_type>"
12925  "</aggregate_column>",
12926  column_name,
12927  type,
12928  column_name,
12929  column_type);
12930  }
12931 
12932  g_string_append (xml, "</column_info>");
12933 
12934  g_string_append (xml, "</aggregate>");
12935 
12936  if (subgroup_column)
12937  {
12938  g_array_free (group_mins, TRUE);
12939  g_array_free (group_maxs, TRUE);
12940  g_array_free (group_mean_sums, TRUE);
12941  g_array_free (group_sums, TRUE);
12942 
12943  for (index = 0; index < data_columns->len; index++)
12944  {
12945  g_tree_destroy (g_array_index (group_c_sums, GTree*, index));
12946  }
12947 
12948  g_array_free (group_c_sums, TRUE);
12949 
12950  g_tree_destroy(subgroup_c_counts);
12951  };
12952 }
double aggregate_iterator_max(iterator_t *, int)
Get the maximum from an aggregate iterator.
Definition: manage_sql.c:5953
int column_is_timestamp(const char *)
double aggregate_iterator_mean(iterator_t *, int)
Get the mean from an aggregate iterator.
Definition: manage_sql.c:5969
int aggregate_iterator_count(iterator_t *)
Get the count from an aggregate iterator.
Definition: manage_sql.c:5923
double aggregate_iterator_sum(iterator_t *, int)
Get the sum from a statistics iterator.
Definition: manage_sql.c:5985
char * iso_time(time_t *)
Create an ISO time from seconds since epoch.
Definition: manage_sql.c:1138
double aggregate_iterator_min(iterator_t *, int)
Get the minimum from an aggregate iterator.
Definition: manage_sql.c:5937
const char * aggregate_iterator_subgroup_value(iterator_t *)
Get the value of the subgroup column from an aggregate iterator.
Definition: manage_sql.c:6042
const char * aggregate_iterator_text(iterator_t *, int, int)
Get the value of a text column from an aggregate iterator.
Definition: manage_sql.c:6003
gboolean next(iterator_t *)
Increment an iterator.
Definition: sql.c:689
const char * aggregate_iterator_value(iterator_t *)
Get the value of the group column from a statistics iterator.
Definition: manage_sql.c:6025
Here is the call graph for this function:

◆ buffer_config_preference_xml()

void buffer_config_preference_xml ( GString *  buffer,
iterator_t prefs,
config_t  config,
int  hide_passwords 
)

Buffer XML for the NVT preference of a config.

Parameters
[in]bufferBuffer.
[in]prefsNVT preference iterator.
[in]configConfig.
[in]hide_passwordsWhether to hide passwords.

Definition at line 11120 of file omp.c.

References nvt_oid(), nvt_preference_iterator_config_value(), nvt_preference_iterator_nvt(), nvt_preference_iterator_real_name(), nvt_preference_iterator_type(), nvt_preference_iterator_value(), and create_port_list_range::type.

11122 {
11123  char *real_name, *type, *value, *nvt;
11124  const char *default_value;
11125  char *oid = NULL;
11126 
11127  real_name = nvt_preference_iterator_real_name (prefs);
11128  type = nvt_preference_iterator_type (prefs);
11129  value = nvt_preference_iterator_config_value (prefs, config);
11130  nvt = nvt_preference_iterator_nvt (prefs);
11131 
11132  default_value = nvt_preference_iterator_value (prefs);
11133 
11134  if (nvt) oid = nvt_oid (nvt);
11135 
11136  buffer_xml_append_printf (buffer,
11137  "<preference>"
11138  "<nvt oid=\"%s\"><name>%s</name></nvt>"
11139  "<hr_name>%s</hr_name>"
11140  "<name>%s</name>"
11141  "<type>%s</type>",
11142  oid ? oid : "",
11143  nvt ? nvt : "",
11144  real_name ? real_name : "",
11145  real_name ? real_name : "",
11146  type ? type : "");
11147 
11148  if (value
11149  && type
11150  && (strcmp (type, "radio") == 0))
11151  {
11152  /* Handle the other possible values. */
11153  char *pos = strchr (value, ';');
11154  if (pos) *pos = '\0';
11155  buffer_xml_append_printf (buffer, "<value>%s</value>", value);
11156  while (pos)
11157  {
11158  char *pos2 = strchr (++pos, ';');
11159  if (pos2) *pos2 = '\0';
11160  buffer_xml_append_printf (buffer, "<alt>%s</alt>", pos);
11161  pos = pos2;
11162  }
11163  }
11164  else if (value
11165  && type
11166  && hide_passwords
11167  && (strcmp (type, "password") == 0))
11168  buffer_xml_append_printf (buffer, "<value></value>");
11169  else
11170  buffer_xml_append_printf (buffer, "<value>%s</value>", value ? value : "");
11171 
11172  if (default_value
11173  && type
11174  && (strcmp (type, "radio") == 0))
11175  {
11176  /* Handle the other possible values. */
11177  char *pos = strchr (default_value, ';');
11178  if (pos) *pos = '\0';
11179  buffer_xml_append_printf (buffer, "<default>%s</default>", default_value);
11180  }
11181  else if (default_value
11182  && type
11183  && (strcmp (type, "password") == 0))
11184  buffer_xml_append_printf (buffer, "<default></default>");
11185  else
11186  buffer_xml_append_printf (buffer, "<default>%s</default>", default_value
11187  ? default_value
11188  : "");
11189 
11190  buffer_xml_append_printf (buffer, "</preference>");
11191 
11192  free (real_name);
11193  free (type);
11194  free (value);
11195  free (nvt);
11196  free (oid);
11197 }
char * nvt_oid(const char *)
const char * nvt_preference_iterator_value(iterator_t *)
char * nvt_preference_iterator_type(iterator_t *)
char * nvt_preference_iterator_real_name(iterator_t *)
char * nvt_preference_iterator_nvt(iterator_t *)
char * nvt_preference_iterator_config_value(iterator_t *, config_t)
Here is the call graph for this function:

◆ buffer_results_xml()

void buffer_results_xml ( GString *  buffer,
iterator_t results,
task_t  task,
int  include_notes,
int  include_notes_details,
int  include_overrides,
int  include_overrides_details,
int  include_tags,
int  include_tags_details,
int  include_details,
const char *  delta_state,
iterator_t delta_results,
int  changed 
)

Buffer XML for some results.

Todo:
Exported for manage_sql.c.
Todo:
Exported for manage_sql.c.
Parameters
[in]bufferBuffer into which to buffer results.
[in]resultsResult iterator.
[in]taskTask associated with results. Only needed with include_notes or include_overrides.
[in]include_notesWhether to include notes.
[in]include_notes_detailsWhether to include details of notes.
[in]include_overridesWhether to include overrides.
[in]include_overrides_detailsWhether to include details of overrides.
[in]include_tagsWhether to include user tag count.
[in]include_tags_detailsWhether to include details of tags.
[in]include_detailsWhether to include details of the result.
[in]delta_stateDelta state of result, or NULL.
[in]delta_resultsIterator for delta result to include, or NULL.
[in]changedWhether the result is a "changed" delta.

Definition at line 11579 of file omp.c.

References create_port_list_range::comment, result_iterator_descr(), result_iterator_qod(), result_iterator_qod_type(), and result_iterator_result().

11586 {
11587  const char *descr = result_iterator_descr (results);
11588  const char *name, *owner_name, *comment, *creation_time, *modification_time;
11589  gchar *nl_descr, *asset_id;
11590  const char *qod = result_iterator_qod (results);
11591  const char *qod_type = result_iterator_qod_type (results);
11592  result_t result = result_iterator_result (results);
11593  char *uuid;
11594  char *detect_ref, *detect_cpe, *detect_loc, *detect_oid, *detect_name;
11595  task_t selected_task;
11596 
11597  nl_descr = descr ? convert_to_newlines (descr) : NULL;
11598 
11599  result_uuid (result, &uuid);
11600 
11601  buffer_xml_append_printf (buffer, "<result id=\"%s\">", uuid);
11602 
11603  selected_task = task;
11604 
11605  name = get_iterator_name (results);
11606  if (name)
11607  buffer_xml_append_printf (buffer,
11608  "<name>%s</name>",
11609  name);
11610 
11611  owner_name = get_iterator_owner_name (results);
11612  if (owner_name)
11613  buffer_xml_append_printf (buffer,
11614  "<owner><name>%s</name></owner>",
11615  owner_name);
11616 
11617  comment = get_iterator_comment (results);
11618  if (comment)
11619  buffer_xml_append_printf (buffer,
11620  "<comment>%s</comment>",
11621  comment);
11622 
11623  creation_time = get_iterator_creation_time (results);
11624  if (creation_time)
11625  buffer_xml_append_printf (buffer,
11626  "<creation_time>%s</creation_time>",
11627  creation_time);
11628 
11629  modification_time = get_iterator_modification_time (results);
11630  if (modification_time)
11631  buffer_xml_append_printf (buffer,
11632  "<modification_time>%s</modification_time>",
11633  modification_time);
11634 
11635  if (include_details)
11636  {
11637  char *result_report_id, *result_task_id, *result_task_name;
11638 
11639  if (task == 0)
11640  selected_task = result_iterator_task (results);
11641 
11642  task_uuid (selected_task, &result_task_id);
11643  result_task_name = task_name (result_iterator_task (results));
11644  result_report_id = report_uuid (result_iterator_report (results));
11645 
11646  buffer_xml_append_printf (buffer,
11647  "<report id=\"%s\"/>"
11648  "<task id=\"%s\"><name>%s</name></task>",
11649  result_report_id,
11650  result_task_id,
11651  result_task_name);
11652 
11653  free (result_report_id);
11654  free (result_task_id);
11655  free (result_task_name);
11656  }
11657 
11658  if (include_tags)
11659  {
11660  buffer_xml_append_printf (buffer,
11661  "<user_tags>"
11662  "<count>%i</count>",
11663  resource_tag_count ("result", result, 1));
11664 
11665  if (include_tags_details)
11666  {
11667  iterator_t tags;
11668 
11669  init_resource_tag_iterator (&tags, "result", result, 1, NULL, 1);
11670 
11671  while (next (&tags))
11672  {
11673  buffer_xml_append_printf (buffer,
11674  "<tag id=\"%s\">"
11675  "<name>%s</name>"
11676  "<value>%s</value>"
11677  "<comment>%s</comment>"
11678  "</tag>",
11683  }
11684 
11685  cleanup_iterator (&tags);
11686  }
11687 
11688  buffer_xml_append_printf (buffer, "</user_tags>");
11689  }
11690 
11691  detect_ref = detect_cpe = detect_loc = detect_oid = detect_name = NULL;
11692  if (result_detection_reference (result, &detect_ref, &detect_cpe, &detect_loc,
11693  &detect_oid, &detect_name) == 0)
11694  {
11695  buffer_xml_append_printf (buffer,
11696  "<detection>"
11697  "<result id=\"%s\">"
11698  "<details>",
11699  detect_ref);
11700 
11701  add_detail (buffer, "product", detect_cpe);
11702  add_detail (buffer, "location", detect_loc);
11703  add_detail (buffer, "source_oid", detect_oid);
11704  add_detail (buffer, "source_name", detect_name);
11705 
11706  buffer_xml_append_printf (buffer,
11707  "</details>"
11708  "</result>"
11709  "</detection>");
11710  }
11711  g_free (detect_ref);
11712  g_free (detect_cpe);
11713  g_free (detect_loc);
11714  g_free (detect_oid);
11715  g_free (detect_name);
11716 
11717  if (result_iterator_host (results))
11718  asset_id = result_host_asset_id (result_iterator_host (results),
11719  get_iterator_resource (results));
11720  else
11721  asset_id = NULL;
11722 
11723  buffer_xml_append_printf (buffer,
11724  "<host>"
11725  "%s"
11726  "<asset asset_id=\"%s\"/>"
11727  "</host>",
11728  result_iterator_host (results),
11729  asset_id ? asset_id : "");
11730  free (asset_id);
11731 
11732  buffer_xml_append_printf (buffer,
11733  "<port>%s</port>",
11734  result_iterator_port (results));
11735 
11736  results_xml_append_nvt (results, buffer);
11737 
11738  buffer_xml_append_printf
11739  (buffer,
11740  "<scan_nvt_version>%s</scan_nvt_version>"
11741  "<threat>%s</threat>"
11742  "<severity>%.1f</severity>"
11743  "<qod><value>%s</value><type>%s</type></qod>"
11744  "<description>%s</description>",
11746  result_iterator_level (results),
11748  qod ? qod : "",
11749  qod_type ? qod_type : "",
11750  descr ? nl_descr : "");
11751 
11752  if (include_overrides)
11753  buffer_xml_append_printf (buffer,
11754  "<original_threat>%s</original_threat>"
11755  "<original_severity>%s</original_severity>",
11758 
11759  free (uuid);
11760 
11761  if (include_notes)
11762  buffer_result_notes_xml (buffer, result,
11763  selected_task, include_notes_details);
11764 
11765  if (include_overrides)
11766  buffer_result_overrides_xml (buffer, result,
11767  selected_task, include_overrides_details);
11768 
11769  if (delta_state || delta_results)
11770  {
11771  g_string_append (buffer, "<delta>");
11772  if (delta_state)
11773  g_string_append_printf (buffer, "%s", delta_state);
11774  if (changed && delta_results)
11775  {
11776  gchar *diff, *delta_nl_descr;
11777  const char *delta_descr;
11778  buffer_results_xml (buffer, delta_results, selected_task,
11779  include_notes, include_notes_details,
11780  include_overrides, include_overrides_details,
11781  include_tags, include_tags_details,
11782  include_details, delta_state, NULL, 0);
11783  delta_descr = result_iterator_descr (delta_results);
11784  delta_nl_descr = delta_descr ? convert_to_newlines (delta_descr)
11785  : NULL;
11786  diff = strdiff (descr ? nl_descr : "",
11787  delta_descr ? delta_nl_descr : "");
11788  g_free (delta_nl_descr);
11789  if (diff)
11790  {
11791  gchar **split, *diff_xml;
11792  /* Remove the leading filename lines. */
11793  split = g_strsplit ((gchar*) diff, "\n", 3);
11794  if (split[0] && split[1] && split[2])
11795  diff_xml = g_markup_escape_text (split[2], strlen (split[2]));
11796  else
11797  diff_xml = g_markup_escape_text (diff, strlen (diff));
11798  g_strfreev (split);
11799  g_string_append_printf (buffer, "<diff>%s</diff>", diff_xml);
11800  g_free (diff_xml);
11801  g_free (diff);
11802  }
11803  else
11804  g_string_append (buffer, "<diff>Error creating diff.</diff>");
11805  }
11806 
11807  if (delta_results)
11808  {
11809  if (include_notes)
11810  buffer_result_notes_xml (buffer,
11811  result_iterator_result (delta_results),
11812  selected_task,
11813  include_notes_details);
11814 
11815  if (include_overrides)
11816  buffer_result_overrides_xml (buffer,
11817  result_iterator_result (delta_results),
11818  selected_task,
11819  include_overrides_details);
11820  }
11821  g_string_append (buffer, "</delta>");
11822  }
11823 
11824  if (descr) g_free (nl_descr);
11825 
11826  g_string_append (buffer, "</result>");
11827 }
const char * resource_tag_iterator_value(iterator_t *)
const char * result_iterator_qod(iterator_t *)
resource_t get_iterator_resource(iterator_t *)
const char * result_iterator_original_severity(iterator_t *)
const char * get_iterator_name(iterator_t *)
const char * result_iterator_level(iterator_t *)
const char * resource_tag_iterator_uuid(iterator_t *)
const char * get_iterator_modification_time(iterator_t *)
char * result_host_asset_id(const char *, result_t)
const char * get_iterator_owner_name(iterator_t *)
A generic SQL iterator.
Definition: iterator.h:52
result_t result_iterator_result(iterator_t *)
const char * result_iterator_descr(iterator_t *)
const char * resource_tag_iterator_comment(iterator_t *)
int task_uuid(task_t, char **)
Return the UUID of a task.
Definition: manage_sql.c:17885
long long int result_t
Definition: manage.h:287
const char * result_iterator_original_level(iterator_t *)
const char * result_iterator_qod_type(iterator_t *)
task_t result_iterator_task(iterator_t *)
void buffer_results_xml(GString *, iterator_t *, task_t, int, int, int, int, int, int, int, const char *, iterator_t *, int)
Buffer XML for some results.
Definition: omp.c:11579
report_t result_iterator_report(iterator_t *)
const char * result_iterator_port(iterator_t *)
const char * result_iterator_scan_nvt_version(iterator_t *)
const char * get_iterator_creation_time(iterator_t *)
const char * get_iterator_comment(iterator_t *)
int init_resource_tag_iterator(iterator_t *, const char *, resource_t, int, const char *, int)
void cleanup_iterator(iterator_t *)
Cleanup an iterator.
Definition: sql.c:664
int resource_tag_count(const char *, resource_t, int)
const char * result_iterator_host(iterator_t *)
char * report_uuid(report_t)
int result_uuid(result_t, char **)
gboolean next(iterator_t *)
Increment an iterator.
Definition: sql.c:689
double result_iterator_severity_double(iterator_t *)
int result_detection_reference(result_t, char **, char **, char **, char **, char **)
const char * resource_tag_iterator_name(iterator_t *)
long long int task_t
Definition: manage.h:286
char * task_name(task_t)
Return the name of a task.
Definition: manage_sql.c:17945
gchar * strdiff(const gchar *one, const gchar *two)
Compare two string with the "diff" command.
Definition: omp.c:11208
Here is the call graph for this function:

◆ find_attribute()

int find_attribute ( const gchar **  attribute_names,
const gchar **  attribute_values,
const char *  attribute_name,
const gchar **  attribute_value 
)

Find an attribute in a parser callback list of attributes.

Parameters
[in]attribute_namesList of names.
[in]attribute_valuesList of values.
[in]attribute_nameName of sought attribute.
[out]attribute_valueAttribute value return.
Returns
1 if found, else 0.

Definition at line 332 of file omp.c.

Referenced by append_attribute().

336 {
337  while (*attribute_names && *attribute_values)
338  if (strcmp (*attribute_names, attribute_name))
339  attribute_names++, attribute_values++;
340  else
341  {
342  *attribute_value = *attribute_values;
343  return 1;
344  }
345  return 0;
346 }
Here is the caller graph for this function:

◆ get_data_reset()

void get_data_reset ( get_data_t data)

Reset command data.

Parameters
[in]dataCommand data.

Definition at line 2322 of file omp.c.

References get_data_t::filt_id, get_data_t::filter, get_data_t::filter_replace, get_data_t::filter_replacement, get_data_t::id, get_data_t::subtype, and get_data_t::type.

2323 {
2324  free (data->id);
2325  free (data->filt_id);
2326  free (data->filter);
2327  free (data->filter_replace);
2328  free (data->filter_replacement);
2329  free (data->subtype);
2330  free (data->type);
2331 
2332  memset (data, 0, sizeof (get_data_t));
2333 }
char * filt_id
Filter ID. Overrides "filter".
Definition: manage.h:313
gchar * subtype
Subtype, or NULL.
Definition: manage.h:320
Command data for a get command.
Definition: manage.h:310
gchar * type
Type of resource.
Definition: manage.h:319
char * id
ID of single item to get.
Definition: manage.h:317
char * filter_replacement
Filter term to replace the one in filt_id.
Definition: manage.h:316
char * filter_replace
Column to replace in filter.
Definition: manage.h:315
char * filter
Filter term.
Definition: manage.h:314

◆ get_ovaldi_files()

char* get_ovaldi_files ( )

Get list of ovaldi definitions files using the values in ovaldefs table in scap.db.

Returns
String of |-concatenated file names. Free with g_free().

Definition at line 13188 of file omp.c.

References cleanup_iterator(), init_ovaldi_file_iterator(), next(), and ovaldi_file_iterator_name().

13189 {
13191  char *result = NULL;
13192 
13194  while (next (&iterator))
13195  {
13196  char *tmp;
13197  const char *fname = ovaldi_file_iterator_name (&iterator);
13198 
13199  if (!fname)
13200  continue;
13201  tmp = g_strconcat (fname, result ? "|" : "", result, NULL);
13202  g_free (result);
13203  result = tmp;
13204  }
13206  return result;
13207 }
A generic SQL iterator.
Definition: iterator.h:52
void init_ovaldi_file_iterator(iterator_t *)
void cleanup_iterator(iterator_t *)
Cleanup an iterator.
Definition: sql.c:664
const char * ovaldi_file_iterator_name(iterator_t *)
gboolean next(iterator_t *)
Increment an iterator.
Definition: sql.c:689
Here is the call graph for this function:

◆ init_aggregate_lists()

void init_aggregate_lists ( const gchar *  group_column,
const gchar *  subgroup_column,
GList *  data_column_list,
GList *  text_column_list,
GList *  sort_data_list,
gchar **  group_column_type,
gchar **  subgroup_column_type,
GArray **  data_column_types,
GArray **  data_columns,
GArray **  text_column_types,
GArray **  text_columns,
GArray **  sort_data,
GArray **  c_sums 
)

Initialize lists for aggregates.

Parameters
[in]group_columnColumn the data are grouped by.
[in]subgroup_columnSecond column the data grouped by.
[in]data_column_listGList of columns statistics are calculated for.
[in]text_column_listGList of columns used for labels.
[in]sort_data_listGList of sort data.
[out]group_column_typeType of the group_column.
[out]subgroup_column_typeType of the group_column.
[out]data_column_typesTypes of the data_column.
[out]data_columnsdata_column_list copied to a GArray.
[out]text_column_typesTypes of the text_columns.
[out]text_columnstext_column_list copied to a GArray.
[out]sort_datasort_data_list copied to a GArray.
[out]c_sumsArray for calculating cumulative sums.

Definition at line 11849 of file omp.c.

References sort_data_t::field, sort_data_t::order, and sort_data_t::stat.

11862 {
11863  if (group_column == NULL)
11864  *group_column_type = "";
11865  else if (strcmp (group_column, "severity") == 0)
11866  *group_column_type = "cvss";
11867  else if (strcmp (group_column, "created") == 0
11868  || strcmp (group_column, "modified") == 0)
11869  *group_column_type = "unix_time";
11870  else
11871  *group_column_type = "text";
11872 
11873  if (subgroup_column == NULL)
11874  *subgroup_column_type = "";
11875  else if (strcmp (subgroup_column, "severity") == 0)
11876  *subgroup_column_type = "cvss";
11877  else if (strcmp (subgroup_column, "created") == 0
11878  || strcmp (subgroup_column, "modified") == 0)
11879  *subgroup_column_type = "unix_time";
11880  else
11881  *subgroup_column_type = "text";
11882 
11883  *data_columns = g_array_new (TRUE, TRUE, sizeof (gchar*));
11884  *data_column_types = g_array_new (TRUE, TRUE, sizeof (char*));
11885  *text_columns = g_array_new (TRUE, TRUE, sizeof (gchar*));
11886  *text_column_types = g_array_new (TRUE, TRUE, sizeof (char*));
11887  *c_sums = g_array_new (TRUE, TRUE, sizeof (double));
11888  *sort_data = g_array_new (TRUE, TRUE, sizeof (sort_data_t*));
11889 
11890  data_column_list = g_list_first (data_column_list);
11891  while (data_column_list)
11892  {
11893  gchar *data_column = data_column_list->data;
11894  if (strcmp (data_column, ""))
11895  {
11896  gchar *current_column = g_strdup (data_column);
11897  gchar *current_column_type;
11898  double c_sum = 0.0;
11899  g_array_append_val (*data_columns,
11900  current_column);
11901 
11902  if (strcmp (data_column, "severity") == 0)
11903  current_column_type = g_strdup ("cvss");
11904  else if (strcmp (data_column, "created") == 0
11905  || strcmp (data_column, "modified") == 0)
11906  current_column_type = g_strdup ("unix_time");
11907  else
11908  current_column_type = g_strdup ("decimal");
11909 
11910  g_array_append_val (*data_column_types, current_column_type);
11911 
11912  g_array_append_val (*c_sums, c_sum);
11913  }
11914  data_column_list = data_column_list->next;
11915  }
11916 
11917  text_column_list = g_list_first (text_column_list);
11918  while (text_column_list)
11919  {
11920  gchar *text_column = text_column_list->data;
11921  if (strcmp (text_column, ""))
11922  {
11923  gchar *current_column = g_strdup (text_column);
11924  gchar *current_column_type;
11925 
11926  current_column_type = g_strdup ("text");
11927 
11928  g_array_append_val (*text_columns, current_column);
11929  g_array_append_val (*text_column_types, current_column_type);
11930  }
11931  text_column_list = text_column_list->next;
11932  }
11933 
11934  sort_data_list = g_list_first (sort_data_list);
11935  while (sort_data_list)
11936  {
11937  sort_data_t *sort_data_item = sort_data_list->data;
11938  sort_data_t *sort_data_copy = g_malloc0 (sizeof (sort_data_t));
11939 
11940  sort_data_copy->field = g_strdup (sort_data_item->field);
11941  sort_data_copy->stat = g_strdup (sort_data_item->stat);
11942  sort_data_copy->order = sort_data_item->order;
11943  g_array_append_val (*sort_data, sort_data_copy);
11944 
11945  sort_data_list = sort_data_list->next;
11946  }
11947 }
int order
The sort order.
Definition: manage.h:4102
gchar * stat
The statistic to sort by.
Definition: manage.h:4101
gchar * field
The field to sort by.
Definition: manage.h:4100

◆ init_get()

int init_get ( gchar *  command,
get_data_t get,
const gchar *  setting_name,
int *  first 
)

Init for a GET handler.

Parameters
[in]commandOMP command name.
[in]getGET data.
[in]setting_nameType name for setting.
[out]firstFirst result, from filter.
Returns
0 success, -1 error.

Definition at line 396 of file omp.c.

References acl_user_may(), filter_term(), filter_term_value(), manage_clean_filter_remove(), manage_filter_controls(), and setting_filter().

398 {
399  gchar *filter, *replacement;
400 
401  if (acl_user_may (command) == 0)
402  return 99;
403 
404  /* Get any replacement out of get->filter, before it changes. Used to add
405  * task_id to the filter for GET_REPORTS. */
406 
407  if (get->filter_replace && strlen (get->filter_replace) && get->filter)
408  replacement = filter_term_value (get->filter, get->filter_replace);
409  else
410  replacement = NULL;
411 
412  /* Switch to the default filter from the setting, if required. */
413 
414  if (get->filt_id && strcmp (get->filt_id, "-2") == 0)
415  {
416  char *user_filter = setting_filter (setting_name);
417 
418  if (user_filter && strlen (user_filter))
419  {
420  get->filt_id = user_filter;
421  get->filter = filter_term (user_filter);
422  }
423  else
424  {
425  free (user_filter);
426  get->filt_id = g_strdup ("0");
427  }
428  }
429 
430  /* Get the actual filter string. */
431 
432  if (get->filt_id && strcmp (get->filt_id, "0"))
433  {
434  filter = filter_term (get->filt_id);
435  if (filter == NULL)
436  {
437  char *user_filter;
438 
439  /* Probably the user deleted the filter, switch to default. */
440 
441  g_free (get->filt_id);
442 
443  user_filter = setting_filter (setting_name);
444  if (user_filter && strlen (user_filter))
445  {
446  get->filt_id = user_filter;
447  get->filter = filter_term (user_filter);
448  filter = filter_term (get->filt_id);
449  }
450  else
451  get->filt_id = g_strdup ("0");
452  }
453  }
454  else
455  filter = NULL;
456 
457  if (replacement)
458  {
459  const gchar *term;
460 
461  /* Replace the term in filter. Used to add task_id to the filter
462  * for GET_REPORTS. */
463 
464  term = filter ? filter : get->filter;
465 
466  if (term)
467  {
468  gchar *new_filter, *clean;
469 
470  clean = manage_clean_filter_remove (term, get->filter_replace);
471  new_filter = g_strdup_printf
472  ("%s=%s %s",
473  get->filter_replace,
474  replacement,
475  clean);
476  g_free (clean);
477  if (get->filter)
478  {
479  g_free (get->filter);
480  get->filter = new_filter;
481  }
482  else
483  {
484  g_free (filter);
485  filter = new_filter;
486  }
487  get->filter_replacement = g_strdup (new_filter);
488  }
489 
490  g_free (replacement);
491  }
492 
493  /* Get the value of "first" from the filter string.
494  *
495  * This is used by get_next when the result set is empty, to determine if
496  * the query should be rerun with first 1.
497  */
498  manage_filter_controls (filter ? filter : get->filter, first, NULL, NULL,
499  NULL);
500 
501  g_free (filter);
502 
503  return 0;
504 }
char * setting_filter(const char *)
char * filt_id
Filter ID. Overrides "filter".
Definition: manage.h:313
gchar * filter_term_value(const char *, const char *)
gchar * manage_clean_filter_remove(const gchar *, const gchar *)
Clean a filter, removing a keyword in the process.
Definition: manage_sql.c:2743
gchar * filter_term(const char *)
void manage_filter_controls(const gchar *, int *, int *, gchar **, int *)
Get info from a filter.
Definition: manage_sql.c:2289
int acl_user_may(const char *operation)
Test whether a user may perform an operation.
Definition: manage_acl.c:56
char * filter_replace
Column to replace in filter.
Definition: manage.h:315
char * filter
Filter term.
Definition: manage.h:314
Here is the call graph for this function:

◆ init_omp()

int init_omp ( 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 OMP library.

Parameters
[in]log_configLogging configuration list.
[in]nvt_cache_modeTrue when running in NVT caching mode.
[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]progressFunction to update progress, or NULL.
[in]fork_connectionFunction to fork a connection to the OMP daemon layer, or NULL.
[in]skip_db_checkSkip DB check.
Returns
0 success, -1 error, -2 database is wrong version, -3 database needs to be initialized from server, -4 max_ips_per_target out of range.

Definition at line 30814 of file omp.c.

30820 {
30821  g_log_set_handler (G_LOG_DOMAIN,
30823  (GLogFunc) openvas_log_func,
30824  log_config);
30825  command_data_init (&command_data);
30826  return init_manage (log_config, nvt_cache_mode, database, max_ips_per_target,
30827  max_email_attachment_size, max_email_include_size,
30828  max_email_message_size,
30829  progress, fork_connection, skip_db_check);
30830 }
GSList * log_config
Logging parameters, as passed to setup_log_handlers.
Definition: openvasmd.c:310
int init_manage(GSList *, int, const gchar *, int, int, int, int, void(*)(), int(*)(openvas_connection_t *, gchar *), int)
Initialize the manage library.
Definition: manage_sql.c:17065
void(* progress)()
Function to mark progress.
Definition: manage_sql.c:352
command_data_t command_data
Parser callback data.
Definition: omp.c:4330
#define G_LOG_DOMAIN
GLib log domain.
Definition: omp.c:130
#define ALL_LOG_LEVELS
Flag with all Glib log levels.
Definition: manage.h:47

◆ init_omp_process()

void init_omp_process ( int  update_nvt_cache,
const gchar *  database,
int(*)(const char *, void *)  write_to_client,
void *  write_to_client_data,
gchar **  disable 
)

Initialise OMP library data for a process.

Parameters
[in]update_nvt_cache0 operate normally, -1 just update NVT cache, -2 just rebuild NVT cache.
[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_omp_client_input.

Definition at line 30846 of file omp.c.

30849 {
30850  forked = 0;
30851  client_state = CLIENT_TOP;
30852  command_data_init (&command_data);
30853  init_manage_process (update_nvt_cache, database);
30855  /* Create the XML parser. */
30856  xml_parser.start_element = omp_xml_handle_start_element;
30857  xml_parser.end_element = omp_xml_handle_end_element;
30858  xml_parser.text = omp_xml_handle_text;
30859  xml_parser.passthrough = NULL;
30860  xml_parser.error = omp_xml_handle_error;
30861  if (xml_context)
30862  g_markup_parse_context_free (xml_context);
30863  xml_context = g_markup_parse_context_new
30864  (&xml_parser,
30865  0,
30866  omp_parser_new (write_to_client, write_to_client_data,
30867  disable),
30868  (GDestroyNotify) omp_parser_free);
30869 }
void init_manage_process(int, const gchar *)
Initialize the manage library for a process.
Definition: manage_sql.c:14303
void omp_parser_free(omp_parser_t *omp_parser)
Free an OMP parser.
Definition: omp.c:748
void manage_reset_currents()
Cleanup as immediately as possible.
Definition: manage_sql.c:17173
command_data_t command_data
Parser callback data.
Definition: omp.c:4330
omp_parser_t * omp_parser_new(int(*write_to_client)(const char *, void *), void *write_to_client_data, gchar **disable)
Create an OMP parser.
Definition: omp.c:729
int forked
Hack for returning fork status to caller.
Definition: omp.c:4974

◆ modify_auth_data_reset()

void modify_auth_data_reset ( modify_auth_data_t data)

Reset command data.

Parameters
[in]dataCommand data.

Definition at line 3247 of file omp.c.

References modify_auth_data_t::curr_group_settings, auth_group_t::group_name, modify_auth_data_t::groups, auth_conf_setting_t::key, modify_auth_data_t::key, auth_group_t::settings, auth_conf_setting_t::value, and modify_auth_data_t::value.

3248 {
3249  GSList *item, *subitem;
3250 
3251  g_free (data->key);
3252  g_free (data->value);
3253 
3254  item = data->groups;
3255  subitem = NULL;
3256  while (item)
3257  {
3258  auth_group_t *group = (auth_group_t *) item->data;
3259  g_free (group->group_name);
3260  /* Free settings. */
3261  subitem = group->settings;
3262  while (subitem)
3263  {
3264  auth_conf_setting_t *kvp = (auth_conf_setting_t *) subitem->data;
3265  g_free (kvp->key);
3266  g_free (kvp->value);
3267  g_free (kvp);
3268  subitem = g_slist_next (subitem);
3269  }
3270  item = g_slist_next (item);
3271  }
3272  g_slist_free (data->groups);
3273 
3274  if (data->curr_group_settings)
3275  {
3276  item = data->curr_group_settings;
3277  while (item)
3278  {
3279  /* Free settings. */
3280  auth_conf_setting_t *kvp = (auth_conf_setting_t *) item->data;
3281  g_free (kvp->key);
3282  g_free (kvp->value);
3283  g_free (kvp);
3284  item = g_slist_next (item);
3285  }
3286  g_slist_free (data->curr_group_settings);
3287  }
3288  memset (data, 0, sizeof (modify_auth_data_t));
3289 }
GSList * curr_group_settings
Settings of currently parsed group.
Definition: omp.c:3238
gchar * value
The value.
Definition: omp.c:382
gchar * group_name
Name of the current group.
Definition: omp.c:3226
gchar * key
The key.
Definition: omp.c:381
Authentication method settings.
Definition: omp.c:3224
Command data for the modify_auth command.
Definition: omp.c:3233
GSList * settings
List of auth_conf_setting_t.
Definition: omp.c:3227
gchar * value
Value for current auth_conf_setting.
Definition: omp.c:3236
GSList * groups
List of auth_group_t.
Definition: omp.c:3237
A simple key/value-pair.
Definition: omp.c:379
gchar * key
Key for current auth_conf_setting.
Definition: omp.c:3235

◆ omp_parser_free()

void omp_parser_free ( omp_parser_t omp_parser)

Free an OMP parser.

Parameters
[in]omp_parserOMP parser.
Returns
An OMP parser.

Definition at line 748 of file omp.c.

References omp_parser_t::disabled_commands.

749 {
750  g_strfreev (omp_parser->disabled_commands);
751  g_free (omp_parser);
752 }
gchar ** disabled_commands
Disabled commands.
Definition: omp.c:712

◆ omp_parser_new()

omp_parser_t* omp_parser_new ( int(*)(const char *, void *)  write_to_client,
void *  write_to_client_data,
gchar **  disable 
)

Create an OMP parser.

Parameters
[in]write_to_clientFunction to write to client.
[in]write_to_client_dataArgument to write_to_client.
[in]disableCommands to disable. Copied, and freed by omp_parser_free.
Returns
An OMP parser.

Definition at line 729 of file omp.c.

731 {
732  omp_parser_t *omp_parser = (omp_parser_t*) g_malloc0 (sizeof (omp_parser_t));
733  omp_parser->client_writer = write_to_client;
734  omp_parser->client_writer_data = write_to_client_data;
735  omp_parser->read_over = 0;
736  omp_parser->disabled_commands = g_strdupv (disable);
737  return omp_parser;
738 }
gchar ** disabled_commands
Disabled commands.
Definition: omp.c:712
void * client_writer_data
Argument to client_writer.
Definition: omp.c:708
int(* client_writer)(const char *, void *)
Writes to the client.
Definition: omp.c:707
int read_over
Read over any child elements.
Definition: omp.c:710
A handle on an OMP parser.
Definition: omp.c:705

◆ process_omp_change()

int process_omp_change ( )

Deal with any changes caused by other processes.

Returns
0 success, 1 did something, -1 too little space in the scanner output buffer.

Definition at line 31098 of file omp.c.

References manage_check_current_task().

31099 {
31100  return manage_check_current_task ();
31101 }
int manage_check_current_task()
Handle state changes to current task made by other processes.
Definition: manage.c:5733
Here is the call graph for this function:

◆ process_omp_client_input()

int process_omp_client_input ( )

Process any XML available in from_client.

Todo:
The -2 return has been replaced by send_to_client trying to write the to_client buffer to the client when it is full. This is necessary, as the to_client buffer may fill up halfway through the processing of an OMP element.
Returns
0 success, -1 error, -2 or -3 too little space in to_client or the scanner output buffer (respectively), -4 XML syntax error.

Definition at line 30895 of file omp.c.

References manage_transaction_stop().

30896 {
30897  gboolean success;
30898  GError* error = NULL;
30899 
30900  /* Terminate any pending transaction. (force close = TRUE). */
30901  manage_transaction_stop (TRUE);
30902 
30903  /* In the XML parser handlers all writes to the to_scanner buffer must be
30904  * complete OTP commands, because the caller may also write into to_scanner
30905  * between calls to this function (via manage_check_current_task). */
30906 
30907  if (xml_context == NULL) return -1;
30908 
30909  current_error = 0;
30910  success = g_markup_parse_context_parse (xml_context,
30913  &error);
30914  if (success == FALSE)
30915  {
30916  int err;
30917  if (error)
30918  {
30919  err = -4;
30920  if (g_error_matches (error,
30921  G_MARKUP_ERROR,
30922  G_MARKUP_ERROR_UNKNOWN_ELEMENT))
30923  g_debug (" client error: G_MARKUP_ERROR_UNKNOWN_ELEMENT\n");
30924  else if (g_error_matches (error,
30925  G_MARKUP_ERROR,
30926  G_MARKUP_ERROR_INVALID_CONTENT))
30927  {
30928  if (current_error)
30929  {
30930  /* This is the return status for a forked child. */
30931  forked = 2; /* Prevent further forking. */
30932  g_error_free (error);
30933  return current_error;
30934  }
30935  g_debug (" client error: G_MARKUP_ERROR_INVALID_CONTENT\n");
30936  }
30937  else if (g_error_matches (error,
30938  G_MARKUP_ERROR,
30939  G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE))
30940  g_debug (" client error: G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE\n");
30941  else
30942  err = -1;
30943  g_info (" Failed to parse client XML: %s\n", error->message);
30944  g_error_free (error);
30945  }
30946  else
30947  err = -1;
30948  /* In all error cases the caller must cease to call this function as it
30949  * would be too hard, if possible at all, to figure out the position of
30950  * start of the next command. */
30951  return err;
30952  }
30954  if (forked)
30955  return 3;
30956  return 0;
30957 }
buffer_size_t from_client_start
The start of the data in the from_client buffer.
Definition: ompd.c:84
#define g_info(...)
Defines g_info for glib versions older than 2.40.
Definition: manage.h:55
int current_error
Hack for returning forked process status from the callbacks.
Definition: omp.c:4969
buffer_size_t from_client_end
The end of the data in the from_client buffer.
Definition: ompd.c:89
void manage_transaction_stop(gboolean)
int forked
Hack for returning fork status to caller.
Definition: omp.c:4974
char from_client[]
Buffer of input from the client.
Definition: ompd.c:74
Here is the call graph for this function:

◆ process_omp_write()

int process_omp_write ( const char *  msg,
void *  buffer 
)

Buffer the response for process_omp.

Parameters
[in]msgOMP response.
[in]bufferBuffer.
Returns
TRUE if failed, else FALSE.

Definition at line 30968 of file omp.c.

30969 {
30970  g_debug ("-> client internal: %s\n", msg);
30971  g_string_append ((GString*) buffer, msg);
30972  return FALSE;
30973 }

◆ strdiff()

gchar* strdiff ( const gchar *  one,
const gchar *  two 
)

Compare two string with the "diff" command.

Parameters
[in]oneFirst string.
[in]twoSecond string.
Returns
Output of "diff", or NULL on error.

Definition at line 11208 of file omp.c.

11209 {
11210  gchar **cmd, *ret, *one_file, *two_file, *old_lc_all, *old_language;
11211  gint exit_status;
11212  gchar *standard_out = NULL;
11213  gchar *standard_err = NULL;
11214  char dir[] = "/tmp/openvasmd-strdiff-XXXXXX";
11215  GError *error = NULL;
11216 
11217  if (mkdtemp (dir) == NULL)
11218  return NULL;
11219 
11220  one_file = g_build_filename (dir, "Report 1", NULL);
11221 
11222  g_file_set_contents (one_file, one, strlen (one), &error);
11223  if (error)
11224  {
11225  g_warning ("%s", error->message);
11226  g_error_free (error);
11227  openvas_file_remove_recurse (dir);
11228  g_free (one_file);
11229  return NULL;
11230  }
11231 
11232  two_file = g_build_filename (dir, "Report 2", NULL);
11233 
11234  g_file_set_contents (two_file, two, strlen (two), &error);
11235  if (error)
11236  {
11237  g_warning ("%s", error->message);
11238  g_error_free (error);
11239  openvas_file_remove_recurse (dir);
11240  g_free (one_file);
11241  g_free (two_file);
11242  return NULL;
11243  }
11244 
11245  old_lc_all = getenv ("LC_ALL") ? g_strdup (getenv ("LC_ALL")) : NULL;
11246  if (setenv ("LC_ALL", "C", 1) == -1)
11247  {
11248  g_warning ("%s: failed to set LC_ALL\n", __FUNCTION__);
11249  return NULL;
11250  }
11251 
11252  old_language = getenv ("LANGUAGE") ? g_strdup (getenv ("LANGUAGE")) : NULL;
11253  if (setenv ("LANGUAGE", "C", 1) == -1)
11254  {
11255  g_warning ("%s: failed to set LANGUAGE\n", __FUNCTION__);
11256  return NULL;
11257  }
11258 
11259  cmd = (gchar **) g_malloc (5 * sizeof (gchar *));
11260 
11261  cmd[0] = g_strdup ("diff");
11262  cmd[1] = g_strdup ("-u");
11263  cmd[2] = g_strdup ("Report 1");
11264  cmd[3] = g_strdup ("Report 2");
11265  cmd[4] = NULL;
11266  g_debug ("%s: Spawning in %s: %s \"%s\" \"%s\"\n",
11267  __FUNCTION__, dir,
11268  cmd[0], cmd[1], cmd[2]);
11269  if ((g_spawn_sync (dir,
11270  cmd,
11271  NULL, /* Environment. */
11272  G_SPAWN_SEARCH_PATH,
11273  NULL, /* Setup func. */
11274  NULL,
11275  &standard_out,
11276  &standard_err,
11277  &exit_status,
11278  NULL) == FALSE)
11279  || (WIFEXITED (exit_status) == 0)
11280  || WEXITSTATUS (exit_status))
11281  {
11282  if (WEXITSTATUS (exit_status) == 1)
11283  ret = standard_out;
11284  else
11285  {
11286  g_debug ("%s: failed to run diff: %d (WIF %i, WEX %i)",
11287  __FUNCTION__,
11288  exit_status,
11289  WIFEXITED (exit_status),
11290  WEXITSTATUS (exit_status));
11291  g_debug ("%s: stdout: %s\n", __FUNCTION__, standard_out);
11292  g_debug ("%s: stderr: %s\n", __FUNCTION__, standard_err);
11293  ret = NULL;
11294  g_free (standard_out);
11295  }
11296  }
11297  else
11298  ret = standard_out;
11299 
11300  if (old_lc_all && (setenv ("LC_ALL", old_lc_all, 1) == -1))
11301  {
11302  g_warning ("%s: failed to reset LC_ALL\n", __FUNCTION__);
11303  ret = NULL;
11304  }
11305  else if (old_language && (setenv ("LANGUAGE", old_language, 1) == -1))
11306  {
11307  g_warning ("%s: failed to reset LANGUAGE\n", __FUNCTION__);
11308  ret = NULL;
11309  }
11310 
11311  g_free (old_lc_all);
11312  g_free (old_language);
11313  g_free (cmd[0]);
11314  g_free (cmd[1]);
11315  g_free (cmd[2]);
11316  g_free (cmd[3]);
11317  g_free (cmd);
11318  g_free (standard_err);
11319  g_free (one_file);
11320  g_free (two_file);
11321  openvas_file_remove_recurse (dir);
11322 
11323  return ret;
11324 }

Variable Documentation

◆ client_address

char client_address[]

The OMP client's address.

Definition at line 285 of file openvasmd.c.

◆ command_data

command_data_t command_data

Parser callback data.

Definition at line 4330 of file omp.c.

◆ create_agent_data

Parser callback data for CREATE_AGENT.

Definition at line 4336 of file omp.c.

◆ create_alert_data

Parser callback data for CREATE_ALERT.

Definition at line 4354 of file omp.c.

◆ create_asset_data

create_asset_data_t* create_asset_data = (create_asset_data_t*) &(command_data.create_asset)

Parser callback data for CREATE_ASSET.

Definition at line 4342 of file omp.c.

◆ create_config_data

Parser callback data for CREATE_CONFIG.

Definition at line 4348 of file omp.c.

◆ create_credential_data

Parser callback data for CREATE_CREDENTIAL.

Definition at line 4360 of file omp.c.

◆ create_filter_data

Parser callback data for CREATE_FILTER.

Definition at line 4366 of file omp.c.

◆ create_group_data

Parser callback data for CREATE_GROUP.

Definition at line 4372 of file omp.c.

◆ create_note_data

Parser callback data for CREATE_NOTE.

Definition at line 4378 of file omp.c.

◆ create_override_data

Parser callback data for CREATE_OVERRIDE.

Definition at line 4384 of file omp.c.

◆ create_permission_data

Parser callback data for CREATE_PERMISSION.

Definition at line 4390 of file omp.c.

◆ create_port_list_data

Parser callback data for CREATE_PORT_LIST.

Definition at line 4396 of file omp.c.

◆ create_port_range_data

Parser callback data for CREATE_PORT_RANGE.

Definition at line 4402 of file omp.c.

◆ create_report_data

Parser callback data for CREATE_REPORT.

Definition at line 4414 of file omp.c.

◆ create_report_format_data

Parser callback data for CREATE_REPORT_FORMAT.

Definition at line 4420 of file omp.c.

◆ create_role_data

Parser callback data for CREATE_ROLE.

Definition at line 4408 of file omp.c.

◆ create_scanner_data

Parser callback data for CREATE_SCANNER.

Definition at line 4426 of file omp.c.

◆ create_schedule_data

Parser callback data for CREATE_SCHEDULE.

Definition at line 4432 of file omp.c.

◆ create_tag_data

Parser callback data for CREATE_TAG.

Definition at line 4438 of file omp.c.

◆ create_target_data

Parser callback data for CREATE_TARGET.

Definition at line 4444 of file omp.c.

◆ create_task_data

create_task_data_t* create_task_data = (create_task_data_t*) &(command_data.create_task)

Parser callback data for CREATE_TASK.

Definition at line 4450 of file omp.c.

◆ create_user_data

Parser callback data for CREATE_USER.

Definition at line 4456 of file omp.c.

◆ current_error

int current_error

Hack for returning forked process status from the callbacks.

Definition at line 4969 of file omp.c.

◆ delete_agent_data

Parser callback data for DELETE_AGENT.

Definition at line 4462 of file omp.c.

◆ delete_alert_data

Parser callback data for DELETE_ALERT.

Definition at line 4480 of file omp.c.

◆ delete_asset_data

Parser callback data for DELETE_ASSET.

Definition at line 4468 of file omp.c.

◆ delete_config_data

Parser callback data for DELETE_CONFIG.

Definition at line 4474 of file omp.c.

◆ delete_credential_data

Parser callback data for DELETE_CREDENTIAL.

Definition at line 4486 of file omp.c.

◆ delete_filter_data

Parser callback data for DELETE_FILTER.

Definition at line 4492 of file omp.c.

◆ delete_group_data

Parser callback data for DELETE_GROUP.

Definition at line 4498 of file omp.c.

◆ delete_note_data

Parser callback data for DELETE_NOTE.

Definition at line 4504 of file omp.c.

◆ delete_override_data

Parser callback data for DELETE_OVERRIDE.

Definition at line 4510 of file omp.c.

◆ delete_permission_data

Parser callback data for DELETE_PERMISSION.

Definition at line 4516 of file omp.c.

◆ delete_port_list_data

Parser callback data for DELETE_PORT_LIST.

Definition at line 4522 of file omp.c.

◆ delete_port_range_data

Parser callback data for DELETE_PORT_RANGE.

Definition at line 4528 of file omp.c.

◆ delete_report_data

Parser callback data for DELETE_REPORT.

Definition at line 4534 of file omp.c.

◆ delete_report_format_data

Parser callback data for DELETE_REPORT_FORMAT.

Definition at line 4540 of file omp.c.

◆ delete_role_data

Parser callback data for DELETE_ROLE.

Definition at line 4546 of file omp.c.

◆ delete_scanner_data

Parser callback data for DELETE_SCANNER.

Definition at line 4552 of file omp.c.

◆ delete_schedule_data

Parser callback data for DELETE_SCHEDULE.

Definition at line 4558 of file omp.c.

◆ delete_tag_data

Parser callback data for DELETE_TAG.

Definition at line 4564 of file omp.c.

◆ delete_target_data

Parser callback data for DELETE_TARGET.

Definition at line 4570 of file omp.c.

◆ delete_task_data

Parser callback data for DELETE_TASK.

Definition at line 4576 of file omp.c.

◆ delete_user_data

Parser callback data for DELETE_USER.

Definition at line 4582 of file omp.c.

◆ forked

int forked

Hack for returning fork status to caller.

Definition at line 4974 of file omp.c.

◆ from_client

char from_client[]

Buffer of input from the client.

Todo:
Most likely the client should get these from init_omp_process inside an omp_parser_t and should pass the omp_parser_t to process_omp_client_input. process_omp_client_input can pass then pass them on to the other Manager "libraries".

Definition at line 74 of file ompd.c.

◆ from_client_end

buffer_size_t from_client_end

The end of the data in the from_client buffer.

Definition at line 89 of file ompd.c.

◆ from_client_start

buffer_size_t from_client_start

The start of the data in the from_client buffer.

Definition at line 84 of file ompd.c.

◆ get_agents_data

get_agents_data_t* get_agents_data = &(command_data.get_agents)

Parser callback data for GET_AGENTS.

Definition at line 4588 of file omp.c.

◆ get_aggregates_data

get_aggregates_data_t* get_aggregates_data = &(command_data.get_aggregates)

Parser callback data for GET_AGGREGATES.

Definition at line 4594 of file omp.c.

◆ get_alerts_data

get_alerts_data_t* get_alerts_data = &(command_data.get_alerts)

Parser callback data for GET_ALERTS.

Definition at line 4606 of file omp.c.

◆ get_assets_data

get_assets_data_t* get_assets_data = &(command_data.get_assets)

Parser callback data for GET_ASSETS.

Definition at line 4612 of file omp.c.

◆ get_configs_data

get_configs_data_t* get_configs_data = &(command_data.get_configs)

Parser callback data for GET_CONFIGS.

Definition at line 4600 of file omp.c.

◆ get_credentials_data

get_credentials_data_t* get_credentials_data = &(command_data.get_credentials)

Parser callback data for GET_CREDENTIALS.

Definition at line 4618 of file omp.c.

◆ get_feeds_data

get_feeds_data_t* get_feeds_data = &(command_data.get_feeds)

Parser callback data for GET_FEEDS.

Definition at line 4624 of file omp.c.

◆ get_filters_data

get_filters_data_t* get_filters_data = &(command_data.get_filters)

Parser callback data for GET_FILTERS.

Definition at line 4630 of file omp.c.

◆ get_groups_data

get_groups_data_t* get_groups_data = &(command_data.get_groups)

Parser callback data for GET_GROUPS.

Definition at line 4636 of file omp.c.

◆ get_info_data

get_info_data_t* get_info_data = &(command_data.get_info)

Parser callback data for GET_INFO.

Definition at line 4642 of file omp.c.

◆ get_notes_data

get_notes_data_t* get_notes_data = &(command_data.get_notes)

Parser callback data for GET_NOTES.

Definition at line 4648 of file omp.c.

◆ get_nvt_families_data

get_nvt_families_data_t* get_nvt_families_data = &(command_data.get_nvt_families)

Parser callback data for GET_NVT_FAMILIES.

Definition at line 4660 of file omp.c.

◆ get_nvts_data

get_nvts_data_t* get_nvts_data = &(command_data.get_nvts)

Parser callback data for GET_NVTS.

Definition at line 4654 of file omp.c.

◆ get_overrides_data

get_overrides_data_t* get_overrides_data = &(command_data.get_overrides)

Parser callback data for GET_OVERRIDES.

Definition at line 4666 of file omp.c.

◆ get_permissions_data

get_permissions_data_t* get_permissions_data = &(command_data.get_permissions)

Parser callback data for GET_PERMISSIONS.

Definition at line 4672 of file omp.c.

◆ get_port_lists_data

get_port_lists_data_t* get_port_lists_data = &(command_data.get_port_lists)

Parser callback data for GET_PORT_LISTS.

Definition at line 4678 of file omp.c.

◆ get_preferences_data

get_preferences_data_t* get_preferences_data = &(command_data.get_preferences)

Parser callback data for GET_PREFERENCES.

Definition at line 4684 of file omp.c.

◆ get_report_formats_data

get_report_formats_data_t* get_report_formats_data = &(command_data.get_report_formats)

Parser callback data for GET_REPORT_FORMATS.

Definition at line 4696 of file omp.c.

◆ get_reports_data

get_reports_data_t* get_reports_data = &(command_data.get_reports)

Parser callback data for GET_REPORTS.

Definition at line 4690 of file omp.c.

◆ get_results_data

get_results_data_t* get_results_data = &(command_data.get_results)

Parser callback data for GET_RESULTS.

Definition at line 4702 of file omp.c.

◆ get_roles_data

get_roles_data_t* get_roles_data = &(command_data.get_roles)

Parser callback data for GET_ROLES.

Definition at line 4708 of file omp.c.

◆ get_scanners_data

get_scanners_data_t* get_scanners_data = &(command_data.get_scanners)

Parser callback data for GET_scannerS.

Definition at line 4714 of file omp.c.

◆ get_schedules_data

get_schedules_data_t* get_schedules_data = &(command_data.get_schedules)

Parser callback data for GET_SCHEDULES.

Definition at line 4720 of file omp.c.

◆ get_settings_data

get_settings_data_t* get_settings_data = &(command_data.get_settings)

Parser callback data for GET_SETTINGS.

Definition at line 4726 of file omp.c.

◆ get_system_reports_data

get_system_reports_data_t* get_system_reports_data = &(command_data.get_system_reports)

Parser callback data for GET_SYSTEM_REPORTS.

Definition at line 4732 of file omp.c.

◆ get_tags_data

get_tags_data_t* get_tags_data = &(command_data.get_tags)

Parser callback data for GET_TAGS.

Definition at line 4738 of file omp.c.

◆ get_targets_data

get_targets_data_t* get_targets_data = &(command_data.get_targets)

Parser callback data for GET_TARGETS.

Definition at line 4744 of file omp.c.

◆ get_tasks_data

get_tasks_data_t* get_tasks_data = &(command_data.get_tasks)

Parser callback data for GET_TASKS.

Definition at line 4750 of file omp.c.

◆ get_users_data

get_users_data_t* get_users_data = &(command_data.get_users)

Parser callback data for GET_USERS.

Definition at line 4756 of file omp.c.

◆ help_data

help_data_t* help_data = &(command_data.help)

Parser callback data for HELP.

Definition at line 4762 of file omp.c.

◆ import_config_data

import_config_data_t* import_config_data = (import_config_data_t*) &(command_data.create_config.import)

Parser callback data for CREATE_CONFIG (import).

Definition at line 4768 of file omp.c.

◆ modify_agent_data

Parser callback data for MODIFY_AGENT.

Definition at line 4780 of file omp.c.

◆ modify_alert_data

Parser callback data for MODIFY_ALERT.

Definition at line 4786 of file omp.c.

◆ modify_asset_data

Parser callback data for MODIFY_ASSET.

Definition at line 4792 of file omp.c.

◆ modify_auth_data

modify_auth_data_t* modify_auth_data = &(command_data.modify_auth)

Parser callback data for MODIFY_AUTH.

Definition at line 4798 of file omp.c.

◆ modify_config_data

modify_config_data_t* modify_config_data = &(command_data.modify_config)

Parser callback data for MODIFY_CONFIG.

Definition at line 4774 of file omp.c.

◆ modify_credential_data

Parser callback data for MODIFY_CREDENTIAL.

Definition at line 4804 of file omp.c.

◆ modify_filter_data

Parser callback data for MODIFY_FILTER.

Definition at line 4810 of file omp.c.

◆ modify_group_data

Parser callback data for MODIFY_GROUP.

Definition at line 4816 of file omp.c.

◆ modify_note_data

Parser callback data for MODIFY_NOTE.

Definition at line 4822 of file omp.c.

◆ modify_override_data

Parser callback data for MODIFY_OVERRIDE.

Definition at line 4828 of file omp.c.

◆ modify_permission_data

Parser callback data for MODIFY_PERMISSION.

Definition at line 4834 of file omp.c.

◆ modify_port_list_data

Parser callback data for MODIFY_PORT_LIST.

Definition at line 4840 of file omp.c.

◆ modify_report_data

Parser callback data for MODIFY_REPORT.

Definition at line 4846 of file omp.c.

◆ modify_report_format_data

Parser callback data for MODIFY_REPORT_FORMAT.

Definition at line 4852 of file omp.c.

◆ modify_role_data

Parser callback data for MODIFY_ROLE.

Definition at line 4858 of file omp.c.

◆ modify_scanner_data

Parser callback data for MODIFY_SCANNER.

Definition at line 4864 of file omp.c.

◆ modify_schedule_data

Parser callback data for MODIFY_SCHEDULE.

Definition at line 4870 of file omp.c.

◆ modify_setting_data

Parser callback data for MODIFY_SETTING.

Definition at line 4876 of file omp.c.

◆ modify_tag_data

Parser callback data for MODIFY_TAG.

Definition at line 4882 of file omp.c.

◆ modify_target_data

Parser callback data for MODIFY_TARGET.

Definition at line 4888 of file omp.c.

◆ modify_task_data

modify_task_data_t* modify_task_data = &(command_data.modify_task)

Parser callback data for MODIFY_TASK.

Definition at line 4894 of file omp.c.

◆ modify_user_data

Parser callback data for MODIFY_USER.

Definition at line 4899 of file omp.c.

◆ move_task_data

Parser callback data for MOVE_TASK.

Definition at line 4904 of file omp.c.

◆ restore_data

restore_data_t* restore_data = (restore_data_t*) &(command_data.restore)

Parser callback data for RESTORE.

Definition at line 4910 of file omp.c.

◆ resume_task_data

Parser callback data for RESUME_TASK.

Definition at line 4916 of file omp.c.

◆ run_wizard_data

run_wizard_data_t* run_wizard_data = (run_wizard_data_t*) &(command_data.wizard)

Parser callback data for WIZARD.

Definition at line 4964 of file omp.c.

◆ start_task_data

Parser callback data for START_TASK.

Definition at line 4922 of file omp.c.

◆ stop_task_data

Parser callback data for STOP_TASK.

Definition at line 4928 of file omp.c.

◆ sync_config_data

Parser callback data for SYNC_CONFIG.

Definition at line 4934 of file omp.c.

◆ test_alert_data

test_alert_data_t* test_alert_data = (test_alert_data_t*) &(command_data.test_alert)

Parser callback data for TEST_ALERT.

Definition at line 4940 of file omp.c.

◆ to_client

char to_client[TO_CLIENT_BUFFER_SIZE]

Buffer of output to the client.

Todo:
As described in omp.c, probably should be replaced by omp_parser_t.

Definition at line 4979 of file omp.c.

◆ to_client_end

buffer_size_t to_client_end = 0

The end of the data in the to_client buffer.

Definition at line 4988 of file omp.c.

Referenced by ompd_send_to_client().

◆ to_client_start

buffer_size_t to_client_start = 0

The start of the data in the to_client buffer.

Definition at line 4984 of file omp.c.

◆ verify_agent_data

Parser callback data for VERIFY_AGENT.

Definition at line 4946 of file omp.c.

◆ verify_report_format_data

Parser callback data for VERIFY_REPORT_FORMAT.

Definition at line 4952 of file omp.c.

◆ verify_scanner_data

Parser callback data for VERIFY_SCANNER.

Definition at line 4958 of file omp.c.