openvasd.h
Go to the documentation of this file.
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _GVM_OPENVASD_OPENVASD_H
#define _GVM_OPENVASD_OPENVASD_H
#include "../base/nvti.h"
#include "../http_scanner/http_scanner.h"
#include "../util/jsonpull.h"
#include <glib.h>
#include <stdio.h>
#include <time.h>
typedef struct
{
int start;
int end;
const gchar *titles;
} openvasd_get_performance_opts_t;
// Requests
http_scanner_resp_t openvasd_get_vts (http_scanner_connector_t);
http_scanner_resp_t openvasd_get_performance (http_scanner_connector_t,
openvasd_get_performance_opts_t);
int
openvasd_parsed_performance (http_scanner_connector_t,
openvasd_get_performance_opts_t, gchar **,
gchar **err);
/* Target builder */
typedef struct openvasd_target openvasd_target_t;
typedef struct openvasd_vt_single openvasd_vt_single_t;
typedef struct openvasd_credential openvasd_credential_t;
openvasd_target_t *
openvasd_target_new (const gchar *, const gchar *, const gchar *, const gchar *,
int, int);
void
openvasd_target_set_finished_hosts (openvasd_target_t *, const gchar *);
void
openvasd_target_add_alive_test_methods (openvasd_target_t *, gboolean, gboolean,
gboolean, gboolean, gboolean);
void
openvasd_target_free (openvasd_target_t *);
openvasd_credential_t *
openvasd_credential_new (const gchar *, const gchar *, const gchar *);
void
openvasd_credential_set_auth_data (openvasd_credential_t *, const gchar *,
const gchar *);
void
openvasd_credential_free (openvasd_credential_t *);
void
openvasd_target_add_credential (openvasd_target_t *, openvasd_credential_t *);
openvasd_vt_single_t *
openvasd_vt_single_new (const gchar *);
void
openvasd_vt_single_free (openvasd_vt_single_t *);
void
openvasd_vt_single_add_value (openvasd_vt_single_t *, const gchar *,
const gchar *);
char *
openvasd_build_scan_config_json (openvasd_target_t *, GHashTable *, GSList *);
/* VT stream */
http_scanner_resp_t openvasd_get_vt_stream_init (http_scanner_connector_t);
int openvasd_get_vt_stream (http_scanner_connector_t);
#endif /* not _GVM_OPENVASD_OPENVASD_H */
jsonpull.h
nvti.h
Protos and data structures for NVT Information data sets.
openvasd_credential_set_auth_data
void openvasd_credential_set_auth_data(openvasd_credential_t *, const gchar *, const gchar *)
Get authentication data from an openvasd credential.
Definition openvasd.c:545
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:149
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:199
openvasd_credential_t
struct openvasd_credential openvasd_credential_t
Definition openvasd.h:44
openvasd_target_add_credential
void openvasd_target_add_credential(openvasd_target_t *, openvasd_credential_t *)
Add a credential to an openvasd target.
Definition openvasd.c:669
openvasd_target_free
void openvasd_target_free(openvasd_target_t *)
Free an openvasd target, including all added credentials.
Definition openvasd.c:620
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:607
openvasd_credential_new
openvasd_credential_t * openvasd_credential_new(const gchar *, const gchar *, const gchar *)
Allocate and initialize a new openvasd credential.
Definition openvasd.c:503
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:83
openvasd_vt_single_new
openvasd_vt_single_t * openvasd_vt_single_new(const gchar *)
Create a new single openvasd VT.
Definition openvasd.c:686
openvasd_vt_single_t
struct openvasd_vt_single openvasd_vt_single_t
Definition openvasd.h:42
openvasd_get_vts
http_scanner_resp_t openvasd_get_vts(http_scanner_connector_t)
Get VT's metadata.
Definition openvasd.c:122
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:704
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:578
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:647
openvasd_target_t
struct openvasd_target openvasd_target_t
Definition openvasd.h:40
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:368
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:725
openvasd_credential_free
void openvasd_credential_free(openvasd_credential_t *)
Free an openvasd credential.
Definition openvasd.c:525
openvasd_get_vt_stream
int openvasd_get_vt_stream(http_scanner_connector_t)
Get a new feed metadata chunk.
Definition openvasd.c:108
openvasd_credential
Struct credential information for openvasd.
Definition openvasd.c:39
openvasd_get_performance_opts_t
Definition openvasd.h:23
openvasd_get_performance_opts_t::titles
const gchar * titles
Definition openvasd.h:26
openvasd_get_performance_opts_t::end
int end
Definition openvasd.h:25
openvasd_get_performance_opts_t::start
int start
Definition openvasd.h:24
openvasd_target
Struct holding target information.
Definition openvasd.c:50
openvasd_vt_single
Struct holding vt information.
Definition openvasd.c:70