|
Open SCAP Library
|
00001 00008 /* 00009 * Copyright 2009-2014 Red Hat Inc., Durham, North Carolina. 00010 * All Rights Reserved. 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Lesser General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2.1 of the License, or (at your option) any later version. 00016 * 00017 * This library is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 * Authors: 00027 * "David Niemoller" <David.Niemoller@g2-inc.com> 00028 */ 00029 00030 #ifndef OVAL_PARSER_H_ 00031 #define OVAL_PARSER_H_ 00032 00033 #include <libxml/xmlreader.h> 00034 #include "public/oval_agent_api.h" 00035 #include "common/util.h" 00036 00037 OSCAP_HIDDEN_START; 00038 00039 #define OVAL_ROOT_ELM_DEFINITIONS "oval_definitions" 00040 #define OVAL_ROOT_ELM_DIRECTIVES "oval_directives" 00041 #define OVAL_ROOT_ELM_RESULTS "oval_results" 00042 #define OVAL_ROOT_ELM_SYSCHARS "oval_system_characteristics" 00043 #define OVAL_ROOT_ELM_VARIABLES "oval_variables" 00044 00045 struct oval_parser_context { 00046 struct oval_definition_model *definition_model; 00047 struct oval_syschar_model *syschar_model; 00048 struct oval_results_model *results_model; 00049 struct oval_variable_model *variable_model; 00050 struct oval_directives_model *directives_model; 00051 xmlTextReader *reader; 00052 void *user_data; 00053 }; 00054 00055 int oval_definition_model_parse(xmlTextReaderPtr, struct oval_parser_context *); 00056 int oval_syschar_model_parse(xmlTextReaderPtr, struct oval_parser_context *); 00057 int oval_results_model_parse(xmlTextReaderPtr , struct oval_parser_context *); 00058 00059 int oval_parser_boolean_attribute(xmlTextReaderPtr reader, char *attname, int defval); 00060 int oval_parser_int_attribute(xmlTextReaderPtr reader, char *attname, int defval); 00061 00062 typedef int (*oval_xml_tag_parser) (xmlTextReaderPtr, struct oval_parser_context *, void *); 00063 int oval_parser_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, oval_xml_tag_parser, void *); 00064 int oval_parser_skip_tag(xmlTextReaderPtr reader, struct oval_parser_context *context); 00065 00066 char *oval_determine_document_schema_version_priv(xmlTextReader *reader, oscap_document_type_t doc_type); 00067 00068 OSCAP_HIDDEN_END; 00069 00070 #endif /* OVAL_PARSER_H_ */
1.7.3