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 **);
00162 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00168 void oval_results_model_free(struct oval_results_model *model);
00175 int oval_results_model_export(struct oval_results_model *, struct oval_result_directives *,
00176 struct oscap_export_target *);
00177
00185 void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *);
00192 void oval_results_model_lock(struct oval_results_model *result_model);
00204 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00205
00211 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00217 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00228 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00239 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00243 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00244 struct oval_result_system *old_system);
00248 void oval_result_system_free(struct oval_result_system *);
00249
00257 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00261 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00271 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00275 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00279 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00283 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00289 bool oval_result_system_is_locked(struct oval_result_system *result_system);
00299 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00303 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00307 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00318 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00329 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00333 struct oval_result_definition *oval_result_definition_clone
00334 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00338 void oval_result_definition_free(struct oval_result_definition *);
00339
00347 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00351 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00355 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00359 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00369 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00373 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00377 int oval_result_definition_get_instance(struct oval_result_definition *);
00381 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00385 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00389 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00395 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00405 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00409 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00413 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00424 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00435 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00439 struct oval_result_test *oval_result_test_clone
00440 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00444 void oval_result_test_free(struct oval_result_test *);
00445
00453 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00457 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00461 void oval_result_test_set_message(struct oval_result_test *, struct oval_message *);
00465 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00469 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00479 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00483 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00487 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00491 int oval_result_test_get_instance(struct oval_result_test *);
00495 struct oval_message *oval_result_test_get_message(struct oval_result_test *);
00499 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00503 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00508 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00518 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00522 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00526 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00537 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00548 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00552 struct oval_result_item *oval_result_item_clone
00553 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00557 void oval_result_item_free(struct oval_result_item *);
00558
00566 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00570 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00580 struct oval_sysdata *oval_result_item_get_sysdata(struct oval_result_item *);
00584 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00588 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00594 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00604 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00608 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00612 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00623 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00634 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00635 int, ...);
00639 struct oval_result_criteria_node *oval_result_criteria_node_clone
00640 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00644 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00645
00653 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00657 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00661 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00665 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00669 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00673 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00682 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00686 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00690 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00694 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00698 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00702 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00706 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00712 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00722 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00726 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00730 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00741 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00751 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00756 void oval_result_directives_free(struct oval_result_directives *);
00757
00758
00766 void oval_result_directives_set_reported(struct oval_result_directives *, oval_result_t, bool);
00770 void oval_result_directives_set_content(struct oval_result_directives *, oval_result_t, oval_result_directive_content_t);
00780 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00784 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00790 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00801 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00815 #endif