Open SCAP Library
|
00001 00019 /* 00020 * Copyright 2009-2010 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 */ 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 "oval_directives.h" 00048 #include <stdbool.h> 00049 00050 00051 const char *oval_result_get_text(oval_result_t); 00052 00057 struct oval_results_model; 00058 00062 struct oval_result_system; 00067 struct oval_result_system_iterator; 00068 00072 struct oval_result_definition; 00077 struct oval_result_definition_iterator; 00078 00082 struct oval_result_test; 00087 struct oval_result_test_iterator; 00088 00092 struct oval_result_item; 00097 struct oval_result_item_iterator; 00098 00099 00103 struct oval_result_criteria_node; 00108 struct oval_result_criteria_node_iterator; 00109 00117 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model, 00118 struct oval_syschar_model **); 00127 int oval_results_model_import(struct oval_results_model *model, const char *file); 00133 struct oval_results_model *oval_results_model_clone(struct oval_results_model *); 00139 void oval_results_model_free(struct oval_results_model *model); 00147 int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file); 00148 00153 void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator); 00160 struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model); 00166 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model); 00167 00173 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *); 00185 int oval_results_model_eval(struct oval_results_model *); 00196 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *); 00201 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model, 00202 struct oval_result_system *old_system); 00206 void oval_result_system_free(struct oval_result_system *); 00207 00215 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *); 00219 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *); 00229 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *); 00233 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *); 00237 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *); 00241 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *); 00245 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *); 00249 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *); 00259 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *); 00263 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *); 00267 void oval_result_system_iterator_free(struct oval_result_system_iterator *); 00281 int oval_result_system_eval(struct oval_result_system *sys); 00290 int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id); 00301 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *); 00306 struct oval_result_definition *oval_result_definition_clone 00307 (struct oval_result_system *new_system, struct oval_result_definition *old_definition); 00311 void oval_result_definition_free(struct oval_result_definition *); 00312 00320 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t); 00324 void oval_result_definition_set_instance(struct oval_result_definition *, int); 00328 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *); 00332 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *); 00342 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *); 00346 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *); 00350 int oval_result_definition_get_instance(struct oval_result_definition *); 00354 oval_result_t oval_result_definition_eval(struct oval_result_definition *); 00358 oval_result_t oval_result_definition_get_result(struct oval_result_definition *); 00362 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *); 00366 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *); 00376 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *); 00380 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *); 00384 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *); 00401 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *); 00406 struct oval_result_test *oval_result_test_clone 00407 (struct oval_result_system *new_system, struct oval_result_test *old_test); 00411 void oval_result_test_free(struct oval_result_test *); 00412 00420 void oval_result_test_set_result(struct oval_result_test *, oval_result_t); 00424 void oval_result_test_set_instance(struct oval_result_test *test, int instance); 00428 void oval_result_test_add_message(struct oval_result_test *, struct oval_message *); 00432 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *); 00436 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *); 00446 struct oval_test *oval_result_test_get_test(struct oval_result_test *); 00450 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *); 00454 oval_result_t oval_result_test_eval(struct oval_result_test *); 00458 oval_result_t oval_result_test_get_result(struct oval_result_test *); 00462 int oval_result_test_get_instance(struct oval_result_test *); 00466 struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *); 00470 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *); 00474 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *); 00484 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *); 00488 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *); 00492 void oval_result_test_iterator_free(struct oval_result_test_iterator *); 00509 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *); 00514 struct oval_result_item *oval_result_item_clone 00515 (struct oval_result_system *new_system, struct oval_result_item *old_item); 00519 void oval_result_item_free(struct oval_result_item *); 00520 00528 void oval_result_item_set_result(struct oval_result_item *, oval_result_t); 00532 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *); 00542 struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *); 00546 oval_result_t oval_result_item_get_result(struct oval_result_item *); 00550 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *); 00560 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *); 00564 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *); 00568 void oval_result_item_iterator_free(struct oval_result_item_iterator *); 00585 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t, 00586 int, ...); 00591 struct oval_result_criteria_node *oval_result_criteria_node_clone 00592 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node); 00596 void oval_result_criteria_node_free(struct oval_result_criteria_node *); 00597 00605 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t); 00609 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool); 00613 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t); //type==NODETYPE_CRITERIA 00617 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA 00621 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *); //type==NODETYPE_CRITERION 00625 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *); //type==NODETYPE_EXTENDDEF 00634 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *); 00638 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *); 00642 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *); 00646 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *); 00650 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA 00654 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA 00658 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *); //type==NODETYPE_CRITERION 00662 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *); //type==NODETYPE_EXTENDDEF 00672 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *); 00676 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *); 00680 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *); 00696 #endif /* OVAL_RESULTS_H_ */ 00697