File: cpeutils.h

package info (click to toggle)
gvm-libs 22.35.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,980 kB
  • sloc: ansic: 39,095; makefile: 26
file content (96 lines) | stat: -rw-r--r-- 1,571 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* SPDX-FileCopyrightText: 2009-2024 Greenbone AG
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

/**
 * @file
 * @brief Headers for CPE utils.
 */

#ifndef _GVM_UTIL_CPEUTILS_H
#define _GVM_UTIL_CPEUTILS_H

#include <glib.h>
#include <stdio.h>

/**
 * @brief XML context.
 *
 * This structure is used to represent the WFN naming of a CPE.
 */
typedef struct
{
  char *part;
  char *vendor;
  char *product;
  char *version;
  char *update;
  char *edition;
  char *sw_edition;
  char *target_sw;
  char *target_hw;
  char *other;
  char *language;
} cpe_struct_t;

char *
uri_cpe_to_fs_cpe (const char *);

char *
uri_cpe_to_fs_product (const char *);

char *
uri_cpe_to_uri_product (const char *);

char *
fs_cpe_to_uri_cpe (const char *);

char *
fs_cpe_to_uri_product (const char *);

void
uri_cpe_to_cpe_struct (const char *, cpe_struct_t *);

char *
cpe_struct_to_uri_cpe (const cpe_struct_t *);

char *
cpe_struct_to_uri_product (const cpe_struct_t *);

char *
get_version_from_uri_cpe (const char *);

void
fs_cpe_to_cpe_struct (const char *, cpe_struct_t *);

char *
cpe_struct_to_fs_cpe (const cpe_struct_t *);

char *
cpe_struct_to_fs_product (const cpe_struct_t *);

void
cpe_struct_init (cpe_struct_t *);

void
cpe_struct_free (cpe_struct_t *);

gboolean
cpe_struct_match (cpe_struct_t *, cpe_struct_t *);

gboolean
cpe_struct_match_tail (cpe_struct_t *, cpe_struct_t *);

enum set_relation
{
  DISJOINT,
  EQUAL,
  SUBSET,
  SUPERSET,
  UNDEFINED
};

#define CPE_COMPONENT_IS_ANY(component) (component[0] == 'A')

#endif /* not _GVM_UTIL_CPEUTILS_H */