cve_nvd.h
Go to the documentation of this file.
/*
* Copyright 2009 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
* Maros Barabas <mbarabas@redhat.com>
* Tomas Heinrich <theinric@redhat.com>
*/
#ifndef _CVE_H_
#define _CVE_H_
#include <stdbool.h>
#include <time.h>
#include "oscap.h"
#include "cpe_name.h"
struct cve_model;
struct cve_entry;
struct cve_summary;
struct cve_product;
struct cve_configuration;
struct cwe_entry;
struct cve_reference;
// fwd
struct cvss_impact;
/************************************************************/
struct cve_entry_iterator *cve_model_get_entries(const struct cve_model *cve_model);
const char *cve_entry_get_id(const struct cve_entry *item);
const char *cve_entry_get_cwe(const struct cve_entry *item);
struct cve_summary_iterator *cve_entry_get_summaries(const struct cve_entry *item);
struct cve_reference_iterator *cve_entry_get_references(const struct cve_entry *item);
const char *cve_reference_get_value(const struct cve_reference *ref);
const char *cve_reference_get_href(const struct cve_reference *ref);
const char *cve_reference_get_type(const struct cve_reference *ref);
const char *cve_reference_get_source(const struct cve_reference *ref);
const char *cve_reference_get_lang(const struct cve_reference *ref);
const char *cve_summary_get_summary(const struct cve_summary *summary);
const char *cve_product_get_value(const struct cve_product *product);
const char *cwe_entry_get_value(const struct cwe_entry *entry);
const char *cve_configuration_get_id(const struct cve_configuration *conf);
const char *cve_entry_get_published(const struct cve_entry *entry);
const char *cve_entry_get_modified(const struct cve_entry *entry);
const char *cve_entry_get_sec_protection(const struct cve_entry *entry);
struct cve_product_iterator *cve_entry_get_products(const struct cve_entry *entry);
struct cve_configuration_iterator *cve_entry_get_configurations(const struct cve_entry *entry);
const struct cpe_testexpr *cve_configuration_get_expr(const struct cve_configuration *conf);
const struct cvss_impact *cve_entry_get_cvss(const struct cve_entry *item);
/************************************************************/
/************************************************************/
bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry);
bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product);
bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference);
bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary);
bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration);
bool cve_entry_set_id(struct cve_entry *entry, const char *new_id);
bool cve_entry_set_published(struct cve_entry *entry, const char *new_published);
bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified);
bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection);
bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe);
bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value);
bool cve_reference_set_value(struct cve_reference *reference, const char *new_value);
bool cve_reference_set_href(struct cve_reference *reference, const char *new_href);
bool cve_reference_set_type(struct cve_reference *reference, const char *new_type);
bool cve_reference_set_source(struct cve_reference *reference, const char *new_source);
bool cve_reference_set_lang(struct cve_reference *reference, const char *new_lang);
bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id);
bool cve_product_set_value(struct cve_product *product, const char *new_value);
bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary);
/************************************************************/
/************************************************************/
struct cve_entry_iterator;
struct cve_entry *cve_entry_iterator_next(struct cve_entry_iterator *it);
bool cve_entry_iterator_has_more(struct cve_entry_iterator *it);
void cve_entry_iterator_free(struct cve_entry_iterator *it);
struct cve_summary_iterator;
struct cve_summary *cve_summary_iterator_next(struct cve_summary_iterator *it);
bool cve_summary_iterator_has_more(struct cve_summary_iterator *it);
void cve_summary_iterator_free(struct cve_summary_iterator *it);
struct cve_product_iterator;
struct cve_product *cve_product_iterator_next(struct cve_product_iterator *it);
bool cve_product_iterator_has_more(struct cve_product_iterator *it);
void cve_product_iterator_free(struct cve_product_iterator *it);
struct cve_configuration_iterator;
struct cve_configuration *cve_configuration_iterator_next(struct cve_configuration_iterator *it);
bool cve_configuration_iterator_has_more(struct cve_configuration_iterator *it);
void cve_configuration_iterator_free(struct cve_configuration_iterator *it);
struct cve_reference_iterator;
struct cve_reference *cve_reference_iterator_next(struct cve_reference_iterator *it);
bool cve_reference_iterator_has_more(struct cve_reference_iterator *it);
void cve_reference_iterator_free(struct cve_reference_iterator *it);
/************************************************************/
/************************************************************/
const char * cve_model_supported(void);
/************************************************************/
struct cve_entry *cve_entry_new(void);
struct cve_configuration *cve_configuration_new(void);
struct cwe_entry *cwe_entry_new(void);
struct cve_product *cve_product_new(void);
struct cve_summary *cve_summary_new(void);
struct cve_reference *cve_reference_new(void);
struct cve_model *cve_model_new(void);
struct cve_entry * cve_entry_clone(struct cve_entry * old_entry);
struct cve_configuration * cve_configuration_clone(struct cve_configuration * old_conf);
struct cwe_entry * cwe_entry_clone(struct cwe_entry * old_entry);
struct cve_product * cve_product_clone(struct cve_product * old_product);
struct cve_summary * cve_summary_clone(struct cve_summary * old_sum);
struct cve_reference * cve_reference_clone(struct cve_reference * old_ref);
struct cve_model * cve_model_clone(struct cve_model * old_model);
void cve_model_free(struct cve_model *cve_model);
void cve_entry_free(struct cve_entry *entry);
void cve_summary_free(struct cve_summary *summary);
void cve_product_free(struct cve_product *product);
void cve_reference_free(struct cve_reference *ref);
void cwe_entry_free(struct cwe_entry *entry);
void cve_configuration_free(struct cve_configuration *conf);
void cve_entry_iterator_remove(struct cve_entry_iterator *it);
void cve_entry_iterator_reset(struct cve_entry_iterator *it);
void cve_product_iterator_remove(struct cve_product_iterator *it);
void cve_product_iterator_reset(struct cve_product_iterator *it);
void cve_reference_iterator_remove(struct cve_reference_iterator *it);
void cve_reference_iterator_reset(struct cve_reference_iterator *it);
void cve_summary_iterator_remove(struct cve_summary_iterator *it);
void cve_summary_iterator_reset(struct cve_summary_iterator *it);
void cve_configuration_iterator_remove(struct cve_configuration_iterator *it);
void cve_configuration_iterator_reset(struct cve_configuration_iterator *it);
void cve_model_export(struct cve_model *cve, const char *file);
struct cve_model *cve_model_import(const char *file);
const char *cve_model_get_nvd_xml_version(const struct cve_model *item);
bool cve_model_set_nvd_xml_version(struct cve_model *obj, const char *newval);
const char *cve_model_get_pub_date(const struct cve_model *item);
bool cve_model_set_pub_date(struct cve_model *obj, const char *newval);
#endif /* _CVE_H_ */