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

Greenbone Vulnerability Management Libraries 23.1.1

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
30// Requests
31http_scanner_resp_t openvasd_get_vts (http_scanner_connector_t);
32
33http_scanner_resp_t openvasd_get_performance (http_scanner_connector_t,
34 openvasd_get_performance_opts_t);
35int
36 openvasd_parsed_performance (http_scanner_connector_t,
37 openvasd_get_performance_opts_t, gchar **,
38 gchar **err);
39
40/* Target builder */
41 typedef struct openvasd_target openvasd_target_t;
42
43 typedef struct openvasd_vt_single openvasd_vt_single_t;
44
45 openvasd_target_t *
46 openvasd_target_new (const gchar *, const gchar *, const gchar *, const gchar *,
47 int, int);
48
49void
50 openvasd_target_set_finished_hosts (openvasd_target_t *, const gchar *);
51
52void
53 openvasd_target_add_alive_test_methods (openvasd_target_t *, gboolean, gboolean,
54 gboolean, gboolean, gboolean);
55
56void
57 openvasd_target_free (openvasd_target_t *);
58
59void
60 openvasd_target_add_credential (openvasd_target_t *, scan_credential_t *);
61
62 openvasd_vt_single_t *
63 openvasd_vt_single_new (const gchar *);
64
65void
66 openvasd_vt_single_free (openvasd_vt_single_t *);
67
68void
69 openvasd_vt_single_add_value (openvasd_vt_single_t *, const gchar *,
70 const gchar *);
71
72char *
73 openvasd_build_scan_config_json (openvasd_target_t *, GHashTable *, GSList *);
74
75/* VT stream */
76http_scanner_resp_t openvasd_get_vt_stream_init (http_scanner_connector_t);
77
78int openvasd_get_vt_stream (http_scanner_connector_t);
79
80#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:138
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:188
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_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:72
openvasd_vt_single_new
openvasd_vt_single_t * openvasd_vt_single_new(const gchar *)
Create a new single openvasd VT.
Definition openvasd.c:619
openvasd_vt_single_t
struct openvasd_vt_single openvasd_vt_single_t
Definition openvasd.h:43
openvasd_get_vts
http_scanner_resp_t openvasd_get_vts(http_scanner_connector_t)
Get VT's metadata.
Definition openvasd.c:111
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:637
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_add_alive_test_methods
void openvasd_target_add_alive_test_methods(openvasd_target_t *, gboolean, gboolean, gboolean, gboolean, gboolean)
Add alive test methods to openvasd target.
Definition openvasd.c:580
openvasd_target_t
struct openvasd_target openvasd_target_t
Definition openvasd.h:41
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:602
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:373
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:658
openvasd_get_vt_stream
int openvasd_get_vt_stream(http_scanner_connector_t)
Get a new feed metadata chunk.
Definition openvasd.c:97
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:59