|
Open SCAP Library
|
00001 00019 /* 00020 * Copyright 2009-2014 Red Hat Inc., Durham, North Carolina. 00021 * All Rights Reserved. 00022 * 00023 * This library is free software; you can redistribute it and/or 00024 * modify it under the terms of the GNU Lesser General Public 00025 * License as published by the Free Software Foundation; either 00026 * version 2.1 of the License, or (at your option) any later version. 00027 * 00028 * This library is distributed in the hope that it will be useful, 00029 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00031 * Lesser General Public License for more details. 00032 * 00033 * You should have received a copy of the GNU Lesser General Public 00034 * License along with this library; if not, write to the Free Software 00035 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00036 * 00037 * Authors: 00038 * "David Niemoller" <David.Niemoller@g2-inc.com> 00039 * Šimon Lukašík 00040 */ 00041 00042 00043 #ifndef OVAL_RESULTS_H_ 00044 #define OVAL_RESULTS_H_ 00045 00046 #include "oscap.h" 00047 #include "oscap_source.h" 00048 #include "oval_types.h" 00049 #include "oval_system_characteristics.h" 00050 #include "oval_directives.h" 00051 #include <stdbool.h> 00052 00053 00054 const char *oval_result_get_text(oval_result_t); 00055 00060 struct oval_results_model; 00061 00065 struct oval_result_system; 00070 struct oval_result_system_iterator; 00071 00075 struct oval_result_definition; 00080 struct oval_result_definition_iterator; 00081 00085 struct oval_result_test; 00090 struct oval_result_test_iterator; 00091 00095 struct oval_result_item; 00100 struct oval_result_item_iterator; 00101 00102 00106 struct oval_result_criteria_node; 00111 struct oval_result_criteria_node_iterator; 00112 00120 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model, 00121 struct oval_syschar_model **); 00122 00131 int oval_results_model_import_source(struct oval_results_model *model, struct oscap_source *source); 00132 00143 OSCAP_DEPRECATED(int oval_results_model_import(struct oval_results_model *model, const char *file)); 00149 struct oval_results_model *oval_results_model_clone(struct oval_results_model *); 00153 void oval_results_model_set_export_system_characteristics(struct oval_results_model *, bool export); 00154 00158 bool oval_results_model_get_export_system_characteristics(struct oval_results_model *); 00164 void oval_results_model_free(struct oval_results_model *model); 00172 int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file); 00173 00182 struct oscap_source *oval_results_model_export_source(struct oval_results_model *results_model, struct oval_directives_model *directives_model, const char *name); 00183 00188 void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator); 00195 struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model); 00196 00202 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model); 00203 00208 struct oval_directives_model *oval_results_model_get_directives_model(struct oval_results_model *model); 00209 00215 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *); 00227 int oval_results_model_eval(struct oval_results_model *); 00238 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_results_model *oval_result_system_get_results_model(struct oval_result_system *); 00275 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *); 00279 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *); 00283 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *); 00287 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *); 00291 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *); 00301 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *); 00305 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *); 00309 void oval_result_system_iterator_free(struct oval_result_system_iterator *); 00323 int oval_result_system_eval(struct oval_result_system *sys); 00332 int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id); 00343 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *); 00348 struct oval_result_definition *oval_result_definition_clone 00349 (struct oval_result_system *new_system, struct oval_result_definition *old_definition); 00353 void oval_result_definition_free(struct oval_result_definition *); 00354 00362 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t); 00366 void oval_result_definition_set_instance(struct oval_result_definition *, int); 00370 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *); 00374 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *); 00384 struct oval_definition *oval_result_definition_get_definition(const struct oval_result_definition *); 00389 const char *oval_result_definition_get_id(const struct oval_result_definition *rslt_definition); 00393 struct oval_result_system *oval_result_definition_get_system(const struct oval_result_definition *); 00397 int oval_result_definition_get_instance(const struct oval_result_definition *); 00401 oval_result_t oval_result_definition_eval(struct oval_result_definition *); 00405 oval_result_t oval_result_definition_get_result(const struct oval_result_definition *); 00409 struct oval_message_iterator *oval_result_definition_get_messages(const struct oval_result_definition *); 00413 struct oval_result_criteria_node *oval_result_definition_get_criteria(const struct oval_result_definition *); 00423 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *); 00427 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *); 00431 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *); 00448 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *); 00453 struct oval_result_test *oval_result_test_clone 00454 (struct oval_result_system *new_system, struct oval_result_test *old_test); 00458 void oval_result_test_free(struct oval_result_test *); 00459 00467 void oval_result_test_set_result(struct oval_result_test *, oval_result_t); 00471 void oval_result_test_set_instance(struct oval_result_test *test, int instance); 00475 void oval_result_test_add_message(struct oval_result_test *, struct oval_message *); 00479 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *); 00483 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *); 00493 struct oval_test *oval_result_test_get_test(struct oval_result_test *); 00497 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *); 00501 oval_result_t oval_result_test_eval(struct oval_result_test *); 00505 oval_result_t oval_result_test_get_result(struct oval_result_test *); 00509 int oval_result_test_get_instance(struct oval_result_test *); 00513 struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *); 00517 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *); 00521 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *); 00531 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *); 00535 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *); 00539 void oval_result_test_iterator_free(struct oval_result_test_iterator *); 00556 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *); 00561 struct oval_result_item *oval_result_item_clone 00562 (struct oval_result_system *new_system, struct oval_result_item *old_item); 00566 void oval_result_item_free(struct oval_result_item *); 00567 00575 void oval_result_item_set_result(struct oval_result_item *, oval_result_t); 00579 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *); 00589 struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *); 00593 oval_result_t oval_result_item_get_result(struct oval_result_item *); 00597 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *); 00607 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *); 00611 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *); 00615 void oval_result_item_iterator_free(struct oval_result_item_iterator *); 00632 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, 00633 oval_criteria_node_type_t, 00634 int, 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_applicability_check(struct oval_result_criteria_node *, bool); 00665 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t); //type==NODETYPE_CRITERIA 00669 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA 00673 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *); //type==NODETYPE_CRITERION 00677 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *); //type==NODETYPE_EXTENDDEF 00686 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *); 00690 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *); 00694 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *); 00698 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *); 00702 bool oval_result_criteria_node_get_applicability_check(struct oval_result_criteria_node *); 00706 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA 00710 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA 00714 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *); //type==NODETYPE_CRITERION 00718 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *); //type==NODETYPE_EXTENDDEF 00728 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *); 00732 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *); 00736 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *); 00752 #endif /* OVAL_RESULTS_H_ */ 00753
1.7.3