Greenbone Vulnerability Management Libraries: openvasd/openvasd.h Source File

Greenbone Vulnerability Management Libraries 23.7.0

openvasd.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
10
11#ifndef _GVM_OPENVASD_OPENVASD_H
12#define _GVM_OPENVASD_OPENVASD_H
13
14#include "../base/nvti.h"
15#include "../http_scanner/http_scanner.h"
16#include "../util/credentialutils.h"
17#include "../util/jsonpull.h"
18
19#include <glib.h>
20#include <stdio.h>
21#include <time.h>
22
23 typedef struct
24{
25 int start;
26 int end;
27 const gchar *titles;
28} openvasd_get_performance_opts_t;
29
33 typedef struct openvasd_alive_test_methods
34{
35 gboolean icmp;
36 gboolean tcp_syn;
37 gboolean tcp_ack;
38 gboolean arp;
39 gboolean consider_alive;
40 gboolean host_discovery_ipv6;
41} openvasd_alive_test_methods_t;
42
43// Requests
44http_scanner_resp_t openvasd_get_vts (http_scanner_connector_t);
45
46http_scanner_resp_t openvasd_get_performance (http_scanner_connector_t,
47 openvasd_get_performance_opts_t);
48int
49 openvasd_parsed_performance (http_scanner_connector_t,
50 openvasd_get_performance_opts_t, gchar **,
51 gchar **err);
52
53/* Target builder */
54 typedef struct openvasd_target openvasd_target_t;
55
56 typedef struct openvasd_vt_single openvasd_vt_single_t;
57
58 openvasd_target_t *
59 openvasd_target_new (const gchar *, const gchar *, const gchar *, const gchar *,
60 int, int);
61
62void
63 openvasd_target_set_finished_hosts (openvasd_target_t *, const gchar *);
64
65void
66 openvasd_target_set_alive_test_methods (
67 openvasd_target_t *target, const openvasd_alive_test_methods_t *methods);
68
69void
70 openvasd_target_free (openvasd_target_t *);
71
72void
73 openvasd_target_add_credential (openvasd_target_t *, scan_credential_t *);
74
75 openvasd_vt_single_t *
76 openvasd_vt_single_new (const gchar *);
77
78void
79 openvasd_vt_single_free (openvasd_vt_single_t *);
80
81void
82 openvasd_vt_single_add_value (openvasd_vt_single_t *, const gchar *,
83 const gchar *);
84
85char *
86 openvasd_build_scan_config_json (openvasd_target_t *, GHashTable *, GSList *);
87
88/* VT stream */
89http_scanner_resp_t openvasd_get_vt_stream_init (http_scanner_connector_t);
90
91int openvasd_get_vt_stream (http_scanner_connector_t);
92
93#endif /* not _GVM_OPENVASD_OPENVASD_H */
credentialutils.h
Functions for handling scan credentials.
scan_credential_t
struct scan_credential scan_credential_t
Definition credentialutils.h:16
jsonpull.h
nvti.h
Protos and data structures for NVT Information data sets.
openvasd_get_performance
http_scanner_resp_t openvasd_get_performance(http_scanner_connector_t, openvasd_get_performance_opts_t)
Get performance data.
Definition openvasd.c:134
openvasd_parsed_performance
int openvasd_parsed_performance(http_scanner_connector_t, openvasd_get_performance_opts_t, gchar **, gchar **err)
Parse performance data.
Definition openvasd.c:184
openvasd_target_free
void openvasd_target_free(openvasd_target_t *)
Free an openvasd target, including all added credentials.
Definition openvasd.c:553
openvasd_target_set_alive_test_methods
void openvasd_target_set_alive_test_methods(openvasd_target_t *target, const openvasd_alive_test_methods_t *methods)
Add alive test methods to openvasd target.
Definition openvasd.c:576
openvasd_target_set_finished_hosts
void openvasd_target_set_finished_hosts(openvasd_target_t *, const gchar *)
Set the finished hosts of an openvasd target.
Definition openvasd.c:540
openvasd_get_vt_stream_init
http_scanner_resp_t openvasd_get_vt_stream_init(http_scanner_connector_t)
Fetch feed metadata chunk by chunk.
Definition openvasd.c:68
openvasd_vt_single_new
openvasd_vt_single_t * openvasd_vt_single_new(const gchar *)
Create a new single openvasd VT.
Definition openvasd.c:616
openvasd_vt_single_t
struct openvasd_vt_single openvasd_vt_single_t
Definition openvasd.h:56
openvasd_get_vts
http_scanner_resp_t openvasd_get_vts(http_scanner_connector_t)
Get VT's metadata.
Definition openvasd.c:107
openvasd_vt_single_free
void openvasd_vt_single_free(openvasd_vt_single_t *)
Free a single openvasd VT, including all preference values.
Definition openvasd.c:634
openvasd_target_new
openvasd_target_t * openvasd_target_new(const gchar *, const gchar *, const gchar *, const gchar *, int, int)
Create a new openvasd target.
Definition openvasd.c:511
openvasd_target_t
struct openvasd_target openvasd_target_t
Definition openvasd.h:54
openvasd_target_add_credential
void openvasd_target_add_credential(openvasd_target_t *, scan_credential_t *)
Add a credential to an openvasd target.
Definition openvasd.c:599
openvasd_alive_test_methods_t
struct openvasd_alive_test_methods openvasd_alive_test_methods_t
Struct holding alive test method options.
openvasd_build_scan_config_json
char * openvasd_build_scan_config_json(openvasd_target_t *, GHashTable *, GSList *)
Build a json object with data necessary to start a scan.
Definition openvasd.c:369
openvasd_vt_single_add_value
void openvasd_vt_single_add_value(openvasd_vt_single_t *, const gchar *, const gchar *)
Add a preference value to an openvasd VT.
Definition openvasd.c:655
openvasd_get_vt_stream
int openvasd_get_vt_stream(http_scanner_connector_t)
Get a new feed metadata chunk.
Definition openvasd.c:93
openvasd_alive_test_methods
Struct holding alive test method options.
Definition openvasd.h:34
openvasd_alive_test_methods::host_discovery_ipv6
gboolean host_discovery_ipv6
Definition openvasd.h:40
openvasd_alive_test_methods::arp
gboolean arp
Definition openvasd.h:38
openvasd_alive_test_methods::tcp_ack
gboolean tcp_ack
Definition openvasd.h:37
openvasd_alive_test_methods::icmp
gboolean icmp
Definition openvasd.h:35
openvasd_alive_test_methods::tcp_syn
gboolean tcp_syn
Definition openvasd.h:36
openvasd_alive_test_methods::consider_alive
gboolean consider_alive
Definition openvasd.h:39
openvasd_get_performance_opts_t
Definition openvasd.h:24
openvasd_get_performance_opts_t::titles
const gchar * titles
Definition openvasd.h:27
openvasd_get_performance_opts_t::end
int end
Definition openvasd.h:26
openvasd_get_performance_opts_t::start
int start
Definition openvasd.h:25
openvasd_target
Struct holding target information.
Definition openvasd.c:39
openvasd_vt_single
Struct holding vt information.
Definition openvasd.c:55