• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

/home/pvrabec/project/openscap/openscap-0.6.3/src/OVAL/public/oval_results.h

Go to the documentation of this file.
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 <stdbool.h>
00048 
00053 typedef enum {
00054         OVAL_RESULT_TRUE = 1,    
00055         OVAL_RESULT_FALSE = 2,   
00056         OVAL_RESULT_UNKNOWN = 4, 
00057         OVAL_RESULT_ERROR = 8,  
00058         OVAL_RESULT_NOT_EVALUATED = 16, 
00059         OVAL_RESULT_NOT_APPLICABLE = 32 
00060 } oval_result_t;
00061 
00066 typedef enum {
00067         OVAL_DIRECTIVE_CONTENT_UNKNOWN = 0, 
00068         OVAL_DIRECTIVE_CONTENT_THIN = 1,    
00069         OVAL_DIRECTIVE_CONTENT_FULL = 2     
00070 } oval_result_directive_content_t;
00071 
00072 
00073 const char *oval_result_get_text(oval_result_t);
00074 
00075 
00076 
00081 struct oval_results_model;
00082 
00086 struct oval_result_system;
00091 struct oval_result_system_iterator;
00092 
00096 struct oval_result_definition;
00101 struct oval_result_definition_iterator;
00102 
00106 struct oval_result_test;
00111 struct oval_result_test_iterator;
00112 
00116 struct oval_result_item;
00121 struct oval_result_item_iterator;
00122 
00123 
00127 struct oval_result_criteria_node;
00132 struct oval_result_criteria_node_iterator;
00133 
00150 struct oval_result_directives;
00151 
00152 
00153 
00154 
00155 
00163 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
00164                                                   struct oval_syschar_model **);
00173 struct oval_result_directives *oval_results_model_import(struct oval_results_model *model, const char *file);
00179 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00185 void oval_results_model_free(struct oval_results_model *model);
00192 int oval_results_model_export(struct oval_results_model *, struct oval_result_directives *, const char *file);
00193 
00204 void oval_results_model_lock(struct oval_results_model *result_model);
00216 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
00217 
00223 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
00227 bool oval_results_model_is_locked(struct oval_results_model *result_model);
00239 int oval_results_model_eval(struct oval_results_model *);
00248 bool oval_results_model_is_valid(struct oval_results_model *results_model);
00259 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
00264 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
00265                                                     struct oval_result_system *old_system);
00269 void oval_result_system_free(struct oval_result_system *);
00270 
00278 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
00282 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
00292 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
00296 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
00300 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
00304 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
00308 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
00312 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
00316 bool oval_result_system_is_locked(struct oval_result_system *result_system);
00326 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
00330 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
00334 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
00348 int oval_result_system_eval(struct oval_result_system *sys);
00358 oval_result_t oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
00367 bool oval_result_system_is_valid(struct oval_result_system *result_system);
00378 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
00383 struct oval_result_definition *oval_result_definition_clone
00384     (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
00388 void oval_result_definition_free(struct oval_result_definition *);
00389 
00397 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
00401 void oval_result_definition_set_instance(struct oval_result_definition *, int);
00405 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
00409 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
00419 struct oval_definition *oval_result_definition_get_definition(struct oval_result_definition *);
00423 struct oval_result_system *oval_result_definition_get_system(struct oval_result_definition *);
00427 int oval_result_definition_get_instance(struct oval_result_definition *);
00431 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
00435 oval_result_t oval_result_definition_get_result(struct oval_result_definition *);
00439 struct oval_message_iterator *oval_result_definition_get_messages(struct oval_result_definition *);
00443 struct oval_result_criteria_node *oval_result_definition_get_criteria(struct oval_result_definition *);
00447 bool oval_result_definition_is_locked(struct oval_result_definition *result_definition);
00457 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
00461 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
00465 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
00480 bool oval_result_definition_is_valid(struct oval_result_definition *result_definition);
00491 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
00496 struct oval_result_test *oval_result_test_clone
00497     (struct oval_result_system *new_system, struct oval_result_test *old_test);
00501 void oval_result_test_free(struct oval_result_test *);
00502 
00510 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
00514 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
00518 void oval_result_test_add_message(struct oval_result_test *, struct oval_message *);
00522 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
00526 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
00536 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
00540 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
00544 oval_result_t oval_result_test_eval(struct oval_result_test *);
00548 oval_result_t oval_result_test_get_result(struct oval_result_test *);
00552 int oval_result_test_get_instance(struct oval_result_test *);
00556 struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *);
00560 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
00564 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
00569 bool oval_result_test_is_locked(struct oval_result_test *result_test);
00579 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
00583 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
00587 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
00602 bool oval_result_test_is_valid(struct oval_result_test *result_test);
00613 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
00618 struct oval_result_item *oval_result_item_clone
00619     (struct oval_result_system *new_system, struct oval_result_item *old_item);
00623 void oval_result_item_free(struct oval_result_item *);
00624 
00632 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
00636 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
00646 struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *);
00650 oval_result_t oval_result_item_get_result(struct oval_result_item *);
00654 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
00658 bool oval_result_item_is_locked(struct oval_result_item *result_item);
00668 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
00672 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
00676 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
00689 bool oval_result_item_is_valid(struct oval_result_item *result_item);
00700 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *, oval_criteria_node_type_t,
00701                                                                 int, ...);
00706 struct oval_result_criteria_node *oval_result_criteria_node_clone
00707     (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
00711 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
00712 
00720 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
00724 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
00728 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t);       //type==NODETYPE_CRITERIA
00732 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *);     //type==NODETYPE_CRITERIA
00736 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *); //type==NODETYPE_CRITERION
00740 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *);        //type==NODETYPE_EXTENDDEF
00749 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
00753 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
00757 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
00761 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
00765 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *);     //type==NODETYPE_CRITERIA
00769 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *);  //type==NODETYPE_CRITERIA
00773 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *);        //type==NODETYPE_CRITERION
00777 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *);       //type==NODETYPE_EXTENDDEF
00781 bool oval_result_criteria_node_is_locked(struct oval_result_criteria_node *result_criteria_node);
00791 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
00795 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
00799 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
00818 bool oval_result_criteria_node_is_valid(struct oval_result_criteria_node *result_criteria_node);
00828 struct oval_result_directives *oval_result_directives_new(struct oval_results_model *);
00832 void oval_result_directives_free(struct oval_result_directives *);
00833 
00834 
00843 void oval_result_directives_set_reported(struct oval_result_directives *, int flag, bool val);
00848 void oval_result_directives_set_content(struct oval_result_directives *, int flag, oval_result_directive_content_t);
00858 bool oval_result_directives_get_reported(struct oval_result_directives *, oval_result_t);
00862 oval_result_directive_content_t oval_result_directives_get_content(struct oval_result_directives *, oval_result_t);
00866 bool oval_result_directives_is_locked(struct oval_result_directives *result_directives);
00876 bool oval_result_directives_is_valid(struct oval_result_directives *result_directives);
00890 #endif                          /* OVAL_RESULTS_H_ */

Generated on Tue Sep 14 2010 for Open SCAP Library by  doxygen 1.7.1