Open SCAP Library

cve_nvd.h
Go to the documentation of this file.
1
11 /*
12 * Copyright 2009 Red Hat Inc., Durham, North Carolina.
13 * All Rights Reserved.
14 *
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
29 * Authors:
30 * Maros Barabas <mbarabas@redhat.com>
31 * Tomas Heinrich <theinric@redhat.com>
32 */
33
34 #ifndef _CVE_H_
35 #define _CVE_H_
36
37 #include <stdbool.h>
38 #include <time.h>
39 #include "oscap.h"
40 #include "cpe_name.h"
41
46 struct cve_model;
51 struct cve_entry;
56 struct cve_summary;
61 struct cve_product;
66 struct cve_configuration;
71 struct cwe_entry;
76 struct cve_reference;
77
78 // fwd
79 struct cvss_impact;
80
81 /************************************************************/
94 struct cve_entry_iterator *cve_model_get_entries(const struct cve_model *cve_model);
95
101 const char *cve_entry_get_id(const struct cve_entry *item);
102
108 const char *cve_entry_get_cwe(const struct cve_entry *item);
109
115 struct cve_summary_iterator *cve_entry_get_summaries(const struct cve_entry *item);
116
122 struct cve_reference_iterator *cve_entry_get_references(const struct cve_entry *item);
123
129 const char *cve_reference_get_value(const struct cve_reference *ref);
130
136 const char *cve_reference_get_href(const struct cve_reference *ref);
137
143 const char *cve_reference_get_type(const struct cve_reference *ref);
144
150 const char *cve_reference_get_source(const struct cve_reference *ref);
152 const char *cve_reference_get_lang(const struct cve_reference *ref);
153
159 const char *cve_summary_get_summary(const struct cve_summary *summary);
165 const char *cve_product_get_value(const struct cve_product *product);
171 const char *cwe_entry_get_value(const struct cwe_entry *entry);
177 const char *cve_configuration_get_id(const struct cve_configuration *conf);
183 const char *cve_entry_get_published(const struct cve_entry *entry);
189 const char *cve_entry_get_modified(const struct cve_entry *entry);
195 const char *cve_entry_get_sec_protection(const struct cve_entry *entry);
196
202 struct cve_product_iterator *cve_entry_get_products(const struct cve_entry *entry);
208 struct cve_configuration_iterator *cve_entry_get_configurations(const struct cve_entry *entry);
214 const struct cpe_testexpr *cve_configuration_get_expr(const struct cve_configuration *conf);
215
221 const struct cvss_impact *cve_entry_get_cvss(const struct cve_entry *item);
222
223 /************************************************************/
226 /************************************************************/
241 bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry);
242
244 bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product);
245
247 bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference);
248
250 bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary);
251
253 bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration);
254
262 bool cve_entry_set_id(struct cve_entry *entry, const char *new_id);
270 bool cve_entry_set_published(struct cve_entry *entry, const char *new_published);
278 bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified);
286 bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection);
294 bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe);
302 bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value);
303
311 bool cve_reference_set_value(struct cve_reference *reference, const char *new_value);
319 bool cve_reference_set_href(struct cve_reference *reference, const char *new_href);
327 bool cve_reference_set_type(struct cve_reference *reference, const char *new_type);
335 bool cve_reference_set_source(struct cve_reference *reference, const char *new_source);
336
338 bool cve_reference_set_lang(struct cve_reference *reference, const char *new_lang);
339
347 bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id);
355 bool cve_product_set_value(struct cve_product *product, const char *new_value);
363 bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary);
364
365 /************************************************************/
368 /************************************************************/
380 struct cve_entry_iterator;
384 struct cve_entry *cve_entry_iterator_next(struct cve_entry_iterator *it);
388 bool cve_entry_iterator_has_more(struct cve_entry_iterator *it);
392 void cve_entry_iterator_free(struct cve_entry_iterator *it);
393
399 struct cve_summary_iterator;
403 struct cve_summary *cve_summary_iterator_next(struct cve_summary_iterator *it);
407 bool cve_summary_iterator_has_more(struct cve_summary_iterator *it);
411 void cve_summary_iterator_free(struct cve_summary_iterator *it);
412
418 struct cve_product_iterator;
422 struct cve_product *cve_product_iterator_next(struct cve_product_iterator *it);
426 bool cve_product_iterator_has_more(struct cve_product_iterator *it);
430 void cve_product_iterator_free(struct cve_product_iterator *it);
431
437 struct cve_configuration_iterator;
441 struct cve_configuration *cve_configuration_iterator_next(struct cve_configuration_iterator *it);
445 bool cve_configuration_iterator_has_more(struct cve_configuration_iterator *it);
449 void cve_configuration_iterator_free(struct cve_configuration_iterator *it);
450
456 struct cve_reference_iterator;
460 struct cve_reference *cve_reference_iterator_next(struct cve_reference_iterator *it);
464 bool cve_reference_iterator_has_more(struct cve_reference_iterator *it);
468 void cve_reference_iterator_free(struct cve_reference_iterator *it);
469
470
471 /************************************************************/
474 /************************************************************/
485 const char * cve_model_supported(void);
486
487 /************************************************************/
495 struct cve_entry *cve_entry_new(void);
501 struct cve_configuration *cve_configuration_new(void);
507 struct cwe_entry *cwe_entry_new(void);
513 struct cve_product *cve_product_new(void);
519 struct cve_summary *cve_summary_new(void);
525 struct cve_reference *cve_reference_new(void);
531 struct cve_model *cve_model_new(void);
532
538 struct cve_entry * cve_entry_clone(struct cve_entry * old_entry);
539
545 struct cve_configuration * cve_configuration_clone(struct cve_configuration * old_conf);
546
552 struct cwe_entry * cwe_entry_clone(struct cwe_entry * old_entry);
553
559 struct cve_product * cve_product_clone(struct cve_product * old_product);
560
566 struct cve_summary * cve_summary_clone(struct cve_summary * old_sum);
567
573 struct cve_reference * cve_reference_clone(struct cve_reference * old_ref);
574
580 struct cve_model * cve_model_clone(struct cve_model * old_model);
581
587 void cve_model_free(struct cve_model *cve_model);
588
594 void cve_entry_free(struct cve_entry *entry);
595
601 void cve_summary_free(struct cve_summary *summary);
602
608 void cve_product_free(struct cve_product *product);
609
615 void cve_reference_free(struct cve_reference *ref);
616
622 void cwe_entry_free(struct cwe_entry *entry);
623
629 void cve_configuration_free(struct cve_configuration *conf);
630
633 void cve_entry_iterator_remove(struct cve_entry_iterator *it);
636 void cve_entry_iterator_reset(struct cve_entry_iterator *it);
637
639 void cve_product_iterator_remove(struct cve_product_iterator *it);
641 void cve_product_iterator_reset(struct cve_product_iterator *it);
642
644 void cve_reference_iterator_remove(struct cve_reference_iterator *it);
646 void cve_reference_iterator_reset(struct cve_reference_iterator *it);
647
649 void cve_summary_iterator_remove(struct cve_summary_iterator *it);
651 void cve_summary_iterator_reset(struct cve_summary_iterator *it);
652
654 void cve_configuration_iterator_remove(struct cve_configuration_iterator *it);
656 void cve_configuration_iterator_reset(struct cve_configuration_iterator *it);
657
664 void cve_model_export(struct cve_model *cve, const char *file);
665
673 struct cve_model *cve_model_import(const char *file);
674
676 const char *cve_model_get_nvd_xml_version(const struct cve_model *item);
678 bool cve_model_set_nvd_xml_version(struct cve_model *obj, const char *newval);
680 const char *cve_model_get_pub_date(const struct cve_model *item);
682 bool cve_model_set_pub_date(struct cve_model *obj, const char *newval);
683
686 #endif /* _CVE_H_ */
cvss_impact
CVSS impact.
Definition: cvss_priv.h:81
cve_reference::cve_reference_set_value
bool cve_reference_set_value(struct cve_reference *reference, const char *new_value)
Set value of CVE reference.
cve_summary::cve_summary_set_summary
bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary)
Set summary of CVE summary.
cve_reference_iterator::cve_reference_iterator_reset
void cve_reference_iterator_reset(struct cve_reference_iterator *it)
cve_entry::cve_entry_set_modified
bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified)
Set modified date of CVE entry.
cve_reference::cve_reference_get_lang
const char * cve_reference_get_lang(const struct cve_reference *ref)
cve_configuration::cve_configuration_new
struct cve_configuration * cve_configuration_new(void)
New CVE vulnerability configuration.
Definition: cve_priv.c:259
cve_entry::cve_entry_set_published
bool cve_entry_set_published(struct cve_entry *entry, const char *new_published)
Set publish date of CVE entry.
cve_model::cve_model_free
void cve_model_free(struct cve_model *cve_model)
Free CVE model.
Definition: cve_priv.c:795
cve_entry::cve_entry_add_product
bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product)
cve_configuration::cve_configuration_free
void cve_configuration_free(struct cve_configuration *conf)
Free CVE configuration.
Definition: cve_priv.c:807
cve_reference::cve_reference_get_source
const char * cve_reference_get_source(const struct cve_reference *ref)
Get CVE reference source.
cve_model::cve_model_export
void cve_model_export(struct cve_model *cve, const char *file)
Export CVE model to XML file.
Definition: cve.c:70
oscap.h
General OpenScap functions and types.
cve_reference::cve_reference_get_href
const char * cve_reference_get_href(const struct cve_reference *ref)
Get CVE reference href.
cve_entry::cve_entry_get_published
const char * cve_entry_get_published(const struct cve_entry *entry)
Get CVE entry published date.
cve_model
Structure holding CVE model.
Definition: cve_priv.c:65
cve_entry_iterator::cve_entry_iterator_remove
void cve_entry_iterator_remove(struct cve_entry_iterator *it)
cve_reference
Structure holding CVE reference data.
Definition: cve_priv.c:77
cve_summary_iterator::cve_summary_iterator_reset
void cve_summary_iterator_reset(struct cve_summary_iterator *it)
cve_entry::cve_entry_new
struct cve_entry * cve_entry_new(void)
New CVE entry.
Definition: cve_priv.c:215
cve_entry::cve_entry_get_summaries
struct cve_summary_iterator * cve_entry_get_summaries(const struct cve_entry *item)
Get CVE entry summary.
cve_summary::cve_summary_clone
struct cve_summary * cve_summary_clone(struct cve_summary *old_sum)
Clone CVE summary.
Definition: cve_priv.c:338
cve_product_iterator::cve_product_iterator_reset
void cve_product_iterator_reset(struct cve_product_iterator *it)
cve_summary::cve_summary_new
struct cve_summary * cve_summary_new(void)
New CVE summary.
Definition: cve_priv.c:324
cve_reference_iterator
Iterator over CVE references.
cpe_name.h
Interface to Common Platform Enumeration (CPE) URI.
cve_configuration
Structure CVE vulnerable configuration data.
Definition: cve_priv.c:113
cve_model::cve_model_import
struct cve_model * cve_model_import(const char *file)
Parses the specified XML file and creates a list of CVE data structures.
Definition: cve.c:50
cwe_entry::cwe_entry_new
struct cwe_entry * cwe_entry_new(void)
New CWE entry.
Definition: cve_priv.c:282
cve_reference::cve_reference_set_href
bool cve_reference_set_href(struct cve_reference *reference, const char *new_href)
Set href of CVE reference.
cve_entry::cve_entry_get_cwe
const char * cve_entry_get_cwe(const struct cve_entry *item)
Get CVE entry CWE.
cwe_entry::cwe_entry_clone
struct cwe_entry * cwe_entry_clone(struct cwe_entry *old_entry)
Clone CWE entry.
Definition: cve_priv.c:296
cve_configuration::cve_configuration_get_expr
const struct cpe_testexpr * cve_configuration_get_expr(const struct cve_configuration *conf)
Get CVE configuration test expression.
Definition: cve_priv.c:201
cve_entry::cve_entry_get_configurations
struct cve_configuration_iterator * cve_entry_get_configurations(const struct cve_entry *entry)
Get CVE .
cve_entry::cve_entry_set_id
bool cve_entry_set_id(struct cve_entry *entry, const char *new_id)
Set id of CVE entry.
cve_reference::cve_reference_free
void cve_reference_free(struct cve_reference *ref)
Free CVE reference.
Definition: cve_priv.c:828
cve_reference::cve_reference_new
struct cve_reference * cve_reference_new(void)
New CVE reference.
Definition: cve_priv.c:345
cve_entry::cve_entry_get_modified
const char * cve_entry_get_modified(const struct cve_entry *entry)
Get CVE entry modified.
cve_entry::cve_entry_set_cwe
bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe)
Set cwe of CVE entry.
cve_entry::cwe_entry_set_value
bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value)
Set value of CVE entry.
cve_model::cve_model_add_entry
bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry)
Add entry to CVE model.
cve_product
Structure holding CVE product data.
Definition: cve_priv.c:99
cve_model::cve_model_get_nvd_xml_version
const char * cve_model_get_nvd_xml_version(const struct cve_model *item)
cve_entry::cve_entry_get_id
const char * cve_entry_get_id(const struct cve_entry *item)
Get CVE entry ID.
cwe_entry
Structure holding CWE data.
Definition: cve_priv.c:106
cve_entry
Structure holding CVE entry data.
Definition: cve_priv.c:121
cve_model::cve_model_set_nvd_xml_version
bool cve_model_set_nvd_xml_version(struct cve_model *obj, const char *newval)
cve_product::cve_product_clone
struct cve_product * cve_product_clone(struct cve_product *old_product)
Clone CVE product.
Definition: cve_priv.c:317
cve_reference::cve_reference_clone
struct cve_reference * cve_reference_clone(struct cve_reference *old_ref)
Clone CVE reference.
Definition: cve_priv.c:356
cve_configuration_iterator::cve_configuration_iterator_reset
void cve_configuration_iterator_reset(struct cve_configuration_iterator *it)
cve_entry::cve_entry_set_sec_protection
bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection)
Set protection of CVE entry.
cve_model::cve_model_supported
const char * cve_model_supported(void)
Get supported version of CVE XML.
Definition: cve.c:82
cve_reference::cve_reference_get_value
const char * cve_reference_get_value(const struct cve_reference *ref)
Get CVE reference values.
cve_entry::cve_entry_add_reference
bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference)
cve_entry::cve_entry_get_cvss
const struct cvss_impact * cve_entry_get_cvss(const struct cve_entry *item)
Get CVSS structure from CVE.
Definition: cve_priv.c:192
cve_entry::cve_entry_free
void cve_entry_free(struct cve_entry *entry)
Free CVE entry.
Definition: cve_priv.c:852
cve_product::cve_product_free
void cve_product_free(struct cve_product *product)
Free CVE product.
Definition: cve_priv.c:818
cve_entry::cve_entry_get_sec_protection
const char * cve_entry_get_sec_protection(const struct cve_entry *entry)
Get CVE entry protection.
cve_entry_iterator
Iterator over CVE entries.
cve_entry::cve_entry_add_summary
bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary)
cve_configuration_iterator::cve_configuration_iterator_remove
void cve_configuration_iterator_remove(struct cve_configuration_iterator *it)
cve_configuration::cve_configuration_set_id
bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id)
Set id of CVE configuration.
cve_product_iterator
Iterator over CVE products.
cve_product::cve_product_set_value
bool cve_product_set_value(struct cve_product *product, const char *new_value)
Set value of CVE product.
cpe_testexpr
CPE language boolean expression.
Definition: cpelang_priv.h:52
cve_configuration_iterator
Iterator over CVE vulnerable configurations.
cve_configuration::cve_configuration_get_id
const char * cve_configuration_get_id(const struct cve_configuration *conf)
Get CVE configuration id.
cve_model::cve_model_set_pub_date
bool cve_model_set_pub_date(struct cve_model *obj, const char *newval)
cve_entry::cve_entry_get_references
struct cve_reference_iterator * cve_entry_get_references(const struct cve_entry *item)
Get an iterator to CVE entry&#39;s references.
cve_entry::cwe_entry_free
void cwe_entry_free(struct cwe_entry *entry)
Free CVE entry.
Definition: cve_priv.c:842
cve_entry::cve_model_get_entries
struct cve_entry_iterator * cve_model_get_entries(const struct cve_model *cve_model)
Get en iterator to CVE entries.
cve_entry::cve_entry_get_products
struct cve_product_iterator * cve_entry_get_products(const struct cve_entry *entry)
Get CVE entry products.
cve_reference::cve_reference_set_lang
bool cve_reference_set_lang(struct cve_reference *reference, const char *new_lang)
cve_model::cve_model_new
struct cve_model * cve_model_new(void)
New CVE model.
Definition: cve_priv.c:367
cve_product_iterator::cve_product_iterator_remove
void cve_product_iterator_remove(struct cve_product_iterator *it)
cve_entry_iterator::cve_entry_iterator_reset
void cve_entry_iterator_reset(struct cve_entry_iterator *it)
cve_reference::cve_reference_set_type
bool cve_reference_set_type(struct cve_reference *reference, const char *new_type)
Set type of CVE reference.
cve_summary::cve_summary_free
void cve_summary_free(struct cve_summary *summary)
Free CVE summary.
Definition: cve_priv.c:785
cve_entry::cve_entry_add_configuration
bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration)
cve_reference::cve_reference_get_type
const char * cve_reference_get_type(const struct cve_reference *ref)
Get CVE reference type.
cve_summary_iterator::cve_summary_iterator_remove
void cve_summary_iterator_remove(struct cve_summary_iterator *it)
cve_summary::cve_summary_get_summary
const char * cve_summary_get_summary(const struct cve_summary *summary)
Get value from CVE summary.
cve_reference::cve_reference_set_source
bool cve_reference_set_source(struct cve_reference *reference, const char *new_source)
Set source of CVE reference.
cve_model::cve_model_get_pub_date
const char * cve_model_get_pub_date(const struct cve_model *item)
cve_product::cve_product_new
struct cve_product * cve_product_new(void)
New CVE product.
Definition: cve_priv.c:303
cve_model::cve_model_clone
struct cve_model * cve_model_clone(struct cve_model *old_model)
Clone CVE model.
Definition: cve_priv.c:383
cve_entry::cwe_entry_get_value
const char * cwe_entry_get_value(const struct cwe_entry *entry)
Get CVE entry value.
cve_summary_iterator
Iterator over CVE summaries.
cve_configuration::cve_configuration_clone
struct cve_configuration * cve_configuration_clone(struct cve_configuration *old_conf)
Clone CVE configuration.
Definition: cve_priv.c:274
cve_summary
Structure holding CVE summary data.
Definition: cve_priv.c:92
cve_reference_iterator::cve_reference_iterator_remove
void cve_reference_iterator_remove(struct cve_reference_iterator *it)
cve_entry::cve_entry_clone
struct cve_entry * cve_entry_clone(struct cve_entry *old_entry)
Clone CVE entry.
Definition: cve_priv.c:239