26 #include <libxml/xmlreader.h>
27 #include <libxml/tree.h>
28 #include <libxml/xpath.h>
29 #include <libxml/parser.h>
30 #include <libxml/xpathInternals.h>
32 #include "../common/list.h"
33 #include "../common/elements.h"
38 #define CVRF_NS BAD_CAST "http://www.icasi.org/CVRF/schema/cvrf/1.1"
39 #define PROD_NS BAD_CAST "http://www.icasi.org/CVRF/schema/prod/1.1"
40 #define VULN_NS BAD_CAST "http://www.icasi.org/CVRF/schema/vuln/1.1"
51 CVRF_DOC_PUBLISHER_UNKNOWN = 0,
52 CVRF_DOC_PUBLISHER_VENDOR,
53 CVRF_DOC_PUBLISHER_DISCOVERER,
54 CVRF_DOC_PUBLISHER_COORDINATOR,
55 CVRF_DOC_PUBLISHER_USER,
56 CVRF_DOC_PUBLISHER_OTHER,
57 } cvrf_doc_publisher_type_t;
80 cvrf_doc_publisher_type_t cvrf_doc_publisher_type_parse(xmlTextReaderPtr reader);
88 cvrf_doc_publisher_type_t cvrf_involvement_party_parse(xmlTextReaderPtr reader);
95 const char *cvrf_doc_publisher_type_get_text(cvrf_doc_publisher_type_t
type);
102 CVRF_DOC_STATUS_UNKNOWN = 0,
103 CVRF_DOC_STATUS_DRAFT,
104 CVRF_DOC_STATUS_INTERIM,
105 CVRF_DOC_STATUS_FINAL,
106 } cvrf_doc_status_type_t;
121 cvrf_doc_status_type_t cvrf_doc_status_type_parse(xmlTextReaderPtr reader);
128 const char *cvrf_doc_status_type_get_text(cvrf_doc_status_type_t
type);
135 CVRF_NOTE_UNKNOWN = 0,
138 CVRF_NOTE_DESCRIPTION,
141 CVRF_NOTE_LEGAL_DISCLAIMER,
158 cvrf_note_type_t cvrf_note_type_parse(xmlTextReaderPtr reader);
165 const char *cvrf_note_type_get_text(cvrf_note_type_t
type);
172 CVRF_REFERENCE_UNKNOWN = 0,
173 CVRF_REFERENCE_EXTERNAL,
175 } cvrf_reference_type_t;
190 cvrf_reference_type_t cvrf_reference_type_parse(xmlTextReaderPtr reader);
197 const char *cvrf_reference_type_get_text(cvrf_reference_type_t
type);
204 CVRF_BRANCH_UNKNOWN = 0,
206 CVRF_BRANCH_PRODUCT_FAMILY,
207 CVRF_BRANCH_PRODUCT_NAME,
208 CVRF_BRANCH_PRODUCT_VERSION,
209 CVRF_BRANCH_PATCH_LEVEL,
210 CVRF_BRANCH_SERVICE_PACK,
211 CVRF_BRANCH_ARCHITECTURE,
212 CVRF_BRANCH_LANGUAGE,
214 CVRF_BRANCH_SPECIFICATION,
215 } cvrf_branch_type_t;
230 cvrf_branch_type_t cvrf_branch_type_parse(xmlTextReaderPtr reader);
237 const char *cvrf_branch_type_get_text(cvrf_branch_type_t
type);
247 CVRF_RELATIONSHIP_UNKNOWN = 0,
248 CVRF_RELATIONSHIP_DEFAULT_COMPONENT,
249 CVRF_RELATIONSHIP_OPTIONAL_COMPONENT,
250 CVRF_RELATIONSHIP_EXTERNAL_COMPONENT,
251 CVRF_RELATIONSHIP_INSTALLED_ON,
252 CVRF_RELATIONSHIP_INSTALLED_WITH,
253 } cvrf_relationship_type_t;
268 cvrf_relationship_type_t cvrf_relationship_type_parse(xmlTextReaderPtr reader);
275 const char *cvrf_relationship_type_get_text(cvrf_relationship_type_t
type);
282 CVRF_INVOLVEMENT_UNKNOWN = 0,
283 CVRF_INVOLVEMENT_OPEN,
284 CVRF_INVOLVEMENT_DISPUTED,
285 CVRF_INVOLVEMENT_IN_PROGRESS,
286 CVRF_INVOLVEMENT_COMPLETED,
287 CVRF_INVOLVEMENT_CONTACT_ATTEMPTED,
288 CVRF_INVOLVEMENT_NOT_CONTACTED,
289 } cvrf_involvement_status_type_t;
304 cvrf_involvement_status_type_t cvrf_involvement_status_type_parse(xmlTextReaderPtr reader);
311 const char *cvrf_involvement_status_type_get_text(cvrf_involvement_status_type_t
type);
320 CVRF_PRODUCT_STATUS_UNKNOWN = 0,
321 CVRF_PRODUCT_STATUS_FIRST_AFFECTED,
322 CVRF_PRODUCT_STATUS_KNOWN_AFFECTED,
323 CVRF_PRODUCT_STATUS_KNOWN_NOT_AFFECTED,
324 CVRF_PRODUCT_STATUS_FIRST_FIXED,
325 CVRF_PRODUCT_STATUS_FIXED,
326 CVRF_PRODUCT_STATUS_RECOMMENDED,
327 CVRF_PRODUCT_STATUS_LAST_AFFECTED,
328 } cvrf_product_status_type_t;
344 cvrf_product_status_type_t cvrf_product_status_type_parse(xmlTextReaderPtr reader);
351 const char *cvrf_product_status_type_get_text(cvrf_product_status_type_t product_status_type);
359 CVRF_THREAT_UNKNOWN = 0,
361 CVRF_THREAT_EXPLOIT_STATUS,
362 CVRF_THREAT_TARGET_SET,
363 } cvrf_threat_type_t;
378 cvrf_threat_type_t cvrf_threat_type_parse(xmlTextReaderPtr reader);
385 const char *cvrf_threat_type_get_text(cvrf_threat_type_t threat_type);
392 CVRF_REMEDIATION_UNKNOWN = 0,
393 CVRF_REMEDIATION_WORKAROUND,
394 CVRF_REMEDIATION_MITIGATION,
395 CVRF_REMEDIATION_VENDOR_FIX,
396 CVRF_REMEDIATION_NONE_AVAILABLE,
397 CVRF_REMEDIATION_WILL_NOT_FIX,
398 } cvrf_remediation_type_t;
413 cvrf_remediation_type_t cvrf_remediation_type_parse(xmlTextReaderPtr reader);
420 const char *cvrf_remediation_type_get_text(cvrf_remediation_type_t remediation_type);
431 CVRF_ITEM_UNKNOWN = 0,
432 CVRF_DOCUMENT_PUBLISHER,
433 CVRF_DOCUMENT_TRACKING,
436 CVRF_DOCUMENT_REFERENCE,
444 CVRF_VULNERABILITY_CWE,
459 const char *cvrf_item_type_get_text(cvrf_item_type_t type);
466 cvrf_item_type_t cvrf_item_type_from_text(
const char *item);
472 bool cvrf_is_valid_item_type(
const char *item);
479 const char *cvrf_item_type_get_container(cvrf_item_type_t type);
487 bool cvrf_item_type_has_container(cvrf_item_type_t type);
506 struct cvrf_score_set *cvrf_score_set_parse(xmlTextReaderPtr reader);
513 struct cvrf_threat *cvrf_threat_parse(xmlTextReaderPtr reader);
555 struct cvrf_group *cvrf_group_parse(xmlTextReaderPtr reader);
569 struct cvrf_branch *cvrf_branch_parse(xmlTextReaderPtr reader);
590 struct cvrf_reference *cvrf_reference_parse(xmlTextReaderPtr reader);
597 struct cvrf_note *cvrf_note_parse(xmlTextReaderPtr reader);
604 struct cvrf_revision *cvrf_revision_parse(xmlTextReaderPtr reader);
626 struct cvrf_document *cvrf_document_parse(xmlTextReaderPtr reader);
633 struct cvrf_model *cvrf_model_parse(xmlTextReaderPtr reader);
650 void cvrf_element_add_container(
struct oscap_list *list, cvrf_item_type_t cvrf_type, xmlNode *parent);
659 void cvrf_element_add_stringlist(
struct oscap_stringlist *list,
const char *tag_name, xmlNode *parent);
668 void cvrf_element_add_attribute(
const char *attr_name,
const char *attr_value, xmlNode *element);
677 void cvrf_element_add_child(
const char *elm_name,
const char *elm_value, xmlNode *parent);
685 xmlNode *cvrf_element_to_dom(
const char *elm_name,
const char *elm_value);
849 xmlNode *cvrf_model_to_dom(
struct cvrf_model *model, xmlDocPtr doc, xmlNode *parent,
void *user_args);
858 xmlNode *cvrf_index_to_dom(
struct cvrf_index *index, xmlDocPtr doc, xmlNode *parent,
void *user_args);
860 bool cvrf_product_vulnerability_fixed(
struct cvrf_vulnerability *vuln,
const char *product);