Debian Codegraph @

src/OVAL/results/oval_resultCriteriaNode.c

raw symbols SCIP
1 /**
2 * @file oval_resultCriteriaNode.c
3 * \brief Open Vulnerability and Assessment Language
4 *
5 * See more details at http://oval.mitre.org/
6 */
7
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 *
26 * Authors:
27 * "David Niemoller" <[email protected]>
28 * Šimon Lukašík
29 */
30
31 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`!
32 #include <config.h>cxx . . $ `<file>/build/config.h`/
33 #endif
34
35 #include <stdlib.h>
36 #include <stdio.h>
37 #include <stdarg.h>
38 #include <string.h>
39
40 #include "oval_agent_api_impl.h"cxx . . $ `<file>/src/OVAL/oval_agent_api_impl.h`/
41 #include "results/oval_results_impl.h"cxx . . $ `<file>/src/OVAL/results/oval_results_impl.h`/
42 #include "adt/oval_collection_impl.h"cxx . . $ `<file>/src/OVAL/adt/oval_collection_impl.h`/
43 #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/
44 #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/
45
46 typedef struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# {
47 struct oval_result_systemcxx . . $ oval_result_system# *syscxx . . $ oval_result_criteria_node#sys.;
48 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# typecxx . . $ oval_result_criteria_node#type.;
49 oval_result_tcxx . . $ oval_result_t# resultcxx . . $ oval_result_criteria_node#result.;
50 int negatecxx . . $ oval_result_criteria_node#negate.;
51 int applicability_checkcxx . . $ oval_result_criteria_node#applicability_check.;
52 } oval_result_criteria_node_tcxx . . $ oval_result_criteria_node_t#;
53
54 typedef struct oval_result_criteria_node_CRITERIAcxx . . $ oval_result_criteria_node_CRITERIA# {
55 struct oval_result_systemcxx . . $ oval_result_system# *syscxx . . $ oval_result_criteria_node_CRITERIA#sys.;
56 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# typecxx . . $ oval_result_criteria_node_CRITERIA#type.;
57 oval_result_tcxx . . $ oval_result_t# resultcxx . . $ oval_result_criteria_node_CRITERIA#result.;
58 int negatecxx . . $ oval_result_criteria_node_CRITERIA#negate.;
59 int applicability_checkcxx . . $ oval_result_criteria_node_CRITERIA#applicability_check.;
60 oval_operator_tcxx . . $ oval_operator_t# operatorcxx . . $ oval_result_criteria_node_CRITERIA#operator.;
61 struct oval_collectioncxx . . $ oval_collection# *subnodescxx . . $ oval_result_criteria_node_CRITERIA#subnodes.;
62 } oval_result_criteria_node_CRITERIA_tcxx . . $ oval_result_criteria_node_CRITERIA_t#;
63
64 typedef struct oval_result_criteria_node_CRITERIONcxx . . $ oval_result_criteria_node_CRITERION# {
65 struct oval_result_systemcxx . . $ oval_result_system# *syscxx . . $ oval_result_criteria_node_CRITERION#sys.;
66 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# typecxx . . $ oval_result_criteria_node_CRITERION#type.;
67 oval_result_tcxx . . $ oval_result_t# resultcxx . . $ oval_result_criteria_node_CRITERION#result.;
68 int negatecxx . . $ oval_result_criteria_node_CRITERION#negate.;
69 int applicability_checkcxx . . $ oval_result_criteria_node_CRITERION#applicability_check.;
70 int variable_instancecxx . . $ oval_result_criteria_node_CRITERION#variable_instance.;
71 struct oval_result_testcxx . . $ oval_result_test# *testcxx . . $ oval_result_criteria_node_CRITERION#test.;
72 } oval_result_criteria_node_CRITERION_tcxx . . $ oval_result_criteria_node_CRITERION_t#;
73
74 typedef struct oval_result_criteria_node_EXTENDDEFcxx . . $ oval_result_criteria_node_EXTENDDEF# {
75 struct oval_result_systemcxx . . $ oval_result_system# *syscxx . . $ oval_result_criteria_node_EXTENDDEF#sys.;
76 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# typecxx . . $ oval_result_criteria_node_EXTENDDEF#type.;
77 oval_result_tcxx . . $ oval_result_t# resultcxx . . $ oval_result_criteria_node_EXTENDDEF#result.;
78 int negatecxx . . $ oval_result_criteria_node_EXTENDDEF#negate.;
79 int applicability_checkcxx . . $ oval_result_criteria_node_EXTENDDEF#applicability_check.;
80 int variable_instancecxx . . $ oval_result_criteria_node_EXTENDDEF#variable_instance.;
81 struct oval_result_definitioncxx . . $ oval_result_definition# *extendscxx . . $ oval_result_criteria_node_EXTENDDEF#extends.;
82 } oval_result_criteria_node_EXTENDDEF_tcxx . . $ oval_result_criteria_node_EXTENDDEF_t#;
83
84 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(struct oval_result_systemcxx . . $ oval_result_system# *sys,
85 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# type,
86 int negate,
87 int applicability_check,
88 ...) {
89
90 oval_result_criteria_node_tcxx . . $ oval_result_criteria_node_t# *node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
91 va_listcxx . . $ va_list# ap;
92
93 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(ap, applicability_check);
94 switch (type) {
95 case OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.:{
96 /*(NODETYPE_CRITERIA, negate, applicability_check, operator); */
97 node = (oval_result_criteria_node_tcxx . . $ oval_result_criteria_node_t# *)
98 malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_result_criteria_node_CRITERIA_tcxx . . $ oval_result_criteria_node_CRITERIA_t#));
99 if (node == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
100 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap);
101 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
102 }
103
104 oval_result_criteria_node_CRITERIA_tcxx . . $ oval_result_criteria_node_CRITERIA_t# *criteria = (oval_result_criteria_node_CRITERIA_tcxx . . $ oval_result_criteria_node_CRITERIA_t# *) node;
105 criteria->operatorcxx . . $ oval_result_criteria_node_CRITERIA#operator. =(oval_operator_tcxx . . $ oval_operator_t#) va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, int);
106 criteria->subnodescxx . . $ oval_result_criteria_node_CRITERIA#subnodes. = oval_collection_newcxx . . $ oval_collection_new(18476da3f812812d).();
107 };
108 break;
109 case OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.:{
110 /*(NODETYPE_CRITERION, negate, applicability_check, test, variable_instance); */
111 node = (oval_result_criteria_node_tcxx . . $ oval_result_criteria_node_t# *)
112 malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_result_criteria_node_CRITERION_tcxx . . $ oval_result_criteria_node_CRITERION_t#));
113 if (node == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
114 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap);
115 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
116 }
117
118 oval_result_criteria_node_CRITERION_tcxx . . $ oval_result_criteria_node_CRITERION_t# *criterion =
119 (oval_result_criteria_node_CRITERION_tcxx . . $ oval_result_criteria_node_CRITERION_t# *) node;
120 criterion->testcxx . . $ oval_result_criteria_node_CRITERION#test. = (struct oval_result_testcxx . . $ oval_result_test# *)va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, void *);
121 criterion->variable_instancecxx . . $ oval_result_criteria_node_CRITERION#variable_instance. = va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, int);
122 };
123 break;
124 case OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.:{
125 /*(NODETYPE_EXTENDDEF, negate, applicability_check, definition, variable_instance); */
126 node = (oval_result_criteria_node_tcxx . . $ oval_result_criteria_node_t# *)
127 malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_result_criteria_node_EXTENDDEF_tcxx . . $ oval_result_criteria_node_EXTENDDEF_t#));
128 if (node == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
129 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap);
130 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
131 }
132
133 oval_result_criteria_node_EXTENDDEF_tcxx . . $ oval_result_criteria_node_EXTENDDEF_t# *extenddef =
134 (oval_result_criteria_node_EXTENDDEF_tcxx . . $ oval_result_criteria_node_EXTENDDEF_t# *) node;
135 extenddef->extendscxx . . $ oval_result_criteria_node_EXTENDDEF#extends. = (struct oval_result_definitioncxx . . $ oval_result_definition# *)va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, void *);
136 extenddef->variable_instancecxx . . $ oval_result_criteria_node_EXTENDDEF#variable_instance. = va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(ap, int);
137 } break;
138 default:
139 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap);
140 dEcxx . . $ `src/common/debug_priv.h:63:9`!("Unsupported criteria node type: %d.", type);
141 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
142 }
143 node->syscxx . . $ oval_result_criteria_node#sys. = sys;
144 node->negatecxx . . $ oval_result_criteria_node#negate. = negate;
145 node->applicability_checkcxx . . $ oval_result_criteria_node#applicability_check. = applicability_check;
146 node->resultcxx . . $ oval_result_criteria_node#result. = OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.;
147 node->typecxx . . $ oval_result_criteria_node#type. = type;
148 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap);
149 return node;
150 }
151
152 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *oval_result_criteria_node_clonecxx . . $ oval_result_criteria_node_clone(39179caf33eaa4c7).
153 (struct oval_result_systemcxx . . $ oval_result_system# *new_system, struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *old_node) {
154 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# type = oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(old_node);
155 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *new_node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
156 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! negate = oval_result_criteria_node_get_negatecxx . . $ oval_result_criteria_node_get_negate(2daa5dcb8401be0e).(old_node);
157 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! applicability_check = oval_result_criteria_node_get_applicability_checkcxx . . $ oval_result_criteria_node_get_applicability_check(2daa5dcb8401be0e).(old_node);
158 switch (type) {
159 case OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.:{
160 oval_operator_tcxx . . $ oval_operator_t# operator = oval_result_criteria_node_get_operatorcxx . . $ oval_result_criteria_node_get_operator(85eb9680abf9543b).(old_node);
161 new_node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(new_system,
162 OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.,
163 negate,
164 applicability_check,
165 operator);
166 struct oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator# *old_subs =
167 oval_result_criteria_node_get_subnodescxx . . $ oval_result_criteria_node_get_subnodes(6060a9ca9cbce0f0).(old_node);
168 while (oval_result_criteria_node_iterator_has_morecxx . . $ oval_result_criteria_node_iterator_has_more(c713111b54e31656).(old_subs)) {
169 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *old_sub =
170 oval_result_criteria_node_iterator_nextcxx . . $ oval_result_criteria_node_iterator_next(7f8ca93031229dd4).(old_subs);
171 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *new_sub =
172 oval_result_criteria_node_clonecxx . . $ oval_result_criteria_node_clone(39179caf33eaa4c7).(new_system, old_sub);
173 oval_result_criteria_node_add_subnodecxx . . $ oval_result_criteria_node_add_subnode(59f1dbe278895574).(new_node, new_sub);
174 }
175 oval_result_criteria_node_iterator_freecxx . . $ oval_result_criteria_node_iterator_free(9984fc3697796a2).(old_subs);
176 };
177 break;
178 case OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.:{
179 struct oval_result_testcxx . . $ oval_result_test# *old_test = oval_result_criteria_node_get_testcxx . . $ oval_result_criteria_node_get_test(f9b1fbaeac56e530).(old_node);
180 struct oval_result_testcxx . . $ oval_result_test# *new_test = oval_result_test_clonecxx . . $ oval_result_test_clone(167630a09afaa8cf).(new_system, old_test);
181 new_node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(new_system,
182 OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.,
183 negate,
184 applicability_check,
185 new_test,
186 1);
187 };
188 break;
189 case OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.:{
190 struct oval_result_definitioncxx . . $ oval_result_definition# *old_def = oval_result_criteria_node_get_extendscxx . . $ oval_result_criteria_node_get_extends(2bf163ddf4cef3a5).(old_node);
191 struct oval_result_definitioncxx . . $ oval_result_definition# *new_def = oval_result_definition_clonecxx . . $ oval_result_definition_clone(cf94456acd15f3).(new_system, old_def);
192 new_node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(new_system,
193 OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.,
194 negate,
195 applicability_check,
196 new_def, 1);
197 } break;
198 default:
199 break;
200 }
201 oval_result_criteria_node_set_resultcxx . . $ oval_result_criteria_node_set_result(9d12669d043449e0).(old_node, oval_result_criteria_node_get_resultcxx . . $ oval_result_criteria_node_get_result(2e45f482f2a06215).(old_node));
202 return new_node;
203 }
204
205 void oval_result_criteria_node_freecxx . . $ oval_result_criteria_node_free(f96b6162ea43d2df).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node)
206 {
207 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
208
209 switch (node->typecxx . . $ oval_result_criteria_node#type.) {
210 case OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.:{
211 oval_result_criteria_node_CRITERIA_tcxx . . $ oval_result_criteria_node_CRITERIA_t# *criteria = (oval_result_criteria_node_CRITERIA_tcxx . . $ oval_result_criteria_node_CRITERIA_t# *) node;
212 criteria->operatorcxx . . $ oval_result_criteria_node_CRITERIA#operator. = OVAL_OPERATOR_UNKNOWNcxx . . $ OVAL_OPERATOR_UNKNOWN.;
213 oval_collection_free_itemscxx . . $ oval_collection_free_items(637ec69504f927f1).
214 (criteria->subnodescxx . . $ oval_result_criteria_node_CRITERIA#subnodes., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_result_criteria_node_freecxx . . $ oval_result_criteria_node_free(f96b6162ea43d2df).);
215 };
216 break;
217 case OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.:{
218 oval_result_criteria_node_CRITERION_tcxx . . $ oval_result_criteria_node_CRITERION_t# *criterion =
219 (oval_result_criteria_node_CRITERION_tcxx . . $ oval_result_criteria_node_CRITERION_t# *) node;
220 criterion->testcxx . . $ oval_result_criteria_node_CRITERION#test. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
221 };
222 break;
223 case OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.:{
224 oval_result_criteria_node_EXTENDDEF_tcxx . . $ oval_result_criteria_node_EXTENDDEF_t# *extenddef =
225 (oval_result_criteria_node_EXTENDDEF_tcxx . . $ oval_result_criteria_node_EXTENDDEF_t# *) node;
226 extenddef->extendscxx . . $ oval_result_criteria_node_EXTENDDEF#extends. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
227 }
228 break;
229 default:
230 break;
231 }
232 node->resultcxx . . $ oval_result_criteria_node#result. = OVAL_RESULT_UNKNOWNcxx . . $ OVAL_RESULT_UNKNOWN.;
233 node->typecxx . . $ oval_result_criteria_node#type. = OVAL_NODETYPE_UNKNOWNcxx . . $ OVAL_NODETYPE_UNKNOWN.;
234 freecxx . . $ free(5d22bdacc48458e8).(node);
235 }
236
237 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *make_result_criteria_node_from_oval_criteria_nodecxx . . $ make_result_criteria_node_from_oval_criteria_node(97ded6c487808541).(
238 struct oval_result_systemcxx . . $ oval_result_system# *sys, struct oval_criteria_nodecxx . . $ oval_criteria_node# *oval_node,
239 struct oscap_listcxx . . $ oscap_list# *visited_definitions, int variable_instance)
240 {
241 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *rslt_node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
242 if (oval_node) {
243 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# type = oval_criteria_node_get_typecxx . . $ oval_criteria_node_get_type(ef81df196a9c20f6).(oval_node);
244 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! negate = oval_criteria_node_get_negatecxx . . $ oval_criteria_node_get_negate(aa0e5da8f114c6e5).(oval_node);
245 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! applicability_check = oval_criteria_node_get_applicability_checkcxx . . $ oval_criteria_node_get_applicability_check(aa0e5da8f114c6e5).(oval_node);
246 switch (type) {
247 case OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.:{
248 oval_operator_tcxx . . $ oval_operator_t# operator = oval_criteria_node_get_operatorcxx . . $ oval_criteria_node_get_operator(3c44d2a2b50c8252).(oval_node);
249 rslt_node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(sys,
250 type,
251 negate,
252 applicability_check,
253 operator);
254 struct oval_criteria_node_iteratorcxx . . $ oval_criteria_node_iterator# *oval_subnodes
255 = oval_criteria_node_get_subnodescxx . . $ oval_criteria_node_get_subnodes(664e31975832357a).(oval_node);
256 while (oval_criteria_node_iterator_has_morecxx . . $ oval_criteria_node_iterator_has_more(1d7c354b15b37d35).(oval_subnodes)) {
257 struct oval_criteria_nodecxx . . $ oval_criteria_node# *oval_subnode
258 = oval_criteria_node_iterator_nextcxx . . $ oval_criteria_node_iterator_next(6cad1f2abc1761f6).(oval_subnodes);
259 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *rslt_subnode
260 = make_result_criteria_node_from_oval_criteria_nodecxx . . $ make_result_criteria_node_from_oval_criteria_node(97ded6c487808541).(sys, oval_subnode, visited_definitions, variable_instance);
261 if (rslt_subnode == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
262 oval_criteria_node_iterator_freecxx . . $ oval_criteria_node_iterator_free(dc39dde275a510d9).(oval_subnodes);
263 oval_result_criteria_node_freecxx . . $ oval_result_criteria_node_free(f96b6162ea43d2df).(rslt_node);
264 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
265 }
266 oval_result_criteria_node_add_subnodecxx . . $ oval_result_criteria_node_add_subnode(59f1dbe278895574).(rslt_node, rslt_subnode);
267 }
268 oval_criteria_node_iterator_freecxx . . $ oval_criteria_node_iterator_free(dc39dde275a510d9).(oval_subnodes);
269 } break;
270 case OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.:{
271 struct oval_testcxx . . $ oval_test# *oval_test = oval_criteria_node_get_testcxx . . $ oval_criteria_node_get_test(a0ab3911a55a3308).(oval_node);
272 struct oval_result_testcxx . . $ oval_result_test# *rslt_test = oval_result_system_get_new_testcxx . . $ oval_result_system_get_new_test(5934dc8ae7e49345).(sys, oval_test, variable_instance);
273 rslt_node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(sys,
274 type,
275 negate,
276 applicability_check,
277 rslt_test, 1);
278 } break;
279 case OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.:{
280 struct oval_definitioncxx . . $ oval_definition# *oval_definition = oval_criteria_node_get_definitioncxx . . $ oval_criteria_node_get_definition(c20eec0d71e88e87).(oval_node);
281 struct oval_result_definitioncxx . . $ oval_result_definition# *rslt_definition
282 = oval_result_system_get_new_definition_with_checkcxx . . $ oval_result_system_get_new_definition_with_check(2bb09844a2d8ada8).(sys, oval_definition, visited_definitions, variable_instance);
283 if (rslt_definition == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
284 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
285 rslt_node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(sys,
286 type,
287 negate,
288 applicability_check,
289 rslt_definition, 1);
290 } break;
291 default:
292 rslt_node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
293 }
294 }
295 return rslt_node;
296 }
297
298 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! oval_result_criteria_node_iterator_has_morecxx . . $ oval_result_criteria_node_iterator_has_more(c713111b54e31656).(struct oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator# * oc_result_criteria_node)
299 {
300 return oval_collection_iterator_has_morecxx . . $ oval_collection_iterator_has_more(de0650ab9b639739).((struct oval_iteratorcxx . . $ oval_iterator# *)
301 oc_result_criteria_node);
302 }
303
304 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *oval_result_criteria_node_iterator_nextcxx . . $ oval_result_criteria_node_iterator_next(7f8ca93031229dd4).(struct
305 oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator#
306 *oc_result_criteria_node)
307 {
308 return (struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *)
309 oval_collection_iterator_nextcxx . . $ oval_collection_iterator_next(344074693c9690a9).((struct oval_iteratorcxx . . $ oval_iterator# *)
310 oc_result_criteria_node);
311 }
312
313 void oval_result_criteria_node_iterator_freecxx . . $ oval_result_criteria_node_iterator_free(9984fc3697796a2).(struct
314 oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator#
315 *oc_result_criteria_node)
316 {
317 oval_collection_iterator_freecxx . . $ oval_collection_iterator_free(ee496816570b41f7).((struct oval_iteratorcxx . . $ oval_iterator# *)
318 oc_result_criteria_node);
319 }
320
321 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node)
322 {
323 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
324
325 oval_criteria_node_type_tcxx . . $ oval_criteria_node_type_t# type = ((struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *)node)->typecxx . . $ oval_result_criteria_node#type.;
326 return type;
327 }
328
329 static struct oval_result_systemcxx . . $ oval_result_system# *oval_result_criteria_get_systemcxx . . $ oval_result_criteria_get_system(40059f0d9f88ccb7).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node)
330 {
331 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
332
333 return node->syscxx . . $ oval_result_criteria_node#sys.;
334 }
335
336 oval_result_tcxx . . $ oval_result_t# oval_result_criteria_node_negatecxx . . $ oval_result_criteria_node_negate(dfb7a8998dd94603).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, oval_result_tcxx . . $ oval_result_t# result)
337 {
338 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! negate = node->negatecxx . . $ oval_result_criteria_node#negate.;
339 return (negate && result == OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE.) ? OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE. :
340 (negate && result == OVAL_RESULT_FALSEcxx . . $ OVAL_RESULT_FALSE.) ? OVAL_RESULT_TRUEcxx . . $ OVAL_RESULT_TRUE. : result;
341 }
342
343
344 static oval_result_tcxx . . $ oval_result_t# _oval_result_criteria_node_resultcxx . . $ _oval_result_criteria_node_result(2e45f482f2a06215).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node) {
345 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
346
347 oval_result_tcxx . . $ oval_result_t# result;
348 switch (node->typecxx . . $ oval_result_criteria_node#type.) {
349 case OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.:{
350 struct oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator# *subnodes
351 = oval_result_criteria_node_get_subnodescxx . . $ oval_result_criteria_node_get_subnodes(6060a9ca9cbce0f0).(node);
352 oval_operator_tcxx . . $ oval_operator_t# operator = oval_result_criteria_node_get_operatorcxx . . $ oval_result_criteria_node_get_operator(85eb9680abf9543b).(node);
353 struct oresultscxx . . $ oresults# node_res;
354 ores_clearcxx . . $ ores_clear(35cef2d1a5f4f1bc).(&node_res);
355 while (oval_result_criteria_node_iterator_has_morecxx . . $ oval_result_criteria_node_iterator_has_more(c713111b54e31656).(subnodes)) {
356 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *subnode
357 = oval_result_criteria_node_iterator_nextcxx . . $ oval_result_criteria_node_iterator_next(7f8ca93031229dd4).(subnodes);
358 oval_result_tcxx . . $ oval_result_t# subres = oval_result_criteria_node_evalcxx . . $ oval_result_criteria_node_eval(2e45f482f2a06215).(subnode);
359 ores_add_rescxx . . $ ores_add_res(a8d562e6ba457016).(&node_res, subres);
360 }
361 oval_result_criteria_node_iterator_freecxx . . $ oval_result_criteria_node_iterator_free(9984fc3697796a2).(subnodes);
362 result = ores_get_result_byoprcxx . . $ ores_get_result_byopr(81735a73c930a9ac).(&node_res, operator);
363
364 } break;
365 case OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.:{
366 struct oval_result_testcxx . . $ oval_result_test# *test = oval_result_criteria_node_get_testcxx . . $ oval_result_criteria_node_get_test(f9b1fbaeac56e530).(node);
367 result = oval_result_test_evalcxx . . $ oval_result_test_eval(2fe1748e889465b4).(test);
368 } break;
369 case OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.:{
370 struct oval_result_definitioncxx . . $ oval_result_definition# *extends = oval_result_criteria_node_get_extendscxx . . $ oval_result_criteria_node_get_extends(2bf163ddf4cef3a5).(node);
371 const char *def_id = oval_result_definition_get_idcxx . . $ oval_result_definition_get_id(2b67139a5c095845).(extends);
372 dIcxx . . $ `src/common/debug_priv.h:61:9`!("Criteria are extended by definition '%s'.", def_id);
373 result = oval_result_definition_evalcxx . . $ oval_result_definition_eval(38fa66758ada5ee).(extends);
374 } break;
375 default:
376 abortcxx . . $ abort(8df32a62017fbbf6). ();
377 break;
378 }
379
380 result = oval_result_criteria_node_negatecxx . . $ oval_result_criteria_node_negate(dfb7a8998dd94603).(node, result);
381
382 return result;
383 }
384
385 oval_result_tcxx . . $ oval_result_t# oval_result_criteria_node_evalcxx . . $ oval_result_criteria_node_eval(2e45f482f2a06215).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# * node)
386 {
387 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
388
389 if (node->resultcxx . . $ oval_result_criteria_node#result. == OVAL_RESULT_NOT_EVALUATEDcxx . . $ OVAL_RESULT_NOT_EVALUATED.) {
390 node->resultcxx . . $ oval_result_criteria_node#result. = _oval_result_criteria_node_resultcxx . . $ _oval_result_criteria_node_result(2e45f482f2a06215).(node);
391 }
392 return node->resultcxx . . $ oval_result_criteria_node#result.;
393 }
394
395 oval_result_tcxx . . $ oval_result_t# oval_result_criteria_node_get_resultcxx . . $ oval_result_criteria_node_get_result(2e45f482f2a06215).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# * node)
396 {
397 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
398
399 return node->resultcxx . . $ oval_result_criteria_node#result.;
400 }
401
402 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! oval_result_criteria_node_get_negatecxx . . $ oval_result_criteria_node_get_negate(2daa5dcb8401be0e).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# * node) {
403 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
404
405 return node->negatecxx . . $ oval_result_criteria_node#negate.;
406 }
407
408 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! oval_result_criteria_node_get_applicability_checkcxx . . $ oval_result_criteria_node_get_applicability_check(2daa5dcb8401be0e).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# * node) {
409 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
410
411 return node->applicability_checkcxx . . $ oval_result_criteria_node#applicability_check.;
412 }
413
414 oval_operator_tcxx . . $ oval_operator_t# oval_result_criteria_node_get_operatorcxx . . $ oval_result_criteria_node_get_operator(85eb9680abf9543b).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# * node)
415 {
416 /*type==NODETYPE_CRITERIA */
417 oval_operator_tcxx . . $ oval_operator_t# operator = OVAL_OPERATOR_UNKNOWNcxx . . $ OVAL_OPERATOR_UNKNOWN.;
418 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.) {
419 operator =((struct oval_result_criteria_node_CRITERIAcxx . . $ oval_result_criteria_node_CRITERIA# *)node)->operatorcxx . . $ oval_result_criteria_node_CRITERIA#operator.;
420 }
421 return operator;
422 }
423
424 struct oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator# *oval_result_criteria_node_get_subnodescxx . . $ oval_result_criteria_node_get_subnodes(6060a9ca9cbce0f0).(struct
425 oval_result_criteria_nodecxx . . $ oval_result_criteria_node#
426 *node)
427 {
428 /*type==NODETYPE_CRITERIA */
429 struct oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator# *subnodes = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
430 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.) {
431 struct oval_result_criteria_node_CRITERIAcxx . . $ oval_result_criteria_node_CRITERIA# *criteria = (struct oval_result_criteria_node_CRITERIAcxx . . $ oval_result_criteria_node_CRITERIA# *)node;
432 subnodes = (struct oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator# *)
433 oval_collection_iteratorcxx . . $ oval_collection_iterator(8bdeb6a25e21af3e).(criteria->subnodescxx . . $ oval_result_criteria_node_CRITERIA#subnodes.);
434 }
435 return subnodes;
436 }
437
438 struct oval_result_testcxx . . $ oval_result_test# *oval_result_criteria_node_get_testcxx . . $ oval_result_criteria_node_get_test(f9b1fbaeac56e530).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node) {
439 /*type==NODETYPE_CRITERION */
440 struct oval_result_testcxx . . $ oval_result_test# *test = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
441 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.) {
442 test = ((struct oval_result_criteria_node_CRITERIONcxx . . $ oval_result_criteria_node_CRITERION# *)node)->testcxx . . $ oval_result_criteria_node_CRITERION#test.;
443 }
444 return test;
445 }
446
447 struct oval_result_definitioncxx . . $ oval_result_definition# *oval_result_criteria_node_get_extendscxx . . $ oval_result_criteria_node_get_extends(2bf163ddf4cef3a5).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node) {
448 /*type==NODETYPE_EXTENDDEF */
449 struct oval_result_definitioncxx . . $ oval_result_definition# *extends = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
450 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.) {
451 extends = ((struct oval_result_criteria_node_EXTENDDEFcxx . . $ oval_result_criteria_node_EXTENDDEF# *)node)->extendscxx . . $ oval_result_criteria_node_EXTENDDEF#extends.;
452 }
453 return extends;
454 }
455
456 void oval_result_criteria_node_set_resultcxx . . $ oval_result_criteria_node_set_result(9d12669d043449e0).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, oval_result_tcxx . . $ oval_result_t# result)
457 {
458 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
459 node->resultcxx . . $ oval_result_criteria_node#result. = result;
460 }
461
462 void oval_result_criteria_node_set_negatecxx . . $ oval_result_criteria_node_set_negate(233aa2dcf6d70a20).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! negate)
463 {
464 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
465 node->negatecxx . . $ oval_result_criteria_node#negate. = negate;
466 }
467
468 void oval_result_criteria_node_set_applicability_checkcxx . . $ oval_result_criteria_node_set_applicability_check(233aa2dcf6d70a20).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node,
469 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! applicability_check)
470 {
471 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
472 node->applicability_checkcxx . . $ oval_result_criteria_node#applicability_check. = applicability_check;
473 }
474
475 void oval_result_criteria_node_add_subnodecxx . . $ oval_result_criteria_node_add_subnode(59f1dbe278895574).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *subnode)
476 {
477 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
478
479 /*type==NODETYPE_CRITERIA */
480 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.) {
481 struct oval_result_criteria_node_CRITERIAcxx . . $ oval_result_criteria_node_CRITERIA# *criteria = ((struct oval_result_criteria_node_CRITERIAcxx . . $ oval_result_criteria_node_CRITERIA# *)node);
482 oval_collection_addcxx . . $ oval_collection_add(3c6bf54730c0284).(criteria->subnodescxx . . $ oval_result_criteria_node_CRITERIA#subnodes., subnode);
483 }
484 }
485
486 void oval_result_criteria_node_set_operatorcxx . . $ oval_result_criteria_node_set_operator(219c13d2b123c3d8).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, oval_operator_tcxx . . $ oval_operator_t# operator)
487 {
488 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
489 /*type==NODETYPE_CRITERIA */
490 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.) {
491 ((struct oval_result_criteria_node_CRITERIAcxx . . $ oval_result_criteria_node_CRITERIA# *)node)->operatorcxx . . $ oval_result_criteria_node_CRITERIA#operator. = operator;
492 }
493 }
494
495 void oval_result_criteria_node_set_testcxx . . $ oval_result_criteria_node_set_test(cfd8bac85116a64).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, struct oval_result_testcxx . . $ oval_result_test# *test)
496 {
497 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
498 /*type==NODETYPE_CRITERION */
499 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.) {
500 ((struct oval_result_criteria_node_CRITERIONcxx . . $ oval_result_criteria_node_CRITERION# *)node)->testcxx . . $ oval_result_criteria_node_CRITERION#test. = test;
501 }
502 }
503
504 void oval_result_criteria_node_set_extendscxx . . $ oval_result_criteria_node_set_extends(8a31cfb37f5b6937).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, struct oval_result_definitioncxx . . $ oval_result_definition# *extends)
505 {
506 __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(node);
507 /*type==NODETYPE_EXTENDDEF */
508 if (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node) == OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.) {
509 ((struct oval_result_criteria_node_EXTENDDEFcxx . . $ oval_result_criteria_node_EXTENDDEF# *)node)->extendscxx . . $ oval_result_criteria_node_EXTENDDEF#extends. = extends;
510 }
511 }
512
513 static void _oval_result_criteria_consume_subnodecxx . . $ _oval_result_criteria_consume_subnode(59f1dbe278895574).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *subnode, struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node) {
514 oval_result_criteria_node_add_subnodecxx . . $ oval_result_criteria_node_add_subnode(59f1dbe278895574).(node, subnode);
515 }
516
517 static int _oval_result_criteria_parsecxx . . $ _oval_result_criteria_parse(cf369959597901d1).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, struct oval_parser_contextcxx . . $ oval_parser_context# *context, void *usr) {
518 struct oval_result_systemcxx . . $ oval_result_system# *sys = oval_result_criteria_get_systemcxx . . $ oval_result_criteria_get_system(40059f0d9f88ccb7).(usr);
519 return oval_result_criteria_node_parsecxx . . $ oval_result_criteria_node_parse(5cfa71e0f637957f).(reader, context, sys, (oscap_consumer_funccxx . . $ oscap_consumer_func#) _oval_result_criteria_consume_subnodecxx . . $ _oval_result_criteria_consume_subnode(59f1dbe278895574)., usr);
520 }
521
522 int oval_result_criteria_node_parsecxx . . $ oval_result_criteria_node_parse(5cfa71e0f637957f).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader,
523 struct oval_parser_contextcxx . . $ oval_parser_context# *context,
524 struct oval_result_systemcxx . . $ oval_result_system# *sys,
525 oscap_consumer_funccxx . . $ oscap_consumer_func# consumer,
526 void *client)
527 {
528 xmlCharcxx . . $ xmlChar# *localName = xmlTextReaderLocalNamecxx . . $ xmlTextReaderLocalName(3322afb275581432).(reader);
529 int rc = 0;
530
531 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
532 if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char *)localName, "criteria") == 0) {
533 oval_operator_tcxx . . $ oval_operator_t# operator = oval_operator_parsecxx . . $ oval_operator_parse(68bd3d297b7c50e).(reader, "operator", OVAL_OPERATOR_UNKNOWNcxx . . $ OVAL_OPERATOR_UNKNOWN.);
534 int negate = oval_parser_boolean_attributecxx . . $ oval_parser_boolean_attribute(a53adaee35698733).(reader, "negate", falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
535 int applicability_check = oval_parser_boolean_attributecxx . . $ oval_parser_boolean_attribute(a53adaee35698733).(reader, "applicability_check", falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
536 node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(sys,
537 OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.,
538 negate,
539 applicability_check,
540 operator);
541 rc = oval_parser_parse_tagcxx . . $ oval_parser_parse_tag(4eaaf867ce26f59b).(reader, context, _oval_result_criteria_parsecxx . . $ _oval_result_criteria_parse(cf369959597901d1)., node);
542 } else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char *)localName, "criterion") == 0) {
543 xmlCharcxx . . $ xmlChar# *test_ref = xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "test_ref");
544 int variable_instance = oval_parser_int_attributecxx . . $ oval_parser_int_attribute(a53adaee35698733).(reader, "variable_instance", 1);
545 int negate = oval_parser_boolean_attributecxx . . $ oval_parser_boolean_attribute(a53adaee35698733).(reader, "negate", falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
546 int applicability_check = oval_parser_boolean_attributecxx . . $ oval_parser_boolean_attribute(a53adaee35698733).(reader, "applicability_check", falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
547
548 struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model = oval_result_system_get_syschar_modelcxx . . $ oval_result_system_get_syschar_model(5f48a1cbef7fd193).(sys);
549 struct oval_definition_modelcxx . . $ oval_definition_model# *definition_model = oval_syschar_model_get_definition_modelcxx . . $ oval_syschar_model_get_definition_model(be4563ea788378af).(syschar_model);
550 struct oval_testcxx . . $ oval_test# *oval_test = oval_definition_model_get_new_testcxx . . $ oval_definition_model_get_new_test(c765f99071e189c).(definition_model, (char *)test_ref);
551 struct oval_result_testcxx . . $ oval_result_test# *rslt_test = oval_result_system_get_new_testcxx . . $ oval_result_system_get_new_test(5934dc8ae7e49345).(sys, oval_test, variable_instance);
552
553 node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(sys,
554 OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.,
555 negate,
556 applicability_check,
557 rslt_test,
558 variable_instance);
559 freecxx . . $ free(5d22bdacc48458e8).(test_ref);
560 } else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char *)localName, "extend_definition") == 0) {
561 xmlCharcxx . . $ xmlChar# *definition_ref = xmlTextReaderGetAttributecxx . . $ xmlTextReaderGetAttribute(6d056300a6ef2116).(reader, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "definition_ref");
562 int variable_instance = oval_parser_int_attributecxx . . $ oval_parser_int_attribute(a53adaee35698733).(reader, "variable_instance", 1);
563 int negate = oval_parser_boolean_attributecxx . . $ oval_parser_boolean_attribute(a53adaee35698733).(reader, "negate", falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
564 int applicability_check = oval_parser_boolean_attributecxx . . $ oval_parser_boolean_attribute(a53adaee35698733).(reader, "applicability_check", falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
565 struct oval_syschar_modelcxx . . $ oval_syschar_model# *syschar_model = oval_result_system_get_syschar_modelcxx . . $ oval_result_system_get_syschar_model(5f48a1cbef7fd193).(sys);
566 struct oval_definition_modelcxx . . $ oval_definition_model# *definition_model = oval_syschar_model_get_definition_modelcxx . . $ oval_syschar_model_get_definition_model(be4563ea788378af).(syschar_model);
567 struct oval_definitioncxx . . $ oval_definition# *oval_definition = oval_definition_model_get_new_definitioncxx . . $ oval_definition_model_get_new_definition(d4bef07f0697769).(definition_model, (char *)definition_ref);
568 struct oval_result_definitioncxx . . $ oval_result_definition# *rslt_definition = oval_result_system_get_new_definitioncxx . . $ oval_result_system_get_new_definition(7d495e95dbf76cc4).(sys, oval_definition, variable_instance);
569 node = oval_result_criteria_node_newcxx . . $ oval_result_criteria_node_new(ae16f019e17e1808).(sys,
570 OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.,
571 negate,
572 applicability_check,
573 rslt_definition,
574 variable_instance);
575 freecxx . . $ free(5d22bdacc48458e8).(definition_ref);
576 } else {
577 dWcxx . . $ `src/common/debug_priv.h:62:9`!("unhandled criteria node: <%s>.",(char *)localName);
578 oval_parser_skip_tagcxx . . $ oval_parser_skip_tag(b61d4daae99e998a).(reader, context);
579 }
580
581 if (node==NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || rc==-1) {
582 dEcxx . . $ `src/common/debug_priv.h:63:9`!("Can't parse result criteria node.");
583 return 1;
584 }
585
586 oval_result_tcxx . . $ oval_result_t# result = oval_result_parsecxx . . $ oval_result_parse(7314a5850c06c36d).(reader, "result", 0);
587 oval_result_criteria_node_set_resultcxx . . $ oval_result_criteria_node_set_result(9d12669d043449e0).(node, result);
588
589 (*consumer) (node, client);
590
591
592 freecxx . . $ free(5d22bdacc48458e8).(localName);
593 return rc;
594 }
595
596 static xmlNodecxx . . $ xmlNode# *_oval_result_CRITERIA_to_domcxx . . $ _oval_result_CRITERIA_to_dom(5626c2c640298092).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, xmlDocPtrcxx . . $ xmlDocPtr# doc, xmlNodecxx . . $ xmlNode# * parent) {
597 xmlNscxx . . $ xmlNs# *ns_results = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, parent, OVAL_RESULTS_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:57:9`!);
598 xmlNodecxx . . $ xmlNode# *node_root = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, ns_results, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "criteria", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
599
600 oval_operator_tcxx . . $ oval_operator_t# operator = oval_result_criteria_node_get_operatorcxx . . $ oval_result_criteria_node_get_operator(85eb9680abf9543b).(node);
601 const char *operator_att = oval_operator_get_textcxx . . $ oval_operator_get_text(31e5cd98682f5d2e).(operator);
602 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node_root, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "operator", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! operator_att);
603
604 struct oval_result_criteria_node_iteratorcxx . . $ oval_result_criteria_node_iterator# *subnodes = oval_result_criteria_node_get_subnodescxx . . $ oval_result_criteria_node_get_subnodes(6060a9ca9cbce0f0).(node);
605 while (oval_result_criteria_node_iterator_has_morecxx . . $ oval_result_criteria_node_iterator_has_more(c713111b54e31656).(subnodes)) {
606 struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *subnode = oval_result_criteria_node_iterator_nextcxx . . $ oval_result_criteria_node_iterator_next(7f8ca93031229dd4).(subnodes);
607 oval_result_criteria_node_to_domcxx . . $ oval_result_criteria_node_to_dom(5626c2c640298092).(subnode, doc, node_root);
608 }
609 oval_result_criteria_node_iterator_freecxx . . $ oval_result_criteria_node_iterator_free(9984fc3697796a2).(subnodes);
610 return node_root;
611 }
612
613 static xmlNodecxx . . $ xmlNode# *_oval_result_CRITERION_to_domcxx . . $ _oval_result_CRITERION_to_dom(5626c2c640298092).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, xmlDocPtrcxx . . $ xmlDocPtr# doc, xmlNodecxx . . $ xmlNode# * parent) {
614 xmlNscxx . . $ xmlNs# *ns_results = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, parent, OVAL_RESULTS_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:57:9`!);
615 xmlNodecxx . . $ xmlNode# *node_root = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, ns_results, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "criterion", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
616
617 struct oval_result_testcxx . . $ oval_result_test# *rslt_test = oval_result_criteria_node_get_testcxx . . $ oval_result_criteria_node_get_test(f9b1fbaeac56e530).(node);
618 struct oval_testcxx . . $ oval_test# *oval_test = oval_result_test_get_testcxx . . $ oval_result_test_get_test(37dedc4a312dc786).(rslt_test);
619 char *test_ref = oval_test_get_idcxx . . $ oval_test_get_id(6776e4970683fd20).(oval_test);
620 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node_root, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "test_ref", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! test_ref);
621
622 char version[10];
623 *version = '\0';
624 snprintfcxx . . $ snprintf(ea502d73e74c754c).(version, sizeof(version), "%d", oval_test_get_versioncxx . . $ oval_test_get_version(9ebe9a7516516147).(oval_test));
625 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node_root, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "version", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! version);
626
627 int instance = ((struct oval_result_criteria_node_CRITERIONcxx . . $ oval_result_criteria_node_CRITERION# *) node)->variable_instancecxx . . $ oval_result_criteria_node_CRITERION#variable_instance.;
628 if (instance != 1) {
629 char instance_att[10] = "";
630 snprintfcxx . . $ snprintf(ea502d73e74c754c).(instance_att, sizeof (instance_att), "%d", instance);
631 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node_root, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "variable_instance", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! instance_att);
632 }
633
634 return node_root;
635
636 }
637
638 static xmlNodecxx . . $ xmlNode# *_oval_result_EXTENDDEF_to_domcxx . . $ _oval_result_EXTENDDEF_to_dom(5626c2c640298092).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# *node, xmlDocPtrcxx . . $ xmlDocPtr# doc, xmlNodecxx . . $ xmlNode# * parent) {
639 xmlNscxx . . $ xmlNs# *ns_results = xmlSearchNsByHrefcxx . . $ xmlSearchNsByHref(d0fb0b6b99319c4).(doc, parent, OVAL_RESULTS_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:57:9`!);
640 xmlNodecxx . . $ xmlNode# *node_root = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, ns_results, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "extend_definition", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
641
642 struct oval_result_definitioncxx . . $ oval_result_definition# *rslt_definition = oval_result_criteria_node_get_extendscxx . . $ oval_result_criteria_node_get_extends(2bf163ddf4cef3a5).(node);
643 struct oval_definitioncxx . . $ oval_definition# *oval_definition = oval_result_definition_get_definitioncxx . . $ oval_result_definition_get_definition(3933d69144cda8f).(rslt_definition);
644
645 char *definition_ref = oval_definition_get_idcxx . . $ oval_definition_get_id(293cc7080a5789e2).(oval_definition);
646 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node_root, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "definition_ref", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! definition_ref);
647
648 int version = oval_definition_get_versioncxx . . $ oval_definition_get_version(5d9693806bb51fdb).(oval_definition);
649 char version_att[10] = "";
650 snprintfcxx . . $ snprintf(ea502d73e74c754c).(version_att, sizeof(version_att), "%d", version);
651 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node_root, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "version", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! version_att);
652
653 int instance = ((struct oval_result_criteria_node_EXTENDDEFcxx . . $ oval_result_criteria_node_EXTENDDEF# *) node)->variable_instancecxx . . $ oval_result_criteria_node_EXTENDDEF#variable_instance.;
654 if (instance != 1) {
655 char instance_att[10] = "";
656 snprintfcxx . . $ snprintf(ea502d73e74c754c).(instance_att, sizeof (instance_att), "%d", instance);
657 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node_root, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "variable_instance", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! instance_att);
658 }
659
660 return node_root;
661
662 }
663
664 xmlNodecxx . . $ xmlNode# *oval_result_criteria_node_to_domcxx . . $ oval_result_criteria_node_to_dom(5626c2c640298092).(struct oval_result_criteria_nodecxx . . $ oval_result_criteria_node# * node, xmlDocPtrcxx . . $ xmlDocPtr# doc, xmlNodecxx . . $ xmlNode# * parent) {
665 xmlNodecxx . . $ xmlNode# *criteria_node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
666 switch (oval_result_criteria_node_get_typecxx . . $ oval_result_criteria_node_get_type(171acb683c338180).(node)) {
667 case OVAL_NODETYPE_CRITERIAcxx . . $ OVAL_NODETYPE_CRITERIA.:
668 criteria_node = _oval_result_CRITERIA_to_domcxx . . $ _oval_result_CRITERIA_to_dom(5626c2c640298092).(node, doc, parent);
669 break;
670 case OVAL_NODETYPE_CRITERIONcxx . . $ OVAL_NODETYPE_CRITERION.:
671 criteria_node = _oval_result_CRITERION_to_domcxx . . $ _oval_result_CRITERION_to_dom(5626c2c640298092).(node, doc, parent);
672 break;
673 case OVAL_NODETYPE_EXTENDDEFcxx . . $ OVAL_NODETYPE_EXTENDDEF.:
674 criteria_node = _oval_result_EXTENDDEF_to_domcxx . . $ _oval_result_EXTENDDEF_to_dom(5626c2c640298092).(node, doc, parent);
675 break;
676 default:
677 break;
678 }
679
680 if (criteria_node) {
681 oval_result_tcxx . . $ oval_result_t# result = oval_result_criteria_node_get_resultcxx . . $ oval_result_criteria_node_get_result(2e45f482f2a06215).(node);
682 const char *result_att = oval_result_get_textcxx . . $ oval_result_get_text(889be41b1f382b15).(result);
683 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(criteria_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "result", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! result_att);
684
685 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! negate = oval_result_criteria_node_get_negatecxx . . $ oval_result_criteria_node_get_negate(2daa5dcb8401be0e).(node);
686 if (negate != falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!) {
687 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(criteria_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "negate", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "true");
688 }
689
690 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! applicability_check = oval_result_criteria_node_get_applicability_checkcxx . . $ oval_result_criteria_node_get_applicability_check(2daa5dcb8401be0e).(node);
691 if (applicability_check != falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!) {
692 xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(criteria_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "applicability_check", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "true");
693 }
694 }
695 return criteria_node;
696 }