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-2013 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 "oval_types.h"
47 #include "oval_system_characteristics.h"
48 #include "oval_directives.h"
49 #include <stdbool.h>
50
51
52 const char *oval_result_get_text(oval_result_t);
53
58 struct oval_results_model;
59
63 struct oval_result_system;
68 struct oval_result_system_iterator;
69
73 struct oval_result_definition;
78 struct oval_result_definition_iterator;
79
83 struct oval_result_test;
88 struct oval_result_test_iterator;
89
93 struct oval_result_item;
98 struct oval_result_item_iterator;
99
100
104 struct oval_result_criteria_node;
109 struct oval_result_criteria_node_iterator;
110
118 struct oval_results_model *oval_results_model_new(struct oval_definition_model *definition_model,
119 struct oval_syschar_model **);
128 int oval_results_model_import(struct oval_results_model *model, const char *file);
134 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
140 void oval_results_model_free(struct oval_results_model *model);
148 int oval_results_model_export(struct oval_results_model *, struct oval_directives_model *, const char *file);
149
154 void oval_results_model_set_generator(struct oval_results_model *model, struct oval_generator *generator);
161 struct oval_generator *oval_results_model_get_generator(struct oval_results_model *model);
167 struct oval_definition_model *oval_results_model_get_definition_model(struct oval_results_model *model);
168
174 struct oval_result_system_iterator *oval_results_model_get_systems(struct oval_results_model *);
186 int oval_results_model_eval(struct oval_results_model *);
197 struct oval_result_system *oval_result_system_new(struct oval_results_model *, struct oval_syschar_model *);
202 struct oval_result_system *oval_result_system_clone(struct oval_results_model *new_model,
203 struct oval_result_system *old_system);
207 void oval_result_system_free(struct oval_result_system *);
208
216 void oval_result_system_add_definition(struct oval_result_system *, struct oval_result_definition *);
220 void oval_result_system_add_test(struct oval_result_system *, struct oval_result_test *);
230 struct oval_results_model *oval_result_system_get_results_model(struct oval_result_system *);
234 struct oval_result_definition *oval_result_system_get_definition(struct oval_result_system *, const char *);
238 struct oval_result_definition_iterator *oval_result_system_get_definitions(struct oval_result_system *);
242 struct oval_result_test_iterator *oval_result_system_get_tests(struct oval_result_system *);
246 struct oval_syschar_model *oval_result_system_get_syschar_model(struct oval_result_system *);
250 struct oval_sysinfo *oval_result_system_get_sysinfo(struct oval_result_system *);
260 bool oval_result_system_iterator_has_more(struct oval_result_system_iterator *);
264 struct oval_result_system *oval_result_system_iterator_next(struct oval_result_system_iterator *);
268 void oval_result_system_iterator_free(struct oval_result_system_iterator *);
282 int oval_result_system_eval(struct oval_result_system *sys);
291 int oval_result_system_eval_definition(struct oval_result_system *sys, const char *id);
302 struct oval_result_definition *oval_result_definition_new(struct oval_result_system *, char *);
307 struct oval_result_definition *oval_result_definition_clone
308 (struct oval_result_system *new_system, struct oval_result_definition *old_definition);
312 void oval_result_definition_free(struct oval_result_definition *);
313
321 void oval_result_definition_set_result(struct oval_result_definition *, oval_result_t);
325 void oval_result_definition_set_instance(struct oval_result_definition *, int);
329 void oval_result_definition_set_criteria(struct oval_result_definition *, struct oval_result_criteria_node *);
333 void oval_result_definition_add_message(struct oval_result_definition *, struct oval_message *);
343 struct oval_definition *oval_result_definition_get_definition(const struct oval_result_definition *);
348 const char *oval_result_definition_get_id(const struct oval_result_definition *rslt_definition);
352 struct oval_result_system *oval_result_definition_get_system(const struct oval_result_definition *);
356 int oval_result_definition_get_instance(const struct oval_result_definition *);
360 oval_result_t oval_result_definition_eval(struct oval_result_definition *);
364 oval_result_t oval_result_definition_get_result(const struct oval_result_definition *);
368 struct oval_message_iterator *oval_result_definition_get_messages(const struct oval_result_definition *);
372 struct oval_result_criteria_node *oval_result_definition_get_criteria(const struct oval_result_definition *);
382 bool oval_result_definition_iterator_has_more(struct oval_result_definition_iterator *);
386 struct oval_result_definition *oval_result_definition_iterator_next(struct oval_result_definition_iterator *);
390 void oval_result_definition_iterator_free(struct oval_result_definition_iterator *);
407 struct oval_result_test *oval_result_test_new(struct oval_result_system *, char *);
412 struct oval_result_test *oval_result_test_clone
413 (struct oval_result_system *new_system, struct oval_result_test *old_test);
417 void oval_result_test_free(struct oval_result_test *);
418
426 void oval_result_test_set_result(struct oval_result_test *, oval_result_t);
430 void oval_result_test_set_instance(struct oval_result_test *test, int instance);
434 void oval_result_test_add_message(struct oval_result_test *, struct oval_message *);
438 void oval_result_test_add_item(struct oval_result_test *, struct oval_result_item *);
442 void oval_result_test_add_binding(struct oval_result_test *, struct oval_variable_binding *);
452 struct oval_test *oval_result_test_get_test(struct oval_result_test *);
456 struct oval_result_system *oval_result_test_get_system(struct oval_result_test *);
460 oval_result_t oval_result_test_eval(struct oval_result_test *);
464 oval_result_t oval_result_test_get_result(struct oval_result_test *);
468 int oval_result_test_get_instance(struct oval_result_test *);
472 struct oval_message_iterator *oval_result_test_get_messages(struct oval_result_test *);
476 struct oval_result_item_iterator *oval_result_test_get_items(struct oval_result_test *);
480 struct oval_variable_binding_iterator *oval_result_test_get_bindings(struct oval_result_test *);
490 bool oval_result_test_iterator_has_more(struct oval_result_test_iterator *);
494 struct oval_result_test *oval_result_test_iterator_next(struct oval_result_test_iterator *);
498 void oval_result_test_iterator_free(struct oval_result_test_iterator *);
515 struct oval_result_item *oval_result_item_new(struct oval_result_system *, char *);
520 struct oval_result_item *oval_result_item_clone
521 (struct oval_result_system *new_system, struct oval_result_item *old_item);
525 void oval_result_item_free(struct oval_result_item *);
526
534 void oval_result_item_set_result(struct oval_result_item *, oval_result_t);
538 void oval_result_item_add_message(struct oval_result_item *, struct oval_message *);
548 struct oval_sysitem *oval_result_item_get_sysitem(struct oval_result_item *);
552 oval_result_t oval_result_item_get_result(struct oval_result_item *);
556 struct oval_message_iterator *oval_result_item_get_messages(struct oval_result_item *);
566 bool oval_result_item_iterator_has_more(struct oval_result_item_iterator *);
570 struct oval_result_item *oval_result_item_iterator_next(struct oval_result_item_iterator *);
574 void oval_result_item_iterator_free(struct oval_result_item_iterator *);
591 struct oval_result_criteria_node *oval_result_criteria_node_new(struct oval_result_system *,
592 oval_criteria_node_type_t,
593 int, int, ...);
598 struct oval_result_criteria_node *oval_result_criteria_node_clone
599 (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node);
603 void oval_result_criteria_node_free(struct oval_result_criteria_node *);
604
612 void oval_result_criteria_node_set_result(struct oval_result_criteria_node *, oval_result_t);
616 void oval_result_criteria_node_set_negate(struct oval_result_criteria_node *, bool);
620 void oval_result_criteria_node_set_applicability_check(struct oval_result_criteria_node *, bool);
624 void oval_result_criteria_node_set_operator(struct oval_result_criteria_node *, oval_operator_t); //type==NODETYPE_CRITERIA
628 void oval_result_criteria_node_add_subnode(struct oval_result_criteria_node *, struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
632 void oval_result_criteria_node_set_test(struct oval_result_criteria_node *, struct oval_result_test *); //type==NODETYPE_CRITERION
636 void oval_result_criteria_node_set_extends(struct oval_result_criteria_node *, struct oval_result_definition *); //type==NODETYPE_EXTENDDEF
645 oval_criteria_node_type_t oval_result_criteria_node_get_type(struct oval_result_criteria_node *);
649 oval_result_t oval_result_criteria_node_eval(struct oval_result_criteria_node *);
653 oval_result_t oval_result_criteria_node_get_result(struct oval_result_criteria_node *);
657 bool oval_result_criteria_node_get_negate(struct oval_result_criteria_node *);
661 bool oval_result_criteria_node_get_applicability_check(struct oval_result_criteria_node *);
665 oval_operator_t oval_result_criteria_node_get_operator(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
669 struct oval_result_criteria_node_iterator *oval_result_criteria_node_get_subnodes(struct oval_result_criteria_node *); //type==NODETYPE_CRITERIA
673 struct oval_result_test *oval_result_criteria_node_get_test(struct oval_result_criteria_node *); //type==NODETYPE_CRITERION
677 struct oval_result_definition *oval_result_criteria_node_get_extends(struct oval_result_criteria_node *); //type==NODETYPE_EXTENDDEF
687 bool oval_result_criteria_node_iterator_has_more(struct oval_result_criteria_node_iterator *);
691 struct oval_result_criteria_node *oval_result_criteria_node_iterator_next(struct oval_result_criteria_node_iterator *);
695 void oval_result_criteria_node_iterator_free(struct oval_result_criteria_node_iterator *);
711 #endif /* OVAL_RESULTS_H_ */
712
oval_operator_t
oval_operator_t
Boolean operators.
Definition: oval_definitions.h:72
oval_syschar_model
OVAL System Characteristics model.
Definition: oval_sysModel.c:52
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:63
oval_result_definition_iterator
Definition: oval_results.h:73
oval_result_system
Definition: oval_resultSystem.c:54
oval_sysinfo
General instrumented host description.
Definition: oval_sysInfo.c:44
oval_results_model
OVAL Results Model holds OVAL results structure instances.
Definition: oval_resModel.c:52
oval_definition
Oval definition specification.
Definition: oval_definition.c:53
oval_criteria_node_type_t
oval_criteria_node_type_t
Criteria node type.
Definition: oval_definitions.h:64
oval_variable_binding_iterator
Definition: oval_system_characteristics.h:179
oval_directives_model
This structure holds instance of OVAL Directives.
oval_types.h
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:59
oval_result_item_iterator
Definition: oval_results.h:93
oval_message
OVAL message.
Definition: oval_message.c:44
oval_variable_binding
Binding of an value to an OVAL variable.
Definition: oval_variableBinding.c:44
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:83
oval_message_iterator
Definition: oval_system_characteristics.h:169
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:99
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:133
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:127
oval_result_criteria_node_iterator
Definition: oval_results.h:104
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:81
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:148
oval_result_test_iterator
Definition: oval_results.h:83
oval_results_model_eval
int oval_results_model_eval(struct oval_results_model *)
Evaluate all result_systems.
Definition: oval_resModel.c:195
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:265
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:326
oval_result_definition
Definition: oval_resultDefinition.c:46
oval_system_characteristics.h
oval_definition_model
Oval definition model.
Definition: oval_defModel.c:49
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:46
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:43
oval_result_test
Definition: oval_resultTest.c:49