|
Greenbone Vulnerability Management Libraries 22.32.0
|
Headers for CPE utils. More...
#include <glib.h>#include <stdio.h>

Go to the source code of this file.
Data Structures | |
| struct | cpe_struct_t |
| XML context. More... | |
Macros | |
| #define | CPE_COMPONENT_IS_ANY(component) |
Enumerations | |
| enum | set_relation { DISJOINT , EQUAL , SUBSET , SUPERSET , UNDEFINED } |
Functions | |
| char * | uri_cpe_to_fs_cpe (const char *) |
| Convert a URI CPE to a formatted string CPE. | |
| char * | uri_cpe_to_fs_product (const char *) |
| Convert a URI CPE to a formatted string product. | |
| char * | uri_cpe_to_uri_product (const char *) |
| Convert a URI CPE to a formatted string product. | |
| char * | fs_cpe_to_uri_cpe (const char *) |
| Convert a formatted string CPE to a URI CPE. | |
| char * | fs_cpe_to_uri_product (const char *) |
| Convert a formatted string CPE to an URI product. | |
| void | uri_cpe_to_cpe_struct (const char *, cpe_struct_t *) |
| Read a URI CPE into the CPE struct. | |
| char * | cpe_struct_to_uri_cpe (const cpe_struct_t *) |
| Convert a CPE struct into a URI CPE. | |
| char * | cpe_struct_to_uri_product (const cpe_struct_t *) |
| Convert a CPE struct into a URI product. | |
| char * | get_version_from_uri_cpe (const char *) |
| Get the version from an uri cpe. | |
| void | fs_cpe_to_cpe_struct (const char *, cpe_struct_t *) |
| Read a formatted string CPE into the CPE struct. | |
| char * | cpe_struct_to_fs_cpe (const cpe_struct_t *) |
| Convert a CPE struct into a formatted string CPE. | |
| char * | cpe_struct_to_fs_product (const cpe_struct_t *) |
| Convert a CPE struct into a formatted string product. | |
| void | cpe_struct_init (cpe_struct_t *) |
| Initialize a CPE struct. | |
| void | cpe_struct_free (cpe_struct_t *) |
| Free a CPE struct. | |
| gboolean | cpe_struct_match (cpe_struct_t *, cpe_struct_t *) |
| Returns if source is a match for target. That means that source is a superset of target. | |
| gboolean | cpe_struct_match_tail (cpe_struct_t *, cpe_struct_t *) |
| Returns if the part behind the version of source is a match for that part of target. That means, that source is a superset of target if also the first part matches. | |
Headers for CPE utils.
Definition in file cpeutils.h.
| #define CPE_COMPONENT_IS_ANY | ( | component | ) |
Definition at line 94 of file cpeutils.h.
| enum set_relation |
| void cpe_struct_free | ( | cpe_struct_t * | cpe | ) |
Free a CPE struct.
| [in/out] | cpe The CPE to be freed. |
Definition at line 1214 of file cpeutils.c.
References cpe_struct_t::edition, cpe_struct_t::language, cpe_struct_t::other, cpe_struct_t::part, cpe_struct_t::product, cpe_struct_t::sw_edition, cpe_struct_t::target_hw, cpe_struct_t::target_sw, cpe_struct_t::update, cpe_struct_t::vendor, and cpe_struct_t::version.
Referenced by Ensure(), Ensure(), Ensure(), fs_cpe_to_uri_cpe(), fs_cpe_to_uri_product(), uri_cpe_to_fs_cpe(), uri_cpe_to_fs_product(), and uri_cpe_to_uri_product().

| void cpe_struct_init | ( | cpe_struct_t * | cpe | ) |
Initialize a CPE struct.
| [in/out] | cpe The pointer to the CPE to initialize. |
Definition at line 1190 of file cpeutils.c.
References cpe_struct_t::edition, cpe_struct_t::language, cpe_struct_t::other, cpe_struct_t::part, cpe_struct_t::product, cpe_struct_t::sw_edition, cpe_struct_t::target_hw, cpe_struct_t::target_sw, cpe_struct_t::update, cpe_struct_t::vendor, and cpe_struct_t::version.
Referenced by Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), fs_cpe_to_uri_cpe(), fs_cpe_to_uri_product(), uri_cpe_to_fs_cpe(), uri_cpe_to_fs_product(), and uri_cpe_to_uri_product().

| gboolean cpe_struct_match | ( | cpe_struct_t * | source, |
| cpe_struct_t * | target ) |
Returns if source is a match for target. That means that source is a superset of target.
| [in] | source | The cpe_struct that represents a set of CPEs. |
| [in] | target | The cpe_struct that represents a single CPE or or a set of CPEs that is checked if it is a subset of source meaning that it is matched by source. |
Definition at line 1295 of file cpeutils.c.
References compare_component(), cpe_struct_t::edition, EQUAL, cpe_struct_t::language, cpe_struct_t::other, cpe_struct_t::part, cpe_struct_t::product, SUPERSET, cpe_struct_t::sw_edition, cpe_struct_t::target_hw, cpe_struct_t::target_sw, cpe_struct_t::update, cpe_struct_t::vendor, and cpe_struct_t::version.
Referenced by Ensure(), and main().


| gboolean cpe_struct_match_tail | ( | cpe_struct_t * | source, |
| cpe_struct_t * | target ) |
Returns if the part behind the version of source is a match for that part of target. That means, that source is a superset of target if also the first part matches.
| [in] | source | The cpe_struct that represents a set of CPEs. |
| [in] | target | The cpe_struct that represents a single CPE or or a set of CPEs that is checked if it is a subset of source meaning that it is matched by source. |
Definition at line 1350 of file cpeutils.c.
References compare_component(), cpe_struct_t::edition, EQUAL, cpe_struct_t::language, cpe_struct_t::other, SUPERSET, cpe_struct_t::sw_edition, cpe_struct_t::target_hw, cpe_struct_t::target_sw, and cpe_struct_t::update.

| char * cpe_struct_to_fs_cpe | ( | const cpe_struct_t * | cpe | ) |
Convert a CPE struct into a formatted string CPE.
| [in] | cpe | A pointer to the CPE struct. |
Definition at line 402 of file cpeutils.c.
References bind_cpe_component_for_fs(), cpe_struct_t::edition, cpe_struct_t::language, cpe_struct_t::other, cpe_struct_t::part, cpe_struct_t::product, cpe_struct_t::sw_edition, cpe_struct_t::target_hw, cpe_struct_t::target_sw, cpe_struct_t::update, cpe_struct_t::vendor, and cpe_struct_t::version.
Referenced by Ensure(), main(), and uri_cpe_to_fs_cpe().


| char * cpe_struct_to_fs_product | ( | const cpe_struct_t * | cpe | ) |
Convert a CPE struct into a formatted string product.
| [in] | cpe | A pointer to the CPE struct. |
Definition at line 496 of file cpeutils.c.
References bind_cpe_component_for_fs(), cpe_struct_t::part, cpe_struct_t::product, and cpe_struct_t::vendor.
Referenced by uri_cpe_to_fs_product().


| char * cpe_struct_to_uri_cpe | ( | const cpe_struct_t * | cpe | ) |
Convert a CPE struct into a URI CPE.
| [in] | cpe | A pointer to the CPE struct. |
Definition at line 240 of file cpeutils.c.
References bind_cpe_component_for_uri(), cpe_struct_t::language, pack_sixth_uri_component(), cpe_struct_t::part, cpe_struct_t::product, trim_pct(), cpe_struct_t::update, cpe_struct_t::vendor, and cpe_struct_t::version.
Referenced by Ensure(), fs_cpe_to_uri_cpe(), and main().


| char * cpe_struct_to_uri_product | ( | const cpe_struct_t * | cpe | ) |
Convert a CPE struct into a URI product.
| [in] | cpe | A pointer to the CPE struct. |
Definition at line 309 of file cpeutils.c.
References bind_cpe_component_for_uri(), cpe_struct_t::part, cpe_struct_t::product, trim_pct(), and cpe_struct_t::vendor.
Referenced by fs_cpe_to_uri_product(), and uri_cpe_to_uri_product().


| void fs_cpe_to_cpe_struct | ( | const char * | fs_cpe, |
| cpe_struct_t * | cpe ) |
Read a formatted string CPE into the CPE struct.
| [in] | fs_cpe | A formatted string CPE. |
| [out] | cpe | Pointer to the filled CPE struct. |
Definition at line 366 of file cpeutils.c.
References cpe_struct_t::edition, get_fs_component(), cpe_struct_t::language, cpe_struct_t::other, cpe_struct_t::part, cpe_struct_t::product, cpe_struct_t::sw_edition, cpe_struct_t::target_hw, cpe_struct_t::target_sw, unbind_fs_component(), cpe_struct_t::update, cpe_struct_t::vendor, and cpe_struct_t::version.
Referenced by Ensure(), Ensure(), fs_cpe_to_uri_cpe(), fs_cpe_to_uri_product(), and main().


| char * fs_cpe_to_uri_cpe | ( | const char * | fs_cpe | ) |
Convert a formatted string CPE to a URI CPE.
| [in] | fs_cpe | A formatted string CPE. |
Definition at line 160 of file cpeutils.c.
References cpe_struct_free(), cpe_struct_init(), cpe_struct_to_uri_cpe(), and fs_cpe_to_cpe_struct().
Referenced by Ensure(), and main().


| char * fs_cpe_to_uri_product | ( | const char * | fs_cpe | ) |
Convert a formatted string CPE to an URI product.
| [in] | fs_cpe | A formatted string CPE. |
Definition at line 180 of file cpeutils.c.
References cpe_struct_free(), cpe_struct_init(), cpe_struct_to_uri_product(), and fs_cpe_to_cpe_struct().

| char * get_version_from_uri_cpe | ( | const char * | uri_cpe | ) |
Get the version from an uri cpe.
| [in] | uri_cpe | The uri cpe to get the version from. |
Definition at line 350 of file cpeutils.c.
References decode_uri_component(), and get_uri_component().

| void uri_cpe_to_cpe_struct | ( | const char * | uri_cpe, |
| cpe_struct_t * | cpe ) |
Read a URI CPE into the CPE struct.
| [in] | uri_cpe | A CPE v2.2-conformant URI. |
| [out] | cpe | Pointer to the filled CPE struct. |
Definition at line 200 of file cpeutils.c.
References decode_uri_component(), cpe_struct_t::edition, get_uri_component(), cpe_struct_t::language, cpe_struct_t::part, cpe_struct_t::product, unpack_sixth_uri_component(), cpe_struct_t::update, cpe_struct_t::vendor, and cpe_struct_t::version.
Referenced by Ensure(), main(), uri_cpe_to_fs_cpe(), uri_cpe_to_fs_product(), and uri_cpe_to_uri_product().


| char * uri_cpe_to_fs_cpe | ( | const char * | uri_cpe | ) |
Convert a URI CPE to a formatted string CPE.
| [in] | uri_cpe | A CPE v2.2-conformant URI. |
Definition at line 100 of file cpeutils.c.
References cpe_struct_free(), cpe_struct_init(), cpe_struct_to_fs_cpe(), and uri_cpe_to_cpe_struct().
Referenced by Ensure(), and main().


| char * uri_cpe_to_fs_product | ( | const char * | uri_cpe | ) |
Convert a URI CPE to a formatted string product.
| [in] | uri_cpe | A CPE v2.2-conformant URI. |
Definition at line 120 of file cpeutils.c.
References cpe_struct_free(), cpe_struct_init(), cpe_struct_to_fs_product(), and uri_cpe_to_cpe_struct().

| char * uri_cpe_to_uri_product | ( | const char * | uri_cpe | ) |
Convert a URI CPE to a formatted string product.
| [in] | uri_cpe | A CPE v2.2-conformant URI. |
Definition at line 140 of file cpeutils.c.
References cpe_struct_free(), cpe_struct_init(), cpe_struct_to_uri_product(), and uri_cpe_to_cpe_struct().
Referenced by Ensure(), and main().

