Loading...
Searching...
No Matches
oval_results.h
Go to the documentation of this file.
/*
* Copyright 2009-2014 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* "David Niemoller" <David.Niemoller@g2-inc.com>
* Šimon Lukašík
*/
#ifndef OVAL_RESULTS_H_
#define OVAL_RESULTS_H_
#include "oscap.h"
#include "oscap_source.h"
#include "oval_types.h"
#include "oval_system_characteristics.h"
#include "oval_directives.h"
#include <stdbool.h>
#include "oscap_export.h"
OSCAP_API const char *oval_result_get_text(oval_result_t);
struct oval_results_model;
struct oval_result_system;
struct oval_result_system_iterator;
struct oval_result_definition;
struct oval_result_definition_iterator;
struct oval_result_test;
struct oval_result_test_iterator;
struct oval_result_item;
struct oval_result_item_iterator;
struct oval_result_criteria_node;
struct oval_result_criteria_node_iterator;
OSCAP_API struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
struct oval_syschar_model **);
OSCAP_API int oval_results_model_import_source(struct oval_results_model *model, struct oscap_source *source);
OSCAP_API struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
OSCAP_API void oval_results_model_set_export_system_characteristics(struct oval_results_model *, bool export);
OSCAP_API bool oval_results_model_get_export_system_characteristics(struct oval_results_model *);
OSCAP_API void oval_results_model_free(struct oval_results_model *model);
OSCAP_API int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file);
OSCAP_API struct oscap_source *oval_results_model_export_source(struct oval_results_model *results_model, struct oval_directives_model *directives_model, const char *name);
OSCAP_API void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator);
OSCAP_API struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model);
OSCAP_API struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
OSCAP_API struct oval_directives_model *oval_results_model_get_directives_model(struct oval_results_model *model);
OSCAP_API struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
OSCAP_API int oval_results_model_eval(struct oval_results_model *);
OSCAP_API struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
OSCAP_API struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
struct oval_result_system *old_system);
OSCAP_API void oval_result_system_free(struct oval_result_system *);
OSCAP_API void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
OSCAP_API void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
OSCAP_API struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
OSCAP_API struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
OSCAP_API struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
OSCAP_API struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
OSCAP_API struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
OSCAP_API struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
OSCAP_API bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
OSCAP_API struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
OSCAP_API void oval_result_system_iterator_free(struct oval_result_system_iterator *);
OSCAP_API int oval_result_system_eval(struct oval_result_system *sys);
OSCAP_API int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
OSCAP_API struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
OSCAP_API struct oval_result_definition *oval_result_definition_clone
(struct oval_result_system *new_system, struct oval_result_definition *old_definition);
OSCAP_API void oval_result_definition_free(struct oval_result_definition *);
OSCAP_API void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
OSCAP_API void oval_result_definition_set_instance(struct oval_result_definition *, int);
OSCAP_API void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
OSCAP_API void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
OSCAP_API struct oval_definition *oval_result_definition_get_definition(const struct oval_result_definition *);
OSCAP_API const char *oval_result_definition_get_id(const struct oval_result_definition *rslt_definition);
OSCAP_API struct oval_result_system *oval_result_definition_get_system(const struct oval_result_definition *);
OSCAP_API int oval_result_definition_get_instance(const struct oval_result_definition *);
OSCAP_API oval_result_t oval_result_definition_eval(struct oval_result_definition *);
OSCAP_API oval_result_t oval_result_definition_get_result(const struct oval_result_definition *);
OSCAP_API struct oval_message_iterator *oval_result_definition_get_messages(const struct oval_result_definition *);
OSCAP_API struct oval_result_criteria_node *oval_result_definition_get_criteria(const struct oval_result_definition *);
OSCAP_API bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
OSCAP_API struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
OSCAP_API void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
OSCAP_API struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
OSCAP_API struct oval_result_test *oval_result_test_clone
(struct oval_result_system *new_system, struct oval_result_test *old_test);
OSCAP_API void oval_result_test_free(struct oval_result_test *);
OSCAP_API void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
OSCAP_API void oval_result_test_set_instance(struct oval_result_test *test, int instance);
OSCAP_API void oval_result_test_add_message(struct oval_result_test *, struct oval_message *);
OSCAP_API void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
OSCAP_API void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
OSCAP_API struct oval_test *oval_result_test_get_test(struct oval_result_test *);
OSCAP_API struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
OSCAP_API oval_result_t oval_result_test_eval(struct oval_result_test *);
OSCAP_API oval_result_t oval_result_test_get_result(struct oval_result_test *);
OSCAP_API int oval_result_test_get_instance(struct oval_result_test *);
OSCAP_API struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *);
OSCAP_API struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
OSCAP_API struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
OSCAP_API bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
OSCAP_API struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
OSCAP_API void oval_result_test_iterator_free(struct oval_result_test_iterator *);
OSCAP_API struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
OSCAP_API struct oval_result_item *oval_result_item_clone
(struct oval_result_system *new_system, struct oval_result_item *old_item);
OSCAP_API void oval_result_item_free(struct oval_result_item *);
OSCAP_API void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
OSCAP_API void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
OSCAP_API struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *);
OSCAP_API oval_result_t oval_result_item_get_result(struct oval_result_item *);
OSCAP_API struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
OSCAP_API bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
OSCAP_API struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
OSCAP_API void oval_result_item_iterator_free(struct oval_result_item_iterator *);
OSCAP_API struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *,
oval_criteria_node_type_t,
int, int, ...);
OSCAP_API struct oval_result_criteria_node *oval_result_criteria_node_clone
(struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
OSCAP_API void oval_result_criteria_node_free(struct oval_result_criteria_node *);
OSCAP_API void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
OSCAP_API void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
OSCAP_API void oval_result_criteria_node_set_applicability_check(struct oval_result_criteria_node *, bool);
OSCAP_API void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t); //type==NODETYPE_CRITERIA
OSCAP_API void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
OSCAP_API void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *); //type==NODETYPE_CRITERION
OSCAP_API void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *); //type==NODETYPE_EXTENDDEF
OSCAP_API oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
OSCAP_API oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
OSCAP_API oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
OSCAP_API bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
OSCAP_API bool oval_result_criteria_node_get_applicability_check(struct oval_result_criteria_node *);
OSCAP_API oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
OSCAP_API struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
OSCAP_API struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *); //type==NODETYPE_CRITERION
OSCAP_API struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *); //type==NODETYPE_EXTENDDEF
OSCAP_API bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
OSCAP_API struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
OSCAP_API void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
#endif /* OVAL_RESULTS_H_ */
oval_criteria_node_type_t
oval_criteria_node_type_t
Criteria node type.
Definition oval_definitions.h:67
oval_operator_t
oval_operator_t
Boolean operators.
Definition oval_definitions.h:75
oval_results_model::oval_results_model_new
OSCAP_API struct oval_results_model * oval_results_model_new(struct oval_definition_model *definition_model, struct oval_syschar_model **)
Create new oval_results_model.
Definition oval_resModel.c:67
oval_result_item::oval_result_item_clone
OSCAP_API struct oval_result_item * oval_result_item_clone(struct oval_result_system *new_system, struct oval_result_item *old_item)
Definition oval_resultItem.c:69
oval_result_system::oval_result_system_eval
OSCAP_API int oval_result_system_eval(struct oval_result_system *sys)
Function evaluates all OVAL definitions of specified result_system.
Definition oval_resultSystem.c:344
oval_result_system::oval_result_system_eval_definition
OSCAP_API int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id)
Function evaluates specified OVAL definition in result_system.
Definition oval_resultSystem.c:367
oval_result_t
oval_result_t
Result values for the evaluation of an OVAL Definition or an OVAL Test.
Definition oval_types.h:445
oval_results_model_export_source
OSCAP_API struct oscap_source * oval_results_model_export_source(struct oval_results_model *results_model, struct oval_directives_model *directives_model, const char *name)
Export OVAL results into oscap_source.
Definition oval_resModel.c:299
oval_result_criteria_node::oval_result_criteria_node_clone
OSCAP_API struct oval_result_criteria_node * oval_result_criteria_node_clone(struct oval_result_system *new_system, struct oval_result_criteria_node *old_node)
Definition oval_resultCriteriaNode.c:153
oval_result_system::oval_result_system_clone
OSCAP_API struct oval_result_system * oval_result_system_clone(struct oval_results_model *new_model, struct oval_result_system *old_system)
Definition oval_resultSystem.c:126
oval_results_model::oval_results_model_export
OSCAP_API int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file)
Export oval results into file.
Definition oval_resModel.c:313
oval_results_model::oval_results_model_clone
OSCAP_API struct oval_results_model * oval_results_model_clone(struct oval_results_model *)
Copy an oval_results_model.
Definition oval_resModel.c:103
oval_results_model::oval_results_model_free
OSCAP_API void oval_results_model_free(struct oval_results_model *model)
Free memory allocated to a specified oval results model.
Definition oval_resModel.c:129
oval_results_model::oval_results_model_import_source
OSCAP_API int oval_results_model_import_source(struct oval_results_model *model, struct oscap_source *source)
Import the content from the oscap_source into an oval_result_model.
Definition oval_resModel.c:192
oval_result_definition::oval_result_definition_clone
OSCAP_API struct oval_result_definition * oval_result_definition_clone(struct oval_result_system *new_system, struct oval_result_definition *old_definition)
Definition oval_resultDefinition.c:75
oval_result_test::oval_result_test_clone
OSCAP_API struct oval_result_test * oval_result_test_clone(struct oval_result_system *new_system, struct oval_result_test *old_test)
Definition oval_resultTest.c:85
oval_results_model_eval
OSCAP_API int oval_results_model_eval(struct oval_results_model *)
Evaluate all result_systems.
Definition oval_resModel.c:231
oscap.h
General OpenScap functions and types.
oval_directives.h
oval_system_characteristics.h
oval_types.h
oscap_source
Definition oscap_source.c:66
oval_definition_model
Oval definition model.
Definition oval_defModel.c:53
oval_definition
Oval definition specification.
Definition oval_definition.c:53
oval_directives_model
This structure holds instance of OVAL Directives.
oval_generator
Definition oval_generator.c:47
oval_message_iterator
oval_message
OVAL message.
Definition oval_message.c:45
oval_result_criteria_node_iterator
oval_result_criteria_node
Definition oval_resultCriteriaNode.c:46
oval_result_definition_iterator
oval_result_definition
Definition oval_resultDefinition.c:46
oval_result_item_iterator
oval_result_item
Definition oval_resultItem.c:44
oval_result_system_iterator
oval_result_system
Definition oval_resultSystem.c:55
oval_result_test_iterator
oval_result_test
Definition oval_resultTest.c:53
oval_results_model
OVAL Results Model holds OVAL results structure instances.
Definition oval_resModel.c:56
oval_syschar_model
OVAL System Characteristics model.
Definition oval_sysModel.c:56
oval_sysinfo
General instrumented host description.
Definition oval_sysInfo.c:45
oval_sysitem
Each instance of Oval_sysitem represents one item.
Definition oval_sysItem.c:45
oval_test
An Oval_test specifies a technical control by identifying an oval_object that is evaluated on an inst...
Definition oval_test.c:48
oval_variable_binding_iterator
oval_variable_binding
Binding of an value to an OVAL variable.
Definition oval_variableBinding.c:45