00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef OVAL_RESULTS_H_
00031 #define OVAL_RESULTS_H_
00032
00033 #include "oval_definitions.h"
00034 #include "oval_system_characteristics.h"
00035 #include <stdbool.h>
00042 typedef enum {
00043 OVAL_RESULT_INVALID = 0,
00044 OVAL_RESULT_TRUE = 1,
00045 OVAL_RESULT_FALSE = 2,
00046 OVAL_RESULT_UNKNOWN = 3,
00047 OVAL_RESULT_ERROR = 4,
00048 OVAL_RESULT_NOT_EVALUATED = 5,
00049 OVAL_RESULT_NOT_APPLICABLE = 6
00050 } oval_result_t;
00051
00052 typedef enum {
00053 OVAL_DIRECTIVE_CONTENT_UNKNOWN = 0,
00054 OVAL_DIRECTIVE_CONTENT_THIN = 1,
00055 OVAL_DIRECTIVE_CONTENT_FULL = 2
00056 } oval_result_directive_content_t;
00108 struct oval_result_definition;
00113 struct oval_result_definition_iterator;
00145 struct oval_result_item;
00150 struct oval_result_item_iterator;
00182 struct oval_result_test;
00187 struct oval_result_test_iterator;
00219 struct oval_result_criteria_node;
00224 struct oval_result_criteria_node_iterator;
00256 struct oval_result_directives;
00288 struct oval_result_system;
00293 struct oval_result_system_iterator;
00304 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
00305 struct oval_syschar_model **);
00310 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00316 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00323 void oval_results_model_lock(struct oval_results_model *result_model);
00324
00329 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00330
00336 void oval_results_model_free(struct oval_results_model *model);
00337
00343 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00344
00350 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00354 void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *);
00355
00364 struct oval_result_directives *oval_results_model_import
00365 (struct oval_results_model *, struct oscap_import_source *, void *);
00366
00371 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00376 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00382 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00383
00388 void oval_result_directives_free(struct oval_result_directives *);
00389
00396 int oval_results_model_export(struct oval_results_model *, struct oval_result_directives *,
00397 struct oscap_export_target *);
00401 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00405 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00409 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00413 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00417 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00421 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00425 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00429 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00433 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00437 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00441 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00445 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00449 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00453 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00457 int oval_result_definition_get_instance(struct oval_result_definition *);
00461 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00465 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00469 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00473 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00477 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00481 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00485 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00489 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00493 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00497 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00501 struct oval_sysdata *oval_result_item_get_sysdata(struct oval_result_item *);
00505 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00509 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00513 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00517 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00521 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00525 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00529 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00533 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00537 int oval_result_test_get_instance(struct oval_result_test *);
00541 struct oval_message *oval_result_test_get_message(struct oval_result_test *);
00545 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00549 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00553 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00557 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00561 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00565 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00569 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00573 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00577 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00581 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00585 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00589 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00593 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00597 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00601 void oval_result_directives_set_reported(struct oval_result_directives *, oval_result_t, bool);
00605 void oval_result_directives_set_content(struct oval_result_directives *, oval_result_t,
00606 oval_result_directive_content_t);
00610 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00615 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00621 bool oval_result_system_is_locked(struct oval_result_system *result_system);
00625 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00626 struct oval_result_system *old_system);
00630 void oval_result_system_free(struct oval_result_system *);
00634 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00639 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00645 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00649 struct oval_result_definition *oval_result_definition_clone
00650 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00654 void oval_result_definition_free(struct oval_result_definition *);
00658 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00663 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00669 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00673 struct oval_result_test *oval_result_test_clone
00674 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00678 void oval_result_test_free(struct oval_result_test *);
00682 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00687 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00693 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00697 struct oval_result_item *oval_result_item_clone
00698 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00702 void oval_result_item_free(struct oval_result_item *);
00706 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00710 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00714 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00718 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00722 void oval_result_test_set_message(struct oval_result_test *, struct oval_message *);
00726 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00730 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00734 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00735 int, ...);
00740 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00746 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00750 struct oval_result_criteria_node *oval_result_criteria_node_clone
00751 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00755 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00759 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00763 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00767 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00771 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00775 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00779 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00780
00781 const char *oval_result_get_text(oval_result_t);
00782
00788 #endif