00001
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _CVE_H_
00040 #define _CVE_H_
00041
00042 #include <stdbool.h>
00043 #include "oscap.h"
00044 #include "cpeuri.h"
00045
00050 struct cve_model;
00055 struct cve_entry;
00060 struct cve_summary;
00065 struct cve_product;
00070 struct cve_configuration;
00075 struct cwe_entry;
00080 struct cve_reference;
00081
00094 struct xml_metadata_iterator *cve_model_get_xmlns(const struct cve_model *cve_model);
00095
00101 struct cve_entry_iterator *cve_model_get_entries(const struct cve_model *cve_model);
00102
00108 const char *cve_entry_get_id(const struct cve_entry *item);
00109
00115 const char *cve_entry_get_cwe(const struct cve_entry *item);
00116
00122 struct cve_summary_iterator *cve_entry_get_summaries(const struct cve_entry *item);
00123
00129 struct cve_reference_iterator *cve_entry_get_references(const struct cve_entry *item);
00130
00136 const char *cve_reference_get_value(const struct cve_reference *ref);
00137
00143 const char *cve_reference_get_href(const struct cve_reference *ref);
00144
00150 const char *cve_reference_get_type(const struct cve_reference *ref);
00151
00157 const char *cve_reference_get_source(const struct cve_reference *ref);
00158
00164 const char *cve_summary_get_summary(const struct cve_summary *summary);
00170 const char *cve_product_get_value(const struct cve_product *product);
00176 const char *cwe_entry_get_value(const struct cwe_entry *entry);
00182 const char *cve_configuration_get_id(const struct cve_configuration *conf);
00188 const char *cve_entry_get_published(const struct cve_entry *entry);
00194 const char *cve_entry_get_modified(const struct cve_entry *entry);
00200 const char *cve_entry_get_sec_protection(const struct cve_entry *entry);
00201
00207 struct cve_product_iterator *cve_entry_get_products(const struct cve_entry *entry);
00213 struct cve_configuration_iterator *cve_entry_get_configurations(const struct cve_entry *entry);
00219 const struct cpe_testexpr *cve_configuration_get_expr(const struct cve_configuration *conf);
00220
00226 const struct cvss_entry *cve_entry_get_cvss(const struct cve_entry *item);
00227
00243 bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry);
00244
00246 bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product);
00247
00249 bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference);
00250
00252 bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary);
00253
00255 bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration);
00256
00261 bool cve_model_add_xml(struct cve_model *model, struct xml_metadata *xml);
00262
00271
00272 void cve_entry_iterator_remove(struct cve_entry_iterator *it);
00273
00275 void cve_product_iterator_remove(struct cve_product_iterator *it);
00276
00278 void cve_reference_iterator_remove(struct cve_reference_iterator *it);
00279
00281 void cve_summary_iterator_remove(struct cve_summary_iterator *it);
00282
00284 void cve_configuration_iterator_remove(struct cve_configuration_iterator *it);
00285
00302 bool cve_entry_set_id(struct cve_entry *entry, const char *new_id);
00310 bool cve_entry_set_published(struct cve_entry *entry, const char *new_published);
00318 bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified);
00326 bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection);
00334 bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe);
00342 bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value);
00343
00351 bool cve_reference_set_value(struct cve_reference *reference, const char *new_value);
00359 bool cve_reference_set_href(struct cve_reference *reference, const char *new_href);
00367 bool cve_reference_set_type(struct cve_reference *reference, const char *new_type);
00375 bool cve_reference_set_source(struct cve_reference *reference, const char *new_source);
00376
00384 bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id);
00392 bool cve_product_set_value(struct cve_product *product, const char *new_value);
00400 bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary);
00401
00416 struct cve_entry *cve_entry_new(void);
00422 struct cve_configuration *cve_configuration_new(void);
00428 struct cwe_entry *cwe_entry_new(void);
00434 struct cve_product *cve_product_new(void);
00440 struct cve_summary *cve_summary_new(void);
00446 struct cve_reference *cve_reference_new(void);
00452 struct cve_model *cve_model_new(void);
00453
00468 void cve_model_free(struct cve_model *cve_model);
00469
00475 void cve_entry_free(struct cve_entry *entry);
00476
00482 void cve_summary_free(struct cve_summary *summary);
00483
00489 void cve_product_free(struct cve_product *product);
00490
00496 void cve_reference_free(struct cve_reference *ref);
00497
00503 void cwe_entry_free(struct cwe_entry *entry);
00504
00510 void cve_configuration_free(struct cve_configuration *conf);
00511
00526 struct cve_entry_iterator;
00530 struct cve_entry *cve_entry_iterator_next(struct cve_entry_iterator *it);
00534 bool cve_entry_iterator_has_more(struct cve_entry_iterator *it);
00538 void cve_entry_iterator_free(struct cve_entry_iterator *it);
00539
00545 struct cve_summary_iterator;
00549 struct cve_summary *cve_summary_iterator_next(struct cve_summary_iterator *it);
00553 bool cve_summary_iterator_has_more(struct cve_summary_iterator *it);
00557 void cve_summary_iterator_free(struct cve_summary_iterator *it);
00558
00564 struct cve_product_iterator;
00568 struct cve_product *cve_product_iterator_next(struct cve_product_iterator *it);
00572 bool cve_product_iterator_has_more(struct cve_product_iterator *it);
00576 void cve_product_iterator_free(struct cve_product_iterator *it);
00577
00583 struct cve_configuration_iterator;
00587 struct cve_configuration *cve_configuration_iterator_next(struct cve_configuration_iterator *it);
00591 bool cve_configuration_iterator_has_more(struct cve_configuration_iterator *it);
00595 void cve_configuration_iterator_free(struct cve_configuration_iterator *it);
00596
00602 struct cve_reference_iterator;
00606 struct cve_reference *cve_reference_iterator_next(struct cve_reference_iterator *it);
00610 bool cve_reference_iterator_has_more(struct cve_reference_iterator *it);
00614 void cve_reference_iterator_free(struct cve_reference_iterator *it);
00615
00629 void cve_model_export(struct cve_model *cve, const struct oscap_export_target *target);
00630
00638 struct cve_model *cve_model_import(const struct oscap_import_source *source);
00639
00645 const char * cve_model_supported(void);
00646
00650
00651 #endif