|
Greenbone Vulnerability Management Libraries 22.29.3
|
API for Openvas Daemon communication. More...
#include "../base/nvti.h"#include "../http_scanner/http_scanner.h"#include "../util/jsonpull.h"#include <glib.h>#include <stdio.h>#include <time.h>Go to the source code of this file.
Data Structures | |
| struct | openvasd_get_performance_opts_t |
Typedefs | |
| typedef struct openvasd_target | openvasd_target_t |
| typedef struct openvasd_vt_single | openvasd_vt_single_t |
| typedef struct openvasd_credential | openvasd_credential_t |
Functions | |
| http_scanner_resp_t | openvasd_get_vts (http_scanner_connector_t) |
| Get VT's metadata. | |
| http_scanner_resp_t | openvasd_get_performance (http_scanner_connector_t, openvasd_get_performance_opts_t) |
| Get performance data. | |
| int | openvasd_parsed_performance (http_scanner_connector_t, openvasd_get_performance_opts_t, gchar **, gchar **err) |
| Parse performance data. | |
| openvasd_target_t * | openvasd_target_new (const gchar *, const gchar *, const gchar *, const gchar *, int, int) |
| Create a new openvasd target. | |
| void | openvasd_target_set_finished_hosts (openvasd_target_t *, const gchar *) |
| Set the finished hosts of an openvasd target. | |
| void | openvasd_target_add_alive_test_methods (openvasd_target_t *, gboolean, gboolean, gboolean, gboolean, gboolean) |
| Add alive test methods to openvasd target. | |
| void | openvasd_target_free (openvasd_target_t *) |
| Free an openvasd target, including all added credentials. | |
| openvasd_credential_t * | openvasd_credential_new (const gchar *, const gchar *, const gchar *) |
| Allocate and initialize a new openvasd credential. | |
| void | openvasd_credential_set_auth_data (openvasd_credential_t *, const gchar *, const gchar *) |
| Get authentication data from an openvasd credential. | |
| void | openvasd_credential_free (openvasd_credential_t *) |
| Free an openvasd credential. | |
| void | openvasd_target_add_credential (openvasd_target_t *, openvasd_credential_t *) |
| Add a credential to an openvasd target. | |
| openvasd_vt_single_t * | openvasd_vt_single_new (const gchar *) |
| Create a new single openvasd VT. | |
| void | openvasd_vt_single_free (openvasd_vt_single_t *) |
| Free a single openvasd VT, including all preference values. | |
| void | openvasd_vt_single_add_value (openvasd_vt_single_t *, const gchar *, const gchar *) |
| Add a preference value to an openvasd VT. | |
| char * | openvasd_build_scan_config_json (openvasd_target_t *, GHashTable *, GSList *) |
| Build a json object with data necessary to start a scan. | |
| http_scanner_resp_t | openvasd_get_vt_stream_init (http_scanner_connector_t) |
| Fetch feed metadata chunk by chunk. | |
| int | openvasd_get_vt_stream (http_scanner_connector_t) |
| Get a new feed metadata chunk. | |
API for Openvas Daemon communication.
| typedef struct openvasd_credential openvasd_credential_t |
| typedef struct openvasd_target openvasd_target_t |
| typedef struct openvasd_vt_single openvasd_vt_single_t |
| char * openvasd_build_scan_config_json | ( | openvasd_target_t * | target, |
| GHashTable * | scan_preferences, | ||
| GSList * | vts ) |
Build a json object with data necessary to start a scan.
JSON result consists of scan_id, message type, host ip, hostname, port, together with proto, OID, result message and uri.
| target | target |
| scan_preferences | Scan preferences to be added to the scan config |
| vts | VTS collection to be added to the scan config. |
| void openvasd_credential_free | ( | openvasd_credential_t * | credential | ) |
Free an openvasd credential.
| credential | The credential to free. |
| openvasd_credential_t * openvasd_credential_new | ( | const gchar * | type, |
| const gchar * | service, | ||
| const gchar * | port ) |
Allocate and initialize a new openvasd credential.
| type | The credential type. |
| service | The service the credential is for. |
| port | The port. |
| void openvasd_credential_set_auth_data | ( | openvasd_credential_t * | credential, |
| const gchar * | name, | ||
| const gchar * | value ) |
Get authentication data from an openvasd credential.
| credential | The credential to get the data from. |
| name | The name of the data item to get. |
| value | The authentication data or NULL to unset. |
| http_scanner_resp_t openvasd_get_performance | ( | http_scanner_connector_t | conn, |
| openvasd_get_performance_opts_t | opts ) |
Get performance data.
| conn | Connector struct with the data necessary for the connection. |
| opts | Options for the performance request. |
| int openvasd_get_vt_stream | ( | http_scanner_connector_t | conn | ) |
Get a new feed metadata chunk.
This function must be call until the return value is 0, meaning there is no more data to fetch.
| conn | Connector struct with the data necessary for the connection |
| http_scanner_resp_t openvasd_get_vt_stream_init | ( | http_scanner_connector_t | conn | ) |
Fetch feed metadata chunk by chunk.
| conn | Connector struct with the data necessary for the connection |
| http_scanner_resp_t openvasd_get_vts | ( | http_scanner_connector_t | conn | ) |
Get VT's metadata.
| conn | Connector struct with the data necessary for the connection |
| int openvasd_parsed_performance | ( | http_scanner_connector_t | conn, |
| openvasd_get_performance_opts_t | opts, | ||
| gchar ** | graph, | ||
| gchar ** | err ) |
Parse performance data.
| conn | Connector struct with the data necessary for the connection. |
| opts | Options for the performance request. |
| graph | Pointer to store the graph data. |
| err | Pointer to store error message if any. |
| void openvasd_target_add_alive_test_methods | ( | openvasd_target_t * | target, |
| gboolean | icmp, | ||
| gboolean | tcp_syn, | ||
| gboolean | tcp_ack, | ||
| gboolean | arp, | ||
| gboolean | consider_alive ) |
Add alive test methods to openvasd target.
| target | The openvasd target to add the methods to. |
| icmp | Use ICMP ping. |
| tcp_syn | Use TCP-SYN ping. |
| tcp_ack | Use TCP-ACK ping. |
| arp | Use ARP ping. |
| consider_alive | Consider host to be alive. |
| void openvasd_target_add_credential | ( | openvasd_target_t * | target, |
| openvasd_credential_t * | credential ) |
Add a credential to an openvasd target.
| target | The openvasd target to add the credential to. |
| credential | The credential to add. Will be freed with target. |
| void openvasd_target_free | ( | openvasd_target_t * | target | ) |
Free an openvasd target, including all added credentials.
| target | The openvasd target to free. |
| openvasd_target_t * openvasd_target_new | ( | const gchar * | scanid, |
| const gchar * | hosts, | ||
| const gchar * | ports, | ||
| const gchar * | exclude_hosts, | ||
| int | reverse_lookup_unify, | ||
| int | reverse_lookup_only ) |
Create a new openvasd target.
| scanid | Scan ID. |
| hosts | The hostnames of the target. |
| ports | The ports of the target. |
| exclude_hosts | The excluded hosts of the target. |
| reverse_lookup_unify | Lookup flag. |
| reverse_lookup_only | Lookup flag. |
| void openvasd_target_set_finished_hosts | ( | openvasd_target_t * | target, |
| const gchar * | finished_hosts ) |
Set the finished hosts of an openvasd target.
| target | The openvasd target to modify. |
| finished_hosts | The hostnames to consider finished. |
| void openvasd_vt_single_add_value | ( | openvasd_vt_single_t * | vt_single, |
| const gchar * | name, | ||
| const gchar * | value ) |
Add a preference value to an openvasd VT.
This creates a copy of the name and value.
| vt_single | The VT to add the preference to. |
| name | The name / identifier of the preference. |
| value | The value of the preference. |
| void openvasd_vt_single_free | ( | openvasd_vt_single_t * | vt_single | ) |
Free a single openvasd VT, including all preference values.
| vt_single | The openvasd VT to free. |
| openvasd_vt_single_t * openvasd_vt_single_new | ( | const gchar * | vt_id | ) |
Create a new single openvasd VT.
| vt_id | The id of the VT. |