00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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 struct oval_parser_context {
00040 struct oval_definition_model *definition_model;
00041 struct oval_syschar_model *syschar_model;
00042 struct oval_results_model *results_model;
00043
00044 xmlTextReader *reader;
00045 oval_xml_error_handler error_handler;
00046 void* user_data;
00047 };
00048
00049 struct oval_definition_model *oval_parser_context_model(struct oval_parser_context
00050 *context);
00051
00052 int ovaldef_parser_parse
00053 (struct oval_definition_model *, xmlTextReader *, oval_xml_error_handler, void *);
00054 int ovaldef_parse_node(xmlTextReaderPtr, struct oval_parser_context *);
00055
00056 int ovalsys_parser_parse
00057 (struct oval_syschar_model *, xmlTextReader *, oval_xml_error_handler , void *);
00058
00059 struct oval_result_directives *ovalres_parser_parse
00060 (struct oval_results_model *, xmlTextReader *, oval_xml_error_handler, void *);
00061
00062 int oval_parser_report(struct oval_parser_context*, struct oval_xml_error*);
00063
00064 int oval_parser_log_info (struct oval_parser_context *context, char* message);
00065 int oval_parser_log_debug(struct oval_parser_context *context, char* message);
00066 int oval_parser_log_warn (struct oval_parser_context *context, char* message);
00067
00068 void libxml_error_handler(void *user, const char *message,
00069 xmlParserSeverities severity,
00070 xmlTextReaderLocatorPtr locator);
00071
00072
00073 int oval_parser_boolean(const char *, int);
00074
00075 int oval_parser_boolean_attribute(xmlTextReaderPtr reader, char *attname,
00076 int defval);
00077
00078 int oval_parser_int_attribute(xmlTextReaderPtr reader, char *attname,
00079 int defval);
00080
00081 int oval_parser_skip_tag(xmlTextReaderPtr reader,
00082 struct oval_parser_context *context);
00083
00084 typedef void (*oval_xml_value_consumer) (char *, void *);
00085
00086 int oval_parser_text_value(xmlTextReaderPtr reader,
00087 struct oval_parser_context *context,
00088 oval_xml_value_consumer, void *);
00089
00090 typedef int (*oval_xml_tag_parser) (xmlTextReaderPtr,
00091 struct oval_parser_context *, void *);
00092
00093 int oval_parser_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00094 oval_xml_tag_parser, void *);
00095
00096 void oval_text_consumer(char *text, void *user);
00097
00098 OSCAP_HIDDEN_END;
00099
00100 #endif