Open SCAP Library: oval_results.h Source File

Open SCAP Library

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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"
49 #include "oval_system_characteristics.h"
50 #include "oval_directives.h"
51 #include <stdbool.h>
52
53
54 const char *oval_result_get_text(oval_result_t);
55
60 struct oval_results_model;
61
65 struct oval_result_system;
70 struct oval_result_system_iterator;
71
75 struct oval_result_definition;
80 struct oval_result_definition_iterator;
81
85 struct oval_result_test;
90 struct oval_result_test_iterator;
91
95 struct oval_result_item;
100 struct oval_result_item_iterator;
101
102
106 struct oval_result_criteria_node;
111 struct oval_result_criteria_node_iterator;
112
120 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
121 struct oval_syschar_model **);
122
131 int oval_results_model_import_source(struct oval_results_model *model, struct oscap_source *source);
132
143 OSCAP_DEPRECATED(int oval_results_model_import(struct oval_results_model *model, const char *file));
149 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
155 void oval_results_model_free(struct oval_results_model *model);
163 int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file);
164
173 struct oscap_source *oval_results_model_export_source(struct oval_results_model *results_model, struct oval_directives_model *directives_model, const char *name);
174
179 void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator);
186 struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model);
192 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
193
199 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
211 int oval_results_model_eval(struct oval_results_model *);
222 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
227 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
228 struct oval_result_system *old_system);
232 void oval_result_system_free(struct oval_result_system *);
233
241 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
245 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
255 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
259 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
263 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
267 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
271 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
275 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
285 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
289 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
293 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
307 int oval_result_system_eval(struct oval_result_system *sys);
316 int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
327 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
332 struct oval_result_definition *oval_result_definition_clone
333 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
337 void oval_result_definition_free(struct oval_result_definition *);
338
346 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
350 void oval_result_definition_set_instance(struct oval_result_definition *, int);
354 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
358 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
368 struct oval_definition *oval_result_definition_get_definition(const struct oval_result_definition *);
373 const char *oval_result_definition_get_id(const struct oval_result_definition *rslt_definition);
377 struct oval_result_system *oval_result_definition_get_system(const struct oval_result_definition *);
381 int oval_result_definition_get_instance(const struct oval_result_definition *);
385 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
389 oval_result_t oval_result_definition_get_result(const struct oval_result_definition *);
393 struct oval_message_iterator *oval_result_definition_get_messages(const struct oval_result_definition *);
397 struct oval_result_criteria_node *oval_result_definition_get_criteria(const struct oval_result_definition *);
407 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
411 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
415 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
432 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
437 struct oval_result_test *oval_result_test_clone
438 (struct oval_result_system *new_system, struct oval_result_test *old_test);
442 void oval_result_test_free(struct oval_result_test *);
443
451 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
455 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
459 void oval_result_test_add_message(struct oval_result_test *, struct oval_message *);
463 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
467 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
477 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
481 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
485 oval_result_t oval_result_test_eval(struct oval_result_test *);
489 oval_result_t oval_result_test_get_result(struct oval_result_test *);
493 int oval_result_test_get_instance(struct oval_result_test *);
497 struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *);
501 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
505 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
515 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
519 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
523 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
540 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
545 struct oval_result_item *oval_result_item_clone
546 (struct oval_result_system *new_system, struct oval_result_item *old_item);
550 void oval_result_item_free(struct oval_result_item *);
551
559 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
563 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
573 struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *);
577 oval_result_t oval_result_item_get_result(struct oval_result_item *);
581 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
591 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
595 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
599 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
616 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *,
617 oval_criteria_node_type_t,
618 int, int, ...);
623 struct oval_result_criteria_node *oval_result_criteria_node_clone
624 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
628 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
629
637 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
641 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
645 void oval_result_criteria_node_set_applicability_check(struct oval_result_criteria_node *, bool);
649 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t); //type==NODETYPE_CRITERIA
653 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
657 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *); //type==NODETYPE_CRITERION
661 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *); //type==NODETYPE_EXTENDDEF
670 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
674 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
678 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
682 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
686 bool oval_result_criteria_node_get_applicability_check(struct oval_result_criteria_node *);
690 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
694 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
698 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *); //type==NODETYPE_CRITERION
702 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *); //type==NODETYPE_EXTENDDEF
712 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
716 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
720 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
736 #endif /* OVAL_RESULTS_H_ */
737
oval_operator_t
oval_operator_t
Boolean operators.
Definition: oval_definitions.h:75
oval_syschar_model
OVAL System Characteristics model.
Definition: oval_sysModel.c:54
oval_result_system::oval_result_system_eval
int oval_result_system_eval(struct oval_result_system *sys)
Function evaluates all OVAL definitions of specified result_system.
Definition: oval_resultSystem.c:331
oval_result_system_iterator
Definition: oval_results.h:65
oval_result_definition_iterator
Definition: oval_results.h:75
oval_result_system
Definition: oval_resultSystem.c:54
oval_sysinfo
General instrumented host description.
Definition: oval_sysInfo.c:45
oval_results_model
OVAL Results Model holds OVAL results structure instances.
Definition: oval_resModel.c:54
oval_definition
Oval definition specification.
Definition: oval_definition.c:54
oval_criteria_node_type_t
oval_criteria_node_type_t
Criteria node type.
Definition: oval_definitions.h:67
oscap.h
General OpenScap functions and types.
oval_variable_binding_iterator
Definition: oval_system_characteristics.h:181
oval_directives_model
This structure holds instance of OVAL Directives.
oval_types.h
OSCAP_DEPRECATED
#define OSCAP_DEPRECATED(func)
This macro will warn, when a deprecated function is used.
Definition: oscap.h:50
oval_results_model::oval_results_model_new
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:61
oval_result_item_iterator
Definition: oval_results.h:95
oval_message
OVAL message.
Definition: oval_message.c:45
oval_variable_binding
Binding of an value to an OVAL variable.
Definition: oval_variableBinding.c:45
oval_result_definition::oval_result_definition_clone
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_sysitem
Each instance of Oval_sysitem represents one item.
Definition: oval_sysItem.c:45
oval_results_model::oval_results_model_clone
struct oval_results_model * oval_results_model_clone(struct oval_results_model *)
Copy an oval_results_model.
Definition: oval_resModel.c:84
oval_message_iterator
Definition: oval_system_characteristics.h:171
oval_results_model::oval_results_model_free
void oval_results_model_free(struct oval_results_model *model)
Free memory allocated to a specified oval results model.
Definition: oval_resModel.c:100
oval_results_model::oval_results_model_get_systems
struct oval_result_system_iterator * oval_results_model_get_systems(struct oval_results_model *)
Return iterator over reporting systems.
Definition: oval_resModel.c:134
oval_results_model::oval_results_model_get_definition_model
struct oval_definition_model * oval_results_model_get_definition_model(struct oval_results_model *model)
Return bound definition model from an oval_results_model.
Definition: oval_resModel.c:128
oval_result_criteria_node_iterator
Definition: oval_results.h:106
oval_result_test::oval_result_test_clone
struct oval_result_test * oval_result_test_clone(struct oval_result_system *new_system, struct oval_result_test *old_test)
Definition: oval_resultTest.c:82
oval_results_model::oval_results_model_import_source
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:149
oval_results_model::oval_results_model_import
int oval_results_model_import(struct oval_results_model *model, const char *file)
Import the content from the file into an oval_result_model.
Definition: oval_resModel.c:188
oval_result_test_iterator
Definition: oval_results.h:85
oval_results_model_eval
int oval_results_model_eval(struct oval_results_model *)
Evaluate all result_systems.
Definition: oval_resModel.c:203
oscap_source
Definition: oscap_source.c:62
oval_results_model_export_source
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:271
oval_result_item::oval_result_item_clone
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_results_model::oval_results_model_export
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:285
oval_result_definition::oval_result_definition_get_id
const char * oval_result_definition_get_id(const struct oval_result_definition *rslt_definition)
Returns the attribute of a given result definition.
Definition: oval_resultDefinition.c:347
oval_result_system::oval_result_system_eval_definition
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:354
oval_result_t
oval_result_t
Result values for the evaluation of an OVAL Definition or an OVAL Test.
Definition: oval_types.h:327
oval_result_definition
Definition: oval_resultDefinition.c:46
oval_system_characteristics.h
oval_definition_model
Oval definition model.
Definition: oval_defModel.c:51
oval_result_criteria_node
Definition: oval_resultCriteriaNode.c:46
oval_result_item
Definition: oval_resultItem.c:44
oval_test
An Oval_test specifies a technical control by identifying an oval_object that is evaluated on an inst...
Definition: oval_test.c:47
oval_result_criteria_node::oval_result_criteria_node_clone
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_directives.h
oval_result_system::oval_result_system_clone
struct oval_result_system * oval_result_system_clone(struct oval_results_model *new_model, struct oval_result_system *old_system)
Definition: oval_resultSystem.c:125
oval_generator
Definition: oval_generator.c:44
oval_result_test
Definition: oval_resultTest.c:50