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
00153 struct oval_result_directives *oval_results_model_import
00154 (struct oval_results_model *, struct oscap_import_source *, void *);
00162 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
00163 struct oval_syschar_model **);
00169 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00175 void oval_results_model_free(struct oval_results_model *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 *);
00222 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00234 int oval_results_model_eval(struct oval_results_model *);
00243 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00254 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00259 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00260 struct oval_result_system *old_system);
00264 void oval_result_system_free(struct oval_result_system *);
00265
00273 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00277 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00287 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
00291 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, char *);
00295 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00299 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00303 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00307 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00311 bool oval_result_system_is_locked(struct oval_result_system *result_system);
00321 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00325 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00329 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00343 int oval_result_system_eval(struct oval_result_system *sys);
00353 oval_result_t oval_result_system_eval_definition(struct oval_result_system *sys, char *id);
00362 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00373 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00378 struct oval_result_definition *oval_result_definition_clone
00379 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00383 void oval_result_definition_free(struct oval_result_definition *);
00384
00392 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00396 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00400 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00404 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00414 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00418 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00422 int oval_result_definition_get_instance(struct oval_result_definition *);
00426 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
00430 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00434 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00438 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00442 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00452 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00456 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00460 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00475 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00486 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00491 struct oval_result_test *oval_result_test_clone
00492 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00496 void oval_result_test_free(struct oval_result_test *);
00497
00505 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00509 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00513 void oval_result_test_set_message(struct oval_result_test *, struct oval_message *);
00517 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00521 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00531 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00535 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00539 oval_result_t oval_result_test_eval(struct oval_result_test *);
00543 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00547 int oval_result_test_get_instance(struct oval_result_test *);
00551 struct oval_message *oval_result_test_get_message(struct oval_result_test *);
00555 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00559 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00564 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00574 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00578 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00582 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00597 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00608 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00613 struct oval_result_item *oval_result_item_clone
00614 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00618 void oval_result_item_free(struct oval_result_item *);
00619
00627 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00631 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00641 struct oval_sysdata *oval_result_item_get_sysdata(struct oval_result_item *);
00645 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00649 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00653 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00663 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00667 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00671 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00684 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00695 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00696 int, ...);
00701 struct oval_result_criteria_node *oval_result_criteria_node_clone
00702 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00706 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00707
00715 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00719 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00723 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00727 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00731 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00735 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00744 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00748 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
00752 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00756 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00760 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00764 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00768 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00772 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00776 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00786 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00790 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00794 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00813 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00823 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00828 void oval_result_directives_free(struct oval_result_directives *);
00829
00830
00838 void oval_result_directives_set_reported(struct oval_result_directives *, oval_result_t, bool);
00842 void oval_result_directives_set_content(struct oval_result_directives *, oval_result_t, oval_result_directive_content_t);
00852 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00856 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00860 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00870 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00884 #endif