Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the actual nvti struct internal. #253

Merged
merged 1 commit into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions base/nvti.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,38 @@ vtref_text (const vtref_t *r)
return (r ? r->ref_text : NULL);
}

/* VT Information */

/**
* @brief The structure of a information record that corresponds to a NVT.
*/
typedef struct nvti
{
gchar *oid; /**< @brief Object ID */
gchar *name; /**< @brief The name */

gchar *tag; /**< @brief List of tags attached to this NVT */
gchar *cvss_base; /**< @brief CVSS base score for this NVT. */

gchar *dependencies; /**< @brief List of dependencies of this NVT */
gchar *required_keys; /**< @brief List of required KB keys of this NVT */
gchar *mandatory_keys; /**< @brief List of mandatory KB keys of this NVT */
gchar *excluded_keys; /**< @brief List of excluded KB keys of this NVT */
gchar *required_ports; /**< @brief List of required ports of this NVT */
gchar
*required_udp_ports; /**< @brief List of required UDP ports of this NVT*/

gchar *qod_type; /**< @brief Quality of detection type */

GSList *refs; /**< @brief Collection of VT references */
GSList *prefs; /**< @brief Collection of NVT preferences */

// The following are not settled yet.
gint timeout; /**< @brief Default timeout time for this NVT */
gint category; /**< @brief The category, this NVT belongs to */
gchar *family; /**< @brief Family the NVT belongs to */
} nvti_t;

/**
* @brief Add a reference to the VT Info.
*
Expand Down
30 changes: 1 addition & 29 deletions base/nvti.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,36 +68,8 @@ typedef struct vtref vtref_t;

/**
* @brief The structure of a information record that corresponds to a NVT.
*
* The elements of this structure should never be accessed directly.
* Only the functions corresponding to this module should be used.
*/
typedef struct nvti
{
gchar *oid; /**< @brief Object ID */
gchar *name; /**< @brief The name */

gchar *tag; /**< @brief List of tags attached to this NVT */
gchar *cvss_base; /**< @brief CVSS base score for this NVT. */

gchar *dependencies; /**< @brief List of dependencies of this NVT */
gchar *required_keys; /**< @brief List of required KB keys of this NVT */
gchar *mandatory_keys; /**< @brief List of mandatory KB keys of this NVT */
gchar *excluded_keys; /**< @brief List of excluded KB keys of this NVT */
gchar *required_ports; /**< @brief List of required ports of this NVT */
gchar
*required_udp_ports; /**< @brief List of required UDP ports of this NVT*/

gchar *qod_type; /**< @brief Quality of detection type */

GSList *refs; /**< @brief Collection of VT references */
GSList *prefs; /**< @brief Collection of NVT preferences */

// The following are not settled yet.
gint timeout; /**< @brief Default timeout time for this NVT */
gint category; /**< @brief The category, this NVT belongs to */
gchar *family; /**< @brief Family the NVT belongs to */
} nvti_t;
typedef struct nvti nvti_t;

vtref_t *
vtref_new (const gchar *, const gchar *, const gchar *);
Expand Down