00001 #ifndef OVAL_DEFINITIONS_IMPL
00002 #define OVAL_DEFINITIONS_IMPL
00003 #include <liboval/oval_definitions.h>
00004 #include <libxml/xmlreader.h>
00005 #include "oval_parser_impl.h"
00006
00007 oval_family_enum oval_family_parse (xmlTextReaderPtr);
00008 oval_subtype_enum oval_subtype_parse (xmlTextReaderPtr);
00009 oval_affected_family_enum oval_affected_family_parse (xmlTextReaderPtr);
00010 oval_operator_enum oval_operator_parse (xmlTextReaderPtr);
00011 oval_definition_class_enum oval_definition_class_parse (xmlTextReaderPtr);
00012 oval_existence_enum oval_existence_parse (xmlTextReaderPtr);
00013 oval_check_enum oval_check_parse (xmlTextReaderPtr,char*);
00014 oval_entity_type_enum oval_entity_type_parse (xmlTextReaderPtr);
00015 oval_datatype_enum oval_datatype_parse (xmlTextReaderPtr);
00016 oval_entity_varref_type_enum oval_entity_varref_type_parse(xmlTextReaderPtr);
00017 oval_set_type_enum oval_set_type_parse (xmlTextReaderPtr);
00018 oval_set_operation_enum oval_set_operation_parse (xmlTextReaderPtr);
00019 oval_variable_type_enum oval_variable_type_parse (xmlTextReaderPtr);
00020 oval_component_type_enum oval_component_type_parse (xmlTextReaderPtr);
00021 oval_function_type_enum oval_function_type_parse (xmlTextReaderPtr);
00022
00023
00024 struct oval_affected_s *oval_affected_new();
00025 void oval_affected_free(struct oval_affected_s*);
00026
00027 void set_oval_affected_family (struct oval_affected_s*, oval_affected_family_enum);
00028 void add_oval_affected_platform(struct oval_affected_s*, char*);
00029 void add_oval_affected_product (struct oval_affected_s*, char*);
00030
00031 typedef void (*oval_affected_consumer)(struct oval_affected_s*, void*);
00032 int oval_affected_parse_tag (xmlTextReaderPtr reader, struct oval_parser_context_s *context, oval_affected_consumer, void*);
00033
00034 struct oval_test_s *oval_test_new();
00035 void oval_test_free(struct oval_test_s*);
00036
00037 void set_oval_test_family (struct oval_test_s*, oval_family_enum);
00038 void set_oval_test_subtype (struct oval_test_s*, oval_subtype_enum);
00039 void set_oval_test_comment (struct oval_test_s*, char*);
00040 void set_oval_test_id (struct oval_test_s*, char*);
00041 void set_oval_test_deprecated(struct oval_test_s*, int);
00042 void set_oval_test_version (struct oval_test_s*, int);
00043 void set_oval_test_existence (struct oval_test_s*, oval_existence_enum);
00044 void set_oval_test_check (struct oval_test_s*, oval_check_enum);
00045 void set_oval_test_object (struct oval_test_s*, struct oval_object_s*);
00046 void set_oval_test_state (struct oval_test_s*, struct oval_state_s*);
00047 void add_oval_test_notes (struct oval_test_s*, char*);
00048 int oval_test_parse_tag (xmlTextReaderPtr reader, struct oval_parser_context_s *context);
00049
00050 struct oval_criteria_node_s *oval_criteria_node_new(oval_criteria_node_type_enum);
00051 void oval_criteria_node_free(struct oval_criteria_node_s*);
00052
00053 void set_oval_criteria_node_type (struct oval_criteria_node_s*, oval_criteria_node_type_enum);
00054 void set_oval_criteria_node_negate (struct oval_criteria_node_s*, int);
00055 void set_oval_criteria_node_comment (struct oval_criteria_node_s*, char*);
00056 void set_oval_criteria_node_operator (struct oval_criteria_node_s*, oval_operator_enum);
00057 void add_oval_criteria_node_subnodes (struct oval_criteria_node_s*, struct oval_criteria_node_s*);
00058 void set_oval_criteria_node_test (struct oval_criteria_node_s*, struct oval_test_s*);
00059 void set_oval_criteria_node_definition(struct oval_criteria_node_s*, struct oval_definition_s*);
00060
00061 typedef void (*oval_criteria_consumer)(struct oval_criteria_node_s*, void*);
00062 int oval_criteria_parse_tag (xmlTextReaderPtr, struct oval_parser_context_s*, oval_criteria_consumer, void*);
00063
00064 struct oval_reference_s *oval_reference_new();
00065 void oval_reference_free(struct oval_reference_s*);
00066
00067 void set_oval_reference_source(struct oval_reference_s*, char*);
00068 void set_oval_reference_id (struct oval_reference_s*, char*);
00069 void set_oval_reference_url (struct oval_reference_s*, char*);
00070
00071 struct oval_definition_s *oval_definition_new();
00072 void oval_definition_free(struct oval_definition_s*);
00073
00074 void set_oval_definition_id (struct oval_definition_s*, char*);
00075 void set_oval_definition_version (struct oval_definition_s*, int);
00076 void set_oval_definition_class (struct oval_definition_s*, oval_definition_class_enum);
00077 void set_oval_definition_deprecated (struct oval_definition_s*, int);
00078 void set_oval_definition_title (struct oval_definition_s*, char*);
00079 void set_oval_definition_description(struct oval_definition_s*, char*);
00080 void set_oval_definition_criteria (struct oval_definition_s*, struct oval_criteria_node_s*);
00081 void add_oval_definition_affected (struct oval_definition_s*, struct oval_affected_s*);
00082 void add_oval_definition_reference (struct oval_definition_s*, struct oval_reference_s*);
00083 int oval_definition_parse_tag (xmlTextReaderPtr reader, struct oval_parser_context_s *context);
00084
00085 struct oval_object_s *oval_object_new();
00086 void oval_object_free(struct oval_object_s*);
00087
00088 void set_oval_object_family (struct oval_object_s*, oval_family_enum);
00089 void set_oval_object_subtype (struct oval_object_s*, oval_subtype_enum);
00090 void set_oval_object_name (struct oval_object_s*, char*);
00091 void add_oval_object_notes (struct oval_object_s*, char*);
00092 void set_oval_object_comment (struct oval_object_s*, char*);
00093 void set_oval_object_id (struct oval_object_s*, char*);
00094 void set_oval_object_deprecated (struct oval_object_s*, int);
00095 void set_oval_object_version (struct oval_object_s*, int);
00096 void add_oval_object_object_content(struct oval_object_s*, struct oval_object_content_s*);
00097 void add_oval_object_behaviors (struct oval_object_s*, struct oval_behavior_s*);
00098 int oval_object_parse_tag (xmlTextReaderPtr reader, struct oval_parser_context_s *context);
00099
00100 struct oval_state_s *oval_state_new();
00101 void oval_state_free(struct oval_state_s*);
00102
00103 void set_oval_state_family (struct oval_state_s*, oval_family_enum);
00104 void set_oval_state_subtype (struct oval_state_s*, oval_subtype_enum);
00105 void set_oval_state_name (struct oval_state_s*, char*);
00106 void add_oval_state_notes (struct oval_state_s*, char*);
00107 void set_oval_state_comment (struct oval_state_s*, char*);
00108 void set_oval_state_id (struct oval_state_s*, char*);
00109 void set_oval_state_deprecated(struct oval_state_s*, int);
00110 void set_oval_state_version (struct oval_state_s*, int);
00111
00112 struct oval_variable_s *oval_variable_new();
00113 void oval_variable_free(struct oval_variable_s*);
00114
00115 void set_oval_variable_id (struct oval_variable_s*, char*);
00116 void set_oval_variable_type (struct oval_variable_s*, oval_variable_type_enum);
00117 void set_oval_variable_datatype (struct oval_variable_s*, oval_datatype_enum);
00118 void add_oval_variable_values (struct oval_variable_s*, struct oval_value_s*);
00119 void set_oval_variable_component(struct oval_variable_s*, struct oval_component_s*);
00120
00121 struct oval_variable_binding_s *oval_variable_binding_new();
00122 void oval_variable_binding_free(struct oval_variable_binding_s*);
00123
00124 void set_oval_variable_binding_variable(struct oval_variable_binding_s*, struct oval_variable_s*);
00125 void set_oval_variable_binding_value (struct oval_variable_binding_s*, char*);
00126
00127 struct oval_object_content_s *oval_object_content_new(oval_object_content_type_enum type);
00128 void oval_object_content_free(struct oval_object_content_s*);
00129
00130 void set_oval_object_content_field_name(struct oval_object_content_s*, char*);
00131 void set_oval_object_content_entity (struct oval_object_content_s*, struct oval_entity_s*);
00132 void set_oval_object_content_varCheck (struct oval_object_content_s*, oval_check_enum);
00133 void set_oval_object_content_set (struct oval_object_content_s*, struct oval_set_s*);
00134 typedef void (*oval_object_content_consumer)(struct oval_object_content_s*,void*);
00135 int oval_object_content_parse_tag(xmlTextReaderPtr, struct oval_parser_context_s*, oval_object_content_consumer, void*);
00136
00137 struct oval_behavior_s *oval_behavior_new();
00138 void oval_behavior_free(struct oval_behavior_s*);
00139
00140 void set_oval_behavior_value (struct oval_behavior_s*, struct oval_value_s*);
00141 void set_oval_behavior_value_for_key (struct oval_behavior_s*, struct oval_value_s*, char *attribute_key);
00142
00143 struct oval_entity_s *oval_entity_new();
00144 void oval_entity_free(struct oval_entity_s*);
00145
00146 void set_oval_entity_type (struct oval_entity_s*, oval_entity_type_enum);
00147 void set_oval_entity_datatype (struct oval_entity_s*, oval_datatype_enum);
00148 void set_oval_entity_operator (struct oval_entity_s*, oval_operator_enum);
00149 void set_oval_entity_mask (struct oval_entity_s*, int);
00150 void set_oval_entity_varref_type(struct oval_entity_s*, oval_entity_varref_type_enum);
00151 void set_oval_entity_variable (struct oval_entity_s*, struct oval_variable_s*);
00152 void set_oval_entity_value (struct oval_entity_s*, struct oval_value_s*);
00153
00154 typedef void (*oval_entity_consumer)(struct oval_entity_node_s*, void*);
00155 int oval_entity_parse_tag (xmlTextReaderPtr, struct oval_parser_context_s*, oval_entity_consumer, void*);
00156
00157
00158 struct oval_set_s *oval_set_new(oval_set_type_enum);
00159 void oval_set_free(struct oval_set_s*);
00160
00161 void set_oval_set_type (struct oval_set_s*, oval_set_type_enum);
00162 void set_oval_set_operation(struct oval_set_s*, oval_set_operation_enum);
00163 void add_oval_set_subsets (struct oval_set_s*, struct oval_set_s*);
00164 void add_oval_set_objects (struct oval_set_s*, struct oval_object_s*);
00165 void add_oval_set_filters (struct oval_set_s*, struct oval_state_s*);
00166
00167 struct oval_value_s *oval_value_new();
00168 void oval_value_free(struct oval_value_s*);
00169
00170 void set_oval_value_datatype(struct oval_value_s*, oval_datatype_enum);
00171 void set_oval_value_text (struct oval_value_s*, char*);
00172 void set_oval_value_binary (struct oval_value_s*, unsigned char*);
00173 void set_oval_value_boolean (struct oval_value_s*, int);
00174 void set_oval_value_float (struct oval_value_s*, float);
00175 void set_oval_value_integer (struct oval_value_s*, long);
00176
00177 struct oval_component_s *oval_component_new(oval_component_type_enum);
00178 void oval_component_free(struct oval_component_s*);
00179
00180 void set_oval_component_type (struct oval_component_s*, oval_component_type_enum);
00181 void set_oval_component_literal_value (struct oval_component_s*, struct oval_value_s*);
00182 void set_oval_component_object (struct oval_component_s*, struct oval_object_s*);
00183 void set_oval_component_object_field (struct oval_component_s*, char*);
00184 void set_oval_component_variable (struct oval_component_s*, struct oval_variable_s*);
00185 void set_oval_component_function_type (struct oval_component_s*, oval_function_type_enum);
00186 void add_oval_component_function_components(struct oval_component_s*, struct oval_component_s*);
00187 void set_oval_component_function_keys (struct oval_component_s*, char*);
00188 #endif