00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _CVE_H_
00038 #define _CVE_H_
00039
00040 #include <stdbool.h>
00041 #include "oscap.h"
00042 #include "cpeuri.h"
00043
00048 struct cve_model;
00053 struct cve_entry;
00058 struct cve_summary;
00063 struct cve_product;
00068 struct cve_configuration;
00073 struct cwe_entry;
00078 struct cve_reference;
00079
00092 struct xml_metadata_iterator *cve_model_get_xmlns(const struct cve_model *cve_model);
00093
00099 struct cve_entry_iterator *cve_model_get_entries(const struct cve_model *cve_model);
00100
00106 const char *cve_entry_get_id(const struct cve_entry *item);
00107
00113 const char *cve_entry_get_cwe(const struct cve_entry *item);
00114
00120 struct cve_summary_iterator *cve_entry_get_summaries(const struct cve_entry *item);
00121
00127 struct cve_reference_iterator *cve_entry_get_references(const struct cve_entry *item);
00128
00134 const char *cve_reference_get_value(const struct cve_reference *ref);
00135
00141 const char *cve_reference_get_href(const struct cve_reference *ref);
00142
00148 const char *cve_reference_get_type(const struct cve_reference *ref);
00149
00155 const char *cve_reference_get_source(const struct cve_reference *ref);
00156
00162 const char *cve_summary_get_summary(const struct cve_summary *summary);
00168 const char *cve_product_get_value(const struct cve_product *product);
00174 const char *cwe_entry_get_value(const struct cwe_entry *entry);
00180 const char *cve_configuration_get_id(const struct cve_configuration *conf);
00186 const char *cve_entry_get_published(const struct cve_entry *entry);
00192 const char *cve_entry_get_modified(const struct cve_entry *entry);
00198 const char *cve_entry_get_sec_protection(const struct cve_entry *entry);
00199
00205 struct cve_product_iterator *cve_entry_get_products(const struct cve_entry *entry);
00211 struct cve_configuration_iterator *cve_entry_get_configurations(const struct cve_entry *entry);
00217 const struct cpe_testexpr *cve_configuration_get_expr(const struct cve_configuration *conf);
00218
00224 const struct cvss_entry *cve_entry_get_cvss(const struct cve_entry *item);
00225
00241 bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry);
00242
00244 bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product);
00245
00247 bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference);
00248
00250 bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary);
00251
00253 bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration);
00254
00259 bool cve_model_add_xml(struct cve_model *model, struct xml_metadata *xml);
00260
00269
00270 void cve_entry_iterator_remove(struct cve_entry_iterator *it);
00271
00273 void cve_product_iterator_remove(struct cve_product_iterator *it);
00274
00276 void cve_reference_iterator_remove(struct cve_reference_iterator *it);
00277
00279 void cve_summary_iterator_remove(struct cve_summary_iterator *it);
00280
00282 void cve_configuration_iterator_remove(struct cve_configuration_iterator *it);
00283
00300 bool cve_entry_set_id(struct cve_entry *entry, const char *new_id);
00308 bool cve_entry_set_published(struct cve_entry *entry, const char *new_published);
00316 bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified);
00324 bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection);
00332 bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe);
00340 bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value);
00341
00349 bool cve_reference_set_value(struct cve_reference *reference, const char *new_value);
00357 bool cve_reference_set_href(struct cve_reference *reference, const char *new_href);
00365 bool cve_reference_set_type(struct cve_reference *reference, const char *new_type);
00373 bool cve_reference_set_source(struct cve_reference *reference, const char *new_source);
00374
00382 bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id);
00390 bool cve_product_set_value(struct cve_product *product, const char *new_value);
00398 bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary);
00399
00414 struct cve_entry *cve_entry_new(void);
00420 struct cve_configuration *cve_configuration_new(void);
00426 struct cwe_entry *cwe_entry_new(void);
00432 struct cve_product *cve_product_new(void);
00438 struct cve_summary *cve_summary_new(void);
00444 struct cve_reference *cve_reference_new(void);
00450 struct cve_model *cve_model_new(void);
00451
00466 void cve_model_free(struct cve_model *cve_model);
00467
00473 void cve_entry_free(struct cve_entry *entry);
00474
00480 void cve_summary_free(struct cve_summary *summary);
00481
00487 void cve_product_free(struct cve_product *product);
00488
00494 void cve_reference_free(struct cve_reference *ref);
00495
00501 void cwe_entry_free(struct cwe_entry *entry);
00502
00508 void cve_configuration_free(struct cve_configuration *conf);
00509
00524 struct cve_entry_iterator;
00528 struct cve_entry *cve_entry_iterator_next(struct cve_entry_iterator *it);
00532 bool cve_entry_iterator_has_more(struct cve_entry_iterator *it);
00536 void cve_entry_iterator_free(struct cve_entry_iterator *it);
00537
00543 struct cve_summary_iterator;
00547 struct cve_summary *cve_summary_iterator_next(struct cve_summary_iterator *it);
00551 bool cve_summary_iterator_has_more(struct cve_summary_iterator *it);
00555 void cve_summary_iterator_free(struct cve_summary_iterator *it);
00556
00562 struct cve_product_iterator;
00566 struct cve_product *cve_product_iterator_next(struct cve_product_iterator *it);
00570 bool cve_product_iterator_has_more(struct cve_product_iterator *it);
00574 void cve_product_iterator_free(struct cve_product_iterator *it);
00575
00581 struct cve_configuration_iterator;
00585 struct cve_configuration *cve_configuration_iterator_next(struct cve_configuration_iterator *it);
00589 bool cve_configuration_iterator_has_more(struct cve_configuration_iterator *it);
00593 void cve_configuration_iterator_free(struct cve_configuration_iterator *it);
00594
00600 struct cve_reference_iterator;
00604 struct cve_reference *cve_reference_iterator_next(struct cve_reference_iterator *it);
00608 bool cve_reference_iterator_has_more(struct cve_reference_iterator *it);
00612 void cve_reference_iterator_free(struct cve_reference_iterator *it);
00613
00627 void cve_model_export(struct cve_model *cve, const struct oscap_export_target *target);
00628
00636 struct cve_model *cve_model_import(const struct oscap_import_source *source);
00637
00641
00642 #endif