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_INVALID = 0,
00055 OVAL_RESULT_TRUE = 1,
00056 OVAL_RESULT_FALSE = 2,
00057 OVAL_RESULT_UNKNOWN = 3,
00058 OVAL_RESULT_ERROR = 4,
00059 OVAL_RESULT_NOT_EVALUATED = 5,
00060 OVAL_RESULT_NOT_APPLICABLE = 6
00061 } oval_result_t;
00062
00067 typedef enum {
00068 OVAL_DIRECTIVE_CONTENT_UNKNOWN = 0,
00069 OVAL_DIRECTIVE_CONTENT_THIN = 1,
00070 OVAL_DIRECTIVE_CONTENT_FULL = 2
00071 } oval_result_directive_content_t;
00072
00073
00074 const char *oval_result_get_text(oval_result_t);
00075
00076
00077
00082 struct oval_results_model;
00083
00087 struct oval_result_system;
00092 struct oval_result_system_iterator;
00093
00097 struct oval_result_definition;
00102 struct oval_result_definition_iterator;
00103
00107 struct oval_result_test;
00112 struct oval_result_test_iterator;
00113
00117 struct oval_result_item;
00122 struct oval_result_item_iterator;
00123
00124
00128 struct oval_result_criteria_node;
00133 struct oval_result_criteria_node_iterator;
00134
00138 struct oval_result_directives;
00139
00140
00141
00142
00143
00144
00152 struct oval_result_directives *oval_results_model_import(struct oval_results_model *, struct oscap_import_source *);
00160 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
00161 struct oval_syschar_model **);
00167 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00173 void oval_results_model_free(struct oval_results_model *model);
00180 int oval_results_model_export(struct oval_results_model *, struct oval_result_directives *,
00181 struct oscap_export_target *);
00182
00190 void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *);
00197 void oval_results_model_lock(struct oval_results_model *result_model);
00209 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00210
00216 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00220 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00232 int oval_results_model_eval(struct oval_results_model *);
00241 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00252 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00257 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00258 struct oval_result_system *old_system);
00262 void oval_result_system_free(struct oval_result_system *);
00263
00271 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00275 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00285 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
00289 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, char *);
00293 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00297 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00301 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00305 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00309 bool oval_result_system_is_locked(struct oval_result_system *result_system);
00319 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00323 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00327 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00341 int oval_result_system_eval(struct oval_result_system *sys);
00351 oval_result_t oval_result_system_eval_definition(struct oval_result_system *sys, char *id);
00360 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00371 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00376 struct oval_result_definition *oval_result_definition_clone
00377 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00381 void oval_result_definition_free(struct oval_result_definition *);
00382
00390 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00394 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00398 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00402 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00412 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00416 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00420 int oval_result_definition_get_instance(struct oval_result_definition *);
00424 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
00428 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00432 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00436 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00440 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00450 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00454 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00458 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00473 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00484 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00489 struct oval_result_test *oval_result_test_clone
00490 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00494 void oval_result_test_free(struct oval_result_test *);
00495
00503 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00507 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00511 void oval_result_test_set_message(struct oval_result_test *, struct oval_message *);
00515 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00519 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00529 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00533 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00537 oval_result_t oval_result_test_eval(struct oval_result_test *);
00541 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00545 int oval_result_test_get_instance(struct oval_result_test *);
00549 struct oval_message *oval_result_test_get_message(struct oval_result_test *);
00553 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00557 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00562 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00572 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00576 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00580 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00595 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00606 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00611 struct oval_result_item *oval_result_item_clone
00612 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00616 void oval_result_item_free(struct oval_result_item *);
00617
00625 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00629 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00639 struct oval_sysdata *oval_result_item_get_sysdata(struct oval_result_item *);
00643 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00647 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00651 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00661 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00665 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00669 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00682 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00693 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00694 int, ...);
00699 struct oval_result_criteria_node *oval_result_criteria_node_clone
00700 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00704 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00705
00713 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00717 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00721 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00725 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00729 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00733 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00742 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00746 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
00750 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00754 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00758 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00762 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00766 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00770 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00774 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00784 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00788 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00792 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00811 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00821 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00826 void oval_result_directives_free(struct oval_result_directives *);
00827
00828
00836 void oval_result_directives_set_reported(struct oval_result_directives *, oval_result_t, bool);
00840 void oval_result_directives_set_content(struct oval_result_directives *, oval_result_t, oval_result_directive_content_t);
00850 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00854 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00858 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00868 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00882 #endif