Go to the documentation of this file.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 <time.h>
00039 #include "oscap.h"
00040 #include "cpeuri.h"
00041
00046 struct cve_model;
00051 struct cve_entry;
00056 struct cve_summary;
00061 struct cve_product;
00066 struct cve_configuration;
00071 struct cwe_entry;
00076 struct cve_reference;
00077
00078
00091 struct cve_entry_iterator *cve_model_get_entries(const struct cve_model *cve_model);
00092
00098 const char *cve_entry_get_id(const struct cve_entry *item);
00099
00105 const char *cve_entry_get_cwe(const struct cve_entry *item);
00106
00112 struct cve_summary_iterator *cve_entry_get_summaries(const struct cve_entry *item);
00113
00119 struct cve_reference_iterator *cve_entry_get_references(const struct cve_entry *item);
00120
00126 const char *cve_reference_get_value(const struct cve_reference *ref);
00127
00133 const char *cve_reference_get_href(const struct cve_reference *ref);
00134
00140 const char *cve_reference_get_type(const struct cve_reference *ref);
00141
00147 const char *cve_reference_get_source(const struct cve_reference *ref);
00149 const char *cve_reference_get_lang(const struct cve_reference *ref);
00150
00156 const char *cve_summary_get_summary(const struct cve_summary *summary);
00162 const char *cve_product_get_value(const struct cve_product *product);
00168 const char *cwe_entry_get_value(const struct cwe_entry *entry);
00174 const char *cve_configuration_get_id(const struct cve_configuration *conf);
00180 const char *cve_entry_get_published(const struct cve_entry *entry);
00186 const char *cve_entry_get_modified(const struct cve_entry *entry);
00192 const char *cve_entry_get_sec_protection(const struct cve_entry *entry);
00193
00199 struct cve_product_iterator *cve_entry_get_products(const struct cve_entry *entry);
00205 struct cve_configuration_iterator *cve_entry_get_configurations(const struct cve_entry *entry);
00211 const struct cpe_testexpr *cve_configuration_get_expr(const struct cve_configuration *conf);
00212
00218 const struct cvss_entry *cve_entry_get_cvss(const struct cve_entry *item);
00219
00220
00223
00238 bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry);
00239
00241 bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product);
00242
00244 bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference);
00245
00247 bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary);
00248
00250 bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration);
00251
00259 bool cve_entry_set_id(struct cve_entry *entry, const char *new_id);
00267 bool cve_entry_set_published(struct cve_entry *entry, const char *new_published);
00275 bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified);
00283 bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection);
00291 bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe);
00299 bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value);
00300
00308 bool cve_reference_set_value(struct cve_reference *reference, const char *new_value);
00316 bool cve_reference_set_href(struct cve_reference *reference, const char *new_href);
00324 bool cve_reference_set_type(struct cve_reference *reference, const char *new_type);
00332 bool cve_reference_set_source(struct cve_reference *reference, const char *new_source);
00333
00335 bool cve_reference_set_lang(struct cve_reference *reference, const char *new_lang);
00336
00344 bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id);
00352 bool cve_product_set_value(struct cve_product *product, const char *new_value);
00360 bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary);
00361
00362
00365
00377 struct cve_entry_iterator;
00381 struct cve_entry *cve_entry_iterator_next(struct cve_entry_iterator *it);
00385 bool cve_entry_iterator_has_more(struct cve_entry_iterator *it);
00389 void cve_entry_iterator_free(struct cve_entry_iterator *it);
00390
00396 struct cve_summary_iterator;
00400 struct cve_summary *cve_summary_iterator_next(struct cve_summary_iterator *it);
00404 bool cve_summary_iterator_has_more(struct cve_summary_iterator *it);
00408 void cve_summary_iterator_free(struct cve_summary_iterator *it);
00409
00415 struct cve_product_iterator;
00419 struct cve_product *cve_product_iterator_next(struct cve_product_iterator *it);
00423 bool cve_product_iterator_has_more(struct cve_product_iterator *it);
00427 void cve_product_iterator_free(struct cve_product_iterator *it);
00428
00434 struct cve_configuration_iterator;
00438 struct cve_configuration *cve_configuration_iterator_next(struct cve_configuration_iterator *it);
00442 bool cve_configuration_iterator_has_more(struct cve_configuration_iterator *it);
00446 void cve_configuration_iterator_free(struct cve_configuration_iterator *it);
00447
00453 struct cve_reference_iterator;
00457 struct cve_reference *cve_reference_iterator_next(struct cve_reference_iterator *it);
00461 bool cve_reference_iterator_has_more(struct cve_reference_iterator *it);
00465 void cve_reference_iterator_free(struct cve_reference_iterator *it);
00466
00467
00468
00471
00482 const char * cve_model_supported(void);
00483
00484
00492 struct cve_entry *cve_entry_new(void);
00498 struct cve_configuration *cve_configuration_new(void);
00504 struct cwe_entry *cwe_entry_new(void);
00510 struct cve_product *cve_product_new(void);
00516 struct cve_summary *cve_summary_new(void);
00522 struct cve_reference *cve_reference_new(void);
00528 struct cve_model *cve_model_new(void);
00529
00535 void cve_model_free(struct cve_model *cve_model);
00536
00542 void cve_entry_free(struct cve_entry *entry);
00543
00549 void cve_summary_free(struct cve_summary *summary);
00550
00556 void cve_product_free(struct cve_product *product);
00557
00563 void cve_reference_free(struct cve_reference *ref);
00564
00570 void cwe_entry_free(struct cwe_entry *entry);
00571
00577 void cve_configuration_free(struct cve_configuration *conf);
00578
00581
00582 void cve_entry_iterator_remove(struct cve_entry_iterator *it);
00583
00585 void cve_product_iterator_remove(struct cve_product_iterator *it);
00586
00588 void cve_reference_iterator_remove(struct cve_reference_iterator *it);
00589
00591 void cve_summary_iterator_remove(struct cve_summary_iterator *it);
00592
00594 void cve_configuration_iterator_remove(struct cve_configuration_iterator *it);
00595
00602 void cve_model_export(struct cve_model *cve, const char *file);
00603
00611 struct cve_model *cve_model_import(const char *file);
00612
00614 const char *cve_model_get_nvd_xml_version(const struct cve_model *item);
00616 bool cve_model_set_nvd_xml_version(struct cve_model *obj, const char *newval);
00618 time_t cve_model_get_pub_date(const struct cve_model *item);
00620 bool cve_model_set_pub_date(struct cve_model *obj, time_t newval);
00621
00624 #endif