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
00049
00050 typedef enum {
00051 OVAL_RESULT_INVALID = 0,
00052 OVAL_RESULT_TRUE = 1,
00053 OVAL_RESULT_FALSE = 2,
00054 OVAL_RESULT_UNKNOWN = 3,
00055 OVAL_RESULT_ERROR = 4,
00056 OVAL_RESULT_NOT_EVALUATED = 5,
00057 OVAL_RESULT_NOT_APPLICABLE = 6
00058 } oval_result_t;
00059
00060 typedef enum {
00061 OVAL_DIRECTIVE_CONTENT_UNKNOWN = 0,
00062 OVAL_DIRECTIVE_CONTENT_THIN = 1,
00063 OVAL_DIRECTIVE_CONTENT_FULL = 2
00064 } oval_result_directive_content_t;
00065
00066
00067 const char *oval_result_get_text(oval_result_t);
00068
00069
00070
00076 struct oval_results_model;
00077
00081 struct oval_result_system;
00086 struct oval_result_system_iterator;
00087
00091 struct oval_result_definition;
00096 struct oval_result_definition_iterator;
00097
00101 struct oval_result_test;
00106 struct oval_result_test_iterator;
00107
00111 struct oval_result_item;
00116 struct oval_result_item_iterator;
00117
00118
00122 struct oval_result_criteria_node;
00127 struct oval_result_criteria_node_iterator;
00128
00132 struct oval_result_directives;
00133
00134
00135
00136
00137
00138
00147 struct oval_result_directives *oval_results_model_import
00148 (struct oval_results_model *, struct oscap_import_source *, void *);
00156 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
00157 struct oval_syschar_model **);
00163 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00169 void oval_results_model_free(struct oval_results_model *model);
00175 void oval_results_model_eval(struct oval_results_model *);
00182 int oval_results_model_export(struct oval_results_model *, struct oval_result_directives *,
00183 struct oscap_export_target *);
00184
00192 void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *);
00199 void oval_results_model_lock(struct oval_results_model *result_model);
00211 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00212
00218 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00224 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00235 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00246 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00251 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00252 struct oval_result_system *old_system);
00256 void oval_result_system_free(struct oval_result_system *);
00260 void oval_result_system_eval(struct oval_result_system *);
00261
00269 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00273 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00283 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
00287 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, char *);
00291 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00295 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00299 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00303 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 *);
00338 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00349 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00354 struct oval_result_definition *oval_result_definition_clone
00355 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00359 void oval_result_definition_free(struct oval_result_definition *);
00360
00368 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00372 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00376 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00380 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00390 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00394 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00398 int oval_result_definition_get_instance(struct oval_result_definition *);
00402 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
00406 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00410 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00414 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00420 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00430 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00434 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00438 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00449 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00460 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00465 struct oval_result_test *oval_result_test_clone
00466 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00470 void oval_result_test_free(struct oval_result_test *);
00471
00479 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00483 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00487 void oval_result_test_set_message(struct oval_result_test *, struct oval_message *);
00491 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00495 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00505 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00509 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00513 oval_result_t oval_result_test_eval(struct oval_result_test *);
00517 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00521 int oval_result_test_get_instance(struct oval_result_test *);
00525 struct oval_message *oval_result_test_get_message(struct oval_result_test *);
00529 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00533 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00538 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00548 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00552 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00556 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00567 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00578 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00583 struct oval_result_item *oval_result_item_clone
00584 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00588 void oval_result_item_free(struct oval_result_item *);
00589
00597 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00601 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00611 struct oval_sysdata *oval_result_item_get_sysdata(struct oval_result_item *);
00615 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00619 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00625 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00635 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00639 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00643 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00654 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00665 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00666 int, ...);
00671 struct oval_result_criteria_node *oval_result_criteria_node_clone
00672 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00676 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00677
00685 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00689 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00693 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00697 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00701 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00705 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00714 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00718 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
00722 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00726 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00730 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00734 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00738 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00742 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00748 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00758 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00762 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00766 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00777 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00787 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00792 void oval_result_directives_free(struct oval_result_directives *);
00793
00794
00802 void oval_result_directives_set_reported(struct oval_result_directives *, oval_result_t, bool);
00806 void oval_result_directives_set_content(struct oval_result_directives *, oval_result_t, oval_result_directive_content_t);
00816 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00820 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00826 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00837 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00851 #endif