Open SCAP Library
cpe_dict.h
Go to the documentation of this file.
1 
13 /*
14  * Copyright 2009--2013 Red Hat Inc., Durham, North Carolina.
15  * All Rights Reserved.
16  *
17  * This library is free software; you can redistribute it and/or
18  * modify it under the terms of the GNU Lesser General Public
19  * License as published by the Free Software Foundation; either
20  * version 2.1 of the License, or (at your option) any later version.
21  *
22  * This library is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25  * Lesser General Public License for more details.
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  *
31  * Authors:
32  * Maros Barabas <mbarabas@redhat.com>
33  * Lukas Kuklinek <lkuklinek@redhat.com>
34  * Šimon Lukašík
35  */
36 
37 #ifndef CPEDICT_H_
38 #define CPEDICT_H_
39 
40 #include "oscap.h"
41 #include "cpe_name.h"
42 #include "oscap_text.h"
43 
48 struct cpe_dict_model;
49 
54 struct cpe_item;
55 
60 struct cpe_vendor;
61 
66 struct cpe_generator;
67 
72 struct cpe_check;
73 
78 struct cpe_reference;
79 
84 struct cpe_item_metadata;
85 
90 struct cpe_product;
95 struct cpe_version;
100 struct cpe_update;
105 struct cpe_edition;
110 struct cpe_language;
111 
112 /************************************************************/
124 const char *cpe_item_metadata_get_modification_date(const struct cpe_item_metadata *item);
125 
130 const char *cpe_item_metadata_get_status(const struct cpe_item_metadata *item);
131 
136 const char *cpe_item_metadata_get_nvd_id(const struct cpe_item_metadata *item);
137 
142 const char *cpe_item_metadata_get_deprecated_by_nvd_id(const struct cpe_item_metadata *item);
143 
148 const char *cpe_check_get_system(const struct cpe_check *item);
149 
154 const char *cpe_check_get_href(const struct cpe_check *item);
155 
160 const char *cpe_check_get_identifier(const struct cpe_check *item);
161 
166 const char *cpe_reference_get_href(const struct cpe_reference *item);
167 
172 const char *cpe_reference_get_content(const struct cpe_reference *item);
173 
178 struct cpe_name *cpe_item_get_name(const struct cpe_item *item);
179 
184 struct cpe_name *cpe_item_get_deprecated_by(const struct cpe_item *item);
185 
193 OSCAP_DEPRECATED(struct cpe_name *cpe_item_get_deprecated(const struct cpe_item *item));
194 
199 const char *cpe_item_get_deprecation_date(const struct cpe_item *item);
200 
205 struct cpe_item_metadata *cpe_item_get_metadata(const struct cpe_item *item);
206 
211 struct cpe_reference_iterator *cpe_item_get_references(const struct cpe_item *item);
212 
217 struct cpe_check_iterator *cpe_item_get_checks(const struct cpe_item *item);
218 
223 struct oscap_text_iterator *cpe_item_get_titles(const struct cpe_item *item);
224 
232 
237 const char *cpe_generator_get_product_name(const struct cpe_generator *item);
238 
243 const char *cpe_generator_get_product_version(const struct cpe_generator *item);
244 
249 const char *cpe_generator_get_schema_version(const struct cpe_generator *item);
250 
255 const char *cpe_generator_get_timestamp(const struct cpe_generator *item);
256 
268 int cpe_dict_model_get_base_version(const struct cpe_dict_model *item);
269 
274 bool cpe_dict_model_set_base_version(struct cpe_dict_model *item, int base_version);
275 
281 struct cpe_generator *cpe_dict_model_get_generator(const struct cpe_dict_model *item);
282 
287 struct cpe_item_iterator *cpe_dict_model_get_items(const struct cpe_dict_model *item);
288 
294 
299 const char *cpe_vendor_get_value(const struct cpe_vendor *item);
300 
305 struct oscap_text_iterator *cpe_vendor_get_titles(const struct cpe_vendor *item);
306 
311 struct cpe_product_iterator *cpe_vendor_get_products(const struct cpe_vendor *item);
312 
317 const char *cpe_product_get_value(const struct cpe_product *item);
318 
323 cpe_part_t cpe_product_get_part(const struct cpe_product *item);
324 
330 struct cpe_version_iterator *cpe_product_get_versions(const struct cpe_product *item);
331 
336 const char *cpe_version_get_value(const struct cpe_version *item);
337 
343 struct cpe_update_iterator *cpe_version_get_updates(const struct cpe_version *item);
344 
349 const char *cpe_update_get_value(const struct cpe_update *item);
350 
356 struct cpe_edition_iterator *cpe_update_get_editions(const struct cpe_update *item);
357 
362 const char *cpe_edition_get_value(const struct cpe_edition *item);
363 
370 
375 const char *cpe_language_get_value(const struct cpe_language *item);
376 
377 /************************************************************/
380 void cpe_check_free(struct cpe_check *check);
383 void cpe_reference_free(struct cpe_reference *ref);
385 void cpe_vendor_free(struct cpe_vendor *vendor);
387 void cpe_product_free(struct cpe_product *product);
389 void cpe_version_free(struct cpe_version *version);
391 void cpe_update_free(struct cpe_update *update);
393 void cpe_edition_free(struct cpe_edition *edition);
395 void cpe_language_free(struct cpe_language *language);
397 void cpe_itemmetadata_free(struct cpe_item_metadata *meta);
399 void cpe_dict_model_free(struct cpe_dict_model *dict);
401 void cpe_generator_free(struct cpe_generator *generator);
403 void cpe_item_free(struct cpe_item *item);
404 
406 struct cpe_dict_model *cpe_dict_model_new(void);
408 struct cpe_generator *cpe_generator_new(void);
410 struct cpe_check *cpe_check_new(void);
412 struct cpe_reference *cpe_reference_new(void);
414 struct cpe_item *cpe_item_new(void);
416 struct cpe_vendor *cpe_vendor_new(void);
418 struct cpe_product *cpe_product_new(void);
420 struct cpe_version *cpe_version_new(void);
422 struct cpe_update *cpe_update_new(void);
424 struct cpe_edition *cpe_edition_new(void);
426 struct cpe_language *cpe_language_new(void);
429 
430 /************************************************************/
438 bool cpe_item_set_deprecation_date(struct cpe_item *item, const char *new_deprecation_date);
440 
443  const char *new_modification_date);
444 
446 bool cpe_item_metadata_set_status(struct cpe_item_metadata *item_metadata, const char *new_status);
447 
449 bool cpe_item_metadata_set_nvd_id(struct cpe_item_metadata *item_metadata, const char *new_nvd_id);
450 
453  const char *new_deprecated_by_nvd_id);
454 
456 bool cpe_check_set_system(struct cpe_check *check, const char *new_system);
457 
459 bool cpe_check_set_href(struct cpe_check *check, const char *new_href);
460 
462 bool cpe_check_set_identifier(struct cpe_check *check, const char *new_identifier);
463 
465 bool cpe_reference_set_href(struct cpe_reference *reference, const char *new_href);
466 
468 bool cpe_reference_set_content(struct cpe_reference *reference, const char *new_content);
469 
471 bool cpe_generator_set_product_name(struct cpe_generator *generator, const char *new_product_name);
472 
474 bool cpe_generator_set_product_version(struct cpe_generator *generator, const char *new_product_version);
475 
477 bool cpe_generator_set_schema_version(struct cpe_generator *generator, const char *new_schema_version);
478 
480 bool cpe_generator_set_timestamp(struct cpe_generator *generator, const char *new_timestamp);
481 
483 bool cpe_vendor_set_value(struct cpe_vendor *vendor, const char *new_value);
484 
486 bool cpe_product_set_value(struct cpe_product *product, const char *new_value);
487 
489 bool cpe_product_set_part(struct cpe_product *product, cpe_part_t new_part);
490 
492 bool cpe_version_set_value(struct cpe_version *version, const char *new_value);
493 
495 bool cpe_update_set_value(struct cpe_update *update, const char *new_value);
496 
498 bool cpe_edition_set_value(struct cpe_edition *edition, const char *new_value);
499 
501 bool cpe_language_set_value(struct cpe_language *language, const char *new_value);
502 
503 /*
504  * Add functions
505  */
506 
508 bool cpe_item_add_reference(struct cpe_item *item, struct cpe_reference *new_reference);
509 
511 bool cpe_item_add_check(struct cpe_item *item, struct cpe_check *new_check);
512 
514 bool cpe_item_add_title(struct cpe_item *item, struct oscap_text *new_title);
515 
521 OSCAP_DEPRECATED(bool cpe_item_add_note(struct cpe_item *item, struct oscap_text *new_title));
522 
524 bool cpe_dict_model_add_vendor(struct cpe_dict_model *dict, struct cpe_vendor *new_vendor);
525 
527 bool cpe_vendor_add_title(struct cpe_vendor *vendor, struct oscap_text *new_title);
528 
530 bool cpe_vendor_add_product(struct cpe_vendor *vendor, struct cpe_product *new_product);
531 
533 bool cpe_product_add_version(struct cpe_product *product, struct cpe_version *new_version);
534 
536 bool cpe_version_add_update(struct cpe_version *version, struct cpe_update *new_update);
537 
539 bool cpe_update_add_edition(struct cpe_update *update, struct cpe_edition *new_edition);
540 
542 bool cpe_edition_add_language(struct cpe_edition *edition, struct cpe_language *new_language);
543 
544 
545 /************************************************************/
548 /************************************************************/
559 struct cpe_item_iterator;
560 
567 
574 
581 
586 
593 
600 
607 
614 
619 
625 struct cpe_check_iterator;
626 
633 
640 
647 
652 
658 struct cpe_vendor_iterator;
659 
666 
673 
680 
685 
691 struct cpe_product_iterator;
692 
699 
706 
713 
718 
724 struct cpe_version_iterator;
725 
732 
739 
746 
751 
757 struct cpe_update_iterator;
758 
765 
772 
779 
784 
790 struct cpe_edition_iterator;
791 
798 
805 
812 
817 
823 struct cpe_language_iterator;
824 
831 
838 
845 
850 
851 /************************************************************/
854 /************************************************************/
865 const char * cpe_dict_model_supported(void);
866 
872 char * cpe_dict_detect_version(const char* file);
873 
882 bool cpe_name_match_dict(struct cpe_name *cpe, struct cpe_dict_model *dict);
883 
892 bool cpe_name_match_dict_str(const char *cpe, struct cpe_dict_model *dict);
893 
903 bool cpe_name_applicable_dict(struct cpe_name *cpe, struct cpe_dict_model *dict, cpe_check_fn cb, void* usr);
904 
906 bool cpe_item_is_applicable(struct cpe_item* item, cpe_check_fn cb, void* usr);
907 
908 /************************************************************/
916 void cpe_dict_model_export(const struct cpe_dict_model *dict, const char *file);
917 
925 struct cpe_dict_model *cpe_dict_model_import(const char *file);
926 
932 bool cpe_dict_model_set_origin_file(struct cpe_dict_model* dict, const char* origin_file);
933 
941 const char* cpe_dict_model_get_origin_file(const struct cpe_dict_model* dict);
942 
947 #endif /* _CPEDICT_H_ */
struct cpe_version_iterator * cpe_product_get_versions(const struct cpe_product *item)
cpe_product functions to get versions of product
struct cpe_version * cpe_version_iterator_next(struct cpe_version_iterator *it)
Iterator over CPE version items.
Product of some vendor.
Definition: cpedict_priv.c:177
void cpe_version_free(struct cpe_version *version)
Definition: cpedict_priv.c:1469
const char * cpe_check_get_href(const struct cpe_check *item)
cpe_check functions to get href
struct cpe_vendor_iterator * cpe_dict_model_get_vendors(const struct cpe_dict_model *item)
cpe_dict_model functions to get vendors
void cpe_update_free(struct cpe_update *update)
Definition: cpedict_priv.c:1480
Structure representing single CPE check.
Definition: cpedict_priv.c:123
CPE dictionary item reference.
Definition: cpedict_priv.c:134
bool cpe_item_add_reference(struct cpe_item *item, struct cpe_reference *new_reference)
const char * cpe_check_get_identifier(const struct cpe_check *item)
cpe_check functions to get identifier
struct cpe_dict_model * cpe_dict_model_new(void)
Definition: cpedict_priv.c:348
void cpe_check_iterator_remove(struct cpe_check_iterator *it)
Structure with information about document.
Definition: cpedict_priv.c:143
void cpe_product_iterator_free(struct cpe_product_iterator *it)
Iterator over CPE product items.
General OpenScap functions and types.
bool cpe_name_match_dict_str(const char *cpe, struct cpe_dict_model *dict)
Verify if CPE given by string is known according to specified dictionary.
Definition: cpedict.c:118
bool cpe_item_metadata_set_modification_date(struct cpe_item_metadata *item_metadata, const char *new_modification_date)
struct cpe_name * cpe_item_get_deprecated(const struct cpe_item *item)
cpe_item functions to get variable member deprecated_by
Definition: cpedict_priv.c:94
Edition of product update.
Definition: cpedict_priv.c:209
Iterator over CPE dictionary item updates.
struct cpe_product * cpe_product_new(void)
Definition: cpedict_priv.c:479
bool cpe_edition_add_language(struct cpe_edition *edition, struct cpe_language *new_language)
const char * cpe_item_metadata_get_nvd_id(const struct cpe_item_metadata *item)
cpe_item_metadata function to get nvd ID
bool cpe_vendor_add_product(struct cpe_vendor *vendor, struct cpe_product *new_product)
struct cpe_product * cpe_product_iterator_next(struct cpe_product_iterator *it)
Iterator over CPE product items.
Structure with information about vendor.
Definition: cpedict_priv.h:84
const char * cpe_vendor_get_value(const struct cpe_vendor *item)
cpe_vendor functions to get vendor value
bool cpe_check_set_system(struct cpe_check *check, const char *new_system)
const char * cpe_item_metadata_get_status(const struct cpe_item_metadata *item)
cpe_item_metadata function to get status
bool cpe_language_iterator_has_more(struct cpe_language_iterator *it)
Iterator over CPE language items.
void cpe_check_iterator_free(struct cpe_check_iterator *it)
Iterator over CPE item check items.
#define OSCAP_DEPRECATED(func)
This macro will warn, when a deprecated function is used.
Definition: oscap.h:50
bool cpe_generator_set_product_name(struct cpe_generator *generator, const char *new_product_name)
struct cpe_vendor * cpe_vendor_new(void)
Definition: cpedict_priv.c:462
bool cpe_check_set_identifier(struct cpe_check *check, const char *new_identifier)
void cpe_edition_iterator_remove(struct cpe_edition_iterator *it)
const char * cpe_check_get_system(const struct cpe_check *item)
cpe_check functions to get system
void cpe_version_iterator_remove(struct cpe_version_iterator *it)
void cpe_dict_model_free(struct cpe_dict_model *dict)
Definition: cpedict_priv.c:1372
const char * cpe_generator_get_timestamp(const struct cpe_generator *item)
cpe_generator functions to get timestamp from generator
Iterator over CPE dictionary item languages.
struct cpe_item_metadata * cpe_item_metadata_new(void)
Definition: cpedict_priv.c:368
Update of product version.
Definition: cpedict_priv.c:199
bool cpe_item_metadata_set_status(struct cpe_item_metadata *item_metadata, const char *new_status)
void cpe_version_iterator_free(struct cpe_version_iterator *it)
Iterator over CPE version items.
const char * cpe_product_get_value(const struct cpe_product *item)
cpe_product functions to get product value
const char * cpe_edition_get_value(const struct cpe_edition *item)
cpe_edition functions to get value of edition
void cpe_product_free(struct cpe_product *product)
Definition: cpedict_priv.c:1458
void cpe_item_iterator_remove(struct cpe_item_iterator *it)
struct cpe_name * cpe_item_get_name(const struct cpe_item *item)
cpe_item functions to get variable member name
void cpe_language_iterator_remove(struct cpe_language_iterator *it)
bool cpe_dict_model_add_vendor(struct cpe_dict_model *dict, struct cpe_vendor *new_vendor)
Iterator over CPE dictionary items.
void cpe_edition_iterator_free(struct cpe_edition_iterator *it)
Iterator over CPE edition items.
bool cpe_update_set_value(struct cpe_update *update, const char *new_value)
const char * cpe_language_get_value(const struct cpe_language *item)
cpe_language functions to get value of language
Interface to Common Platform Enumeration (CPE) URI.
void cpe_update_iterator_free(struct cpe_update_iterator *it)
Iterator over CPE update items.
bool cpe_product_set_value(struct cpe_product *product, const char *new_value)
const char * cpe_generator_get_product_version(const struct cpe_generator *item)
cpe_generator functions to get product version
bool cpe_generator_set_schema_version(struct cpe_generator *generator, const char *new_schema_version)
struct cpe_language * cpe_language_iterator_next(struct cpe_language_iterator *it)
Iterator over CPE language items.
bool cpe_update_iterator_has_more(struct cpe_update_iterator *it)
Iterator over CPE update items.
void cpe_vendor_iterator_remove(struct cpe_vendor_iterator *it)
void cpe_generator_free(struct cpe_generator *generator)
Definition: cpedict_priv.c:1401
const char * cpe_generator_get_schema_version(const struct cpe_generator *item)
cpe_generator functions to get document schema version
void cpe_update_iterator_reset(struct cpe_update_iterator *it)
bool cpe_language_set_value(struct cpe_language *language, const char *new_value)
Internationalized string iterator.
struct cpe_edition * cpe_edition_new(void)
Definition: cpedict_priv.c:527
const char * cpe_dict_model_supported(void)
Get the newest supported version of CPE dictionary XML.
Definition: cpedict.c:193
bool cpe_item_add_check(struct cpe_item *item, struct cpe_check *new_check)
struct cpe_edition * cpe_edition_iterator_next(struct cpe_edition_iterator *it)
Iterator over CPE edition items.
bool *(* cpe_check_fn)(const char *, const char *, const char *, void *)
Shared callback definition used to evaluate checks to perform applicability tests.
Definition: cpe_name.h:362
struct cpe_generator * cpe_generator_new(void)
Definition: cpedict_priv.c:444
const char * cpe_item_get_deprecation_date(const struct cpe_item *item)
cpe_item functions to get variable member date
bool cpe_product_add_version(struct cpe_product *product, struct cpe_version *new_version)
void cpe_language_iterator_reset(struct cpe_language_iterator *it)
bool cpe_version_set_value(struct cpe_version *version, const char *new_value)
bool cpe_item_metadata_set_deprecated_by_nvd_id(struct cpe_item_metadata *item_metadata, const char *new_deprecated_by_nvd_id)
bool cpe_version_add_update(struct cpe_version *version, struct cpe_update *new_update)
void cpe_language_iterator_free(struct cpe_language_iterator *it)
Iterator over CPE language items.
bool cpe_dict_model_set_origin_file(struct cpe_dict_model *dict, const char *origin_file)
Sets the origin file hint.
Definition: cpedict.c:64
Iterator over CPE dictionary item vendors.
struct cpe_reference * cpe_reference_new(void)
Definition: cpedict_priv.c:421
const char * cpe_item_metadata_get_modification_date(const struct cpe_item_metadata *item)
cpe_item_metadata function to get date
Iterator over CPE dictionary item editions.
void cpe_language_free(struct cpe_language *language)
Definition: cpedict_priv.c:1502
struct oscap_text_iterator * cpe_vendor_get_titles(const struct cpe_vendor *item)
cpe_vendor functions to get vendor titles
bool cpe_product_iterator_has_more(struct cpe_product_iterator *it)
Iterator over CPE product items.
struct cpe_product_iterator * cpe_vendor_get_products(const struct cpe_vendor *item)
cpe_vendor functions to get vendor products
const char * cpe_item_metadata_get_deprecated_by_nvd_id(const struct cpe_item_metadata *item)
cpe_item_metadata function to get NVD ID of deprecated item
bool cpe_item_iterator_has_more(struct cpe_item_iterator *it)
Iterator over CPE dictionary items.
Version of product.
Definition: cpedict_priv.c:189
bool cpe_product_set_part(struct cpe_product *product, cpe_part_t new_part)
struct cpe_vendor * cpe_vendor_iterator_next(struct cpe_vendor_iterator *it)
Iterator over CPE vendor items.
struct cpe_reference_iterator * cpe_item_get_references(const struct cpe_item *item)
cpe_item functions to get CPE references
struct cpe_check * cpe_check_iterator_next(struct cpe_check_iterator *it)
Iterator over CPE item check items.
void cpe_product_iterator_remove(struct cpe_product_iterator *it)
void cpe_check_iterator_reset(struct cpe_check_iterator *it)
bool cpe_item_set_deprecation_date(struct cpe_item *item, const char *new_deprecation_date)
struct cpe_generator * cpe_dict_model_get_generator(const struct cpe_dict_model *item)
cpe_dict_model functions to get generator from CPE dictionary model
const char * cpe_dict_model_get_origin_file(const struct cpe_dict_model *dict)
Gets the file the CPE dict model was loaded from.
Definition: cpedict.c:72
bool cpe_generator_set_timestamp(struct cpe_generator *generator, const char *new_timestamp)
struct cpe_update_iterator * cpe_version_get_updates(const struct cpe_version *item)
cpe_version functions to get value of version
void cpe_reference_iterator_reset(struct cpe_reference_iterator *it)
bool cpe_reference_set_href(struct cpe_reference *reference, const char *new_href)
bool cpe_check_set_href(struct cpe_check *check, const char *new_href)
bool cpe_item_add_note(struct cpe_item *item, struct oscap_text *new_title)
struct cpe_item * cpe_item_new(void)
Definition: cpedict_priv.c:386
struct cpe_dict_model * cpe_dict_model_import(const char *file)
Load new CPE dictionary from file.
Definition: cpedict.c:47
Structure representing metadata of CPE item.
Definition: cpedict_priv.c:110
void cpe_reference_iterator_remove(struct cpe_reference_iterator *it)
const char * cpe_version_get_value(const struct cpe_version *item)
cpe_version functions to get vupdates of versions
bool cpe_version_iterator_has_more(struct cpe_version_iterator *it)
Iterator over CPE version items.
Structure representing a CPE dictionary.
Definition: cpedict_priv.h:191
void cpe_check_free(struct cpe_check *check)
Definition: cpedict_priv.c:1414
void cpe_vendor_iterator_reset(struct cpe_vendor_iterator *it)
Multilingual text processing interface.
struct cpe_check * cpe_check_new(void)
Definition: cpedict_priv.c:404
struct cpe_version * cpe_version_new(void)
Definition: cpedict_priv.c:495
Iterator over CPE dictionary item versions.
void cpe_version_iterator_reset(struct cpe_version_iterator *it)
bool cpe_dict_model_set_base_version(struct cpe_dict_model *item, int base_version)
cpe_dict_model functions to get the base version from CPE dictionary model
void cpe_product_iterator_reset(struct cpe_product_iterator *it)
const char * cpe_reference_get_content(const struct cpe_reference *item)
cpe_reference functions to get content of reference
struct cpe_item_iterator * cpe_dict_model_get_items(const struct cpe_dict_model *item)
cpe_dict_model functions to get CPE items
const char * cpe_reference_get_href(const struct cpe_reference *item)
cpe_reference functions to get href of reference
Structure representing single CPE dictionary item.
Definition: cpedict_priv.c:69
bool cpe_vendor_set_value(struct cpe_vendor *vendor, const char *new_value)
Structure holding Common Platform Enumeration URI data.
Definition: cpename.c:68
const char * cpe_update_get_value(const struct cpe_update *item)
cpe_update functions to get updates of version
Iterator over CPE dictionary item products.
bool cpe_edition_set_value(struct cpe_edition *edition, const char *new_value)
struct cpe_reference * cpe_reference_iterator_next(struct cpe_reference_iterator *it)
Iterator over CPE item reference items.
struct oscap_text_iterator * cpe_item_get_titles(const struct cpe_item *item)
cpe_item functions to get CPE titles
Representation of internationalizable character strings.
Definition: text_priv.h:47
Language of product edition.
Definition: cpedict_priv.c:219
struct cpe_item * cpe_item_iterator_next(struct cpe_item_iterator *it)
Iterator over CPE dictionary items.
bool cpe_edition_iterator_has_more(struct cpe_edition_iterator *it)
Iterator over CPE edition items.
bool cpe_check_iterator_has_more(struct cpe_check_iterator *it)
Iterator over CPE item check items.
struct cpe_check_iterator * cpe_item_get_checks(const struct cpe_item *item)
cpe_item functions to get CPE checks
bool cpe_vendor_add_title(struct cpe_vendor *vendor, struct oscap_text *new_title)
Iterator over CPE dictionary references.
struct cpe_update * cpe_update_new(void)
Definition: cpedict_priv.c:511
int cpe_dict_model_get_base_version(const struct cpe_dict_model *item)
cpe_dict_model functions to get the base version from CPE dictionary model
bool cpe_name_match_dict(struct cpe_name *cpe, struct cpe_dict_model *dict)
Verify wether given CPE is known according to specified dictionary.
Definition: cpedict.c:90
void cpe_edition_iterator_reset(struct cpe_edition_iterator *it)
char * cpe_dict_detect_version(const char *file)
Detects which version the given CPE file is.
Definition: cpedict.c:198
cpe_part_t cpe_product_get_part(const struct cpe_product *item)
cpe_product functions to get product part
bool cpe_update_add_edition(struct cpe_update *update, struct cpe_edition *new_edition)
bool cpe_reference_iterator_has_more(struct cpe_reference_iterator *it)
Iterator over CPE item reference items.
void cpe_reference_free(struct cpe_reference *ref)
Definition: cpedict_priv.c:1426
void cpe_item_iterator_reset(struct cpe_item_iterator *it)
struct cpe_update * cpe_update_iterator_next(struct cpe_update_iterator *it)
Iterator over CPE update items.
void cpe_item_iterator_free(struct cpe_item_iterator *it)
Iterator over CPE dictionary items.
Iterator over CPE dictionary checks.
struct cpe_name * cpe_item_get_deprecated_by(const struct cpe_item *item)
cpe_item functions to get variable member deprecated_by
bool cpe_item_is_applicable(struct cpe_item *item, cpe_check_fn cb, void *usr)
Definition: cpedict.c:176
void cpe_reference_iterator_free(struct cpe_reference_iterator *it)
Iterator over CPE item reference items.
bool cpe_item_add_title(struct cpe_item *item, struct oscap_text *new_title)
bool cpe_vendor_iterator_has_more(struct cpe_vendor_iterator *it)
Iterator over CPE vendor items.
bool cpe_item_metadata_set_nvd_id(struct cpe_item_metadata *item_metadata, const char *new_nvd_id)
const char * cpe_generator_get_product_name(const struct cpe_generator *item)
cpe_generator functions to get product name
bool cpe_name_applicable_dict(struct cpe_name *cpe, struct cpe_dict_model *dict, cpe_check_fn cb, void *usr)
Verify whether given CPE is applicable to current platform by evaluating checks associated with it...
Definition: cpedict.c:134
bool cpe_generator_set_product_version(struct cpe_generator *generator, const char *new_product_version)
void cpe_vendor_iterator_free(struct cpe_vendor_iterator *it)
Iterator over CPE vendor items.
struct cpe_item_metadata * cpe_item_get_metadata(const struct cpe_item *item)
cpe_item functions to get metadata of cpe_item
struct oscap_text_iterator * cpe_item_get_notes(const struct cpe_item *item)
cpe_item functions to get CPE notes
struct cpe_language * cpe_language_new(void)
Definition: cpedict_priv.c:543
void cpe_item_free(struct cpe_item *item)
Definition: cpedict_priv.c:1384
void cpe_update_iterator_remove(struct cpe_update_iterator *it)
void cpe_dict_model_export(const struct cpe_dict_model *dict, const char *file)
Write the dict_model to a file.
Definition: cpedict.c:77
void cpe_vendor_free(struct cpe_vendor *vendor)
Definition: cpedict_priv.c:1446
bool cpe_reference_set_content(struct cpe_reference *reference, const char *new_content)
struct cpe_edition_iterator * cpe_update_get_editions(const struct cpe_update *item)
cpe_update functions to get editions of update
void cpe_edition_free(struct cpe_edition *edition)
Definition: cpedict_priv.c:1491
struct cpe_language_iterator * cpe_edition_get_languages(const struct cpe_edition *item)
cpe_edition functions to get languages of edition
cpe_part_t
enumeration of possible CPE parts
Definition: cpe_name.h:45