OpenVAS Scanner 23.32.3
table_driven_lsc.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
10
11#ifndef MISC_TABLE_DRIVEN_LSC_H
12#define MISC_TABLE_DRIVEN_LSC_H
13
14#include <glib.h>
15#include <gvm/util/kb.h> // for kb_t
16
20{
21 UNKNOWN, // Unknown
22 RANGE, // Range of version which fixed the package
23 SINGLE, // A single version with a specifier (gt or lt)
24};
25
29{
30 char *version; // a version
31 char *specifier; // a lt or gt specifier
32};
34
38{
39 char *start; // <= the version
40 char *stop; // >= the version
41};
43
47{
48 char *pkg_name; // package name
49 char *install_version; // installed version of the vulnerable package
50 enum fixed_type type; // fixed version type: range or single
51 union
52 {
53 version_range_t *range; // range of vulnerable versions
54 fixed_version_t *version; // version and specifier for the fixed versions
55 };
56};
57
59
63{
64 char *oid; // Advisory OID
65 vuln_pkg_t *pkgs[100]; // list of vulnerable packages, installed version and
66 // fixed versions
67 size_t count; // Count of vulnerable packages this advisory has
68};
69
70typedef struct advisory advisory_t;
71
75{
77 size_t count;
78 size_t max_size;
79};
80typedef struct advisories advisories_t;
81
82void
84
85void
86set_lsc_flag (void);
87
88int
89lsc_has_run (void);
90
91int
92run_table_driven_lsc (const char *, const char *, const char *, const char *,
93 const char *);
94
95char *
96notus_get_response (const char *pkg_list, const char *os);
97
99process_notus_response (const gchar *resp, const size_t len);
100
101#endif // MISC_TABLE_DRIVEN_LSC_H
uint8_t len
advisory_t ** advisories
vuln_pkg_t * pkgs[100]
Fixed version.
Specify a version range.
Define a vulnerable package.
fixed_version_t * version
enum fixed_type type
version_range_t * range
char * notus_get_response(const char *pkg_list, const char *os)
Sent the installed package list and OS to notus.
struct advisories advisories_t
fixed_type
Fixed version format.
@ SINGLE
@ RANGE
@ UNKNOWN
int run_table_driven_lsc(const char *, const char *, const char *, const char *, const char *)
Publish the necessary data to start a Table driven LSC scan.
struct advisory advisory_t
advisories_t * process_notus_response(const gchar *resp, const size_t len)
Process a json object which contains advisories and vulnerable packages.
int lsc_has_run(void)
Get lsc_flag value.
struct fixed_version fixed_version_t
struct vulnerable_pkg vuln_pkg_t
struct version_range version_range_t
void set_lsc_flag(void)
Set lsc_flag to 1.
void advisories_free(advisories_t *advisories)
Free()'s an advisories.