00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef OVAL_DEFINITIONS_IMPL
00032 #define OVAL_DEFINITIONS_IMPL
00033
00034 #include <libxml/xmlreader.h>
00035 #include "api/oval_definitions.h"
00036 #include "oval_parser_impl.h"
00037
00038 oval_family_enum oval_family_parse(xmlTextReaderPtr);
00039 oval_subtype_enum oval_subtype_parse(xmlTextReaderPtr);
00040 oval_affected_family_enum oval_affected_family_parse(xmlTextReaderPtr);
00041 oval_operator_enum oval_operator_parse(xmlTextReaderPtr, char *,
00042 oval_operator_enum);
00043 oval_operation_enum oval_operation_parse(xmlTextReaderPtr, char *,
00044 oval_operation_enum);
00045 oval_definition_class_enum oval_definition_class_parse(xmlTextReaderPtr);
00046 oval_existence_enum oval_existence_parse(xmlTextReaderPtr, char *,
00047 oval_existence_enum);
00048 oval_check_enum oval_check_parse(xmlTextReaderPtr, char *, oval_check_enum);
00049 oval_entity_type_enum oval_entity_type_parse(xmlTextReaderPtr);
00050 oval_datatype_enum oval_datatype_parse(xmlTextReaderPtr, char *,
00051 oval_datatype_enum);
00052 oval_entity_varref_type_enum oval_entity_varref_type_parse(xmlTextReaderPtr);
00053 oval_set_type_enum oval_set_type_parse(xmlTextReaderPtr);
00054 oval_set_operation_enum oval_set_operation_parse(xmlTextReaderPtr, char *,
00055 oval_set_operation_enum);
00056 oval_variable_type_enum oval_variable_type_parse(xmlTextReaderPtr);
00057 oval_component_type_enum oval_component_type_parse(xmlTextReaderPtr);
00058 oval_arithmetic_operation_enum oval_arithmetic_operation_parse(xmlTextReaderPtr,
00059 char *,
00060 oval_arithmetic_operation_enum);
00061 oval_datetime_format_enum oval_datetime_format_parse(xmlTextReaderPtr, char *,
00062 oval_arithmetic_operation_enum);
00063
00064 struct oval_affected *oval_affected_new();
00065 void oval_affected_free(struct oval_affected *);
00066
00067 void set_oval_affected_family(struct oval_affected *,
00068 oval_affected_family_enum);
00069 void add_oval_affected_platform(struct oval_affected *, char *);
00070 void add_oval_affected_product(struct oval_affected *, char *);
00071
00072 typedef void (*oval_affected_consumer) (struct oval_affected *, void *);
00073 int oval_affected_parse_tag(xmlTextReaderPtr reader,
00074 struct oval_parser_context *context,
00075 oval_affected_consumer, void *);
00076
00077 struct oval_test *oval_test_new();
00078 void oval_test_free(struct oval_test *);
00079
00080 void set_oval_test_family(struct oval_test *, oval_family_enum);
00081 void set_oval_test_subtype(struct oval_test *, oval_subtype_enum);
00082 void set_oval_test_comment(struct oval_test *, char *);
00083 void set_oval_test_id(struct oval_test *, char *);
00084 void set_oval_test_deprecated(struct oval_test *, int);
00085 void set_oval_test_version(struct oval_test *, int);
00086 void set_oval_test_existence(struct oval_test *, oval_existence_enum);
00087 void set_oval_test_check(struct oval_test *, oval_check_enum);
00088 void set_oval_test_object(struct oval_test *, struct oval_object *);
00089 void set_oval_test_state(struct oval_test *, struct oval_state *);
00090 void add_oval_test_notes(struct oval_test *, char *);
00091 int oval_test_parse_tag(xmlTextReaderPtr reader,
00092 struct oval_parser_context *context);
00093
00094 struct oval_criteria_node *oval_criteria_node_new(oval_criteria_node_type_enum);
00095 void oval_criteria_node_free(struct oval_criteria_node *);
00096
00097 void set_oval_criteria_node_type(struct oval_criteria_node *,
00098 oval_criteria_node_type_enum);
00099 void set_oval_criteria_node_negate(struct oval_criteria_node *, int);
00100 void set_oval_criteria_node_comment(struct oval_criteria_node *, char *);
00101 void set_oval_criteria_node_operator(struct oval_criteria_node *, oval_operator_enum);
00102 void add_oval_criteria_node_subnodes(struct oval_criteria_node *, struct oval_criteria_node *);
00103 void set_oval_criteria_node_test(struct oval_criteria_node *, struct oval_test *);
00104 void set_oval_criteria_node_definition(struct oval_criteria_node *, struct oval_definition *);
00105
00106 typedef void (*oval_criteria_consumer) (struct oval_criteria_node *, void *);
00107 int oval_criteria_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00108 oval_criteria_consumer, void *);
00109
00110 struct oval_reference *oval_reference_new();
00111 void oval_reference_free(struct oval_reference *);
00112
00113 void set_oval_reference_source(struct oval_reference *, char *);
00114 void set_oval_reference_id(struct oval_reference *, char *);
00115 void set_oval_reference_url(struct oval_reference *, char *);
00116
00117 typedef void (*oval_reference_consumer) (struct oval_reference *, void *);
00118 int oval_reference_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00119 oval_reference_consumer, void *);
00120
00121 struct oval_definition *oval_definition_new();
00122 void oval_definition_free(struct oval_definition *);
00123
00124 void set_oval_definition_id(struct oval_definition *, char *);
00125 void set_oval_definition_version(struct oval_definition *, int);
00126 void set_oval_definition_class(struct oval_definition *,
00127 oval_definition_class_enum);
00128 void set_oval_definition_deprecated(struct oval_definition *, int);
00129 void set_oval_definition_title(struct oval_definition *, char *);
00130 void set_oval_definition_description(struct oval_definition *, char *);
00131 void set_oval_definition_criteria(struct oval_definition *,
00132 struct oval_criteria_node *);
00133 void add_oval_definition_affected(struct oval_definition *,
00134 struct oval_affected *);
00135 void add_oval_definition_reference(struct oval_definition *,
00136 struct oval_reference *);
00137 int oval_definition_parse_tag(xmlTextReaderPtr reader,
00138 struct oval_parser_context *context);
00139
00140 struct oval_object *oval_object_new();
00141 void oval_object_free(struct oval_object *);
00142
00143 void set_oval_object_family(struct oval_object *, oval_family_enum);
00144 void set_oval_object_subtype(struct oval_object *, oval_subtype_enum);
00145 void set_oval_object_name(struct oval_object *, char *);
00146 void add_oval_object_notes(struct oval_object *, char *);
00147 void set_oval_object_comment(struct oval_object *, char *);
00148 void set_oval_object_id(struct oval_object *, char *);
00149 void set_oval_object_deprecated(struct oval_object *, int);
00150 void set_oval_object_version(struct oval_object *, int);
00151 void add_oval_object_object_content(struct oval_object *,
00152 struct oval_object_content *);
00153 void add_oval_object_behaviors(struct oval_object *, struct oval_behavior *);
00154 int oval_object_parse_tag(xmlTextReaderPtr reader,
00155 struct oval_parser_context *context);
00156
00157 struct oval_state *oval_state_new();
00158 void oval_state_free(struct oval_state *);
00159
00160 void set_oval_state_family(struct oval_state *, oval_family_enum);
00161 void set_oval_state_subtype(struct oval_state *, oval_subtype_enum);
00162 void set_oval_state_name(struct oval_state *, char *);
00163 void add_oval_state_notes(struct oval_state *, char *);
00164 void set_oval_state_comment(struct oval_state *, char *);
00165 void set_oval_state_id(struct oval_state *, char *);
00166 void set_oval_state_deprecated(struct oval_state *, int);
00167 void set_oval_state_version(struct oval_state *, int);
00168 int oval_state_parse_tag(xmlTextReaderPtr reader,
00169 struct oval_parser_context *context);
00170
00171 struct oval_variable *oval_variable_new();
00172 void oval_variable_free(struct oval_variable *);
00173
00174 void set_oval_variable_id(struct oval_variable *, char *);
00175 void set_oval_variable_type(struct oval_variable *, oval_variable_type_enum);
00176 void set_oval_variable_datatype(struct oval_variable *, oval_datatype_enum);
00177 void add_oval_variable_values(struct oval_variable *, struct oval_value *);
00178 void set_oval_variable_component(struct oval_variable *, struct oval_component *);
00179 int oval_variable_parse_tag(xmlTextReaderPtr reader,
00180 struct oval_parser_context *context);
00181
00182 struct oval_variable_binding *oval_variable_binding_new();
00183 void oval_variable_binding_free(struct oval_variable_binding *);
00184
00185 void set_oval_variable_binding_variable(struct oval_variable_binding *,
00186 struct oval_variable *);
00187 void set_oval_variable_binding_value(struct oval_variable_binding *, char *);
00188
00189 struct oval_object_content
00190 *oval_object_content_new(oval_object_content_type_enum type);
00191 void oval_object_content_free(struct oval_object_content *);
00192
00193 void set_oval_object_content_field_name(struct oval_object_content *, char *);
00194 void set_oval_object_content_entity(struct oval_object_content *, struct oval_entity *);
00195 void set_oval_object_content_varCheck(struct oval_object_content *, oval_check_enum);
00196 void set_oval_object_content_set(struct oval_object_content *, struct oval_set *);
00197 typedef void (*oval_object_content_consumer) (struct oval_object_content *,
00198 void *);
00199 int oval_object_content_parse_tag(xmlTextReaderPtr,
00200 struct oval_parser_context *,
00201 oval_object_content_consumer, void *);
00202
00203 struct oval_behavior *oval_behavior_new();
00204 void oval_behavior_free(struct oval_behavior *);
00205
00206 void set_oval_behavior_value(struct oval_behavior *, struct oval_value *);
00207 void set_oval_behavior_value_for_key(struct oval_behavior *,
00208 struct oval_value *, char *attribute_key);
00209 typedef void (*oval_behavior_consumer) (struct oval_behavior *, void *);
00210 int oval_behavior_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00211 oval_family_enum, oval_behavior_consumer, void *);
00212
00213 struct oval_entity *oval_entity_new();
00214 void oval_entity_free(struct oval_entity *);
00215
00216 void set_oval_entity_type(struct oval_entity *, oval_entity_type_enum);
00217 void set_oval_entity_datatype(struct oval_entity *, oval_datatype_enum);
00218 void set_oval_entity_operator(struct oval_entity *, oval_operator_enum);
00219 void set_oval_entity_mask(struct oval_entity *, int);
00220 void set_oval_entity_varref_type(struct oval_entity *,
00221 oval_entity_varref_type_enum);
00222 void set_oval_entity_variable(struct oval_entity *, struct oval_variable *);
00223 void set_oval_entity_value(struct oval_entity *, struct oval_value *);
00224
00225 typedef void (*oval_entity_consumer) (struct oval_entity *, void *);
00226 int oval_entity_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00227 oval_entity_consumer, void *);
00228
00229 struct oval_set *oval_set_new();
00230 void oval_set_free(struct oval_set *);
00231
00232 void set_oval_set_type(struct oval_set *, oval_set_type_enum);
00233 void set_oval_set_operation(struct oval_set *, oval_set_operation_enum);
00234 void add_oval_set_subsets(struct oval_set *, struct oval_set *);
00235 void add_oval_set_objects(struct oval_set *, struct oval_object *);
00236 void add_oval_set_filters(struct oval_set *, struct oval_state *);
00237 typedef void (*oval_set_consumer) (struct oval_set *, void *);
00238 int oval_set_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00239 oval_set_consumer, void *);
00240
00241 struct oval_value *oval_value_new();
00242 void oval_value_free(struct oval_value *);
00243
00244 void set_oval_value_datatype(struct oval_value *, oval_datatype_enum);
00245 void set_oval_value_text(struct oval_value *, char *);
00246 void set_oval_value_binary(struct oval_value *, unsigned char *);
00247 void set_oval_value_boolean(struct oval_value *, int);
00248 void set_oval_value_float(struct oval_value *, float);
00249 void set_oval_value_integer(struct oval_value *, long);
00250
00251 typedef void (*oval_value_consumer) (struct oval_value *, void *);
00252 int oval_value_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00253 oval_value_consumer, void *);
00254
00255 struct oval_component *oval_component_new(oval_component_type_enum);
00256 void oval_component_free(struct oval_component *);
00257
00258 void set_oval_component_type(struct oval_component *, oval_component_type_enum);
00259 void set_oval_component_literal_value(struct oval_component *, struct oval_value *);
00260 void set_oval_component_object(struct oval_component *, struct oval_object *);
00261 void set_oval_component_object_field(struct oval_component *, char *);
00262 void set_oval_component_variable(struct oval_component *, struct oval_variable *);
00263 void add_oval_component_function_components(struct oval_component *, struct oval_component *);
00264 typedef void (*oval_component_consumer) (struct oval_component *, void *);
00265 int oval_component_parse_tag(xmlTextReaderPtr, struct oval_parser_context *,
00266 oval_component_consumer, void *);
00267 #endif