Greenbone Vulnerability Management Libraries 22.10.0
|
Implementation of API to handle NVT Info datasets. More...
Go to the source code of this file.
Data Structures | |
struct | vtref |
The structure for a cross reference of a VT. More... | |
struct | vtseverity |
The structure for a severity of a VT. More... | |
struct | nvti |
The structure of a information record that corresponds to a NVT. More... | |
struct | nvtpref |
The structure for a preference of a NVT. More... | |
Macros | |
#define | _XOPEN_SOURCE |
#define | G_LOG_DOMAIN "libgvm base" |
GLib log domain. | |
Typedefs | |
typedef struct vtref | vtref_t |
The structure for a cross reference of a VT. | |
typedef struct vtseverity | vtseverity_t |
The structure for a severity of a VT. | |
typedef struct nvti | nvti_t |
The structure of a information record that corresponds to a NVT. | |
typedef struct nvtpref | nvtpref_t |
The structure for a preference of a NVT. | |
Functions | |
vtref_t * | vtref_new (const gchar *type, const gchar *ref_id, const gchar *ref_text) |
Create a new vtref structure filled with the given values. | |
void | vtref_free (vtref_t *ref) |
Free memory of a vtref structure. | |
const gchar * | vtref_type (const vtref_t *r) |
Get the type of a reference. | |
const gchar * | vtref_id (const vtref_t *r) |
Get the id of a reference. | |
const gchar * | vtref_text (const vtref_t *r) |
Get the text of a reference. | |
vtseverity_t * | vtseverity_new (const gchar *type, const gchar *origin, int date, double score, const gchar *value) |
Create a new vtseverity structure filled with the given values. | |
void | vtseverity_free (vtseverity_t *s) |
Free memory of a vtseverity structure. | |
const gchar * | vtseverity_type (const vtseverity_t *s) |
Get the type of a severity. | |
const gchar * | vtseverity_origin (const vtseverity_t *s) |
Get the origin of a severity. | |
const gchar * | vtseverity_value (const vtseverity_t *s) |
Get the value of a severity. | |
int | vtseverity_date (const vtseverity_t *s) |
Get the date of a severity. | |
double | vtseverity_score (const vtseverity_t *s) |
Get the score of a severity. | |
static time_t | parse_nvt_timestamp (const gchar *str_time) |
Try convert an NVT tag time string into epoch time or return 0 upon parse errors. | |
int | nvti_add_vtref (nvti_t *vt, vtref_t *ref) |
Add a reference to the VT Info. | |
int | nvti_add_vtseverity (nvti_t *vt, vtseverity_t *s) |
Add a severity to the VT Info. | |
nvtpref_t * | nvtpref_new (int id, const gchar *name, const gchar *type, const gchar *dflt) |
Create a new nvtpref structure filled with the given values. | |
void | nvtpref_free (nvtpref_t *np) |
Free memory of a nvtpref structure. | |
int | nvtpref_id (const nvtpref_t *np) |
Get the ID of a NVT Preference. | |
gchar * | nvtpref_name (const nvtpref_t *np) |
Get the Name of a NVT Preference. | |
gchar * | nvtpref_type (const nvtpref_t *np) |
Get the Type of a NVT Preference. | |
gchar * | nvtpref_default (const nvtpref_t *np) |
Get the Default of a NVT Preference. | |
nvti_t * | nvti_new (void) |
Create a new (empty) nvti structure. | |
void | nvti_free (nvti_t *n) |
Free memory of a nvti structure. | |
gchar * | nvti_oid (const nvti_t *n) |
Get the OID string. | |
gchar * | nvti_name (const nvti_t *n) |
Get the name. | |
gchar * | nvti_summary (const nvti_t *n) |
Get the summary. | |
gchar * | nvti_insight (const nvti_t *n) |
Get the text about insight. | |
gchar * | nvti_affected (const nvti_t *n) |
Get the text about affected systems. | |
gchar * | nvti_impact (const nvti_t *n) |
Get the text about impact. | |
time_t | nvti_creation_time (const nvti_t *n) |
Get the creation time. | |
time_t | nvti_modification_time (const nvti_t *n) |
Get the modification time. | |
guint | nvti_vtref_len (const nvti_t *n) |
Get the number of references of the NVT. | |
vtref_t * | nvti_vtref (const nvti_t *n, guint p) |
Get the n'th reference of the NVT. | |
gchar * | nvti_refs (const nvti_t *n, const gchar *type, const gchar *exclude_types, guint use_types) |
Get references as string. | |
guint | nvti_vtseverities_len (const nvti_t *n) |
Get the number of severities of the NVT. | |
vtseverity_t * | nvti_vtseverity (const nvti_t *n, guint p) |
Get the n'th reference of the NVT. | |
double | nvti_severity_score (const nvti_t *n) |
Get the maximum severity score. | |
gchar * | nvti_severity_vector_from_tag (const nvti_t *n) |
Get the severity score. | |
gchar * | nvti_solution (const nvti_t *n) |
Get the solution. | |
gchar * | nvti_solution_type (const nvti_t *n) |
Get the solution type. | |
gchar * | nvti_solution_method (const nvti_t *n) |
Get the solution method. | |
gchar * | nvti_tag (const nvti_t *n) |
Get the tags. | |
gchar * | nvti_get_tag (const nvti_t *n, const gchar *name) |
Get a tag value by a tag name. | |
gchar * | nvti_cvss_base (const nvti_t *n) |
Get the CVSS base. | |
gchar * | nvti_dependencies (const nvti_t *n) |
Get the dependencies list. | |
gchar * | nvti_required_keys (const nvti_t *n) |
Get the required keys list. | |
gchar * | nvti_mandatory_keys (const nvti_t *n) |
Get the mandatory keys list. | |
gchar * | nvti_excluded_keys (const nvti_t *n) |
Get the excluded keys list. | |
gchar * | nvti_required_ports (const nvti_t *n) |
Get the required ports list. | |
gchar * | nvti_required_udp_ports (const nvti_t *n) |
Get the required udp ports list. | |
gchar * | nvti_detection (const nvti_t *n) |
Get the text about detection. | |
gchar * | nvti_qod_type (const nvti_t *n) |
Get the QoD type. | |
gchar * | nvti_qod (const nvti_t *n) |
Get the QoD. | |
gchar * | nvti_family (const nvti_t *n) |
Get the family name. | |
guint | nvti_pref_len (const nvti_t *n) |
Get the number of preferences of the NVT. | |
const nvtpref_t * | nvti_pref (const nvti_t *n, guint p) |
Get the n'th preferences of the NVT. | |
gint | nvti_category (const nvti_t *n) |
Get the category for this NVT. | |
int | nvti_set_oid (nvti_t *n, const gchar *oid) |
Set the OID of a NVT Info. | |
int | nvti_set_name (nvti_t *n, const gchar *name) |
Set the name of a NVT. | |
int | nvti_put_name (nvti_t *n, gchar *name) |
Set the name of a NVT, using the given memory. | |
int | nvti_set_summary (nvti_t *n, const gchar *summary) |
Set the summary of a NVT. | |
int | nvti_put_summary (nvti_t *n, gchar *summary) |
Set the summary of a NVT, using the given memory. | |
int | nvti_set_insight (nvti_t *n, const gchar *insight) |
Set the insight text of a NVT. | |
int | nvti_put_insight (nvti_t *n, gchar *insight) |
Set the insight text of a NVT, using the given memory. | |
int | nvti_set_affected (nvti_t *n, const gchar *affected) |
Set the affected text of a NVT. | |
int | nvti_put_affected (nvti_t *n, gchar *affected) |
Set the affected text of a NVT, using the given memory. | |
int | nvti_set_impact (nvti_t *n, const gchar *impact) |
Set the impact text of a NVT. | |
int | nvti_put_impact (nvti_t *n, gchar *impact) |
Set the impact text of a NVT, using the given memory. | |
int | nvti_set_creation_time (nvti_t *n, const time_t creation_time) |
Set the creation time of a NVT. | |
int | nvti_set_modification_time (nvti_t *n, const time_t modification_time) |
Set the modification time of a NVT. | |
int | nvti_set_solution (nvti_t *n, const gchar *solution) |
Set the solution of a NVT. | |
int | nvti_put_solution (nvti_t *n, gchar *solution) |
Set the solution of a NVT, using the given memory. | |
int | nvti_set_solution_type (nvti_t *n, const gchar *solution_type) |
Set the solution type of a NVT. | |
int | nvti_set_solution_method (nvti_t *n, const gchar *solution_method) |
Set the solution method of a NVT. | |
int | nvti_add_tag (nvti_t *n, const gchar *name, const gchar *value) |
Add a tag to the NVT tags. The tag names "severity_date", "last_modification" and "creation_date" are treated special: The value is expected to be a timestamp and it is being converted to seconds since epoch before added as a tag value. The tag name "cvss_base" will be ignored and not added. | |
int | nvti_set_tag (nvti_t *n, const gchar *tag) |
Set the tags of a NVT. | |
int | nvti_set_cvss_base (nvti_t *n, const gchar *cvss_base) |
Set the CVSS base of an NVT. | |
int | nvti_set_dependencies (nvti_t *n, const gchar *dependencies) |
Set the dependencies of a NVT. | |
int | nvti_set_required_keys (nvti_t *n, const gchar *required_keys) |
Set the required keys of a NVT. | |
int | nvti_set_mandatory_keys (nvti_t *n, const gchar *mandatory_keys) |
Set the mandatory keys of a NVT. | |
int | nvti_set_excluded_keys (nvti_t *n, const gchar *excluded_keys) |
Set the excluded keys of a NVT. | |
int | nvti_set_required_ports (nvti_t *n, const gchar *required_ports) |
Set the required ports of a NVT. | |
int | nvti_set_required_udp_ports (nvti_t *n, const gchar *required_udp_ports) |
Set the required udp ports of a NVT. | |
int | nvti_set_detection (nvti_t *n, const gchar *detection) |
Set the detection text of a NVT. | |
int | nvti_put_detection (nvti_t *n, gchar *detection) |
Set the detection text of a NVT, using the given memory. | |
int | nvti_set_qod_type (nvti_t *n, const gchar *qod_type) |
Set the QoD type of a NVT. | |
int | nvti_set_qod (nvti_t *n, const gchar *qod) |
Set the QoD of a NVT. | |
int | nvti_set_family (nvti_t *n, const gchar *family) |
Set the family of a NVT. | |
int | nvti_put_family (nvti_t *n, gchar *family) |
Set the family of a NVT, using the given memory. | |
int | nvti_set_category (nvti_t *n, const gint category) |
Set the category type of a NVT Info. | |
int | nvti_add_refs (nvti_t *n, const gchar *type, const gchar *ref_ids, const gchar *ref_text) |
Add many new vtref from a comma-separated list. | |
int | nvti_add_required_keys (nvti_t *n, const gchar *key) |
Add a required key of a NVT. | |
int | nvti_add_mandatory_keys (nvti_t *n, const gchar *key) |
Add a mandatory key of a NVT. | |
int | nvti_add_excluded_keys (nvti_t *n, const gchar *key) |
Add a excluded key of a NVT. | |
int | nvti_add_required_ports (nvti_t *n, const gchar *port) |
Add a required port of a NVT. | |
int | nvti_add_required_udp_ports (nvti_t *n, const gchar *port) |
Add a required udp port of a NVT. | |
int | nvti_add_pref (nvti_t *n, nvtpref_t *np) |
Add a preference to the NVT Info. | |
static void | free_nvti_for_hash_table (gpointer nvti) |
Free an NVT Info, for g_hash_table_destroy. | |
nvtis_t * | nvtis_new (void) |
Make a collection of NVT Infos. | |
void | nvtis_free (nvtis_t *nvtis) |
Free a collection of NVT Infos. | |
void | nvtis_add (nvtis_t *nvtis, nvti_t *nvti) |
Add an NVT Info to a collection of NVT Infos. | |
nvti_t * | nvtis_lookup (nvtis_t *nvtis, const char *oid) |
Add an NVT Info to a collection of NVT Infos. | |
Implementation of API to handle NVT Info datasets.
This file contains all methods to handle NVT Information datasets (nvti_t).
The module consequently uses glib datatypes and api for memory management etc.
#define _XOPEN_SOURCE |
#define G_LOG_DOMAIN "libgvm base" |
GLib log domain.
The structure for a cross reference of a VT.
The elements of this structure should only be accessed by the respective functions.
typedef struct vtseverity vtseverity_t |
The structure for a severity of a VT.
VTs can have one or several severities.
|
static |
Free an NVT Info, for g_hash_table_destroy.
nvti | The NVT Info. |
int nvti_add_excluded_keys | ( | nvti_t * | n, |
const gchar * | key ) |
Add a excluded key of a NVT.
n | The NVT Info structure. |
key | The excluded key to add. A copy will be created from this. |
int nvti_add_mandatory_keys | ( | nvti_t * | n, |
const gchar * | key ) |
Add a mandatory key of a NVT.
n | The NVT Info structure. |
key | The mandatory key to add. A copy will be created from this. |
Add a preference to the NVT Info.
n | The NVT Info structure. |
np | The NVT preference to add. |
int nvti_add_refs | ( | nvti_t * | n, |
const gchar * | type, | ||
const gchar * | ref_ids, | ||
const gchar * | ref_text ) |
Add many new vtref from a comma-separated list.
n | The NVTI where to add the references. |
type | The type for all references. If NULL, then for ref_ids a syntax is expected that includes the type like "type:id,type:id". |
ref_ids | A CSV of reference to be added. |
ref_text | The optional text accompanying all references. |
int nvti_add_required_keys | ( | nvti_t * | n, |
const gchar * | key ) |
Add a required key of a NVT.
n | The NVT Info structure. |
key | The required key to add. A copy will be created from this. |
int nvti_add_required_ports | ( | nvti_t * | n, |
const gchar * | port ) |
Add a required port of a NVT.
n | The NVT Info structure. |
port | The required port to add. A copy will be created from this. |
int nvti_add_required_udp_ports | ( | nvti_t * | n, |
const gchar * | port ) |
Add a required udp port of a NVT.
n | The NVT Info structure. |
port | The required udp port to add. A copy will be created from this. |
int nvti_add_tag | ( | nvti_t * | n, |
const gchar * | name, | ||
const gchar * | value ) |
Add a tag to the NVT tags. The tag names "severity_date", "last_modification" and "creation_date" are treated special: The value is expected to be a timestamp and it is being converted to seconds since epoch before added as a tag value. The tag name "cvss_base" will be ignored and not added.
n | The NVT Info structure. |
name | The tag name. A copy will be created from this. |
value | The tag value. A copy will be created from this. |
Add a reference to the VT Info.
vt | The VT Info structure. |
ref | The VT reference to add. |
int nvti_add_vtseverity | ( | nvti_t * | vt, |
vtseverity_t * | s ) |
Add a severity to the VT Info.
vt | The VT Info structure. |
s | The VT severity to add. |
gchar * nvti_affected | ( | const nvti_t * | n | ) |
Get the text about affected systems.
n | The NVT Info structure of which the affected description should be returned. |
gint nvti_category | ( | const nvti_t * | n | ) |
Get the category for this NVT.
n | The NVT Info structure of which the category should be returned. |
time_t nvti_creation_time | ( | const nvti_t * | n | ) |
Get the creation time.
n | The NVT Info structure of which the creation time should be returned. |
gchar * nvti_cvss_base | ( | const nvti_t * | n | ) |
Get the CVSS base.
n | The NVT Info structure of which the CVSS base should be returned. |
gchar * nvti_dependencies | ( | const nvti_t * | n | ) |
Get the dependencies list.
n | The NVT Info structure of which the name should be returned. |
gchar * nvti_detection | ( | const nvti_t * | n | ) |
Get the text about detection.
n | The NVT Info structure of which the detection should be returned. |
gchar * nvti_excluded_keys | ( | const nvti_t * | n | ) |
Get the excluded keys list.
n | The NVT Info structure of which the name should be returned. |
gchar * nvti_family | ( | const nvti_t * | n | ) |
Get the family name.
n | The NVT Info structure of which the name should be returned. |
void nvti_free | ( | nvti_t * | n | ) |
Free memory of a nvti structure.
n | The structure to be freed. |
gchar * nvti_get_tag | ( | const nvti_t * | n, |
const gchar * | name ) |
Get a tag value by a tag name.
n | The NVT Info structure from where to search for the tag name. |
name | The name of the tag for which to return the value. |
gchar * nvti_impact | ( | const nvti_t * | n | ) |
Get the text about impact.
n | The NVT Info structure of which the impact description should be returned. |
gchar * nvti_insight | ( | const nvti_t * | n | ) |
Get the text about insight.
n | The NVT Info structure of which the insight description should be returned. |
gchar * nvti_mandatory_keys | ( | const nvti_t * | n | ) |
Get the mandatory keys list.
n | The NVT Info structure of which the name should be returned. |
time_t nvti_modification_time | ( | const nvti_t * | n | ) |
Get the modification time.
n | The NVT Info structure of which the modification time should be returned. |
gchar * nvti_name | ( | const nvti_t * | n | ) |
Get the name.
n | The NVT Info structure of which the name should be returned. |
nvti_t * nvti_new | ( | void | ) |
Create a new (empty) nvti structure.
gchar * nvti_oid | ( | const nvti_t * | n | ) |
Get the OID string.
n | The NVT Info structure of which the OID should be returned. |
Get the n'th preferences of the NVT.
n | The NVT Info structure. |
p | The position of the preference to return. |
guint nvti_pref_len | ( | const nvti_t * | n | ) |
Get the number of preferences of the NVT.
n | The NVT Info structure. |
int nvti_put_affected | ( | nvti_t * | n, |
gchar * | affected ) |
Set the affected text of a NVT, using the given memory.
n | The NVT Info structure. |
affected | The affected text to set. The string will be used directly. |
int nvti_put_detection | ( | nvti_t * | n, |
gchar * | detection ) |
Set the detection text of a NVT, using the given memory.
n | The NVT Info structure. |
detection | The detection text to set. The string will be used directly. |
int nvti_put_family | ( | nvti_t * | n, |
gchar * | family ) |
Set the family of a NVT, using the given memory.
n | The NVT Info structure. |
family | The family to set. The string will be used directly. |
int nvti_put_impact | ( | nvti_t * | n, |
gchar * | impact ) |
Set the impact text of a NVT, using the given memory.
n | The NVT Info structure. |
impact | The impact text to set. The string will be used directly. |
int nvti_put_insight | ( | nvti_t * | n, |
gchar * | insight ) |
Set the insight text of a NVT, using the given memory.
n | The NVT Info structure. |
insight | The insight text to set. The string will be used directly. |
int nvti_put_name | ( | nvti_t * | n, |
gchar * | name ) |
Set the name of a NVT, using the given memory.
n | The NVT Info structure. |
name | The name to set. The string will be used directly. |
int nvti_put_solution | ( | nvti_t * | n, |
gchar * | solution ) |
Set the solution of a NVT, using the given memory.
n | The NVT Info structure. |
solution | The solution to set. The string will be used directly. |
int nvti_put_summary | ( | nvti_t * | n, |
gchar * | summary ) |
Set the summary of a NVT, using the given memory.
n | The NVT Info structure. |
summary | The summary to set. The string will be used directly. |
gchar * nvti_qod | ( | const nvti_t * | n | ) |
Get the QoD.
n | The NVT Info structure of which the QoD should be returned. |
gchar * nvti_qod_type | ( | const nvti_t * | n | ) |
Get the QoD type.
n | The NVT Info structure of which the QoD type should be returned. |
gchar * nvti_refs | ( | const nvti_t * | n, |
const gchar * | type, | ||
const gchar * | exclude_types, | ||
guint | use_types ) |
Get references as string.
n | The NVT Info structure of which the references should be returned. |
type | Optional type to collect. If NULL, all types are collected. |
exclude_types | Optional CSC list of types to exclude from collection. If NULL, no types are excluded. |
use_types | If 0, then a simple comma separated list will be returned. If not 0, then for each reference the syntax "type:id" is applied. |
gchar * nvti_required_keys | ( | const nvti_t * | n | ) |
Get the required keys list.
n | The NVT Info structure of which the name should be returned. |
gchar * nvti_required_ports | ( | const nvti_t * | n | ) |
Get the required ports list.
n | The NVT Info structure of which the name should be returned. |
gchar * nvti_required_udp_ports | ( | const nvti_t * | n | ) |
Get the required udp ports list.
n | The NVT Info structure of which the name should be returned. |
int nvti_set_affected | ( | nvti_t * | n, |
const gchar * | affected ) |
Set the affected text of a NVT.
n | The NVT Info structure. |
affected | The affected text to set. A copy will be created from this. |
int nvti_set_category | ( | nvti_t * | n, |
const gint | category ) |
Set the category type of a NVT Info.
n | The NVT Info structure. |
category | The category to set. Values <= 0 will indicate it is not set. |
int nvti_set_creation_time | ( | nvti_t * | n, |
const time_t | creation_time ) |
Set the creation time of a NVT.
n | The NVT Info structure. |
creation_time | The creation time to set. |
int nvti_set_cvss_base | ( | nvti_t * | n, |
const gchar * | cvss_base ) |
Set the CVSS base of an NVT.
n | The NVT Info structure. |
cvss_base | The CVSS base to set. A copy will be created from this. |
int nvti_set_dependencies | ( | nvti_t * | n, |
const gchar * | dependencies ) |
Set the dependencies of a NVT.
n | The NVT Info structure. |
dependencies | The dependencies to set. A copy will be created from this. |
int nvti_set_detection | ( | nvti_t * | n, |
const gchar * | detection ) |
Set the detection text of a NVT.
n | The NVT Info structure. |
detection | The detection text to set. A copy will be created from this. |
int nvti_set_excluded_keys | ( | nvti_t * | n, |
const gchar * | excluded_keys ) |
Set the excluded keys of a NVT.
n | The NVT Info structure. |
excluded_keys | The excluded keys to set. A copy will be created from this. |
int nvti_set_family | ( | nvti_t * | n, |
const gchar * | family ) |
Set the family of a NVT.
n | The NVT Info structure. |
family | The family to set. A copy will be created from this. |
int nvti_set_impact | ( | nvti_t * | n, |
const gchar * | impact ) |
Set the impact text of a NVT.
n | The NVT Info structure. |
impact | The impact text to set. A copy will be created from this. |
int nvti_set_insight | ( | nvti_t * | n, |
const gchar * | insight ) |
Set the insight text of a NVT.
n | The NVT Info structure. |
insight | The insight text to set. A copy will be created from this. |
int nvti_set_mandatory_keys | ( | nvti_t * | n, |
const gchar * | mandatory_keys ) |
Set the mandatory keys of a NVT.
n | The NVT Info structure. |
mandatory_keys | The mandatory keys to set. A copy will be created from this. |
int nvti_set_modification_time | ( | nvti_t * | n, |
const time_t | modification_time ) |
Set the modification time of a NVT.
n | The NVT Info structure. |
modification_time | The modification time to set. |
int nvti_set_name | ( | nvti_t * | n, |
const gchar * | name ) |
Set the name of a NVT.
n | The NVT Info structure. |
name | The name to set. A copy will be created from this. |
int nvti_set_oid | ( | nvti_t * | n, |
const gchar * | oid ) |
Set the OID of a NVT Info.
n | The NVT Info structure. |
oid | The OID to set. A copy will be created from this. |
int nvti_set_qod | ( | nvti_t * | n, |
const gchar * | qod ) |
Set the QoD of a NVT.
n | The NVT Info structure. |
qod | The QoD to set. A copy will be created from this. The string is not checked, any string is accepted as type. |
int nvti_set_qod_type | ( | nvti_t * | n, |
const gchar * | qod_type ) |
Set the QoD type of a NVT.
n | The NVT Info structure. |
qod_type | The QoD type to set. A copy will be created from this. The string is not checked, any string is accepted as type. |
int nvti_set_required_keys | ( | nvti_t * | n, |
const gchar * | required_keys ) |
Set the required keys of a NVT.
n | The NVT Info structure. |
required_keys | The required keys to set. A copy will be created from this. |
int nvti_set_required_ports | ( | nvti_t * | n, |
const gchar * | required_ports ) |
Set the required ports of a NVT.
n | The NVT Info structure. |
required_ports | The required ports to set. A copy will be created from this. |
int nvti_set_required_udp_ports | ( | nvti_t * | n, |
const gchar * | required_udp_ports ) |
Set the required udp ports of a NVT.
n | The NVT Info structure. |
required_udp_ports | The required udp ports to set. A copy will be created from this. |
int nvti_set_solution | ( | nvti_t * | n, |
const gchar * | solution ) |
Set the solution of a NVT.
n | The NVT Info structure. |
solution | The solution to set. A copy will be created from this. |
int nvti_set_solution_method | ( | nvti_t * | n, |
const gchar * | solution_method ) |
Set the solution method of a NVT.
n | The NVT Info structure. |
solution_method | The solution method to set. A copy will be created from this. |
int nvti_set_solution_type | ( | nvti_t * | n, |
const gchar * | solution_type ) |
Set the solution type of a NVT.
n | The NVT Info structure. |
solution_type | The solution type to set. A copy will be created from this. |
int nvti_set_summary | ( | nvti_t * | n, |
const gchar * | summary ) |
Set the summary of a NVT.
n | The NVT Info structure. |
summary | The summary to set. A copy will be created from this. |
int nvti_set_tag | ( | nvti_t * | n, |
const gchar * | tag ) |
Set the tags of a NVT.
n | The NVT Info structure. |
tag | The tags to set. A copy will be created from this. |
double nvti_severity_score | ( | const nvti_t * | n | ) |
Get the maximum severity score.
n | The NVT Info structure. |
gchar * nvti_severity_vector_from_tag | ( | const nvti_t * | n | ) |
Get the severity score.
Extended severity was introduced but still not all vts are using it. Therefore it must be checked if we can calculate the score from the severity_vector tag or if we have to calculate it from the deprecated cvss_base_vector tag.
n | The NVT Info structure. |
gchar * nvti_solution | ( | const nvti_t * | n | ) |
Get the solution.
n | The NVT Info structure of which the solution should be returned. |
gchar * nvti_solution_method | ( | const nvti_t * | n | ) |
Get the solution method.
n | The NVT Info structure of which the solution method should be returned. |
gchar * nvti_solution_type | ( | const nvti_t * | n | ) |
Get the solution type.
n | The NVT Info structure of which the solution type should be returned. |
gchar * nvti_summary | ( | const nvti_t * | n | ) |
Get the summary.
n | The NVT Info structure of which the summary should be returned. |
gchar * nvti_tag | ( | const nvti_t * | n | ) |
Get the tags.
n | The NVT Info structure of which the tags should be returned. |
Get the n'th reference of the NVT.
n | The NVT Info structure. |
p | The position of the reference to return. |
guint nvti_vtref_len | ( | const nvti_t * | n | ) |
Get the number of references of the NVT.
n | The NVT Info structure. |
guint nvti_vtseverities_len | ( | const nvti_t * | n | ) |
Get the number of severities of the NVT.
n | The NVT Info structure. |
vtseverity_t * nvti_vtseverity | ( | const nvti_t * | n, |
guint | p ) |
Get the n'th reference of the NVT.
n | The NVT Info structure. |
p | The position of the reference to return. |
Add an NVT Info to a collection of NVT Infos.
nvtis | The collection of NVT Infos. |
nvti | The NVT Info to add. |
void nvtis_free | ( | nvtis_t * | nvtis | ) |
Free a collection of NVT Infos.
nvtis | The collection of NVT Infos. |
Add an NVT Info to a collection of NVT Infos.
nvtis | The collection of NVT Infos. |
oid | The OID of the NVT. |
nvtis_t * nvtis_new | ( | void | ) |
Make a collection of NVT Infos.
gchar * nvtpref_default | ( | const nvtpref_t * | np | ) |
Get the Default of a NVT Preference.
np | The NVT Pref structure of which the Default should be returned. |
void nvtpref_free | ( | nvtpref_t * | np | ) |
Free memory of a nvtpref structure.
np | The structure to be freed. |
int nvtpref_id | ( | const nvtpref_t * | np | ) |
Get the ID of a NVT Preference.
np | The NVT Pref structure of which the Name should be returned. |
gchar * nvtpref_name | ( | const nvtpref_t * | np | ) |
Get the Name of a NVT Preference.
np | The NVT Pref structure of which the Name should be returned. |
nvtpref_t * nvtpref_new | ( | int | id, |
const gchar * | name, | ||
const gchar * | type, | ||
const gchar * | dflt ) |
Create a new nvtpref structure filled with the given values.
id | The ID to be set. |
name | The name to be set. A copy will created of this. |
type | The type to be set. A copy will created of this. |
dflt | The default to be set. A copy will created of this. |
gchar * nvtpref_type | ( | const nvtpref_t * | np | ) |
Get the Type of a NVT Preference.
np | The NVT Pref structure of which the Type should be returned. |
|
static |
Try convert an NVT tag time string into epoch time or return 0 upon parse errors.
[in] | str_time | Time stamp as string in one of the forms used in NVTs. |
void vtref_free | ( | vtref_t * | ref | ) |
Free memory of a vtref structure.
ref | The structure to be freed. |
const gchar * vtref_id | ( | const vtref_t * | r | ) |
Get the id of a reference.
r | The VT Reference structure of which the id should be returned. |
vtref_t * vtref_new | ( | const gchar * | type, |
const gchar * | ref_id, | ||
const gchar * | ref_text ) |
Create a new vtref structure filled with the given values.
type | The type to be set. |
ref_id | The actual reference to be set. |
ref_text | The optional text accompanying a reference. |
const gchar * vtref_text | ( | const vtref_t * | r | ) |
Get the text of a reference.
r | The VT Reference structure of which the id should be returned. |
const gchar * vtref_type | ( | const vtref_t * | r | ) |
Get the type of a reference.
r | The VT Reference structure of which the type should be returned. |
int vtseverity_date | ( | const vtseverity_t * | s | ) |
Get the date of a severity.
s | The VT Severity structure of which the date should be returned. |
void vtseverity_free | ( | vtseverity_t * | s | ) |
Free memory of a vtseverity structure.
s | The structure to be freed. |
vtseverity_t * vtseverity_new | ( | const gchar * | type, |
const gchar * | origin, | ||
int | date, | ||
double | score, | ||
const gchar * | value ) |
Create a new vtseverity structure filled with the given values.
[in] | type | The severity type to be set. |
[in] | origin | The origin reference to be set, can be NULL. |
[in] | date | The date to be set. |
[in] | score | The score to be set. |
[in] | value | The value corresponding to the type. |
const gchar * vtseverity_origin | ( | const vtseverity_t * | s | ) |
Get the origin of a severity.
s | The VT Severity structure of which the origin should be returned. |
double vtseverity_score | ( | const vtseverity_t * | s | ) |
Get the score of a severity.
s | The VT Severity structure of which the score should be returned. |
const gchar * vtseverity_type | ( | const vtseverity_t * | s | ) |
Get the type of a severity.
s | The VT Severity structure of which the type should be returned. |
const gchar * vtseverity_value | ( | const vtseverity_t * | s | ) |
Get the value of a severity.
s | The VT Severity structure of which the value should be returned. |