|
Greenbone Vulnerability Management Libraries 22.32.0
|
Simple JSON reader. More...
#include "vtparser.h"

Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "libgvm util" |
| GLib logging domain. | |
Functions | |
| static int | get_category_from_name (const gchar *cat) |
| Get the VT category type given the category as string. | |
| static int | add_tags_to_nvt (nvti_t *nvt, cJSON *tag_obj) |
| Add to the NVT Info structure. | |
| static void | parse_references (nvti_t *nvt, cJSON *vt_obj) |
| static void | add_preferences_to_nvt (nvti_t *nvt, cJSON *vt_obj) |
| int | parse_vt_json (gvm_json_pull_parser_t *parser, gvm_json_pull_event_t *event, nvti_t **nvt) |
| Parse a VT element given in json format. | |
Simple JSON reader.
Definition in file vtparser.c.
| #define G_LOG_DOMAIN "libgvm util" |
GLib logging domain.
Definition at line 17 of file vtparser.c.
|
static |
Definition at line 185 of file vtparser.c.
References gvm_json_obj_check_int(), gvm_json_obj_check_str(), nvti_add_pref(), and nvtpref_new().
Referenced by parse_vt_json().


|
static |
Add to the NVT Info structure.
| nvt | The NVT Info structure. |
| tag_obj | The JSON object containing the tags. |
Definition at line 64 of file vtparser.c.
References get_cvss_score_from_base_metrics(), gvm_json_obj_check_str(), gvm_json_obj_double(), gvm_json_obj_str(), nvti_add_tag(), nvti_add_vtseverity(), nvti_oid(), nvti_set_affected(), nvti_set_creation_time(), nvti_set_cvss_base(), nvti_set_detection(), nvti_set_impact(), nvti_set_insight(), nvti_set_modification_time(), nvti_set_qod(), nvti_set_qod_type(), nvti_set_solution(), nvti_set_solution_method(), nvti_set_solution_type(), nvti_set_summary(), and vtseverity_new().
Referenced by parse_vt_json().


|
static |
Get the VT category type given the category as string.
| cat | The category as string. |
Definition at line 27 of file vtparser.c.
References ACT_ATTACK, ACT_DENIAL, ACT_DESTRUCTIVE_ATTACK, ACT_END, ACT_FLOOD, ACT_GATHER_INFO, ACT_INIT, ACT_KILL_HOST, ACT_MIXED_ATTACK, ACT_SCANNER, and ACT_SETTINGS.
Referenced by parse_vt_json().

|
static |
Definition at line 157 of file vtparser.c.
References gvm_json_obj_check_str(), nvti_add_vtref(), and vtref_new().
Referenced by parse_vt_json().


| int parse_vt_json | ( | gvm_json_pull_parser_t * | parser, |
| gvm_json_pull_event_t * | event, | ||
| nvti_t ** | nvt ) |
Parse a VT element given in json format.
| [in] | parser | Json pull parser. |
| [in] | event | Json pull event. |
| [out] | nvt | The NVT Info structure to fill with the parsed data. |
Definition at line 239 of file vtparser.c.
References add_preferences_to_nvt(), add_tags_to_nvt(), get_category_from_name(), gvm_json_obj_check_str(), gvm_json_path_to_string(), GVM_JSON_PULL_EVENT_ARRAY_END, GVM_JSON_PULL_EVENT_ARRAY_START, GVM_JSON_PULL_EVENT_EOF, GVM_JSON_PULL_EVENT_OBJECT_START, gvm_json_pull_expand_container(), gvm_json_pull_parser_next(), nvti_free(), nvti_new(), nvti_set_category(), nvti_set_family(), nvti_set_name(), nvti_set_oid(), parse_references(), gvm_json_pull_event_t::path, and gvm_json_pull_event_t::type.
Referenced by Ensure().

