/usr/include/openscap/cve_nvd.h is in libopenscap-dev 1.2.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 | /**
* @addtogroup CVE
* @{
*
* @image html cve.png "Class diagram"
*
* @file cve_nvd.h
* @brief Interface to Common Vulnerability and Exposure dictionary
*/
/*
* 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
* Structure holding CVE model
*/
struct cve_model;
/**
* @struct cve_entry
* Structure holding CVE entry data
*/
struct cve_entry;
/**
* @struct cve_summary
* Structure holding CVE summary data
*/
struct cve_summary;
/**
* @struct cve_product
* Structure holding CVE product data
*/
struct cve_product;
/**
* @struct cve_configuration
* Structure CVE vulnerable configuration data
*/
struct cve_configuration;
/**
* @struct cwe_entry
* Structure holding CWE data
*/
struct cwe_entry;
/**
* @struct cve_reference
* Structure holding CVE reference data
*/
struct cve_reference;
// fwd
struct cvss_impact;
/************************************************************/
/**
* @name Getters
* Return value is pointer to structure's member. Do not free unless you null the pointer in the structure.
* Use remove function otherwise.
* @{
* */
/**
* Get en iterator to CVE entries
* @param cve_model CVE model
* @memberof cve_entry
*/
struct cve_entry_iterator *cve_model_get_entries(const struct cve_model *cve_model);
/**
* Get CVE entry ID
* @param item CVE entry
* @memberof cve_entry
*/
const char *cve_entry_get_id(const struct cve_entry *item);
/**
* Get CVE entry CWE
* @param item CVE entry
* @memberof cve_entry
*/
const char *cve_entry_get_cwe(const struct cve_entry *item);
/**
* Get CVE entry summary
* @param item CVE entry
* @memberof cve_entry
*/
struct cve_summary_iterator *cve_entry_get_summaries(const struct cve_entry *item);
/**
* Get an iterator to CVE entry's references
* @param item CVE entry
* @memberof cve_entry
*/
struct cve_reference_iterator *cve_entry_get_references(const struct cve_entry *item);
/**
* Get CVE reference values
* @param ref CVE reference
* @memberof cve_reference
*/
const char *cve_reference_get_value(const struct cve_reference *ref);
/**
* Get CVE reference href
* @param ref CVE reference
* @memberof cve_reference
*/
const char *cve_reference_get_href(const struct cve_reference *ref);
/**
* Get CVE reference type
* @param ref CVE reference
* @memberof cve_reference
*/
const char *cve_reference_get_type(const struct cve_reference *ref);
/**
* Get CVE reference source
* @param ref CVE reference
* @memberof cve_reference
*/
const char *cve_reference_get_source(const struct cve_reference *ref);
/// @memberof cve_reference
const char *cve_reference_get_lang(const struct cve_reference *ref);
/**
* Get value from CVE summary
* @param summary CVE summary
* @memberof cve_summary
*/
const char *cve_summary_get_summary(const struct cve_summary *summary);
/**
* Get CVE product value
* @param prodct CVE product
* @memberof cve_
*/
const char *cve_product_get_value(const struct cve_product *product);
/**
* Get CVE entry value
* @param entry CVE entry
* @memberof cve_entry
*/
const char *cwe_entry_get_value(const struct cwe_entry *entry);
/**
* Get CVE configuration id
* @param conf CVE vulnerable configuration
* @memberof cve_configuration
*/
const char *cve_configuration_get_id(const struct cve_configuration *conf);
/**
* Get CVE entry published date
* @param entry CVE entry
* @memberof cve_entry
*/
const char *cve_entry_get_published(const struct cve_entry *entry);
/**
* Get CVE entry modified
* @param entry CVE entry
* @memberof cve_entry
*/
const char *cve_entry_get_modified(const struct cve_entry *entry);
/**
* Get CVE entry protection
* @param entry CVE entry
* @memberof cve_entry
*/
const char *cve_entry_get_sec_protection(const struct cve_entry *entry);
/**
* Get CVE entry products
* @param entry CVE entry
* @memberof cve_entry
*/
struct cve_product_iterator *cve_entry_get_products(const struct cve_entry *entry);
/**
* Get CVE .
* @param entry CVE entry
* @memberof cve_entry
*/
struct cve_configuration_iterator *cve_entry_get_configurations(const struct cve_entry *entry);
/**
* Get CVE configuration test expression.
* @param conf CVE configuration
* @memberof cve_configuration
*/
const struct cpe_testexpr *cve_configuration_get_expr(const struct cve_configuration *conf);
/**
* Get CVSS structure from CVE.
* @param item CVE entry
* @memberof cve_entry
*/
const struct cvss_impact *cve_entry_get_cvss(const struct cve_entry *item);
/************************************************************/
/** @} End of Getters group */
/************************************************************/
/**
* @name Setters
* For lists use add functions. Parameters of set functions are duplicated in memory and need to
* be freed by caller.
* @{
*/
/**
* Add entry to CVE model
* @param model CVE model
* @param new_entry New CVE entry
* @memberof cve_model
* @return true if added, false otherwise
*/
bool cve_model_add_entry(struct cve_model *model, struct cve_entry *new_entry);
/// @memberof cve_entry
bool cve_entry_add_product(struct cve_entry *entry, struct cve_product *new_product);
/// @memberof cve_entry
bool cve_entry_add_reference(struct cve_entry *entry, struct cve_reference *new_reference);
/// @memberof cve_entry
bool cve_entry_add_summary(struct cve_entry *entry, struct cve_summary *new_summary);
/// @memberof cve_entry
bool cve_entry_add_configuration(struct cve_entry *entry, struct cve_configuration *new_configuration);
/**
* Set id of CVE entry
* @param entry CVE entry
* @param new_id id of CVE entry
* @memberof cve_entry
* return true if set, false otherwise
*/
bool cve_entry_set_id(struct cve_entry *entry, const char *new_id);
/**
* Set publish date of CVE entry
* @param entry CVE entry
* @param new_published date of CVE attribute
* @memberof cve_entry
* return true if set, false otherwise
*/
bool cve_entry_set_published(struct cve_entry *entry, const char *new_published);
/**
* Set modified date of CVE entry
* @param entry CVE entry
* @param new_modified CVE modified date
* @memberof cve_entry
* return true if set, false otherwise
*/
bool cve_entry_set_modified(struct cve_entry *entry, const char *new_modified);
/**
* Set protection of CVE entry
* @param entry CVE entry
* @param new_protection CVE protection
* @memberof cve_entry
* return true if set, false otherwise
*/
bool cve_entry_set_sec_protection(struct cve_entry *entry, const char *new_protection);
/**
* Set cwe of CVE entry
* @param entry CVE entry
* @param cwe CWE of CVE
* @memberof cve_entry
* return true if set, false otherwise
*/
bool cve_entry_set_cwe(struct cve_entry *entry, const char *cwe);
/**
* Set value of CVE entry
* @param entry CVE entry
* @param new_value CVE value
* @memberof cve_entry
* return true if set, false otherwise
*/
bool cwe_entry_set_value(struct cwe_entry *entry, const char *new_value);
/**
* Set value of CVE reference
* @param reference CVE reference
* @param new_value CVE reference value
* @memberof cve_reference
* return true if set, false otherwise
*/
bool cve_reference_set_value(struct cve_reference *reference, const char *new_value);
/**
* Set href of CVE reference
* @param reference CVE reference
* @param new_href CVE reference href
* @memberof cve_reference href
* return true if set, false otherwise
*/
bool cve_reference_set_href(struct cve_reference *reference, const char *new_href);
/**
* Set type of CVE reference
* @param reference CVE reference
* @param new_type CVE reference type
* @memberof cve_reference type
* return true if set, false otherwise
*/
bool cve_reference_set_type(struct cve_reference *reference, const char *new_type);
/**
* Set source of CVE reference
* @param reference CVE reference
* @param new_source CVE reference source
* @memberof cve_reference
* return true if set, false otherwise
*/
bool cve_reference_set_source(struct cve_reference *reference, const char *new_source);
/// @memberof cve_reference
bool cve_reference_set_lang(struct cve_reference *reference, const char *new_lang);
/**
* Set id of CVE configuration
* @param conf CVE vulnerability configuration
* @param new_id id of CVE configuration
* @memberof cve_configuration
* @return true if set, false otherwise
*/
bool cve_configuration_set_id(struct cve_configuration *conf, const char *new_id);
/**
* Set value of CVE product
* @param product CVE product
* @param new_value value of CVE product
* @memberof cve_product
* @return true if set, false otherwise
*/
bool cve_product_set_value(struct cve_product *product, const char *new_value);
/**
* Set summary of CVE summary
* @param summary CVE summary
* @param new_summary summary of CVE summary
* @memberof cve_summary
* @return true if set, false otherwise
*/
bool cve_summary_set_summary(struct cve_summary *summary, const char *new_summary);
/************************************************************/
/** @} End of Setters group */
/************************************************************/
/**
* @name Iterators
* @{
* */
/**
* @struct cve_entry_iterator
* Iterator over CVE entries.
* @see oscap_iterator
* @memberof cve_entry
*/
struct cve_entry_iterator;
/**
* @memberof cve_entry_iterator
*/
struct cve_entry *cve_entry_iterator_next(struct cve_entry_iterator *it);
/**
* @memberof cve_entry_iterator
*/
bool cve_entry_iterator_has_more(struct cve_entry_iterator *it);
/**
* @memberof cve_entry_iterator
*/
void cve_entry_iterator_free(struct cve_entry_iterator *it);
/** @struct cve_summary_iterator
* Iterator over CVE summaries.
* @see oscap_iterator
* @memberof cve_summary
*/
struct cve_summary_iterator;
/**
* @memberof cve_summary_iterator
*/
struct cve_summary *cve_summary_iterator_next(struct cve_summary_iterator *it);
/**
* @memberof cve_summary_iterator
*/
bool cve_summary_iterator_has_more(struct cve_summary_iterator *it);
/**
* @memberof cve_summary_iterator
*/
void cve_summary_iterator_free(struct cve_summary_iterator *it);
/** @struct cve_product_iterator
* Iterator over CVE products.
* @see oscap_iterator
* @memberof cve_product
*/
struct cve_product_iterator;
/**
* @memberof cve_product_iterator
*/
struct cve_product *cve_product_iterator_next(struct cve_product_iterator *it);
/**
* @memberof cve_product_iterator
*/
bool cve_product_iterator_has_more(struct cve_product_iterator *it);
/**
* @memberof cve_product_iterator
*/
void cve_product_iterator_free(struct cve_product_iterator *it);
/** @struct cve_configuration_iterator
* Iterator over CVE vulnerable configurations.
* @see oscap_iterator
* @memberof cve_configuration
*/
struct cve_configuration_iterator;
/**
* @memberof cve_configuration_iterator
*/
struct cve_configuration *cve_configuration_iterator_next(struct cve_configuration_iterator *it);
/**
* @memberof cve_configuration_iterator
*/
bool cve_configuration_iterator_has_more(struct cve_configuration_iterator *it);
/**
* @memberof cve_configuration_iterator
*/
void cve_configuration_iterator_free(struct cve_configuration_iterator *it);
/** @struct cve_reference_iterator
* Iterator over CVE references.
* @see oscap_iterator
* @memberof cve_reference
*/
struct cve_reference_iterator;
/**
* @memberof cve_reference_iterator
*/
struct cve_reference *cve_reference_iterator_next(struct cve_reference_iterator *it);
/**
* @memberof cve_reference_iterator
*/
bool cve_reference_iterator_has_more(struct cve_reference_iterator *it);
/**
* @memberof cve_reference_iterator
*/
void cve_reference_iterator_free(struct cve_reference_iterator *it);
/************************************************************/
/** @} End of Iterators group */
/************************************************************/
/**
* @name Evaluators
* @{
* */
/**
* Get supported version of CVE XML
* @return version of XML file format
* @memberof cve_model
*/
const char * cve_model_supported(void);
/************************************************************/
/** @} End of Evaluators group */
/**
* New CVE entry
* @memberof cve_entry
* @return New CVE entry
*/
struct cve_entry *cve_entry_new(void);
/**
* New CVE vulnerability configuration
* @memberof cve_configuration
* @return New CVE vulnerability configuration
*/
struct cve_configuration *cve_configuration_new(void);
/**
* New CWE entry
* @memberof cwe_entry
* @return New CWE entry
*/
struct cwe_entry *cwe_entry_new(void);
/**
* New CVE product
* @memberof cve_product
* @return New CVE product
*/
struct cve_product *cve_product_new(void);
/**
* New CVE summary
* @memberof cve_summary
* @return New CVE summary
*/
struct cve_summary *cve_summary_new(void);
/**
* New CVE reference
* @memberof cve_reference
* @return New CVE reference
*/
struct cve_reference *cve_reference_new(void);
/**
* New CVE model
* @memberof cve_model
* @return New CVE model
*/
struct cve_model *cve_model_new(void);
/**
* Clone CVE entry
* @param old_entry CVE entry
* @memberof cve_entry
*/
struct cve_entry * cve_entry_clone(struct cve_entry * old_entry);
/**
* Clone CVE configuration
* @param old_conf CVE configuration
* @memberof cve_configuration
*/
struct cve_configuration * cve_configuration_clone(struct cve_configuration * old_conf);
/**
* Clone CWE entry
* @param old_entry CWE entry
* @memberof cwe_entry
*/
struct cwe_entry * cwe_entry_clone(struct cwe_entry * old_entry);
/**
* Clone CVE product
* @param old_product CVE product
* @memberof cve_product
*/
struct cve_product * cve_product_clone(struct cve_product * old_product);
/**
* Clone CVE summary
* @param old_sum CVE summary
* @memberof cve_summary
*/
struct cve_summary * cve_summary_clone(struct cve_summary * old_sum);
/**
* Clone CVE reference
* @param old_ref CVE reference
* @memberof cve_reference
*/
struct cve_reference * cve_reference_clone(struct cve_reference * old_ref);
/**
* Clone CVE model
* @param old_model CVE model
* @memberof cve_model
*/
struct cve_model * cve_model_clone(struct cve_model * old_model);
/**
* Free CVE model
* @param cve_model CVE model
* @memberof cve_model
*/
void cve_model_free(struct cve_model *cve_model);
/**
* Free CVE entry
* @param entry CVE entry
* @memberof cve_entry
*/
void cve_entry_free(struct cve_entry *entry);
/**
* Free CVE summary
* @param summary CVE summary
* @memberof cve_summary
*/
void cve_summary_free(struct cve_summary *summary);
/**
* Free CVE product
* @param product CVE product
* @memberof cve_product
*/
void cve_product_free(struct cve_product *product);
/**
* Free CVE reference
* @param ref CVE reference
* @memberof cve_reference
*/
void cve_reference_free(struct cve_reference *ref);
/**
* Free CVE entry
* @param entry CVE entry
* @memberof cve_entry
*/
void cwe_entry_free(struct cwe_entry *entry);
/**
* Free CVE configuration
* @param conf CVE vulnerability configuration
* @memberof cve_configuration
*/
void cve_configuration_free(struct cve_configuration *conf);
/**@}*/
/// @memberof cve_entry_iterator
void cve_entry_iterator_remove(struct cve_entry_iterator *it);
/// @memberof cve_entry_iterator
void cve_entry_iterator_reset(struct cve_entry_iterator *it);
/// @memberof cve_product_iterator
void cve_product_iterator_remove(struct cve_product_iterator *it);
/// @memberof cve_product_iterator
void cve_product_iterator_reset(struct cve_product_iterator *it);
/// @memberof cve_reference_iterator
void cve_reference_iterator_remove(struct cve_reference_iterator *it);
/// @memberof cve_reference_iterator
void cve_reference_iterator_reset(struct cve_reference_iterator *it);
/// @memberof cve_summary_iterator
void cve_summary_iterator_remove(struct cve_summary_iterator *it);
/// @memberof cve_summary_iterator
void cve_summary_iterator_reset(struct cve_summary_iterator *it);
/// @memberof cve_configuration_iterator
void cve_configuration_iterator_remove(struct cve_configuration_iterator *it);
/// @memberof cve_configuration_iterator
void cve_configuration_iterator_reset(struct cve_configuration_iterator *it);
/**
* Export CVE model to XML file
* @memberof cve_model
* @param cve CVE model
* @param file OSCAP export target
*/
void cve_model_export(struct cve_model *cve, const char *file);
/**
* Parses the specified XML file and creates a list of CVE data structures.
* The returned list can be freed with cveDelAll().
* @memberof cve_model
* @param file filename
* @return non-negative value indicates the number of CVEs in the list, negative value indicates an error
*/
struct cve_model *cve_model_import(const char *file);
/// @memberof cve_model
const char *cve_model_get_nvd_xml_version(const struct cve_model *item);
/// @memberof cve_model
bool cve_model_set_nvd_xml_version(struct cve_model *obj, const char *newval);
/// @memberof cve_model
const char *cve_model_get_pub_date(const struct cve_model *item);
/// @memberof cve_model
bool cve_model_set_pub_date(struct cve_model *obj, const char *newval);
/**@}*/
#endif /* _CVE_H_ */
|