Open SCAP Library
oval_results_impl.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright 2009--2013 Red Hat Inc., Durham, North Carolina.
10  * All Rights Reserved.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  * Authors:
27  * "David Niemoller" <David.Niemoller@g2-inc.com>
28  * Šimon Lukašík
29  */
30 
31 #ifndef OVAL_RESULTS_IMPL_H_
32 #define OVAL_RESULTS_IMPL_H_
33 
34 #include "public/oval_results.h"
35 
36 #include "oval_definitions_impl.h"
38 #include "adt/oval_smc_impl.h"
39 
40 #include "common/util.h"
41 
42 OSCAP_HIDDEN_START;
43 
44 int oval_result_system_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, void *);
45 xmlNode *oval_result_system_to_dom(struct oval_result_system *, struct oval_results_model *, struct oval_directives_model *, xmlDocPtr, xmlNode *);
46 
47 struct oval_result_test *oval_result_system_get_new_test(struct oval_result_system *, struct oval_test *, int variable_instance);
48 
49 int oval_result_definition_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, void *);
50 struct oval_result_definition *make_result_definition_from_oval_definition(struct oval_result_system *,
51  struct oval_definition *,
52  int variable_instance);
53 xmlNode *oval_result_definition_to_dom(struct oval_result_definition *, oval_result_directive_content_t, xmlDocPtr, xmlNode *);
55 void oval_result_definition_set_variable_instance_hint(struct oval_result_definition *definition, int new_hint_value);
56 
57 struct oval_result_test *make_result_test_from_oval_test(struct oval_result_system *system, struct oval_test *oval_test, int variable_instance);
58 
59 int oval_result_test_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, void *);
60 xmlNode *oval_result_test_to_dom(struct oval_result_test *, xmlDocPtr, xmlNode *);
61 
62 
63 int oval_result_item_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, struct oval_result_system *, oscap_consumer_func, void *);
64 xmlNode *oval_result_item_to_dom(struct oval_result_item *, xmlDocPtr, xmlNode *);
65 
66 struct oval_result_criteria_node *make_result_criteria_node_from_oval_criteria_node(struct oval_result_system *, struct oval_criteria_node *, int variable_instance);
67 
68 int oval_result_criteria_node_parse(xmlTextReaderPtr, struct oval_parser_context *, struct oval_result_system *, oscap_consumer_func, void *);
69 xmlNode *oval_result_criteria_node_to_dom(struct oval_result_criteria_node *, xmlDocPtr, xmlNode *);
70 
71 oval_result_t oval_result_parse(xmlTextReaderPtr, char *, oval_result_t);
72 
73 struct oval_result_definition *oval_result_system_get_new_definition(struct oval_result_system *,
74  struct oval_definition *,
75  int variable_instance);
76 struct oval_result_test *oval_result_system_get_test(struct oval_result_system *, char *);
77 
78 struct oresults {
79  int true_cnt;
80  int false_cnt;
81  int unknown_cnt;
82  int error_cnt;
83  int noteval_cnt;
84  int notappl_cnt;
85 };
86 
87 int ores_add_res(struct oresults *ores, oval_result_t res);
88 void ores_clear(struct oresults *ores);
89 oval_result_t ores_get_result_bychk(struct oresults *ores, oval_check_t check);
90 oval_result_t ores_get_result_byopr(struct oresults *ores, oval_operator_t op);
91 
92 void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *);
93 
94 struct oval_result_definition_iterator *oval_result_definition_iterator_new(struct oval_smc *mapping);
95 struct oval_result_test_iterator *oval_result_test_iterator_new(struct oval_smc *mapping);
96 
97 const char *oval_result_test_get_id(const struct oval_result_test *test);
98 
99 OSCAP_HIDDEN_END;
100 
101 #endif /* OVAL_RESULTS_IMPL_H_ */