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
00198 void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator);
00205 void oval_results_model_lock(struct oval_results_model *result_model);
00212 struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model);
00218 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00219
00225 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00229 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00241 int oval_results_model_eval(struct oval_results_model *);
00250 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00261 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00266 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00267 struct oval_result_system *old_system);
00271 void oval_result_system_free(struct oval_result_system *);
00272
00280 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00284 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00294 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
00298 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
00302 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00306 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00310 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00314 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00318 bool oval_result_system_is_locked(struct oval_result_system *result_system);
00328 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00332 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00336 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00350 int oval_result_system_eval(struct oval_result_system *sys);
00360 oval_result_t oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
00369 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00380 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00385 struct oval_result_definition *oval_result_definition_clone
00386 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00390 void oval_result_definition_free(struct oval_result_definition *);
00391
00399 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00403 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00407 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00411 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00421 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00425 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00429 int oval_result_definition_get_instance(struct oval_result_definition *);
00433 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
00437 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00441 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00445 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00449 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00459 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00463 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00467 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00482 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00493 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00498 struct oval_result_test *oval_result_test_clone
00499 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00503 void oval_result_test_free(struct oval_result_test *);
00504
00512 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00516 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00520 void oval_result_test_add_message(struct oval_result_test *, struct oval_message *);
00524 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00528 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00538 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00542 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00546 oval_result_t oval_result_test_eval(struct oval_result_test *);
00550 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00554 int oval_result_test_get_instance(struct oval_result_test *);
00558 struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *);
00562 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00566 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00571 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00581 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00585 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00589 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00604 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00615 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00620 struct oval_result_item *oval_result_item_clone
00621 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00625 void oval_result_item_free(struct oval_result_item *);
00626
00634 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00638 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00648 struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *);
00652 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00656 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00660 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00670 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00674 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00678 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00691 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00702 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00703 int, ...);
00708 struct oval_result_criteria_node *oval_result_criteria_node_clone
00709 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00713 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00714
00722 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00726 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00730 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00734 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00738 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00742 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00751 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00755 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
00759 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00763 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00767 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00771 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00775 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00779 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00783 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00793 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00797 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00801 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00820 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00830 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00834 void oval_result_directives_free(struct oval_result_directives *);
00835
00836
00845 void oval_result_directives_set_reported(struct oval_result_directives *, int flag, bool val);
00850 void oval_result_directives_set_content(struct oval_result_directives *, int flag, oval_result_directive_content_t);
00860 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00864 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00868 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00878 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00892 #endif