| 1 | /** |
| 2 | * @file oval_defModel.c |
| 3 | * \brief Open Vulnerability and Assessment Language |
| 4 | * |
| 5 | * See more details at http://oval.mitre.org/ |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright 2009--2014 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 <string.h> |
| 36 | #include <time.h> |
| 37 | |
| 38 | #include "oval_definitions_impl.h"cxx . . $ `<file>/src/OVAL/oval_definitions_impl.h`/ |
| 39 | #include "oval_agent_api_impl.h"cxx . . $ `<file>/src/OVAL/oval_agent_api_impl.h`/ |
| 40 | #include "oval_parser_impl.h"cxx . . $ `<file>/src/OVAL/oval_parser_impl.h`/ |
| 41 | #include "adt/oval_string_map_impl.h"cxx . . $ `<file>/src/OVAL/adt/oval_string_map_impl.h`/ |
| 42 | #include "oval_system_characteristics_impl.h"cxx . . $ `<file>/src/OVAL/oval_system_characteristics_impl.h`/ |
| 43 | #if defined(OVAL_PROBES_ENABLEDcxx . . $ `build/config.h:67:9`!) |
| 44 | # include "oval_probe_impl.h"cxx . . $ `<file>/src/OVAL/oval_probe_impl.h`/ |
| 45 | #endif |
| 46 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 47 | #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 48 | #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/ |
| 49 | #include "common/elements.h"cxx . . $ `<file>/src/common/elements.h`/ |
| 50 | #include "oscap_source.h"cxx . . $ `<file>/src/source/public/oscap_source.h`/ |
| 51 | #include "source/oscap_source_priv.h"cxx . . $ `<file>/src/source/oscap_source_priv.h`/ |
| 52 | |
| 53 | typedef struct oval_definition_modelcxx . . $ oval_definition_model# { |
| 54 | struct oval_generatorcxx . . $ oval_generator# *generatorcxx . . $ oval_definition_model#generator.; |
| 55 | struct oval_string_mapcxx . . $ oval_string_map# *definition_mapcxx . . $ oval_definition_model#definition_map.; |
| 56 | struct oval_string_mapcxx . . $ oval_string_map# *test_mapcxx . . $ oval_definition_model#test_map.; |
| 57 | struct oval_string_mapcxx . . $ oval_string_map# *object_mapcxx . . $ oval_definition_model#object_map.; |
| 58 | struct oval_string_mapcxx . . $ oval_string_map# *state_mapcxx . . $ oval_definition_model#state_map.; |
| 59 | struct oval_string_mapcxx . . $ oval_string_map# *variable_mapcxx . . $ oval_definition_model#variable_map.; |
| 60 | struct oval_collectioncxx . . $ oval_collection# *bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models.; |
| 61 | char *schemacxx . . $ oval_definition_model#schema.; |
| 62 | struct oval_string_mapcxx . . $ oval_string_map# *vardef_mapcxx . . $ oval_definition_model#vardef_map.; ///< look-up table for efficient @variable_instance processing |
| 63 | } oval_definition_model_tcxx . . $ oval_definition_model_t#; |
| 64 | |
| 65 | /* failed - NULL |
| 66 | * success - oval_definition_model |
| 67 | * */ |
| 68 | struct oval_definition_modelcxx . . $ oval_definition_model# *oval_definition_model_newcxx . . $ oval_definition_model_new(e3611d73a4ba8158).() |
| 69 | { |
| 70 | oval_definition_model_tcxx . . $ oval_definition_model_t# *newmodel = (oval_definition_model_tcxx . . $ oval_definition_model_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(oval_definition_model_tcxx . . $ oval_definition_model_t#)); |
| 71 | if (newmodel == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 72 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 73 | |
| 74 | newmodel->generatorcxx . . $ oval_definition_model#generator. = oval_generator_newcxx . . $ oval_generator_new(1db813de85019778).(); |
| 75 | newmodel->definition_mapcxx . . $ oval_definition_model#definition_map. = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 76 | newmodel->object_mapcxx . . $ oval_definition_model#object_map. = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 77 | newmodel->state_mapcxx . . $ oval_definition_model#state_map. = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 78 | newmodel->test_mapcxx . . $ oval_definition_model#test_map. = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 79 | newmodel->variable_mapcxx . . $ oval_definition_model#variable_map. = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 80 | newmodel->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 81 | newmodel->schemacxx . . $ oval_definition_model#schema. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(OVAL_DEF_SCHEMA_LOCATIONcxx . . $ `src/OVAL/oval_agent_api_impl.h:61:9`!); |
| 82 | newmodel->vardef_mapcxx . . $ oval_definition_model#vardef_map. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 83 | |
| 84 | return newmodel; |
| 85 | } |
| 86 | |
| 87 | typedef void *(*_oval_clone_funccxx . . $ _oval_clone_func#) (void *, struct oval_definition_modelcxx . . $ oval_definition_model# *); |
| 88 | |
| 89 | static void _oval_definition_model_clonecxx . . $ _oval_definition_model_clone(59b679ec1e130a6).(struct oval_string_mapcxx . . $ oval_string_map# *oldmap, |
| 90 | struct oval_definition_modelcxx . . $ oval_definition_model# *newmodel, |
| 91 | _oval_clone_funccxx . . $ _oval_clone_func# cloner) |
| 92 | { |
| 93 | struct oval_string_iteratorcxx . . $ oval_string_iterator# *keys = (struct oval_string_iteratorcxx . . $ oval_string_iterator# *)oval_string_map_keyscxx . . $ oval_string_map_keys(52dd2feb99c28df0).(oldmap); |
| 94 | while (oval_string_iterator_has_morecxx . . $ oval_string_iterator_has_more(41a15bd829ecb6dd).(keys)) { |
| 95 | char *key = oval_string_iterator_nextcxx . . $ oval_string_iterator_next(fc393b19611653f6).(keys); |
| 96 | void *olditem = oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(oldmap, key); |
| 97 | (*cloner) (newmodel, olditem); |
| 98 | } |
| 99 | oval_string_iterator_freecxx . . $ oval_string_iterator_free(eccafcd0705f3c29).(keys); |
| 100 | } |
| 101 | |
| 102 | /* failed - NULL |
| 103 | * success - oval_definition_model |
| 104 | * */ |
| 105 | struct oval_definition_modelcxx . . $ oval_definition_model# *oval_definition_model_clonecxx . . $ oval_definition_model_clone(d9a23e608dd84537).(struct oval_definition_modelcxx . . $ oval_definition_model# *oldmodel) |
| 106 | { |
| 107 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(oldmodel); |
| 108 | |
| 109 | struct oval_definition_modelcxx . . $ oval_definition_model# *newmodel = oval_definition_model_newcxx . . $ oval_definition_model_new(e3611d73a4ba8158).(); |
| 110 | if (newmodel == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 111 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 112 | |
| 113 | _oval_definition_model_clonecxx . . $ _oval_definition_model_clone(59b679ec1e130a6). |
| 114 | (oldmodel->definition_mapcxx . . $ oval_definition_model#definition_map., newmodel, (_oval_clone_funccxx . . $ _oval_clone_func#) oval_definition_clonecxx . . $ oval_definition_clone(fee9b6e6b0c44e22).); |
| 115 | _oval_definition_model_clonecxx . . $ _oval_definition_model_clone(59b679ec1e130a6). |
| 116 | (oldmodel->object_mapcxx . . $ oval_definition_model#object_map., newmodel, (_oval_clone_funccxx . . $ _oval_clone_func#) oval_object_clonecxx . . $ oval_object_clone(cda8d9effee3e98b).); |
| 117 | _oval_definition_model_clonecxx . . $ _oval_definition_model_clone(59b679ec1e130a6).(oldmodel->state_mapcxx . . $ oval_definition_model#state_map., newmodel, (_oval_clone_funccxx . . $ _oval_clone_func#) oval_state_clonecxx . . $ oval_state_clone(4b918e9848c3d95f).); |
| 118 | _oval_definition_model_clonecxx . . $ _oval_definition_model_clone(59b679ec1e130a6).(oldmodel->test_mapcxx . . $ oval_definition_model#test_map., newmodel, (_oval_clone_funccxx . . $ _oval_clone_func#) oval_test_clonecxx . . $ oval_test_clone(b7249b42de984a2b).); |
| 119 | _oval_definition_model_clonecxx . . $ _oval_definition_model_clone(59b679ec1e130a6). |
| 120 | (oldmodel->variable_mapcxx . . $ oval_definition_model#variable_map., newmodel, (_oval_clone_funccxx . . $ _oval_clone_func#) oval_variable_clonecxx . . $ oval_variable_clone(f12623c0add04796).); |
| 121 | newmodel->schemacxx . . $ oval_definition_model#schema. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(oldmodel->schemacxx . . $ oval_definition_model#schema.); |
| 122 | newmodel->vardef_mapcxx . . $ oval_definition_model#vardef_map. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 123 | return newmodel; |
| 124 | } |
| 125 | |
| 126 | void oval_definition_model_freecxx . . $ oval_definition_model_free(fd0cd5af216bd200).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 127 | { |
| 128 | if (model != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 129 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(model->definition_mapcxx . . $ oval_definition_model#definition_map., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_definition_freecxx . . $ oval_definition_free(d484ebf0ad085a97).); |
| 130 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(model->object_mapcxx . . $ oval_definition_model#object_map., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_object_freecxx . . $ oval_object_free(e6e762e45c770aa4).); |
| 131 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(model->state_mapcxx . . $ oval_definition_model#state_map., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_state_freecxx . . $ oval_state_free(11510fad1be1ea5e).); |
| 132 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(model->test_mapcxx . . $ oval_definition_model#test_map., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_test_freecxx . . $ oval_test_free(f7daaecac5035e27).); |
| 133 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(model->variable_mapcxx . . $ oval_definition_model#variable_map., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_variable_freecxx . . $ oval_variable_free(2d44dca3d9c27958).); |
| 134 | if (model->vardef_mapcxx . . $ oval_definition_model#vardef_map. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 135 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(model->vardef_mapcxx . . $ oval_definition_model#vardef_map., (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_string_map_free0cxx . . $ oval_string_map_free0(92dc6c01d132bc35).); |
| 136 | if (model->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models.) |
| 137 | oval_collection_free_itemscxx . . $ oval_collection_free_items(637ec69504f927f1).(model->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models., |
| 138 | (oscap_destruct_funccxx . . $ oscap_destruct_func#) oval_variable_model_freecxx . . $ oval_variable_model_free(64ecb8c3b3b2877a).); |
| 139 | |
| 140 | if (model->schemacxx . . $ oval_definition_model#schema. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 141 | freecxx . . $ free(5d22bdacc48458e8).(model->schemacxx . . $ oval_definition_model#schema.); |
| 142 | |
| 143 | oval_generator_freecxx . . $ oval_generator_free(645b75e3a0637956).(model->generatorcxx . . $ oval_definition_model#generator.); |
| 144 | freecxx . . $ free(5d22bdacc48458e8).(model); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | struct oval_generatorcxx . . $ oval_generator# *oval_definition_model_get_generatorcxx . . $ oval_definition_model_get_generator(34235d354bc59011).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 149 | { |
| 150 | return model->generatorcxx . . $ oval_definition_model#generator.; |
| 151 | } |
| 152 | |
| 153 | void oval_definition_model_set_generatorcxx . . $ oval_definition_model_set_generator(e41dee74d026e1f0).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_generatorcxx . . $ oval_generator# *generator) |
| 154 | { |
| 155 | oval_generator_freecxx . . $ oval_generator_free(645b75e3a0637956).(model->generatorcxx . . $ oval_definition_model#generator.); |
| 156 | model->generatorcxx . . $ oval_definition_model#generator. = generator; |
| 157 | } |
| 158 | |
| 159 | const char * oval_definition_model_get_schemacxx . . $ oval_definition_model_get_schema(83ddaa3a2da812c0).(struct oval_definition_modelcxx . . $ oval_definition_model# * model) |
| 160 | { |
| 161 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 162 | |
| 163 | return model->schemacxx . . $ oval_definition_model#schema.; |
| 164 | } |
| 165 | |
| 166 | oval_schema_version_tcxx . . $ oval_schema_version_t# oval_definition_model_get_core_schema_versioncxx . . $ oval_definition_model_get_core_schema_version(5e2dc48a93a33b7c).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 167 | { |
| 168 | if (model == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || model->generatorcxx . . $ oval_definition_model#generator. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 169 | return OVAL_SCHEMA_VERSION_INVALIDcxx . . $ `src/OVAL/public/oval_schema_version.h:38:9`!; |
| 170 | } |
| 171 | const char *version = oval_generator_get_core_schema_versioncxx . . $ oval_generator_get_core_schema_version(66391abd6e5ca54c).(model->generatorcxx . . $ oval_definition_model#generator.); |
| 172 | return oval_schema_version_from_cstrcxx . . $ oval_schema_version_from_cstr(da442b0b9c467d6b).(version); |
| 173 | } |
| 174 | |
| 175 | oval_schema_version_tcxx . . $ oval_schema_version_t# oval_definition_model_get_platform_schema_versioncxx . . $ oval_definition_model_get_platform_schema_version(4cbe2c112a234203).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *platform) |
| 176 | { |
| 177 | if (model == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || model->generatorcxx . . $ oval_definition_model#generator. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 178 | return OVAL_SCHEMA_VERSION_INVALIDcxx . . $ `src/OVAL/public/oval_schema_version.h:38:9`!; |
| 179 | } |
| 180 | const char *version = oval_generator_get_platform_schema_versioncxx . . $ oval_generator_get_platform_schema_version(e7fbc6352eaaa53a).(model->generatorcxx . . $ oval_definition_model#generator., platform); |
| 181 | return oval_schema_version_from_cstrcxx . . $ oval_schema_version_from_cstr(da442b0b9c467d6b).(version); |
| 182 | } |
| 183 | |
| 184 | void oval_definition_model_add_definitioncxx . . $ oval_definition_model_add_definition(19d97cca8da3649a).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_definitioncxx . . $ oval_definition# *definition) |
| 185 | { |
| 186 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 187 | char *key = oval_definition_get_idcxx . . $ oval_definition_get_id(293cc7080a5789e2).(definition); |
| 188 | oval_string_map_putcxx . . $ oval_string_map_put(95b46de789826acc).(model->definition_mapcxx . . $ oval_definition_model#definition_map., key, (void *)definition); |
| 189 | } |
| 190 | |
| 191 | void oval_definition_model_set_schemacxx . . $ oval_definition_model_set_schema(6022563187f93abc).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *version) |
| 192 | { |
| 193 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 194 | model->schemacxx . . $ oval_definition_model#schema. = oscap_strdupcxx . . $ oscap_strdup(a8b8e32347182212).(version); |
| 195 | } |
| 196 | |
| 197 | void oval_definition_model_add_testcxx . . $ oval_definition_model_add_test(b86237d957f07752).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_testcxx . . $ oval_test# *test) |
| 198 | { |
| 199 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 200 | char *key = oval_test_get_idcxx . . $ oval_test_get_id(6776e4970683fd20).(test); |
| 201 | oval_string_map_putcxx . . $ oval_string_map_put(95b46de789826acc).(model->test_mapcxx . . $ oval_definition_model#test_map., key, (void *)test); |
| 202 | } |
| 203 | |
| 204 | void oval_definition_model_add_objectcxx . . $ oval_definition_model_add_object(3e834f4e76cae4a4).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_objectcxx . . $ oval_object# *object) |
| 205 | { |
| 206 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 207 | char *key = oval_object_get_idcxx . . $ oval_object_get_id(c789946d38fecc83).(object); |
| 208 | oval_string_map_putcxx . . $ oval_string_map_put(95b46de789826acc).(model->object_mapcxx . . $ oval_definition_model#object_map., key, (void *)object); |
| 209 | } |
| 210 | |
| 211 | void oval_definition_model_add_statecxx . . $ oval_definition_model_add_state(1b858300cf94c4cd).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_statecxx . . $ oval_state# *state) |
| 212 | { |
| 213 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 214 | char *key = oval_state_get_idcxx . . $ oval_state_get_id(3f993b0a468bf006).(state); |
| 215 | oval_string_map_putcxx . . $ oval_string_map_put(95b46de789826acc).(model->state_mapcxx . . $ oval_definition_model#state_map., key, (void *)state); |
| 216 | } |
| 217 | |
| 218 | void oval_definition_model_add_variablecxx . . $ oval_definition_model_add_variable(660c386410451a98).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_variablecxx . . $ oval_variable# *variable) |
| 219 | { |
| 220 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 221 | char *key = oval_variable_get_idcxx . . $ oval_variable_get_id(341a3c7e6ea3818b).(variable); |
| 222 | oval_string_map_putcxx . . $ oval_string_map_put(95b46de789826acc).(model->variable_mapcxx . . $ oval_definition_model#variable_map., key, (void *)variable); |
| 223 | } |
| 224 | |
| 225 | static inline int _oval_definition_model_merge_sourcecxx . . $ _oval_definition_model_merge_source(6a1f401950bd04da).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oscap_sourcecxx . . $ oscap_source# *source) |
| 226 | { |
| 227 | /* setup context */ |
| 228 | struct oval_parser_contextcxx . . $ oval_parser_context# context; |
| 229 | context.readercxx . . $ oval_parser_context#reader. = oscap_source_get_xmlTextReadercxx . . $ oscap_source_get_xmlTextReader(9a7ef22a0934f79d).(source); |
| 230 | if (context.readercxx . . $ oval_parser_context#reader. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 231 | return -1; |
| 232 | } |
| 233 | context.definition_modelcxx . . $ oval_parser_context#definition_model. = model; |
| 234 | context.user_datacxx . . $ oval_parser_context#user_data. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 235 | /* jump into oval_definitions */ |
| 236 | while (xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(context.readercxx . . $ oval_parser_context#reader.) == 1 |
| 237 | && xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(context.readercxx . . $ oval_parser_context#reader.) != XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.) ; |
| 238 | /* start parsing */ |
| 239 | int ret = oval_definition_model_parsecxx . . $ oval_definition_model_parse(b61d4daae99e998a).(context.readercxx . . $ oval_parser_context#reader., &context); |
| 240 | xmlFreeTextReadercxx . . $ xmlFreeTextReader(724dbfdba9ec3ce8).(context.readercxx . . $ oval_parser_context#reader.); |
| 241 | return ret; |
| 242 | } |
| 243 | |
| 244 | struct oval_definition_modelcxx . . $ oval_definition_model# *oval_definition_model_import_sourcecxx . . $ oval_definition_model_import_source(5c1ce95823108a2f).(struct oscap_sourcecxx . . $ oscap_source# *source) |
| 245 | { |
| 246 | struct oval_definition_modelcxx . . $ oval_definition_model# *model = oval_definition_model_newcxx . . $ oval_definition_model_new(e3611d73a4ba8158).(); |
| 247 | int ret = _oval_definition_model_merge_sourcecxx . . $ _oval_definition_model_merge_source(6a1f401950bd04da).(model, source); |
| 248 | if (ret == -1 ) { |
| 249 | oval_definition_model_freecxx . . $ oval_definition_model_free(fd0cd5af216bd200).(model); |
| 250 | model = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 251 | } |
| 252 | return model; |
| 253 | } |
| 254 | |
| 255 | struct oval_definitioncxx . . $ oval_definition# *oval_definition_model_get_definitioncxx . . $ oval_definition_model_get_definition(d4bef07f0697769).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *key) |
| 256 | { |
| 257 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 258 | |
| 259 | return (struct oval_definitioncxx . . $ oval_definition# *)oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(model->definition_mapcxx . . $ oval_definition_model#definition_map., key); |
| 260 | } |
| 261 | |
| 262 | struct oval_testcxx . . $ oval_test# *oval_definition_model_get_testcxx . . $ oval_definition_model_get_test(c765f99071e189c).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *key) |
| 263 | { |
| 264 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 265 | |
| 266 | return (struct oval_testcxx . . $ oval_test# *)oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(model->test_mapcxx . . $ oval_definition_model#test_map., key); |
| 267 | } |
| 268 | |
| 269 | struct oval_objectcxx . . $ oval_object# *oval_definition_model_get_objectcxx . . $ oval_definition_model_get_object(2c583c84850ee973).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *key) |
| 270 | { |
| 271 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 272 | |
| 273 | return (struct oval_objectcxx . . $ oval_object# *)oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(model->object_mapcxx . . $ oval_definition_model#object_map., key); |
| 274 | } |
| 275 | |
| 276 | struct oval_statecxx . . $ oval_state# *oval_definition_model_get_statecxx . . $ oval_definition_model_get_state(a16da6d5657b0c91).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *key) |
| 277 | { |
| 278 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 279 | |
| 280 | return (struct oval_statecxx . . $ oval_state# *)oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(model->state_mapcxx . . $ oval_definition_model#state_map., key); |
| 281 | } |
| 282 | |
| 283 | struct oval_variablecxx . . $ oval_variable# *oval_definition_model_get_variablecxx . . $ oval_definition_model_get_variable(6c0310206537dd28).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *key) |
| 284 | { |
| 285 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 286 | |
| 287 | return (struct oval_variablecxx . . $ oval_variable# *)oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(model->variable_mapcxx . . $ oval_definition_model#variable_map., key); |
| 288 | } |
| 289 | |
| 290 | int oval_definition_model_bind_variable_modelcxx . . $ oval_definition_model_bind_variable_model(92d91b6d8ac81b76).(struct oval_definition_modelcxx . . $ oval_definition_model# *defmodel, |
| 291 | struct oval_variable_modelcxx . . $ oval_variable_model# *varmodel) |
| 292 | { |
| 293 | struct oval_string_iteratorcxx . . $ oval_string_iterator# *evar_id_itr; |
| 294 | |
| 295 | if (!defmodel->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models.) |
| 296 | defmodel->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models. = oval_collection_newcxx . . $ oval_collection_new(18476da3f812812d).(); |
| 297 | |
| 298 | oval_collection_addcxx . . $ oval_collection_add(3c6bf54730c0284).(defmodel->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models., varmodel); |
| 299 | |
| 300 | /* todo: keep reference count for each variable model if it can be bound to multiple definition models */ |
| 301 | |
| 302 | evar_id_itr = oval_variable_model_get_variable_idscxx . . $ oval_variable_model_get_variable_ids(7ca1cb012924580c).(varmodel); |
| 303 | while (oval_string_iterator_has_morecxx . . $ oval_string_iterator_has_more(41a15bd829ecb6dd).(evar_id_itr)) { |
| 304 | char *evar_id; |
| 305 | struct oval_variablecxx . . $ oval_variable# *var; |
| 306 | |
| 307 | evar_id = oval_string_iterator_nextcxx . . $ oval_string_iterator_next(fc393b19611653f6).(evar_id_itr); |
| 308 | var = oval_definition_model_get_variablecxx . . $ oval_definition_model_get_variable(6c0310206537dd28).(defmodel, evar_id); |
| 309 | if (!var) |
| 310 | continue; |
| 311 | |
| 312 | oval_variable_bind_ext_varcxx . . $ oval_variable_bind_ext_var(c749c20b71fce).(var, varmodel, evar_id); |
| 313 | } |
| 314 | oval_string_iterator_freecxx . . $ oval_string_iterator_free(eccafcd0705f3c29).(evar_id_itr); |
| 315 | |
| 316 | return 0; |
| 317 | } |
| 318 | |
| 319 | struct oval_variable_model_iteratorcxx . . $ oval_variable_model_iterator# *oval_definition_model_get_variable_modelscxx . . $ oval_definition_model_get_variable_models(c53421ebab0542be).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 320 | { |
| 321 | if (model->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models.) |
| 322 | return (struct oval_variable_model_iteratorcxx . . $ oval_variable_model_iterator# *) oval_collection_iteratorcxx . . $ oval_collection_iterator(8bdeb6a25e21af3e).(model->bound_variable_modelscxx . . $ oval_definition_model#bound_variable_models.); |
| 323 | else |
| 324 | return (struct oval_variable_model_iteratorcxx . . $ oval_variable_model_iterator# *) oval_collection_iterator_newcxx . . $ oval_collection_iterator_new(b73131c625ff44d1).(); |
| 325 | } |
| 326 | |
| 327 | void oval_definition_model_clear_external_variablescxx . . $ oval_definition_model_clear_external_variables(fd0cd5af216bd200).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 328 | { |
| 329 | struct oval_variable_iteratorcxx . . $ oval_variable_iterator# *vars_itr; |
| 330 | |
| 331 | vars_itr = oval_definition_model_get_variablescxx . . $ oval_definition_model_get_variables(cc4f6af076ea23ed).(model); |
| 332 | while (oval_variable_iterator_has_morecxx . . $ oval_variable_iterator_has_more(724287895a243b53).(vars_itr)) { |
| 333 | struct oval_variablecxx . . $ oval_variable# *var; |
| 334 | |
| 335 | var = oval_variable_iterator_nextcxx . . $ oval_variable_iterator_next(bb0fe9a232eabd1b).(vars_itr); |
| 336 | if (oval_variable_get_typecxx . . $ oval_variable_get_type(eb4d8c3228dab61c).(var) != OVAL_VARIABLE_EXTERNALcxx . . $ OVAL_VARIABLE_EXTERNAL.) |
| 337 | continue; |
| 338 | |
| 339 | oval_variable_clear_valuescxx . . $ oval_variable_clear_values(2d44dca3d9c27958).(var); |
| 340 | } |
| 341 | oval_variable_iterator_freecxx . . $ oval_variable_iterator_free(28c60577870efae1).(vars_itr); |
| 342 | } |
| 343 | |
| 344 | struct oval_definition_iteratorcxx . . $ oval_definition_iterator# *oval_definition_model_get_definitionscxx . . $ oval_definition_model_get_definitions(b47d05023b659a14).(struct oval_definition_modelcxx . . $ oval_definition_model# |
| 345 | *model) |
| 346 | { |
| 347 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 348 | |
| 349 | struct oval_definition_iteratorcxx . . $ oval_definition_iterator# *iterator = |
| 350 | (struct oval_definition_iteratorcxx . . $ oval_definition_iterator# *)oval_string_map_valuescxx . . $ oval_string_map_values(52dd2feb99c28df0).(model->definition_mapcxx . . $ oval_definition_model#definition_map.); |
| 351 | |
| 352 | return iterator; |
| 353 | } |
| 354 | |
| 355 | struct oval_string_iteratorcxx . . $ oval_string_iterator# *oval_definition_model_get_definitions_dependent_on_variablecxx . . $ oval_definition_model_get_definitions_dependent_on_variable(42b8d0b760ee8a91).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_variablecxx . . $ oval_variable# *variable) |
| 356 | { |
| 357 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 358 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(variable); |
| 359 | |
| 360 | if (model->vardef_mapcxx . . $ oval_definition_model#vardef_map. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 361 | model->vardef_mapcxx . . $ oval_definition_model#vardef_map. = oval_definition_model_build_vardef_mappingcxx . . $ oval_definition_model_build_vardef_mapping(a6b442aa12b5a8ea).(model); |
| 362 | |
| 363 | struct oval_string_mapcxx . . $ oval_string_map# *def_list = (struct oval_string_mapcxx . . $ oval_string_map# *) oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(model->vardef_mapcxx . . $ oval_definition_model#vardef_map., oval_variable_get_idcxx . . $ oval_variable_get_id(341a3c7e6ea3818b).(variable)); |
| 364 | return (struct oval_string_iteratorcxx . . $ oval_string_iterator# *) (def_list != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? |
| 365 | oval_string_map_keyscxx . . $ oval_string_map_keys(52dd2feb99c28df0).(def_list) : oval_collection_iterator_newcxx . . $ oval_collection_iterator_new(b73131c625ff44d1).()); |
| 366 | } |
| 367 | |
| 368 | struct oval_test_iteratorcxx . . $ oval_test_iterator# *oval_definition_model_get_testscxx . . $ oval_definition_model_get_tests(815a690d489f3e7c).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 369 | { |
| 370 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 371 | |
| 372 | struct oval_test_iteratorcxx . . $ oval_test_iterator# *iterator = (struct oval_test_iteratorcxx . . $ oval_test_iterator# *)oval_string_map_valuescxx . . $ oval_string_map_values(52dd2feb99c28df0).(model->test_mapcxx . . $ oval_definition_model#test_map.); |
| 373 | |
| 374 | return iterator; |
| 375 | } |
| 376 | |
| 377 | struct oval_object_iteratorcxx . . $ oval_object_iterator# *oval_definition_model_get_objectscxx . . $ oval_definition_model_get_objects(cc9da3ec60e09d96).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 378 | { |
| 379 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 380 | |
| 381 | struct oval_object_iteratorcxx . . $ oval_object_iterator# *iterator = |
| 382 | (struct oval_object_iteratorcxx . . $ oval_object_iterator# *)oval_string_map_valuescxx . . $ oval_string_map_values(52dd2feb99c28df0).(model->object_mapcxx . . $ oval_definition_model#object_map.); |
| 383 | |
| 384 | return iterator; |
| 385 | } |
| 386 | |
| 387 | struct oval_state_iteratorcxx . . $ oval_state_iterator# *oval_definition_model_get_statescxx . . $ oval_definition_model_get_states(b252a90b703e87cb).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 388 | { |
| 389 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 390 | |
| 391 | struct oval_state_iteratorcxx . . $ oval_state_iterator# *iterator = (struct oval_state_iteratorcxx . . $ oval_state_iterator# *)oval_string_map_valuescxx . . $ oval_string_map_values(52dd2feb99c28df0).(model->state_mapcxx . . $ oval_definition_model#state_map.); |
| 392 | |
| 393 | return iterator; |
| 394 | } |
| 395 | |
| 396 | struct oval_variable_iteratorcxx . . $ oval_variable_iterator# *oval_definition_model_get_variablescxx . . $ oval_definition_model_get_variables(cc4f6af076ea23ed).(struct oval_definition_modelcxx . . $ oval_definition_model# |
| 397 | *model) |
| 398 | { |
| 399 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 400 | |
| 401 | struct oval_variable_iteratorcxx . . $ oval_variable_iterator# *iterator = |
| 402 | (struct oval_variable_iteratorcxx . . $ oval_variable_iterator# *)oval_string_map_valuescxx . . $ oval_string_map_values(52dd2feb99c28df0).(model->variable_mapcxx . . $ oval_definition_model#variable_map.); |
| 403 | |
| 404 | return iterator; |
| 405 | } |
| 406 | |
| 407 | struct oval_definitioncxx . . $ oval_definition# *oval_definition_model_get_new_definitioncxx . . $ oval_definition_model_get_new_definition(d4bef07f0697769).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *id) |
| 408 | { |
| 409 | struct oval_definitioncxx . . $ oval_definition# *definition = oval_definition_model_get_definitioncxx . . $ oval_definition_model_get_definition(d4bef07f0697769).(model, id); |
| 410 | if (definition == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 411 | definition = oval_definition_newcxx . . $ oval_definition_new(d4bef07f0697769).(model, id); |
| 412 | } |
| 413 | return definition; |
| 414 | } |
| 415 | |
| 416 | struct oval_variablecxx . . $ oval_variable# *oval_definition_model_get_new_variablecxx . . $ oval_definition_model_get_new_variable(d0b65e206dc01f0d).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *id, oval_variable_type_tcxx . . $ oval_variable_type_t# type) |
| 417 | { |
| 418 | struct oval_variablecxx . . $ oval_variable# *variable = oval_definition_model_get_variablecxx . . $ oval_definition_model_get_variable(6c0310206537dd28).(model, id); |
| 419 | if (variable == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 420 | variable = oval_variable_newcxx . . $ oval_variable_new(d0b65e206dc01f0d).(model, id, type); |
| 421 | } else if (type != OVAL_VARIABLE_UNKNOWNcxx . . $ OVAL_VARIABLE_UNKNOWN.) { |
| 422 | oval_variable_set_typecxx . . $ oval_variable_set_type(6967c6d439ae1198).(variable, type); |
| 423 | } |
| 424 | return variable; |
| 425 | } |
| 426 | |
| 427 | struct oval_statecxx . . $ oval_state# *oval_definition_model_get_new_statecxx . . $ oval_definition_model_get_new_state(a16da6d5657b0c91).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *id) |
| 428 | { |
| 429 | struct oval_statecxx . . $ oval_state# *state = oval_definition_model_get_statecxx . . $ oval_definition_model_get_state(a16da6d5657b0c91).(model, id); |
| 430 | if (state == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 431 | state = oval_state_newcxx . . $ oval_state_new(a16da6d5657b0c91).(model, id); |
| 432 | } |
| 433 | return state; |
| 434 | } |
| 435 | |
| 436 | struct oval_objectcxx . . $ oval_object# *oval_definition_model_get_new_objectcxx . . $ oval_definition_model_get_new_object(2c583c84850ee973).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *id) |
| 437 | { |
| 438 | struct oval_objectcxx . . $ oval_object# *object = oval_definition_model_get_objectcxx . . $ oval_definition_model_get_object(2c583c84850ee973).(model, id); |
| 439 | if (object == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 440 | object = oval_object_newcxx . . $ oval_object_new(2c583c84850ee973).(model, id); |
| 441 | } |
| 442 | return object; |
| 443 | } |
| 444 | |
| 445 | struct oval_testcxx . . $ oval_test# *oval_definition_model_get_new_testcxx . . $ oval_definition_model_get_new_test(c765f99071e189c).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *id) |
| 446 | { |
| 447 | struct oval_testcxx . . $ oval_test# *test = oval_definition_model_get_testcxx . . $ oval_definition_model_get_test(c765f99071e189c).(model, id); |
| 448 | if (test == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 449 | test = oval_test_newcxx . . $ oval_test_new(c765f99071e189c).(model, id); |
| 450 | } |
| 451 | return test; |
| 452 | } |
| 453 | |
| 454 | xmlNodecxx . . $ xmlNode# *oval_definition_model_to_domcxx . . $ oval_definition_model_to_dom(54dcee12f3de5484).(struct oval_definition_modelcxx . . $ oval_definition_model# *definition_model, xmlDocPtrcxx . . $ xmlDocPtr# doc, xmlNodecxx . . $ xmlNode# * parent) |
| 455 | { |
| 456 | |
| 457 | xmlNodePtrcxx . . $ xmlNodePtr# root_node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 458 | |
| 459 | if (parent) { /* result file */ |
| 460 | root_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(parent, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! OVAL_ROOT_ELM_DEFINITIONScxx . . $ `src/OVAL/oval_parser_impl.h:38:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 461 | } else { /* definitions file, we are the root */ |
| 462 | root_node = xmlNewNodecxx . . $ xmlNewNode(cc9f3f2e425bac4).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! OVAL_ROOT_ELM_DEFINITIONScxx . . $ `src/OVAL/oval_parser_impl.h:38:9`!); |
| 463 | xmlDocSetRootElementcxx . . $ xmlDocSetRootElement(ad0e42d5f79fdac5).(doc, root_node); |
| 464 | } |
| 465 | xmlNewNsPropcxx . . $ xmlNewNsProp(9b3cf13d34b7936f).(root_node, lookup_xsi_nscxx . . $ lookup_xsi_ns(3e517de3a327c4f9).(doc), BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "schemaLocation", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! definition_model->schemacxx . . $ oval_definition_model#schema.); |
| 466 | |
| 467 | xmlNscxx . . $ xmlNs# *ns_common = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OVAL_COMMON_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:40:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "oval"); |
| 468 | xmlNscxx . . $ xmlNs# *ns_unix = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OVAL_DEFINITIONS_UNIX_NScxx . . $ `src/OVAL/oval_agent_api_impl.h:51:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "unix-def"); |
| 469 | xmlNscxx . . $ xmlNs# *ns_ind = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OVAL_DEFINITIONS_IND_NScxx . . $ `src/OVAL/oval_agent_api_impl.h:52:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "ind-def"); |
| 470 | xmlNscxx . . $ xmlNs# *ns_lin = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OVAL_DEFINITIONS_LIN_NScxx . . $ `src/OVAL/oval_agent_api_impl.h:53:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "lin-def"); |
| 471 | xmlNscxx . . $ xmlNs# *ns_win = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OVAL_DEFINITIONS_WIN_NScxx . . $ `src/OVAL/oval_agent_api_impl.h:54:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "win-def"); |
| 472 | xmlNscxx . . $ xmlNs# *ns_mac = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OVAL_DEFINITIONS_MAC_NScxx . . $ `src/OVAL/oval_agent_api_impl.h:55:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "mac-def"); |
| 473 | xmlNscxx . . $ xmlNs# *ns_defntns = xmlNewNscxx . . $ xmlNewNs(f962c8aae91c9a10).(root_node, OVAL_DEFINITIONS_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:50:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 474 | |
| 475 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(root_node, ns_common); |
| 476 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(root_node, ns_unix); |
| 477 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(root_node, ns_ind); |
| 478 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(root_node, ns_lin); |
| 479 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(root_node, ns_win); |
| 480 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(root_node, ns_mac); |
| 481 | xmlSetNscxx . . $ xmlSetNs(cd680be8abdf9ad3).(root_node, ns_defntns); |
| 482 | |
| 483 | /* Always report the generator */ |
| 484 | oval_generator_to_domcxx . . $ oval_generator_to_dom(56faf3182cb06d7f).(definition_model->generatorcxx . . $ oval_definition_model#generator., doc, root_node); |
| 485 | |
| 486 | /* Report definitions */ |
| 487 | struct oval_definition_iteratorcxx . . $ oval_definition_iterator# *definitions = oval_definition_model_get_definitionscxx . . $ oval_definition_model_get_definitions(b47d05023b659a14).(definition_model); |
| 488 | if (oval_definition_iterator_has_morecxx . . $ oval_definition_iterator_has_more(97a46799ea94a148).(definitions)) { |
| 489 | xmlNodecxx . . $ xmlNode# *definitions_node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 490 | while(oval_definition_iterator_has_morecxx . . $ oval_definition_iterator_has_more(97a46799ea94a148).(definitions)) { |
| 491 | struct oval_definitioncxx . . $ oval_definition# *definition = oval_definition_iterator_nextcxx . . $ oval_definition_iterator_next(cba20bfe98f05efc).(definitions); |
| 492 | if (definitions_node == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 493 | definitions_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_defntns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "definitions", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 494 | } |
| 495 | oval_definition_to_domcxx . . $ oval_definition_to_dom(18b56f54d4ecf829).(definition, doc, definitions_node); |
| 496 | } |
| 497 | } |
| 498 | oval_definition_iterator_freecxx . . $ oval_definition_iterator_free(b4c4f061b8f4c70).(definitions); |
| 499 | |
| 500 | /* Report tests */ |
| 501 | struct oval_test_iteratorcxx . . $ oval_test_iterator# *tests = oval_definition_model_get_testscxx . . $ oval_definition_model_get_tests(815a690d489f3e7c).(definition_model); |
| 502 | if (oval_test_iterator_has_morecxx . . $ oval_test_iterator_has_more(f199731469cf8e01).(tests)) { |
| 503 | xmlNodecxx . . $ xmlNode# *tests_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_defntns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "tests", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 504 | while (oval_test_iterator_has_morecxx . . $ oval_test_iterator_has_more(f199731469cf8e01).(tests)) { |
| 505 | struct oval_testcxx . . $ oval_test# *test = oval_test_iterator_nextcxx . . $ oval_test_iterator_next(48424747268c0c13).(tests); |
| 506 | oval_test_to_domcxx . . $ oval_test_to_dom(17926246352f56a6).(test, doc, tests_node); |
| 507 | } |
| 508 | } |
| 509 | oval_test_iterator_freecxx . . $ oval_test_iterator_free(da66bbde0720dc2).(tests); |
| 510 | |
| 511 | /* Report objects */ |
| 512 | struct oval_object_iteratorcxx . . $ oval_object_iterator# *objects = oval_definition_model_get_objectscxx . . $ oval_definition_model_get_objects(cc9da3ec60e09d96).(definition_model); |
| 513 | if (oval_object_iterator_has_morecxx . . $ oval_object_iterator_has_more(9147d04dca65c7).(objects)) { |
| 514 | xmlNodecxx . . $ xmlNode# *objects_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_defntns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "objects", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 515 | while(oval_object_iterator_has_morecxx . . $ oval_object_iterator_has_more(9147d04dca65c7).(objects)) { |
| 516 | struct oval_objectcxx . . $ oval_object# *object = oval_object_iterator_nextcxx . . $ oval_object_iterator_next(85e8e8a3fd76bfb).(objects); |
| 517 | if (oval_object_get_base_objcxx . . $ oval_object_get_base_obj(59302ff585093271).(object)) |
| 518 | /* Skip internal objects */ |
| 519 | continue; |
| 520 | oval_object_to_domcxx . . $ oval_object_to_dom(cbbfd686a0ef3907).(object, doc, objects_node); |
| 521 | } |
| 522 | } |
| 523 | oval_object_iterator_freecxx . . $ oval_object_iterator_free(bcb47d61bf2b3914).(objects); |
| 524 | |
| 525 | /* Report states */ |
| 526 | struct oval_state_iteratorcxx . . $ oval_state_iterator# *states = oval_definition_model_get_statescxx . . $ oval_definition_model_get_states(b252a90b703e87cb).(definition_model); |
| 527 | if (oval_state_iterator_has_morecxx . . $ oval_state_iterator_has_more(bbfacbd9c1bc3d63).(states)) { |
| 528 | xmlNodecxx . . $ xmlNode# *states_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_defntns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "states", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 529 | while (oval_state_iterator_has_morecxx . . $ oval_state_iterator_has_more(bbfacbd9c1bc3d63).(states)) { |
| 530 | struct oval_statecxx . . $ oval_state# *state = oval_state_iterator_nextcxx . . $ oval_state_iterator_next(f0883bc3981b419).(states); |
| 531 | oval_state_to_domcxx . . $ oval_state_to_dom(77c1a7658257bab2).(state, doc, states_node); |
| 532 | } |
| 533 | } |
| 534 | oval_state_iterator_freecxx . . $ oval_state_iterator_free(37c8c23faa65426a).(states); |
| 535 | |
| 536 | /* Report variables */ |
| 537 | struct oval_variable_iteratorcxx . . $ oval_variable_iterator# *variables = oval_definition_model_get_variablescxx . . $ oval_definition_model_get_variables(cc4f6af076ea23ed).(definition_model); |
| 538 | if (oval_variable_iterator_has_morecxx . . $ oval_variable_iterator_has_more(724287895a243b53).(variables)) { |
| 539 | xmlNodecxx . . $ xmlNode# *variables_node = xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(root_node, ns_defntns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "variables", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 540 | while (oval_variable_iterator_has_morecxx . . $ oval_variable_iterator_has_more(724287895a243b53).(variables)) { |
| 541 | struct oval_variablecxx . . $ oval_variable# *variable = oval_variable_iterator_nextcxx . . $ oval_variable_iterator_next(bb0fe9a232eabd1b).(variables); |
| 542 | oval_variable_to_domcxx . . $ oval_variable_to_dom(d067d931851fc55b).(variable, doc, variables_node); |
| 543 | } |
| 544 | } |
| 545 | oval_variable_iterator_freecxx . . $ oval_variable_iterator_free(28c60577870efae1).(variables); |
| 546 | |
| 547 | return root_node; |
| 548 | } |
| 549 | |
| 550 | int oval_definition_model_exportcxx . . $ oval_definition_model_export(3784ff0470d7d152).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, const char *file) |
| 551 | { |
| 552 | |
| 553 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(model); |
| 554 | |
| 555 | LIBXML_TEST_VERSIONcxx . . $ `<external>/12558958530574576205/xmlversion.h:40:9`!; |
| 556 | |
| 557 | xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlNewDoccxx . . $ xmlNewDoc(6ad5ddcc52642397).(BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "1.0"); |
| 558 | if (doc == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 559 | oscap_setxmlerrcxx . . $ `src/common/_error.h:36:9`!(xmlGetLastError()); |
| 560 | return -1; |
| 561 | } |
| 562 | |
| 563 | oval_definition_model_to_domcxx . . $ oval_definition_model_to_dom(54dcee12f3de5484).(model, doc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 564 | return oscap_xml_save_filename_freecxx . . $ oscap_xml_save_filename_free(4641885591a9fcee).(file, doc); |
| 565 | } |
| 566 | |
| 567 | static void _fp_set_recursecxx . . $ _fp_set_recurse(31044d8aec11b4b5).(struct oval_definition_modelcxx . . $ oval_definition_model# *model, struct oval_setobjectcxx . . $ oval_setobject# *set, char *set_id) |
| 568 | { |
| 569 | struct oval_setobject_iteratorcxx . . $ oval_setobject_iterator# *subset_itr; |
| 570 | |
| 571 | subset_itr = oval_setobject_get_subsetscxx . . $ oval_setobject_get_subsets(13e8a59127c47b3f).(set); |
| 572 | while (oval_setobject_iterator_has_morecxx . . $ oval_setobject_iterator_has_more(ecf6a7229e0ada85).(subset_itr)) { |
| 573 | struct oval_setobjectcxx . . $ oval_setobject# *subset; |
| 574 | |
| 575 | subset = oval_setobject_iterator_nextcxx . . $ oval_setobject_iterator_next(8019d249221a9c9c).(subset_itr); |
| 576 | if (oval_setobject_get_typecxx . . $ oval_setobject_get_type(d5fdd55de288db3f).(subset) == OVAL_SET_COLLECTIVEcxx . . $ OVAL_SET_COLLECTIVE.) |
| 577 | oval_set_propagate_filterscxx . . $ oval_set_propagate_filters(31044d8aec11b4b5).(model, subset, set_id); |
| 578 | else |
| 579 | _fp_set_recursecxx . . $ _fp_set_recurse(31044d8aec11b4b5).(model, subset, set_id); |
| 580 | } |
| 581 | oval_setobject_iterator_freecxx . . $ oval_setobject_iterator_free(9cd4ba6b9ae808f7).(subset_itr); |
| 582 | } |
| 583 | |
| 584 | void oval_definition_model_optimize_by_filter_propagationcxx . . $ oval_definition_model_optimize_by_filter_propagation(fd0cd5af216bd200).(struct oval_definition_modelcxx . . $ oval_definition_model# *model) |
| 585 | { |
| 586 | struct oval_object_iteratorcxx . . $ oval_object_iterator# *obj_itr; |
| 587 | struct oval_string_mapcxx . . $ oval_string_map# *processed_obj_map; |
| 588 | |
| 589 | processed_obj_map = oval_string_map_newcxx . . $ oval_string_map_new(c786b134e882bd29).(); |
| 590 | |
| 591 | obj_itr = oval_definition_model_get_objectscxx . . $ oval_definition_model_get_objects(cc9da3ec60e09d96).(model); |
| 592 | while (oval_object_iterator_has_morecxx . . $ oval_object_iterator_has_more(9147d04dca65c7).(obj_itr)) { |
| 593 | struct oval_objectcxx . . $ oval_object# *obj; |
| 594 | char *obj_id; |
| 595 | struct oval_object_content_iteratorcxx . . $ oval_object_content_iterator# *cont_itr; |
| 596 | struct oval_object_contentcxx . . $ oval_object_content# *cont; |
| 597 | struct oval_setobjectcxx . . $ oval_setobject# *set; |
| 598 | struct oval_filter_iteratorcxx . . $ oval_filter_iterator# *filter_itr; |
| 599 | |
| 600 | obj = oval_object_iterator_nextcxx . . $ oval_object_iterator_next(85e8e8a3fd76bfb).(obj_itr); |
| 601 | obj_id = oval_object_get_idcxx . . $ oval_object_get_id(c789946d38fecc83).(obj); |
| 602 | if (oval_string_map_get_valuecxx . . $ oval_string_map_get_value(c9e9819de236f3d5).(processed_obj_map, obj_id) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 603 | continue; |
| 604 | |
| 605 | oval_string_map_putcxx . . $ oval_string_map_put(95b46de789826acc).(processed_obj_map, obj_id, obj); |
| 606 | |
| 607 | cont_itr = oval_object_get_object_contentscxx . . $ oval_object_get_object_contents(1183628165c9500f).(obj); |
| 608 | if (!oval_object_content_iterator_has_morecxx . . $ oval_object_content_iterator_has_more(94988246e4c8fa99).(cont_itr)) { |
| 609 | oval_object_content_iterator_freecxx . . $ oval_object_content_iterator_free(de918ccd59b4e784).(cont_itr); |
| 610 | continue; |
| 611 | } |
| 612 | |
| 613 | cont = oval_object_content_iterator_nextcxx . . $ oval_object_content_iterator_next(eb16ce6ae0e4b7fc).(cont_itr); |
| 614 | oval_object_content_iterator_freecxx . . $ oval_object_content_iterator_free(de918ccd59b4e784).(cont_itr); |
| 615 | if (oval_object_content_get_typecxx . . $ oval_object_content_get_type(7a653648ed12be92).(cont) != OVAL_OBJECTCONTENT_SETcxx . . $ OVAL_OBJECTCONTENT_SET.) |
| 616 | continue; |
| 617 | |
| 618 | set = oval_object_content_get_setobjectcxx . . $ oval_object_content_get_setobject(25929015085a5f4).(cont); |
| 619 | if (oval_setobject_get_typecxx . . $ oval_setobject_get_type(d5fdd55de288db3f).(set) == OVAL_SET_AGGREGATEcxx . . $ OVAL_SET_AGGREGATE.) { |
| 620 | _fp_set_recursecxx . . $ _fp_set_recurse(31044d8aec11b4b5).(model, set, obj_id); |
| 621 | continue; |
| 622 | } |
| 623 | |
| 624 | filter_itr = oval_setobject_get_filterscxx . . $ oval_setobject_get_filters(a3a77d5b16cc3321).(set); |
| 625 | if (!oval_filter_iterator_has_morecxx . . $ oval_filter_iterator_has_more(1c196fda7090525b).(filter_itr)) { |
| 626 | oval_filter_iterator_freecxx . . $ oval_filter_iterator_free(af72975b992300c1).(filter_itr); |
| 627 | continue; |
| 628 | } |
| 629 | oval_filter_iterator_freecxx . . $ oval_filter_iterator_free(af72975b992300c1).(filter_itr); |
| 630 | |
| 631 | oval_set_propagate_filterscxx . . $ oval_set_propagate_filters(31044d8aec11b4b5).(model, set, obj_id); |
| 632 | } |
| 633 | oval_object_iterator_freecxx . . $ oval_object_iterator_free(bcb47d61bf2b3914).(obj_itr); |
| 634 | |
| 635 | oval_string_map_freecxx . . $ oval_string_map_free(e4310474f4dc2f59).(processed_obj_map, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 636 | } |