00001
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _CVE_H_
00035 #define _CVE_H_
00036
00037 #include <stdbool.h>
00038 #include "oscap.h"
00039 #include "cpeuri.h"
00040
00045 struct cve_model;
00050 struct cve_entry;
00055 struct cve_summary;
00060 struct cve_product;
00065 struct cve_configuration;
00070 struct cwe_entry;
00075 struct cve_reference;
00076
00077
00090 struct xml_metadata_iterator *cve_model_get_xmlns(const struct cve_model *cve_model);
00091
00097 struct cve_entry_iterator *cve_model_get_entries(const struct cve_model *cve_model);
00098
00104 const char *cve_entry_get_id(const struct cve_entry *item);
00105
00111 const char *cve_entry_get_cwe(const struct cve_entry *item);
00112
00118 struct cve_summary_iterator *cve_entry_get_summaries(const struct cve_entry *item);
00119
00125 struct cve_reference_iterator *cve_entry_get_references(const struct cve_entry *item);
00126
00132 const char *cve_reference_get_value(const struct cve_reference *ref);
00133
00139 const char *cve_reference_get_href(const struct cve_reference *ref);
00140
00146 const char *cve_reference_get_type(const struct cve_reference *ref);
00147
00153 const char *cve_reference_get_source(const struct cve_reference *ref);
00154
00160 const char *cve_summary_get_summary(const struct cve_summary *summary);
00166 const char *cve_product_get_value(const struct cve_product *product);
00172 const char *cwe_entry_get_value(const struct cwe_entry *entry);
00178 const char *cve_configuration_get_id(const struct cve_configuration *conf);
00184 const char *cve_entry_get_published(const struct cve_entry *entry);
00190 const char *cve_entry_get_modified(const struct cve_entry *entry);
00196 const char *cve_entry_get_sec_protection(const struct cve_entry *entry);
00197
00203 struct cve_product_iterator *cve_entry_get_products(const struct cve_entry *entry);
00209 struct cve_configuration_iterator *cve_entry_get_configurations(const struct cve_entry *entry);
00215 const struct cpe_testexpr *cve_configuration_get_expr(const struct cve_configuration *conf);
00216
00222 const struct cvss_entry *cve_entry_get_cvss(const struct cve_entry *item);
00223
00224
00227
00242 bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry);
00243
00245 bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product);
00246
00248 bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference);
00249
00251 bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary);
00252
00254 bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration);
00255
00260 bool cve_model_add_xml(struct cve_model *model, struct xml_metadata *xml);
00261
00269 bool cve_entry_set_id(struct cve_entry *entry, const char *new_id);
00277 bool cve_entry_set_published(struct cve_entry *entry, const char *new_published);
00285 bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified);
00293 bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection);
00301 bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe);
00309 bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value);
00310
00318 bool cve_reference_set_value(struct cve_reference *reference, const char *new_value);
00326 bool cve_reference_set_href(struct cve_reference *reference, const char *new_href);
00334 bool cve_reference_set_type(struct cve_reference *reference, const char *new_type);
00342 bool cve_reference_set_source(struct cve_reference *reference, const char *new_source);
00343
00351 bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id);
00359 bool cve_product_set_value(struct cve_product *product, const char *new_value);
00367 bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary);
00368
00369
00372
00384 struct cve_entry_iterator;
00388 struct cve_entry *cve_entry_iterator_next(struct cve_entry_iterator *it);
00392 bool cve_entry_iterator_has_more(struct cve_entry_iterator *it);
00396 void cve_entry_iterator_free(struct cve_entry_iterator *it);
00397
00403 struct cve_summary_iterator;
00407 struct cve_summary *cve_summary_iterator_next(struct cve_summary_iterator *it);
00411 bool cve_summary_iterator_has_more(struct cve_summary_iterator *it);
00415 void cve_summary_iterator_free(struct cve_summary_iterator *it);
00416
00422 struct cve_product_iterator;
00426 struct cve_product *cve_product_iterator_next(struct cve_product_iterator *it);
00430 bool cve_product_iterator_has_more(struct cve_product_iterator *it);
00434 void cve_product_iterator_free(struct cve_product_iterator *it);
00435
00441 struct cve_configuration_iterator;
00445 struct cve_configuration *cve_configuration_iterator_next(struct cve_configuration_iterator *it);
00449 bool cve_configuration_iterator_has_more(struct cve_configuration_iterator *it);
00453 void cve_configuration_iterator_free(struct cve_configuration_iterator *it);
00454
00460 struct cve_reference_iterator;
00464 struct cve_reference *cve_reference_iterator_next(struct cve_reference_iterator *it);
00468 bool cve_reference_iterator_has_more(struct cve_reference_iterator *it);
00472 void cve_reference_iterator_free(struct cve_reference_iterator *it);
00473
00474
00475
00478
00489 const char * cve_model_supported(void);
00490
00491
00499 struct cve_entry *cve_entry_new(void);
00505 struct cve_configuration *cve_configuration_new(void);
00511 struct cwe_entry *cwe_entry_new(void);
00517 struct cve_product *cve_product_new(void);
00523 struct cve_summary *cve_summary_new(void);
00529 struct cve_reference *cve_reference_new(void);
00535 struct cve_model *cve_model_new(void);
00536
00542 void cve_model_free(struct cve_model *cve_model);
00543
00549 void cve_entry_free(struct cve_entry *entry);
00550
00556 void cve_summary_free(struct cve_summary *summary);
00557
00563 void cve_product_free(struct cve_product *product);
00564
00570 void cve_reference_free(struct cve_reference *ref);
00571
00577 void cwe_entry_free(struct cwe_entry *entry);
00578
00584 void cve_configuration_free(struct cve_configuration *conf);
00585
00588
00589 void cve_entry_iterator_remove(struct cve_entry_iterator *it);
00590
00592 void cve_product_iterator_remove(struct cve_product_iterator *it);
00593
00595 void cve_reference_iterator_remove(struct cve_reference_iterator *it);
00596
00598 void cve_summary_iterator_remove(struct cve_summary_iterator *it);
00599
00601 void cve_configuration_iterator_remove(struct cve_configuration_iterator *it);
00602
00609 void cve_model_export(struct cve_model *cve, const char *file);
00610
00618 struct cve_model *cve_model_import(const char *file);
00619
00622 #endif