nvti.h
Go to the documentation of this file.
/* Copyright (C) 2009-2021 Greenbone Networks GmbH
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _NVTI_H
#define _NVTI_H
#include <glib.h>
typedef struct nvtpref nvtpref_t;
nvtpref_t *
nvtpref_new (int, gchar *, gchar *, gchar *);
void
nvtpref_free (nvtpref_t *);
gchar *
nvtpref_name (const nvtpref_t *);
gchar *
nvtpref_type (const nvtpref_t *);
gchar *
nvtpref_default (const nvtpref_t *);
int
nvtpref_id (const nvtpref_t *);
typedef struct vtref vtref_t;
typedef struct vtseverity vtseverity_t;
typedef struct nvti nvti_t;
vtref_t *
vtref_new (const gchar *, const gchar *, const gchar *);
void
vtref_free (vtref_t *);
const gchar *
vtref_type (const vtref_t *);
const gchar *
vtref_id (const vtref_t *);
const gchar *
vtref_text (const vtref_t *);
vtseverity_t *
vtseverity_new (const gchar *, const gchar *, int, double, const gchar *);
void
vtseverity_free (vtseverity_t *);
const gchar *
vtseverity_type (const vtseverity_t *);
const gchar *
vtseverity_origin (const vtseverity_t *);
const gchar *
vtseverity_value (const vtseverity_t *);
int
vtseverity_date (const vtseverity_t *);
double
vtseverity_score (const vtseverity_t *);
int
nvti_add_vtref (nvti_t *, vtref_t *);
guint
nvti_vtref_len (const nvti_t *);
vtref_t *
nvti_vtref (const nvti_t *, guint);
int
nvti_add_vtseverity (nvti_t *, vtseverity_t *);
guint
nvti_vtseverities_len (const nvti_t *);
vtseverity_t *
nvti_vtseverity (const nvti_t *, guint);
double
nvti_severity_score (const nvti_t *);
nvti_t *
nvti_new (void);
void
nvti_free (nvti_t *);
gchar *
nvti_oid (const nvti_t *);
gchar *
nvti_name (const nvti_t *);
gchar *
nvti_summary (const nvti_t *);
gchar *
nvti_affected (const nvti_t *);
gchar *
nvti_impact (const nvti_t *);
time_t
nvti_creation_time (const nvti_t *);
time_t
nvti_modification_time (const nvti_t *);
gchar *
nvti_insight (const nvti_t *);
gchar *
nvti_refs (const nvti_t *, const gchar *, const char *, guint);
gchar *
nvti_solution (const nvti_t *);
gchar *
nvti_solution_type (const nvti_t *);
gchar *
nvti_solution_method (const nvti_t *);
gchar *
nvti_tag (const nvti_t *);
gchar *
nvti_get_tag (const nvti_t *, const gchar *);
gchar *
nvti_cvss_base (const nvti_t *);
gchar *
nvti_dependencies (const nvti_t *);
gchar *
nvti_required_keys (const nvti_t *);
gchar *
nvti_mandatory_keys (const nvti_t *);
gchar *
nvti_excluded_keys (const nvti_t *);
gchar *
nvti_required_ports (const nvti_t *);
gchar *
nvti_required_udp_ports (const nvti_t *);
gchar *
nvti_detection (const nvti_t *);
gchar *
nvti_qod_type (const nvti_t *);
gchar *
nvti_qod (const nvti_t *);
gint
nvti_timeout (const nvti_t *);
gint
nvti_category (const nvti_t *);
gchar *
nvti_family (const nvti_t *);
guint
nvti_pref_len (const nvti_t *);
const nvtpref_t *
nvti_pref (const nvti_t *, guint);
int
nvti_set_oid (nvti_t *, const gchar *);
int
nvti_set_name (nvti_t *, const gchar *);
int
nvti_set_summary (nvti_t *, const gchar *);
int
nvti_set_insight (nvti_t *, const gchar *);
int
nvti_set_affected (nvti_t *, const gchar *);
int
nvti_set_impact (nvti_t *, const gchar *);
int
nvti_set_creation_time (nvti_t *, const time_t);
int
nvti_set_modification_time (nvti_t *, const time_t);
int
nvti_set_solution (nvti_t *, const gchar *);
int
nvti_set_solution_type (nvti_t *, const gchar *);
int
nvti_set_solution_method (nvti_t *, const gchar *);
int
nvti_add_tag (nvti_t *, const gchar *, const gchar *);
int
nvti_set_tag (nvti_t *, const gchar *);
int
nvti_set_cvss_base (nvti_t *, const gchar *);
int
nvti_set_dependencies (nvti_t *, const gchar *);
int
nvti_set_required_keys (nvti_t *, const gchar *);
int
nvti_set_mandatory_keys (nvti_t *, const gchar *);
int
nvti_set_excluded_keys (nvti_t *, const gchar *);
int
nvti_set_required_ports (nvti_t *, const gchar *);
int
nvti_set_required_udp_ports (nvti_t *, const gchar *);
int
nvti_set_detection (nvti_t *, const gchar *);
int
nvti_set_qod_type (nvti_t *, const gchar *);
int
nvti_set_qod (nvti_t *, const gchar *);
int
nvti_set_timeout (nvti_t *, const gint);
int
nvti_set_category (nvti_t *, const gint);
int
nvti_set_family (nvti_t *, const gchar *);
int
nvti_add_refs (nvti_t *, const gchar *, const gchar *, const gchar *);
int
nvti_add_required_keys (nvti_t *, const gchar *);
int
nvti_add_mandatory_keys (nvti_t *, const gchar *);
int
nvti_add_excluded_keys (nvti_t *, const gchar *);
int
nvti_add_required_ports (nvti_t *, const gchar *);
int
nvti_add_required_udp_ports (nvti_t *, const gchar *);
int
nvti_add_pref (nvti_t *, nvtpref_t *);
/* Collections of NVT Infos. */
typedef GHashTable nvtis_t;
nvtis_t *
nvtis_new (void);
void
nvtis_free (nvtis_t *);
void
nvtis_add (nvtis_t *, nvti_t *);
nvti_t *
nvtis_lookup (nvtis_t *, const char *);
#endif /* not _NVTI_H */
nvti_set_qod
int nvti_set_qod(nvti_t *, const gchar *)
Set the QoD of a NVT.
Definition: nvti.c:1778
nvtpref_free
void nvtpref_free(nvtpref_t *)
Free memory of a nvtpref structure.
Definition: nvti.c:537
nvti_summary
gchar * nvti_summary(const nvti_t *)
Get the summary.
Definition: nvti.c:693
nvtis_add
void nvtis_add(nvtis_t *, nvti_t *)
Add an NVT Info to a collection of NVT Infos.
Definition: nvti.c:2130
nvti_tag
gchar * nvti_tag(const nvti_t *)
Get the tags.
Definition: nvti.c:990
nvtpref_new
nvtpref_t * nvtpref_new(int, gchar *, gchar *, gchar *)
Create a new nvtpref structure filled with the given values.
Definition: nvti.c:516
nvti_required_keys
gchar * nvti_required_keys(const nvti_t *)
Get the required keys list.
Definition: nvti.c:1070
nvti_solution
gchar * nvti_solution(const nvti_t *)
Get the solution.
Definition: nvti.c:948
nvti_set_modification_time
int nvti_set_modification_time(nvti_t *, const time_t)
Set the modification time of a NVT.
Definition: nvti.c:1391
nvti_set_dependencies
int nvti_set_dependencies(nvti_t *, const gchar *)
Set the dependencies of a NVT.
Definition: nvti.c:1590
nvti_qod_type
gchar * nvti_qod_type(const nvti_t *)
Get the QoD type.
Definition: nvti.c:1154
nvti_pref_len
guint nvti_pref_len(const nvti_t *)
Get the number of preferences of the NVT.
Definition: nvti.c:1195
nvti_refs
gchar * nvti_refs(const nvti_t *, const gchar *, const char *, guint)
nvti_oid
gchar * nvti_oid(const nvti_t *)
Get the OID string.
Definition: nvti.c:665
nvti_pref
const nvtpref_t * nvti_pref(const nvti_t *, guint)
Get the n'th preferences of the NVT.
Definition: nvti.c:1210
vtref_new
vtref_t * vtref_new(const gchar *, const gchar *, const gchar *)
Create a new vtref structure filled with the given values.
Definition: nvti.c:92
nvti_vtref_len
guint nvti_vtref_len(const nvti_t *)
Get the number of references of the NVT.
Definition: nvti.c:776
nvti_qod
gchar * nvti_qod(const nvti_t *)
Get the QoD.
Definition: nvti.c:1168
nvtis_free
void nvtis_free(nvtis_t *)
Free a collection of NVT Infos.
Definition: nvti.c:2117
nvti_set_solution_method
int nvti_set_solution_method(nvti_t *, const gchar *)
Set the solution method of a NVT.
Definition: nvti.c:1452
nvti_timeout
gint nvti_timeout(const nvti_t *)
Get the timeout for this NVT.
Definition: nvti.c:1224
nvti_severity_score
double nvti_severity_score(const nvti_t *)
Get the maximum severity score.
Definition: nvti.c:922
nvtpref_default
gchar * nvtpref_default(const nvtpref_t *)
Get the Default of a NVT Preference.
Definition: nvti.c:599
nvti_modification_time
time_t nvti_modification_time(const nvti_t *)
Get the modification time.
Definition: nvti.c:763
vtseverity_score
double vtseverity_score(const vtseverity_t *)
Get the score of a severity.
Definition: nvti.c:295
nvti_add_pref
int nvti_add_pref(nvti_t *, nvtpref_t *)
Add a preference to the NVT Info.
Definition: nvti.c:2077
nvti_creation_time
time_t nvti_creation_time(const nvti_t *)
Get the creation time.
Definition: nvti.c:749
nvtis_new
nvtis_t * nvtis_new(void)
Make a collection of NVT Infos.
Definition: nvti.c:2105
nvti_set_family
int nvti_set_family(nvti_t *, const gchar *)
Set the family of a NVT.
Definition: nvti.c:1801
nvti_required_udp_ports
gchar * nvti_required_udp_ports(const nvti_t *)
Get the required udp ports list.
Definition: nvti.c:1126
nvti_set_insight
int nvti_set_insight(nvti_t *, const gchar *)
Set the insight text of a NVT.
Definition: nvti.c:1312
nvti_set_cvss_base
int nvti_set_cvss_base(nvti_t *, const gchar *)
Set the CVSS base of an NVT.
Definition: nvti.c:1566
nvti_affected
gchar * nvti_affected(const nvti_t *)
Get the text about affected systems.
Definition: nvti.c:721
vtseverity_value
const gchar * vtseverity_value(const vtseverity_t *)
Get the value of a severity.
Definition: nvti.c:267
nvti_set_creation_time
int nvti_set_creation_time(nvti_t *, const time_t)
Set the creation time of a NVT.
Definition: nvti.c:1372
nvtis_lookup
nvti_t * nvtis_lookup(nvtis_t *, const char *)
Add an NVT Info to a collection of NVT Infos.
Definition: nvti.c:2147
nvti_set_required_udp_ports
int nvti_set_required_udp_ports(nvti_t *, const gchar *)
Set the required udp ports of a NVT.
Definition: nvti.c:1710
nvti_add_vtseverity
int nvti_add_vtseverity(nvti_t *, vtseverity_t *)
Add a severity to the VT Info.
Definition: nvti.c:478
nvti_set_detection
int nvti_set_detection(nvti_t *, const gchar *)
Set the detection text of a NVT.
Definition: nvti.c:1733
nvti_set_tag
int nvti_set_tag(nvti_t *, const gchar *)
Set the tags of a NVT.
Definition: nvti.c:1543
nvti_required_ports
gchar * nvti_required_ports(const nvti_t *)
Get the required ports list.
Definition: nvti.c:1112
nvti_add_mandatory_keys
int nvti_add_mandatory_keys(nvti_t *, const gchar *)
Add a mandatory key of a NVT.
Definition: nvti.c:1949
vtseverity_origin
const gchar * vtseverity_origin(const vtseverity_t *)
Get the origin of a severity.
Definition: nvti.c:253
nvti_add_excluded_keys
int nvti_add_excluded_keys(nvti_t *, const gchar *)
Add a excluded key of a NVT.
Definition: nvti.c:1981
nvti_set_qod_type
int nvti_set_qod_type(nvti_t *, const gchar *)
Set the QoD type of a NVT.
Definition: nvti.c:1754
nvti_solution_type
gchar * nvti_solution_type(const nvti_t *)
Get the solution type.
Definition: nvti.c:962
nvti_add_tag
int nvti_add_tag(nvti_t *, const gchar *, const gchar *)
Add a tag to the NVT tags. The tag names "severity_date", "last_modification" and "creation_date" are...
Definition: nvti.c:1479
nvti_excluded_keys
gchar * nvti_excluded_keys(const nvti_t *)
Get the excluded keys list.
Definition: nvti.c:1098
nvti_add_required_udp_ports
int nvti_add_required_udp_ports(nvti_t *, const gchar *)
Add a required udp port of a NVT.
Definition: nvti.c:2045
nvti_set_required_keys
int nvti_set_required_keys(nvti_t *, const gchar *)
Set the required keys of a NVT.
Definition: nvti.c:1614
nvtis_t
GHashTable nvtis_t
A collection of information records corresponding to NVTs.
Definition: nvti.h:246
nvti_family
gchar * nvti_family(const nvti_t *)
Get the family name.
Definition: nvti.c:1182
nvti_add_refs
int nvti_add_refs(nvti_t *, const gchar *, const gchar *, const gchar *)
Add many new vtref from a comma-separated list.
Definition: nvti.c:1865
nvti_add_required_keys
int nvti_add_required_keys(nvti_t *, const gchar *)
Add a required key of a NVT.
Definition: nvti.c:1917
nvti_set_impact
int nvti_set_impact(nvti_t *, const gchar *)
Set the impact text of a NVT.
Definition: nvti.c:1352
nvti_name
gchar * nvti_name(const nvti_t *)
Get the name.
Definition: nvti.c:679
nvti_set_summary
int nvti_set_summary(nvti_t *, const gchar *)
Set the summary of a NVT.
Definition: nvti.c:1292
vtref_id
const gchar * vtref_id(const vtref_t *)
Get the id of a reference.
Definition: nvti.c:146
nvti_set_timeout
int nvti_set_timeout(nvti_t *, const gint)
Set the timeout of a NVT Info.
Definition: nvti.c:1821
vtref_type
const gchar * vtref_type(const vtref_t *)
Get the type of a reference.
Definition: nvti.c:132
nvtpref_name
gchar * nvtpref_name(const nvtpref_t *)
Get the Name of a NVT Preference.
Definition: nvti.c:571
nvtpref_id
int nvtpref_id(const nvtpref_t *)
Get the ID of a NVT Preference.
Definition: nvti.c:557
nvti_set_required_ports
int nvti_set_required_ports(nvti_t *, const gchar *)
Set the required ports of a NVT.
Definition: nvti.c:1686
nvti_set_solution_type
int nvti_set_solution_type(nvti_t *, const gchar *)
Set the solution type of a NVT.
Definition: nvti.c:1431
nvti_vtseverity
vtseverity_t * nvti_vtseverity(const nvti_t *, guint)
Get the n'th reference of the NVT.
Definition: nvti.c:909
nvti_add_required_ports
int nvti_add_required_ports(nvti_t *, const gchar *)
Add a required port of a NVT.
Definition: nvti.c:2013
nvti_set_category
int nvti_set_category(nvti_t *, const gint)
Set the category type of a NVT Info.
Definition: nvti.c:1840
nvti_set_mandatory_keys
int nvti_set_mandatory_keys(nvti_t *, const gchar *)
Set the mandatory keys of a NVT.
Definition: nvti.c:1638
nvti_set_affected
int nvti_set_affected(nvti_t *, const gchar *)
Set the affected text of a NVT.
Definition: nvti.c:1332
vtseverity_free
void vtseverity_free(vtseverity_t *)
Free memory of a vtseverity structure.
Definition: nvti.c:219
nvti_cvss_base
gchar * nvti_cvss_base(const nvti_t *)
Get the CVSS base.
Definition: nvti.c:1042
vtseverity_date
int vtseverity_date(const vtseverity_t *)
Get the date of a severity.
Definition: nvti.c:281
vtseverity_type
const gchar * vtseverity_type(const vtseverity_t *)
Get the type of a severity.
Definition: nvti.c:239
nvti_set_name
int nvti_set_name(nvti_t *, const gchar *)
Set the name of a NVT.
Definition: nvti.c:1272
nvti_impact
gchar * nvti_impact(const nvti_t *)
Get the text about impact.
Definition: nvti.c:735
nvti_add_vtref
int nvti_add_vtref(nvti_t *, vtref_t *)
Add a reference to the VT Info.
Definition: nvti.c:459
nvti_set_solution
int nvti_set_solution(nvti_t *, const gchar *)
Set the solution of a NVT.
Definition: nvti.c:1410
nvti_vtseverities_len
guint nvti_vtseverities_len(const nvti_t *)
Get the number of severities of the NVT.
Definition: nvti.c:894
vtseverity_new
vtseverity_t * vtseverity_new(const gchar *, const gchar *, int, double, const gchar *)
Create a new vtseverity structure filled with the given values.
Definition: nvti.c:196
nvti_detection
gchar * nvti_detection(const nvti_t *)
Get the text about detection.
Definition: nvti.c:1140
nvti_free
void nvti_free(nvti_t *)
Free memory of a nvti structure.
Definition: nvti.c:624
nvti_mandatory_keys
gchar * nvti_mandatory_keys(const nvti_t *)
Get the mandatory keys list.
Definition: nvti.c:1084
vtref_free
void vtref_free(vtref_t *)
Free memory of a vtref structure.
Definition: nvti.c:112
nvti_vtref
vtref_t * nvti_vtref(const nvti_t *, guint)
Get the n'th reference of the NVT.
Definition: nvti.c:791
nvti_solution_method
gchar * nvti_solution_method(const nvti_t *)
Get the solution method.
Definition: nvti.c:976
nvti_category
gint nvti_category(const nvti_t *)
Get the category for this NVT.
Definition: nvti.c:1237
nvtpref_type
gchar * nvtpref_type(const nvtpref_t *)
Get the Type of a NVT Preference.
Definition: nvti.c:585
vtref_text
const gchar * vtref_text(const vtref_t *)
Get the text of a reference.
Definition: nvti.c:160
nvti_get_tag
gchar * nvti_get_tag(const nvti_t *, const gchar *)
Get a tag value by a tag name.
Definition: nvti.c:1006
nvti_set_oid
int nvti_set_oid(nvti_t *, const gchar *)
Set the OID of a NVT Info.
Definition: nvti.c:1252
nvti_set_excluded_keys
int nvti_set_excluded_keys(nvti_t *, const gchar *)
Set the excluded keys of a NVT.
Definition: nvti.c:1662
nvti_dependencies
gchar * nvti_dependencies(const nvti_t *)
Get the dependencies list.
Definition: nvti.c:1056
nvti_new
nvti_t * nvti_new(void)
Create a new (empty) nvti structure.
Definition: nvti.c:613
nvti_insight
gchar * nvti_insight(const nvti_t *)
Get the text about insight.
Definition: nvti.c:707
nvti
The structure of a information record that corresponds to a NVT.
Definition: nvti.c:408
nvtpref
The structure for a preference of a NVT.
Definition: nvti.c:493
vtref
The structure for a cross reference of a VT.
Definition: nvti.c:72
vtseverity
The structure for a severity of a VT.
Definition: nvti.c:173