Open SCAP Library
Loading...
Searching...
No Matches
oval_results.h
Go to the documentation of this file.
1
19/*
20 * Copyright 2009-2014 Red Hat Inc., Durham, North Carolina.
21 * All Rights Reserved.
22 *
23 * This library is free software; you can redistribute it and/or
24 * modify it under the terms of the GNU Lesser General Public
25 * License as published by the Free Software Foundation; either
26 * version 2.1 of the License, or (at your option) any later version.
27 *
28 * This library is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31 * Lesser General Public License for more details.
32 *
33 * You should have received a copy of the GNU Lesser General Public
34 * License along with this library; if not, write to the Free Software
35 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
36 *
37 * Authors:
38 * "David Niemoller" <David.Niemoller@g2-inc.com>
39 * Šimon Lukašík
40 */
41
42
43#ifndef OVAL_RESULTS_H_
44#define OVAL_RESULTS_H_
45
46#include "oscap.h"
47#include "oscap_source.h"
48#include "oval_types.h"
50#include "oval_directives.h"
51#include <stdbool.h>
52#include "oscap_export.h"
53
54
55OSCAP_API const char *oval_result_get_text(oval_result_t);
56
62
72
82
86struct oval_result_test;
92
96struct oval_result_item;
102
103
113
121OSCAP_API struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
122 struct oval_syschar_model **);
123
132OSCAP_API int oval_results_model_import_source(struct oval_results_model *model, struct oscap_source *source);
133
143OSCAP_API void oval_results_model_set_export_system_characteristics(struct oval_results_model *, bool export);
144
148OSCAP_API bool oval_results_model_get_export_system_characteristics(struct oval_results_model *);
154OSCAP_API void oval_results_model_free(struct oval_results_model *model);
162OSCAP_API int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file);
163
172OSCAP_API struct oscap_source *oval_results_model_export_source(struct oval_results_model *results_model, struct oval_directives_model *directives_model, const char *name);
173
178OSCAP_API void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator);
185OSCAP_API struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model);
186
192OSCAP_API struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
193
198OSCAP_API struct oval_directives_model *oval_results_model_get_directives_model(struct oval_results_model *model);
199
205OSCAP_API struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
217OSCAP_API int oval_results_model_eval(struct oval_results_model *);
228OSCAP_API struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
233OSCAP_API struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
234 struct oval_result_system *old_system);
238OSCAP_API void oval_result_system_free(struct oval_result_system *);
239
247OSCAP_API void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
251OSCAP_API void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
261OSCAP_API struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
265OSCAP_API struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
269OSCAP_API struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
273OSCAP_API struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
277OSCAP_API struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
281OSCAP_API struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
291OSCAP_API bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
295OSCAP_API struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
299OSCAP_API void oval_result_system_iterator_free(struct oval_result_system_iterator *);
313OSCAP_API int oval_result_system_eval(struct oval_result_system *sys);
322OSCAP_API int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
333OSCAP_API struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
339 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
343OSCAP_API void oval_result_definition_free(struct oval_result_definition *);
344
352OSCAP_API void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
356OSCAP_API void oval_result_definition_set_instance(struct oval_result_definition *, int);
360OSCAP_API void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
364OSCAP_API void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
374OSCAP_API struct oval_definition *oval_result_definition_get_definition(const struct oval_result_definition *);
379OSCAP_API const char *oval_result_definition_get_id(const struct oval_result_definition *rslt_definition);
383OSCAP_API struct oval_result_system *oval_result_definition_get_system(const struct oval_result_definition *);
387OSCAP_API int oval_result_definition_get_instance(const struct oval_result_definition *);
391OSCAP_API oval_result_t oval_result_definition_eval(struct oval_result_definition *);
395OSCAP_API oval_result_t oval_result_definition_get_result(const struct oval_result_definition *);
399OSCAP_API struct oval_message_iterator *oval_result_definition_get_messages(const struct oval_result_definition *);
403OSCAP_API struct oval_result_criteria_node *oval_result_definition_get_criteria(const struct oval_result_definition *);
413OSCAP_API bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
417OSCAP_API struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
421OSCAP_API void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
438OSCAP_API struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
444 (struct oval_result_system *new_system, struct oval_result_test *old_test);
448OSCAP_API void oval_result_test_free(struct oval_result_test *);
449
457OSCAP_API void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
461OSCAP_API void oval_result_test_set_instance(struct oval_result_test *test, int instance);
465OSCAP_API void oval_result_test_add_message(struct oval_result_test *, struct oval_message *);
469OSCAP_API void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
473OSCAP_API void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
483OSCAP_API struct oval_test *oval_result_test_get_test(struct oval_result_test *);
487OSCAP_API struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
491OSCAP_API oval_result_t oval_result_test_eval(struct oval_result_test *);
495OSCAP_API oval_result_t oval_result_test_get_result(struct oval_result_test *);
499OSCAP_API int oval_result_test_get_instance(struct oval_result_test *);
503OSCAP_API struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *);
507OSCAP_API struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
511OSCAP_API struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
521OSCAP_API bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
525OSCAP_API struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
529OSCAP_API void oval_result_test_iterator_free(struct oval_result_test_iterator *);
546OSCAP_API struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
552 (struct oval_result_system *new_system, struct oval_result_item *old_item);
556OSCAP_API void oval_result_item_free(struct oval_result_item *);
557
565OSCAP_API void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
569OSCAP_API void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
579OSCAP_API struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *);
583OSCAP_API oval_result_t oval_result_item_get_result(struct oval_result_item *);
587OSCAP_API struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
597OSCAP_API bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
601OSCAP_API struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
605OSCAP_API void oval_result_item_iterator_free(struct oval_result_item_iterator *);
622OSCAP_API struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *,
624 int, int, ...);
630 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
634OSCAP_API void oval_result_criteria_node_free(struct oval_result_criteria_node *);
635
643OSCAP_API void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
647OSCAP_API void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
651OSCAP_API void oval_result_criteria_node_set_applicability_check(struct oval_result_criteria_node *, bool);
655OSCAP_API void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t); //type==NODETYPE_CRITERIA
659OSCAP_API void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
663OSCAP_API void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *); //type==NODETYPE_CRITERION
667OSCAP_API void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *); //type==NODETYPE_EXTENDDEF
676OSCAP_API oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
680OSCAP_API oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
684OSCAP_API oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
688OSCAP_API bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
692OSCAP_API bool oval_result_criteria_node_get_applicability_check(struct oval_result_criteria_node *);
696OSCAP_API oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
700OSCAP_API struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
704OSCAP_API struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *); //type==NODETYPE_CRITERION
708OSCAP_API struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *); //type==NODETYPE_EXTENDDEF
718OSCAP_API bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
722OSCAP_API struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
726OSCAP_API void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
742#endif /* OVAL_RESULTS_H_ */
743
oval_criteria_node_type_t
Criteria node type.
Definition oval_definitions.h:67
oval_operator_t
Boolean operators.
Definition oval_definitions.h:75
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
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
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
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
Result values for the evaluation of an OVAL Definition or an OVAL Test.
Definition oval_types.h:445
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
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
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
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
OSCAP_API struct oval_results_model * oval_results_model_clone(struct oval_results_model *)
Copy an oval_results_model.
Definition oval_resModel.c:103
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
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
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
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
OSCAP_API int oval_results_model_eval(struct oval_results_model *)
Evaluate all result_systems.
Definition oval_resModel.c:231
General OpenScap functions and types.
Definition oscap_source.c:66
Oval definition model.
Definition oval_defModel.c:53
Oval definition specification.
Definition oval_definition.c:53
This structure holds instance of OVAL Directives.
Definition oval_generator.c:47
OVAL message.
Definition oval_message.c:45
Definition oval_resultCriteriaNode.c:46
Definition oval_resultDefinition.c:46
Definition oval_resultItem.c:44
Definition oval_resultSystem.c:55
Definition oval_resultTest.c:53
OVAL Results Model holds OVAL results structure instances.
Definition oval_resModel.c:56
OVAL System Characteristics model.
Definition oval_sysModel.c:56
General instrumented host description.
Definition oval_sysInfo.c:45
Each instance of Oval_sysitem represents one item.
Definition oval_sysItem.c:45
An Oval_test specifies a technical control by identifying an oval_object that is evaluated on an inst...
Definition oval_test.c:48
Binding of an value to an OVAL variable.
Definition oval_variableBinding.c:45