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
00043 #ifndef OVAL_RESULTS_H_
00044 #define OVAL_RESULTS_H_
00045
00046 #include "oval_types.h"
00047 #include "oval_system_characteristics.h"
00048 #include "oval_directives.h"
00049 #include <stdbool.h>
00050
00051
00052 const char *oval_result_get_text(oval_result_t);
00053
00058 struct oval_results_model;
00059
00063 struct oval_result_system;
00068 struct oval_result_system_iterator;
00069
00073 struct oval_result_definition;
00078 struct oval_result_definition_iterator;
00079
00083 struct oval_result_test;
00088 struct oval_result_test_iterator;
00089
00093 struct oval_result_item;
00098 struct oval_result_item_iterator;
00099
00100
00104 struct oval_result_criteria_node;
00109 struct oval_result_criteria_node_iterator;
00110
00118 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
00119 struct oval_syschar_model **);
00128 int oval_results_model_import(struct oval_results_model *model, const char *file);
00134 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00140 void oval_results_model_free(struct oval_results_model *model);
00148 int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file);
00149
00154 void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator);
00161 struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model);
00167 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00168
00174 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00186 int oval_results_model_eval(struct oval_results_model *);
00197 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00202 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00203 struct oval_result_system *old_system);
00207 void oval_result_system_free(struct oval_result_system *);
00208
00216 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00220 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00230 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
00234 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
00238 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00242 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00246 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00250 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00260 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00264 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00268 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00282 int oval_result_system_eval(struct oval_result_system *sys);
00291 int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
00302 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00307 struct oval_result_definition *oval_result_definition_clone
00308 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00312 void oval_result_definition_free(struct oval_result_definition *);
00313
00321 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00325 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00329 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00333 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00343 struct oval_definition *oval_result_definition_get_definition(const struct oval_result_definition *);
00348 const char *oval_result_definition_get_id(const struct oval_result_definition *rslt_definition);
00352 struct oval_result_system *oval_result_definition_get_system(const struct oval_result_definition *);
00356 int oval_result_definition_get_instance(const struct oval_result_definition *);
00360 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
00364 oval_result_t oval_result_definition_get_result(const struct oval_result_definition *);
00368 struct oval_message_iterator *oval_result_definition_get_messages(const struct oval_result_definition *);
00372 struct oval_result_criteria_node *oval_result_definition_get_criteria(const struct oval_result_definition *);
00382 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00386 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00390 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00407 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00412 struct oval_result_test *oval_result_test_clone
00413 (struct oval_result_system *new_system, struct oval_result_test *old_test);
00417 void oval_result_test_free(struct oval_result_test *);
00418
00426 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00430 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00434 void oval_result_test_add_message(struct oval_result_test *, struct oval_message *);
00438 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00442 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00452 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00456 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00460 oval_result_t oval_result_test_eval(struct oval_result_test *);
00464 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00468 int oval_result_test_get_instance(struct oval_result_test *);
00472 struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *);
00476 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00480 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00490 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00494 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00498 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00515 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00520 struct oval_result_item *oval_result_item_clone
00521 (struct oval_result_system *new_system, struct oval_result_item *old_item);
00525 void oval_result_item_free(struct oval_result_item *);
00526
00534 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00538 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00548 struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *);
00552 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00556 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00566 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00570 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00574 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00591 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *,
00592 oval_criteria_node_type_t,
00593 int, int, ...);
00598 struct oval_result_criteria_node *oval_result_criteria_node_clone
00599 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00603 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00604
00612 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00616 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00620 void oval_result_criteria_node_set_applicability_check(struct oval_result_criteria_node *, bool);
00624 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);
00628 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);
00632 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *);
00636 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);
00645 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00649 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
00653 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00657 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00661 bool oval_result_criteria_node_get_applicability_check(struct oval_result_criteria_node *);
00665 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);
00669 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);
00673 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);
00677 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);
00687 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00691 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00695 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00711 #endif
00712