00001
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef OVAL_RESULTS_H_
00043 #define OVAL_RESULTS_H_
00044
00045 #include "oval_types.h"
00046 #include "oval_system_characteristics.h"
00047 #include <stdbool.h>
00048
00053 typedef enum {
00054 OVAL_RESULT_TRUE = 1,
00055 OVAL_RESULT_FALSE = 2,
00056 OVAL_RESULT_UNKNOWN = 4,
00057 OVAL_RESULT_ERROR = 8,
00058 OVAL_RESULT_NOT_EVALUATED = 16,
00059 OVAL_RESULT_NOT_APPLICABLE = 32
00060 } oval_result_t;
00061
00066 typedef enum {
00067 OVAL_DIRECTIVE_CONTENT_UNKNOWN = 0,
00068 OVAL_DIRECTIVE_CONTENT_THIN = 1,
00069 OVAL_DIRECTIVE_CONTENT_FULL = 2
00070 } oval_result_directive_content_t;
00071
00072
00073 const char *oval_result_get_text(oval_result_t);
00074
00075
00076
00081 struct oval_results_model;
00082
00086 struct oval_result_system;
00091 struct oval_result_system_iterator;
00092
00096 struct oval_result_definition;
00101 struct oval_result_definition_iterator;
00102
00106 struct oval_result_test;
00111 struct oval_result_test_iterator;
00112
00116 struct oval_result_item;
00121 struct oval_result_item_iterator;
00122
00123
00127 struct oval_result_criteria_node;
00132 struct oval_result_criteria_node_iterator;
00133
00150 struct oval_result_directives;
00151
00152
00153
00154
00155
00163 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
00164 struct oval_syschar_model **);
00173 struct oval_result_directives *oval_results_model_import(struct oval_results_model *model, const char *file);
00179 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00185 void oval_results_model_free(struct oval_results_model *model);
00192 int oval_results_model_export(struct oval_results_model *, struct oval_result_directives *, const char *file);
00193
00201 void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *);
00208 void oval_results_model_lock(struct oval_results_model *result_model);
00220 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00221
00227 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00231 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00243 int oval_results_model_eval(struct oval_results_model *);
00252 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00263 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00268 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00269 struct oval_result_system *old_system);
00273 void oval_result_system_free(struct oval_result_system *);
00274
00282 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00286 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00296 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
00300 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
00304 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00308 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00312 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00316 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00320 bool oval_result_system_is_locked(struct oval_result_system *result_system);
00330 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00334 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00338 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00352 int oval_result_system_eval(struct oval_result_system *sys);
00362 oval_result_t oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
00371 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00382 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00387 struct oval_result_definition *oval_result_definition_clone
00388 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00392 void oval_result_definition_free(struct oval_result_definition *);
00393
00401 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00405 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00409 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00413 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00423 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00427 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00431 int oval_result_definition_get_instance(struct oval_result_definition *);
00435 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
00439 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00443 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00447 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00451 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00461 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00465 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00469 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00484 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00495 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00500 struct oval_result_test *oval_result_test_clone
00501 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00505 void oval_result_test_free(struct oval_result_test *);
00506
00514 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00518 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00522 void oval_result_test_set_message(struct oval_result_test *, struct oval_message *);
00526 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00530 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00540 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00544 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00548 oval_result_t oval_result_test_eval(struct oval_result_test *);
00552 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00556 int oval_result_test_get_instance(struct oval_result_test *);
00560 struct oval_message *oval_result_test_get_message(struct oval_result_test *);
00564 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00568 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00573 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00583 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00587 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00591 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00606 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00617 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00622 struct oval_result_item *oval_result_item_clone
00623 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00627 void oval_result_item_free(struct oval_result_item *);
00628
00636 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00640 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00650 struct oval_sysdata *oval_result_item_get_sysdata(struct oval_result_item *);
00654 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00658 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00662 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00672 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00676 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00680 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00693 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00704 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00705 int, ...);
00710 struct oval_result_criteria_node *oval_result_criteria_node_clone
00711 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00715 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00716
00724 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00728 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00732 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00736 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00740 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00744 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00753 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00757 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
00761 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00765 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00769 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00773 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00777 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00781 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00785 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00795 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00799 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00803 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00822 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00832 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00836 void oval_result_directives_free(struct oval_result_directives *);
00837
00838
00847 void oval_result_directives_set_reported(struct oval_result_directives *, int flag, bool val);
00852 void oval_result_directives_set_content(struct oval_result_directives *, int flag, oval_result_directive_content_t);
00862 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00866 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00870 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00880 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00894 #endif