| 1 | /* |
| 2 | * Copyright 2009 Red Hat Inc., Durham, North Carolina. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | * |
| 19 | * Authors: |
| 20 | * Lukas Kuklinek <[email protected]> |
| 21 | */ |
| 22 | |
| 23 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 24 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 25 | #endif |
| 26 | |
| 27 | #include <math.h> |
| 28 | #include <string.h> |
| 29 | |
| 30 | #include "item.h"cxx . . $ `<file>/src/XCCDF/item.h`/ |
| 31 | #include "elements.h"cxx . . $ `<file>/src/XCCDF/elements.h`/ |
| 32 | #include "helpers.h"cxx . . $ `<file>/src/XCCDF/helpers.h`/ |
| 33 | #include "xccdf_impl.h"cxx . . $ `<file>/src/XCCDF/xccdf_impl.h`/ |
| 34 | #include "common/elements.h"cxx . . $ `<file>/src/common/elements.h`/ |
| 35 | #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/ |
| 36 | #include "oscap_helpers.h"cxx . . $ `<file>/src/common/public/oscap_helpers.h`/ |
| 37 | |
| 38 | static struct xccdf_value_instancecxx . . $ xccdf_value_instance# *xccdf_value_instance_newcxx . . $ xccdf_value_instance_new(9ab277c33bc2a47d).(xccdf_value_type_tcxx . . $ xccdf_value_type_t# type); |
| 39 | static struct xccdf_value_instancecxx . . $ xccdf_value_instance# *_xccdf_value_get_instance_by_selector_internalcxx . . $ _xccdf_value_get_instance_by_selector_internal(1c9d6811ccaf1af0).(const struct xccdf_valuecxx . . $ xccdf_value# *value, const char *selector); |
| 40 | |
| 41 | struct xccdf_itemcxx . . $ xccdf_item# *xccdf_value_new_internalcxx . . $ xccdf_value_new_internal(53486341d521a605).(struct xccdf_itemcxx . . $ xccdf_item# *parent, xccdf_value_type_tcxx . . $ xccdf_value_type_t# type) |
| 42 | { |
| 43 | struct xccdf_itemcxx . . $ xccdf_item# *val = xccdf_item_newcxx . . $ xccdf_item_new(8094a7806c065071).(XCCDF_VALUEcxx . . $ XCCDF_VALUE., parent); |
| 44 | val->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..typecxx . . $ xccdf_value_item#type. = type; |
| 45 | val->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..interface_hintcxx . . $ xccdf_value_item#interface_hint. = 0; |
| 46 | val->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..opercxx . . $ xccdf_value_item#oper. = 0; |
| 47 | |
| 48 | val->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..instancescxx . . $ xccdf_value_item#instances. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 49 | val->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..sourcescxx . . $ xccdf_value_item#sources. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 50 | |
| 51 | return val; |
| 52 | } |
| 53 | |
| 54 | struct xccdf_valuecxx . . $ xccdf_value# *xccdf_value_newcxx . . $ xccdf_value_new(b89dbfb1acc93369).(xccdf_value_type_tcxx . . $ xccdf_value_type_t# type) |
| 55 | { |
| 56 | return XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(xccdf_value_new_internal(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, type)); |
| 57 | } |
| 58 | |
| 59 | struct xccdf_valuecxx . . $ xccdf_value# * xccdf_value_clonecxx . . $ xccdf_value_clone(95940259ce856647).(const struct xccdf_valuecxx . . $ xccdf_value# * value) |
| 60 | { |
| 61 | struct xccdf_itemcxx . . $ xccdf_item# *new_value = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_itemcxx . . $ xccdf_item#) + sizeof(struct xccdf_value_itemcxx . . $ xccdf_value_item#)); |
| 62 | struct xccdf_itemcxx . . $ xccdf_item# *old = XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(value); |
| 63 | xccdf_item_base_clonecxx . . $ xccdf_item_base_clone(f0db45ff8e952d03).(&new_value->itemcxx . . $ xccdf_item#item., &old->itemcxx . . $ xccdf_item#item.); |
| 64 | new_value->typecxx . . $ xccdf_item#type. = old->typecxx . . $ xccdf_item#type.; |
| 65 | xccdf_value_item_clonecxx . . $ xccdf_value_item_clone(19527132204f3420).(&new_value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value., &XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(value)->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value.); |
| 66 | return XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(new_value); |
| 67 | } |
| 68 | |
| 69 | static const struct oscap_string_mapcxx . . $ oscap_string_map# XCCDF_VALUE_TYPE_MAPcxx . . $ XCCDF_VALUE_TYPE_MAP.[] = { |
| 70 | {XCCDF_TYPE_NUMBERcxx . . $ XCCDF_TYPE_NUMBER., "number"}, |
| 71 | {XCCDF_TYPE_STRINGcxx . . $ XCCDF_TYPE_STRING., "string"}, |
| 72 | {XCCDF_TYPE_BOOLEANcxx . . $ XCCDF_TYPE_BOOLEAN., "boolean"}, |
| 73 | {XCCDF_TYPE_STRINGcxx . . $ XCCDF_TYPE_STRING., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!} |
| 74 | }; |
| 75 | |
| 76 | static const struct oscap_string_mapcxx . . $ oscap_string_map# XCCDF_IFACE_HINT_MAPcxx . . $ XCCDF_IFACE_HINT_MAP.[] = { |
| 77 | {XCCDF_IFACE_HINT_CHOICEcxx . . $ XCCDF_IFACE_HINT_CHOICE., "choice"}, |
| 78 | {XCCDF_IFACE_HINT_TEXTLINEcxx . . $ XCCDF_IFACE_HINT_TEXTLINE., "textline"}, |
| 79 | {XCCDF_IFACE_HINT_TEXTcxx . . $ XCCDF_IFACE_HINT_TEXT., "text"}, |
| 80 | {XCCDF_IFACE_HINT_DATEcxx . . $ XCCDF_IFACE_HINT_DATE., "date"}, |
| 81 | {XCCDF_IFACE_HINT_DATETIMEcxx . . $ XCCDF_IFACE_HINT_DATETIME., "datetime"}, |
| 82 | {XCCDF_IFACE_HINT_NONEcxx . . $ XCCDF_IFACE_HINT_NONE., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!} |
| 83 | }; |
| 84 | |
| 85 | static struct xccdf_value_instancecxx . . $ xccdf_value_instance# * |
| 86 | _xccdf_value_find_or_create_instancecxx . . $ _xccdf_value_find_or_create_instance(ea256ce1e24652c7).(struct xccdf_valuecxx . . $ xccdf_value# *value, const char *selector, xccdf_value_type_tcxx . . $ xccdf_value_type_t# type) |
| 87 | { |
| 88 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *val = _xccdf_value_get_instance_by_selector_internalcxx . . $ _xccdf_value_get_instance_by_selector_internal(1c9d6811ccaf1af0).(value, selector); |
| 89 | if (val == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 90 | val = xccdf_value_instance_newcxx . . $ xccdf_value_instance_new(9ab277c33bc2a47d).(type); |
| 91 | assertcxx . . $ `/usr/include/assert.h:50:10`!(val != NULL); |
| 92 | xccdf_value_instance_set_selectorcxx . . $ xccdf_value_instance_set_selector(24caaf4611b47a18).(val, selector); |
| 93 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(value)->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..instancescxx . . $ xccdf_value_item#instances., val); |
| 94 | } |
| 95 | else |
| 96 | assertcxx . . $ `/usr/include/assert.h:50:10`!(type == xccdf_value_instance_get_type(val)); |
| 97 | return val; |
| 98 | } |
| 99 | |
| 100 | struct xccdf_itemcxx . . $ xccdf_item# *xccdf_value_parsecxx . . $ xccdf_value_parse(8cf60c58117f1f7b).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, struct xccdf_itemcxx . . $ xccdf_item# *parent) |
| 101 | { |
| 102 | if (xccdf_element_getcxx . . $ xccdf_element_get(a5dd71d24d1f6f1).(reader) != XCCDFE_VALUEcxx . . $ XCCDFE_VALUE.) |
| 103 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 104 | xccdf_value_type_tcxx . . $ xccdf_value_type_t# type = oscap_string_to_enumcxx . . $ oscap_string_to_enum(851d6ce10579b7d8).(XCCDF_VALUE_TYPE_MAPcxx . . $ XCCDF_VALUE_TYPE_MAP., xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, XCCDFA_TYPEcxx . . $ XCCDFA_TYPE.)); |
| 105 | struct xccdf_itemcxx . . $ xccdf_item# *value = xccdf_value_new_internalcxx . . $ xccdf_value_new_internal(53486341d521a605).(parent, type); |
| 106 | |
| 107 | value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..opercxx . . $ xccdf_value_item#oper. = oscap_string_to_enumcxx . . $ oscap_string_to_enum(851d6ce10579b7d8).(XCCDF_OPERATOR_MAPcxx . . $ XCCDF_OPERATOR_MAP., xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, XCCDFA_OPERATORcxx . . $ XCCDFA_OPERATOR.)); |
| 108 | value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..interface_hintcxx . . $ xccdf_value_item#interface_hint. = |
| 109 | oscap_string_to_enumcxx . . $ oscap_string_to_enum(851d6ce10579b7d8).(XCCDF_IFACE_HINT_MAPcxx . . $ XCCDF_IFACE_HINT_MAP., xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, XCCDFA_INTERFACEHINTcxx . . $ XCCDFA_INTERFACEHINT.)); |
| 110 | if (!xccdf_item_process_attributescxx . . $ xccdf_item_process_attributes(bf0f85c13dd5e40b).(value, reader)) { |
| 111 | xccdf_value_freecxx . . $ xccdf_value_free(9e1ae929b010245a).(value); |
| 112 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 113 | } |
| 114 | |
| 115 | int depth = oscap_element_depthcxx . . $ oscap_element_depth(82a242a19623f75).(reader) + 1; |
| 116 | |
| 117 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *val; |
| 118 | while (oscap_to_start_elementcxx . . $ oscap_to_start_element(c0c45fd800596ca5).(reader, depth)) { |
| 119 | xccdf_element_tcxx . . $ xccdf_element_t# el = xccdf_element_getcxx . . $ xccdf_element_get(a5dd71d24d1f6f1).(reader); |
| 120 | const char *selector = xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(reader, XCCDFA_SELECTORcxx . . $ XCCDFA_SELECTOR.); |
| 121 | if (selector == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) selector = ""; |
| 122 | |
| 123 | val = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 124 | switch (el) { |
| 125 | case XCCDFE_SOURCEcxx . . $ XCCDFE_SOURCE.: |
| 126 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..sourcescxx . . $ xccdf_value_item#sources., oscap_element_string_copycxx . . $ oscap_element_string_copy(93c99f8009311dd0).(reader)); |
| 127 | break; |
| 128 | case XCCDFE_VALUE_VALcxx . . $ XCCDFE_VALUE_VAL.: |
| 129 | val = _xccdf_value_find_or_create_instancecxx . . $ _xccdf_value_find_or_create_instance(ea256ce1e24652c7).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(value), selector, type); |
| 130 | val->valuecxx . . $ xccdf_value_instance#value. = oscap_element_string_copycxx . . $ oscap_element_string_copy(93c99f8009311dd0).(reader); |
| 131 | val->flagscxx . . $ xccdf_value_instance#flags..value_givencxx . . $ xccdf_value_instance#$anonymous_type_0#value_given. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 132 | break; |
| 133 | case XCCDFE_DEFAULTcxx . . $ XCCDFE_DEFAULT.: |
| 134 | val = _xccdf_value_find_or_create_instancecxx . . $ _xccdf_value_find_or_create_instance(ea256ce1e24652c7).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(value), selector, type); |
| 135 | val->defvalcxx . . $ xccdf_value_instance#defval. = oscap_element_string_copycxx . . $ oscap_element_string_copy(93c99f8009311dd0).(reader); |
| 136 | val->flagscxx . . $ xccdf_value_instance#flags..defval_givencxx . . $ xccdf_value_instance#$anonymous_type_0#defval_given. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 137 | break; |
| 138 | case XCCDFE_MATCHcxx . . $ XCCDFE_MATCH.: |
| 139 | if (type == XCCDF_TYPE_STRINGcxx . . $ XCCDF_TYPE_STRING.) { |
| 140 | val = _xccdf_value_find_or_create_instancecxx . . $ _xccdf_value_find_or_create_instance(ea256ce1e24652c7).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(value), selector, type); |
| 141 | val->matchcxx . . $ xccdf_value_instance#match. = oscap_element_string_copycxx . . $ oscap_element_string_copy(93c99f8009311dd0).(reader); |
| 142 | } |
| 143 | break; |
| 144 | case XCCDFE_LOWER_BOUNDcxx . . $ XCCDFE_LOWER_BOUND.: |
| 145 | if (type == XCCDF_TYPE_NUMBERcxx . . $ XCCDF_TYPE_NUMBER.) { |
| 146 | val = _xccdf_value_find_or_create_instancecxx . . $ _xccdf_value_find_or_create_instance(ea256ce1e24652c7).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(value), selector, type); |
| 147 | val->lower_boundcxx . . $ xccdf_value_instance#lower_bound. = atofcxx . . $ atof(9a18bdb0e56c1bc2).(oscap_element_string_getcxx . . $ oscap_element_string_get(fcb9bb882cfd5f9d).(reader)); |
| 148 | } |
| 149 | break; |
| 150 | case XCCDFE_UPPER_BOUNDcxx . . $ XCCDFE_UPPER_BOUND.: |
| 151 | if (type == XCCDF_TYPE_NUMBERcxx . . $ XCCDF_TYPE_NUMBER.) { |
| 152 | val = _xccdf_value_find_or_create_instancecxx . . $ _xccdf_value_find_or_create_instance(ea256ce1e24652c7).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(value), selector, type); |
| 153 | val->upper_boundcxx . . $ xccdf_value_instance#upper_bound. = atofcxx . . $ atof(9a18bdb0e56c1bc2).(oscap_element_string_getcxx . . $ oscap_element_string_get(fcb9bb882cfd5f9d).(reader)); |
| 154 | } |
| 155 | break; |
| 156 | case XCCDFE_CHOICEScxx . . $ XCCDFE_CHOICES.: |
| 157 | val = _xccdf_value_find_or_create_instancecxx . . $ _xccdf_value_find_or_create_instance(ea256ce1e24652c7).(XVALUEcxx . . $ `src/XCCDF/helpers.h:36:9`!(value), selector, type); |
| 158 | val->flagscxx . . $ xccdf_value_instance#flags..must_matchcxx . . $ xccdf_value_instance#$anonymous_type_0#must_match. = xccdf_attribute_get_boolcxx . . $ xccdf_attribute_get_bool(5c4b5ba7d6a00a2).(reader, XCCDFA_MUSTMATCHcxx . . $ XCCDFA_MUSTMATCH.); |
| 159 | val->flagscxx . . $ xccdf_value_instance#flags..must_match_givencxx . . $ xccdf_value_instance#$anonymous_type_0#must_match_given. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 160 | xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader); /* Move to the next node (subnode of <choices>)*/ |
| 161 | while (oscap_to_start_elementcxx . . $ oscap_to_start_element(c0c45fd800596ca5).(reader, depth + 1)) { |
| 162 | if (xccdf_element_getcxx . . $ xccdf_element_get(a5dd71d24d1f6f1).(reader) == XCCDFE_CHOICEcxx . . $ XCCDFE_CHOICE.) |
| 163 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(val->choicescxx . . $ xccdf_value_instance#choices., oscap_element_string_copycxx . . $ oscap_element_string_copy(93c99f8009311dd0).(reader)); |
| 164 | xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader); |
| 165 | } |
| 166 | break; |
| 167 | default: |
| 168 | if (!xccdf_item_process_elementcxx . . $ xccdf_item_process_element(bf0f85c13dd5e40b).(value, reader)) |
| 169 | dWcxx . . $ `src/common/debug_priv.h:62:9`!("Encountered an unknown element '%s' while parsing XCCDF group.", |
| 170 | xmlTextReaderConstLocalName(reader)); |
| 171 | break; |
| 172 | } |
| 173 | xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader); |
| 174 | } |
| 175 | |
| 176 | return value; |
| 177 | } |
| 178 | |
| 179 | static void xccdf_unit_nodecxx . . $ xccdf_unit_node(44b1db95ccf94818).(struct oscap_listcxx . . $ oscap_list# *list, xccdf_value_type_tcxx . . $ xccdf_value_type_t# type, const char *u, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! given, |
| 180 | xmlNscxx . . $ xmlNs# *ns, const char *elname, const char *selector) |
| 181 | { |
| 182 | if (!given) return; |
| 183 | xmlNodecxx . . $ xmlNode# *node = xmlNewNodecxx . . $ xmlNewNode(cc9f3f2e425bac4).(ns, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! elname); |
| 184 | if ((selector) && (strlencxx . . $ strlen(751346f8406fd082).(selector) > 0)) xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "selector", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! selector); |
| 185 | xmlCharcxx . . $ xmlChar# *escaped = xmlEncodeSpecialCharscxx . . $ xmlEncodeSpecialChars(99a3e5bc38e6c4b2).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! u); |
| 186 | xmlNodeSetContentcxx . . $ xmlNodeSetContent(fbf30e8d041579ec).(node, escaped); |
| 187 | xmlFreecxx . . $ xmlFree.(escaped); |
| 188 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(list, node); |
| 189 | } |
| 190 | |
| 191 | void xccdf_value_to_domcxx . . $ xccdf_value_to_dom(2e191256832a93a6).(struct xccdf_valuecxx . . $ xccdf_value# *value, xmlNodecxx . . $ xmlNode# *value_node, xmlDoccxx . . $ xmlDoc# *doc, xmlNodecxx . . $ xmlNode# *parent) |
| 192 | { |
| 193 | const struct xccdf_version_infocxx . . $ xccdf_version_info#* version_info = xccdf_item_get_schema_versioncxx . . $ xccdf_item_get_schema_version(a15732c9a5bba7d0).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(value)); |
| 194 | xmlNscxx . . $ xmlNs# *ns_xccdf = lookup_xccdf_nscxx . . $ lookup_xccdf_ns(145fb009c13e3a1).(doc, parent, version_info); |
| 195 | |
| 196 | /* Handle Attributes */ |
| 197 | const char *extends = xccdf_value_get_extendscxx . . $ xccdf_value_get_extends(7dce63a6a4cb9377).(value); |
| 198 | if (extends) |
| 199 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(value_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "extends", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! extends); |
| 200 | |
| 201 | xccdf_operator_tcxx . . $ xccdf_operator_t# operator = xccdf_value_get_opercxx . . $ xccdf_value_get_oper(1af997407da308aa).(value); |
| 202 | if (operator != 0) |
| 203 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(value_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "operator", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XCCDF_OPERATOR_MAPcxx . . $ XCCDF_OPERATOR_MAP.[operator - 1].stringcxx . . $ oscap_string_map#string.); |
| 204 | |
| 205 | xccdf_value_type_tcxx . . $ xccdf_value_type_t# type = xccdf_value_get_typecxx . . $ xccdf_value_get_type(241bbac253e8107a).(value); |
| 206 | if (type != 0) |
| 207 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(value_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "type", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XCCDF_VALUE_TYPE_MAPcxx . . $ XCCDF_VALUE_TYPE_MAP.[type - 1].stringcxx . . $ oscap_string_map#string.); |
| 208 | |
| 209 | if (xccdf_value_get_interactivecxx . . $ xccdf_value_get_interactive(83817b94fe60bc79).(value)) |
| 210 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(value_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "interactive", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "true"); |
| 211 | |
| 212 | xccdf_interface_hint_tcxx . . $ xccdf_interface_hint_t# hint = xccdf_value_get_interface_hintcxx . . $ xccdf_value_get_interface_hint(6d7af891b11e2c1).(value); |
| 213 | if (hint != XCCDF_IFACE_HINT_NONEcxx . . $ XCCDF_IFACE_HINT_NONE.) |
| 214 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(value_node, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "interfaceHint", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! XCCDF_IFACE_HINT_MAPcxx . . $ XCCDF_IFACE_HINT_MAP.[hint - 1].stringcxx . . $ oscap_string_map#string.); |
| 215 | |
| 216 | struct oscap_listcxx . . $ oscap_list# *value_nodes = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 217 | struct oscap_listcxx . . $ oscap_list# *defval_nodes = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 218 | struct oscap_listcxx . . $ oscap_list# *choices_nodes = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 219 | struct oscap_listcxx . . $ oscap_list# *lower_bound_nodes = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 220 | struct oscap_listcxx . . $ oscap_list# *upper_bound_nodes = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 221 | struct oscap_listcxx . . $ oscap_list# *match_nodes = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 222 | |
| 223 | OSCAP_FORcxx . . $ `src/common/list.h:155:9`!(xccdf_value_instance, inst, xccdf_value_get_instances(value)) { |
| 224 | char buff[16]; buff[15] = '\0'; |
| 225 | xccdf_unit_nodecxx . . $ xccdf_unit_node(44b1db95ccf94818).(value_nodes, inst->typecxx . . $ xccdf_value_instance#type., inst->valuecxx . . $ xccdf_value_instance#value., inst->flagscxx . . $ xccdf_value_instance#flags..value_givencxx . . $ xccdf_value_instance#$anonymous_type_0#value_given., ns_xccdf, "value", inst->selectorcxx . . $ xccdf_value_instance#selector.); |
| 226 | xccdf_unit_nodecxx . . $ xccdf_unit_node(44b1db95ccf94818).(defval_nodes, inst->typecxx . . $ xccdf_value_instance#type., inst->defvalcxx . . $ xccdf_value_instance#defval., inst->flagscxx . . $ xccdf_value_instance#flags..defval_givencxx . . $ xccdf_value_instance#$anonymous_type_0#defval_given., ns_xccdf, "default", inst->selectorcxx . . $ xccdf_value_instance#selector.); |
| 227 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(buff, 15, "%f", inst->lower_boundcxx . . $ xccdf_value_instance#lower_bound.); |
| 228 | xccdf_unit_nodecxx . . $ xccdf_unit_node(44b1db95ccf94818).(lower_bound_nodes, inst->typecxx . . $ xccdf_value_instance#type., buff, |
| 229 | inst->typecxx . . $ xccdf_value_instance#type. == XCCDF_TYPE_NUMBERcxx . . $ XCCDF_TYPE_NUMBER. && !isnancxx . . $ `<external>/11263917310783833665/math.h:980:11`!(inst->lower_bound) && buff[0] != 'n', ns_xccdf, "lower-bound", inst->selectorcxx . . $ xccdf_value_instance#selector.); |
| 230 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(buff, 15, "%f", inst->upper_boundcxx . . $ xccdf_value_instance#upper_bound.); |
| 231 | xccdf_unit_nodecxx . . $ xccdf_unit_node(44b1db95ccf94818).(upper_bound_nodes, inst->typecxx . . $ xccdf_value_instance#type., buff, |
| 232 | inst->typecxx . . $ xccdf_value_instance#type. == XCCDF_TYPE_NUMBERcxx . . $ XCCDF_TYPE_NUMBER. && !isnancxx . . $ `<external>/11263917310783833665/math.h:980:11`!(inst->upper_bound) && buff[0] != 'n', ns_xccdf, "upper-bound", inst->selectorcxx . . $ xccdf_value_instance#selector.); |
| 233 | xccdf_unit_nodecxx . . $ xccdf_unit_node(44b1db95ccf94818).(match_nodes, inst->typecxx . . $ xccdf_value_instance#type., inst->matchcxx . . $ xccdf_value_instance#match., |
| 234 | inst->typecxx . . $ xccdf_value_instance#type. == XCCDF_TYPE_STRINGcxx . . $ XCCDF_TYPE_STRING. && inst->matchcxx . . $ xccdf_value_instance#match. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, ns_xccdf, "match", inst->selectorcxx . . $ xccdf_value_instance#selector.); |
| 235 | if (inst->choicescxx . . $ xccdf_value_instance#choices.->firstcxx . . $ oscap_list#first.) { |
| 236 | xmlNodecxx . . $ xmlNode# *choices = xmlNewNodecxx . . $ xmlNewNode(cc9f3f2e425bac4).(ns_xccdf, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "choices"); |
| 237 | if ((inst->flagscxx . . $ xccdf_value_instance#flags..must_match_givencxx . . $ xccdf_value_instance#$anonymous_type_0#must_match_given.) && (inst->flagscxx . . $ xccdf_value_instance#flags..must_matchcxx . . $ xccdf_value_instance#$anonymous_type_0#must_match.)) |
| 238 | xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(choices, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "mustMatch", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! oscap_enum_to_stringcxx . . $ oscap_enum_to_string(64165c519d473d40).(OSCAP_BOOL_MAPcxx . . $ OSCAP_BOOL_MAP., inst->flagscxx . . $ xccdf_value_instance#flags..must_matchcxx . . $ xccdf_value_instance#$anonymous_type_0#must_match.)); |
| 239 | if ((inst->selectorcxx . . $ xccdf_value_instance#selector.)&&(strlencxx . . $ strlen(751346f8406fd082).(inst->selectorcxx . . $ xccdf_value_instance#selector.) > 0)) xmlNewPropcxx . . $ xmlNewProp(6ee5a6130c40eb8b).(choices, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "selector", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! inst->selectorcxx . . $ xccdf_value_instance#selector.); |
| 240 | OSCAP_FOR_STRcxx . . $ `src/common/list.h:163:9`!(ch, xccdf_value_instance_get_choices(inst)) |
| 241 | xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(choices, ns_xccdf, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "choice", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! ch); |
| 242 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(choices_nodes, choices); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | struct oscap_listcxx . . $ oscap_list# *all_nodes = oscap_list_destructive_joincxx . . $ oscap_list_destructive_join(ff1de76ad37ec509).(oscap_list_destructive_joincxx . . $ oscap_list_destructive_join(ff1de76ad37ec509).(value_nodes, defval_nodes), |
| 247 | oscap_list_destructive_joincxx . . $ oscap_list_destructive_join(ff1de76ad37ec509).(oscap_list_destructive_joincxx . . $ oscap_list_destructive_join(ff1de76ad37ec509).(match_nodes, lower_bound_nodes), |
| 248 | oscap_list_destructive_joincxx . . $ oscap_list_destructive_join(ff1de76ad37ec509).(upper_bound_nodes, choices_nodes))); |
| 249 | |
| 250 | struct oscap_iteratorcxx . . $ oscap_iterator# *it = oscap_iterator_newcxx . . $ oscap_iterator_new(f89fb456dfd589d7).(all_nodes); |
| 251 | while (oscap_iterator_has_morecxx . . $ oscap_iterator_has_more(63b1de9a5adb9205).(it)) xmlAddChildcxx . . $ xmlAddChild(93e65f4d4ebd68bd).(value_node, oscap_iterator_nextcxx . . $ oscap_iterator_next(4c75051c806960eb).(it)); |
| 252 | oscap_iterator_freecxx . . $ oscap_iterator_free(3cba44c1b7872358).(it); |
| 253 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(all_nodes, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 254 | |
| 255 | struct oscap_string_iteratorcxx . . $ oscap_string_iterator# *sources = xccdf_value_get_sourcescxx . . $ xccdf_value_get_sources(6a628c7dcc1c83a4).(value); |
| 256 | while (oscap_string_iterator_has_morecxx . . $ oscap_string_iterator_has_more(3724f2faf2515a82).(sources)) { |
| 257 | const char *source = oscap_string_iterator_nextcxx . . $ oscap_string_iterator_next(1f2a9ae2534eef34).(sources); |
| 258 | xmlNewTextChildcxx . . $ xmlNewTextChild(4c74f4d7754e7bc8).(value_node, ns_xccdf, BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! "source", BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! source); |
| 259 | } |
| 260 | oscap_string_iterator_freecxx . . $ oscap_string_iterator_free(41a77e9ce361f406).(sources); |
| 261 | } |
| 262 | |
| 263 | |
| 264 | void xccdf_value_freecxx . . $ xccdf_value_free(9e1ae929b010245a).(struct xccdf_itemcxx . . $ xccdf_item# *val) |
| 265 | { |
| 266 | if (val) { |
| 267 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(val->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..instancescxx . . $ xccdf_value_item#instances., (oscap_destruct_funccxx . . $ oscap_destruct_func#)xccdf_value_instance_freecxx . . $ xccdf_value_instance_free(64b0065843df938d).); |
| 268 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(val->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..sourcescxx . . $ xccdf_value_item#sources., freecxx . . $ free(5d22bdacc48458e8).); |
| 269 | xccdf_item_releasecxx . . $ xccdf_item_release(9e1ae929b010245a).(val); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_value_set_opercxx . . $ xccdf_value_set_oper(18e639079e2e2b71).(struct xccdf_valuecxx . . $ xccdf_value# * value, xccdf_operator_tcxx . . $ xccdf_operator_t# oper) |
| 274 | { |
| 275 | __attribute__nonnull__cxx . . $ `src/common/util.h:39:9`!(value); |
| 276 | |
| 277 | xccdf_value_to_itemcxx . . $ xccdf_value_to_item(8177c121c599be72).(value)->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..opercxx . . $ xccdf_value_item#oper. = oper; |
| 278 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 279 | |
| 280 | } |
| 281 | |
| 282 | static void xccdf_string_dumpcxx . . $ xccdf_string_dump(34d26762b42c433a).(const char *s, int depth) |
| 283 | { |
| 284 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 285 | printfcxx . . $ printf(581fddd72a8db8fc).("%s\n", s); |
| 286 | } |
| 287 | |
| 288 | static void |
| 289 | _xccdf_value_type_dumpcxx . . $ _xccdf_value_type_dump(19c64c45753562a8).(xccdf_value_type_tcxx . . $ xccdf_value_type_t# type, int depth) |
| 290 | { |
| 291 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 292 | printfcxx . . $ printf(581fddd72a8db8fc).("type: "); |
| 293 | switch (type) { |
| 294 | case XCCDF_TYPE_NUMBERcxx . . $ XCCDF_TYPE_NUMBER.: printfcxx . . $ printf(581fddd72a8db8fc).("number\n"); break; |
| 295 | case XCCDF_TYPE_STRINGcxx . . $ XCCDF_TYPE_STRING.: printfcxx . . $ printf(581fddd72a8db8fc).("string\n"); break; |
| 296 | case XCCDF_TYPE_BOOLEANcxx . . $ XCCDF_TYPE_BOOLEAN.: printfcxx . . $ printf(581fddd72a8db8fc).("boolean\n"); break; |
| 297 | default: |
| 298 | assertcxx . . $ `/usr/include/assert.h:50:10`!(false); |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | static void |
| 303 | _xccdf_value_instance_dumpcxx . . $ _xccdf_value_instance_dump(2c4f829c15fda7f1).(struct xccdf_value_instancecxx . . $ xccdf_value_instance# *vi, int depth) |
| 304 | { |
| 305 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth++); |
| 306 | printfcxx . . $ printf(581fddd72a8db8fc).("Value Instance: "); |
| 307 | if (vi == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 308 | printfcxx . . $ printf(581fddd72a8db8fc).("(NULL)\n"); |
| 309 | return; |
| 310 | } |
| 311 | printfcxx . . $ printf(581fddd72a8db8fc).("\n"); |
| 312 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 313 | printfcxx . . $ printf(581fddd72a8db8fc).("selector: '%s'\n", vi->selectorcxx . . $ xccdf_value_instance#selector. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? "(NULL)" : vi->selectorcxx . . $ xccdf_value_instance#selector.); |
| 314 | _xccdf_value_type_dumpcxx . . $ _xccdf_value_type_dump(19c64c45753562a8).(vi->typecxx . . $ xccdf_value_instance#type., depth); |
| 315 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 316 | printfcxx . . $ printf(581fddd72a8db8fc).("value: '%s'\n", vi->valuecxx . . $ xccdf_value_instance#value. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? "(NULL)" : vi->valuecxx . . $ xccdf_value_instance#value.); |
| 317 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 318 | printfcxx . . $ printf(581fddd72a8db8fc).("defval:'%s'\n", vi->defvalcxx . . $ xccdf_value_instance#defval. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? "(NULL)" : vi->defvalcxx . . $ xccdf_value_instance#defval.); |
| 319 | } |
| 320 | |
| 321 | void xccdf_value_dumpcxx . . $ xccdf_value_dump(399eb5318584c7ce).(struct xccdf_itemcxx . . $ xccdf_item# *value, int depth) |
| 322 | { |
| 323 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth++); |
| 324 | printfcxx . . $ printf(581fddd72a8db8fc).("Value : %s\n", (value ? value->itemcxx . . $ xccdf_item#item..idcxx . . $ xccdf_item_base#id. : "(NULL)")); |
| 325 | if (!value) |
| 326 | return; |
| 327 | xccdf_item_printcxx . . $ xccdf_item_print(399eb5318584c7ce).(value, depth); |
| 328 | _xccdf_value_type_dumpcxx . . $ _xccdf_value_type_dump(19c64c45753562a8).(value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..typecxx . . $ xccdf_value_item#type., depth); |
| 329 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 330 | printfcxx . . $ printf(581fddd72a8db8fc).("values"); |
| 331 | oscap_list_dumpcxx . . $ oscap_list_dump(df0831e7fcc09688).(value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..instancescxx . . $ xccdf_value_item#instances., (oscap_dump_funccxx . . $ oscap_dump_func#) _xccdf_value_instance_dumpcxx . . $ _xccdf_value_instance_dump(2c4f829c15fda7f1)., depth + 1); |
| 332 | if (value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..sourcescxx . . $ xccdf_value_item#sources.->itemcountcxx . . $ oscap_list#itemcount. != 0) { |
| 333 | xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(depth); |
| 334 | printfcxx . . $ printf(581fddd72a8db8fc).("sources"); |
| 335 | oscap_list_dumpcxx . . $ oscap_list_dump(df0831e7fcc09688).(value->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..sourcescxx . . $ xccdf_value_item#sources., (oscap_dump_funccxx . . $ oscap_dump_func#) xccdf_string_dumpcxx . . $ xccdf_string_dump(34d26762b42c433a)., depth + 1); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_value_has_selectorcxx . . $ xccdf_value_has_selector(838b4d1787e4a177).(void *inst, void *sel) |
| 340 | { |
| 341 | if (inst == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 342 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 343 | return oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(((struct xccdf_value_instancecxx . . $ xccdf_value_instance# *)inst)->selectorcxx . . $ xccdf_value_instance#selector., sel); |
| 344 | } |
| 345 | |
| 346 | static inline struct xccdf_value_instancecxx . . $ xccdf_value_instance# * |
| 347 | _xccdf_value_get_instance_by_selector_internalcxx . . $ _xccdf_value_get_instance_by_selector_internal(1c9d6811ccaf1af0).(const struct xccdf_valuecxx . . $ xccdf_value# *value, const char *selector) |
| 348 | { |
| 349 | return oscap_list_findcxx . . $ oscap_list_find(56869e8d639c7a63).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(value)->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..instancescxx . . $ xccdf_value_item#instances., (void*)selector, xccdf_value_has_selectorcxx . . $ xccdf_value_has_selector(838b4d1787e4a177).); |
| 350 | } |
| 351 | |
| 352 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *xccdf_value_get_instance_by_selectorcxx . . $ xccdf_value_get_instance_by_selector(1c9d6811ccaf1af0).(const struct xccdf_valuecxx . . $ xccdf_value# *value, const char *selector) |
| 353 | { |
| 354 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *val = _xccdf_value_get_instance_by_selector_internalcxx . . $ _xccdf_value_get_instance_by_selector_internal(1c9d6811ccaf1af0).(value, selector); |
| 355 | if (val == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && oscap_streqcxx . . $ oscap_streq(b7a7aa4a824b7595).(selector, "")) { |
| 356 | /* From NISTIR-7275r4: |
| 357 | * If there is no <xccdf:value> or <xccdf:complex-value> element with an empty |
| 358 | * or absent @selector, the first <xccdf:value> or <xccdf:complex-value> |
| 359 | * element in top-down processing of the XML SHALL be the default element. */ |
| 360 | struct xccdf_value_instance_iteratorcxx . . $ xccdf_value_instance_iterator# *instance_it = xccdf_value_get_instancescxx . . $ xccdf_value_get_instances(bcb6d4c853e3b862).(value); |
| 361 | if (xccdf_value_instance_iterator_has_morecxx . . $ xccdf_value_instance_iterator_has_more(563960b2fc1c463f).(instance_it)) |
| 362 | val = xccdf_value_instance_iterator_nextcxx . . $ xccdf_value_instance_iterator_next(590aa572a9f76df1).(instance_it); |
| 363 | xccdf_value_instance_iterator_freecxx . . $ xccdf_value_instance_iterator_free(4e23a798b7a4a5c).(instance_it); |
| 364 | } |
| 365 | return val; |
| 366 | } |
| 367 | |
| 368 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_value_add_instancecxx . . $ xccdf_value_add_instance(825a32ff3f04a49d).(struct xccdf_valuecxx . . $ xccdf_value# *value, struct xccdf_value_instancecxx . . $ xccdf_value_instance# *instance) |
| 369 | { |
| 370 | if (instance == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || value == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || xccdf_value_get_typecxx . . $ xccdf_value_get_type(241bbac253e8107a).(value) != instance->typecxx . . $ xccdf_value_instance#type.) |
| 371 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 372 | oscap_list_addcxx . . $ oscap_list_add(97f28760a5cf7823).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(value)->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..instancescxx . . $ xccdf_value_item#instances., instance); |
| 373 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 374 | } |
| 375 | |
| 376 | XCCDF_STATUS_CURRENTcxx . . $ `src/XCCDF/helpers.h:39:9`!(value) |
| 377 | XCCDF_VALUE_GETTERcxx . . $ `src/XCCDF/helpers.h:96:9`!(xccdf_value_type_t, type) |
| 378 | XCCDF_VALUE_GETTERcxx . . $ `src/XCCDF/helpers.h:96:9`!(xccdf_interface_hint_t, interface_hint) |
| 379 | XCCDF_VALUE_GETTERcxx . . $ `src/XCCDF/helpers.h:96:9`!(xccdf_operator_t, oper) |
| 380 | XCCDF_VALUE_IGETTERcxx . . $ `src/XCCDF/helpers.h:97:9`!(value_instance, instances) |
| 381 | XCCDF_SIGETTERcxx . . $ `src/XCCDF/helpers.h:65:9`!(value, sources) |
| 382 | XCCDF_ITERATOR_GEN_Scxx . . $ `src/XCCDF/helpers.h:218:9`!(value) |
| 383 | OSCAP_ITERATOR_GENcxx . . $ `src/common/util.h:123:9`!(xccdf_value_instance) |
| 384 | OSCAP_ITERATOR_REMOVE_Fcxx . . $ `src/common/util.h:128:9`!(xccdf_value_instance) |
| 385 | |
| 386 | |
| 387 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *xccdf_value_instance_newcxx . . $ xccdf_value_instance_new(9ab277c33bc2a47d).(xccdf_value_type_tcxx . . $ xccdf_value_type_t# type) |
| 388 | { |
| 389 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *inst = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct xccdf_value_instancecxx . . $ xccdf_value_instance#)); |
| 390 | inst->lower_boundcxx . . $ xccdf_value_instance#lower_bound. = NANcxx . . $ `<external>/11263917310783833665/math.h:101:12`!; |
| 391 | inst->upper_boundcxx . . $ xccdf_value_instance#upper_bound. = NANcxx . . $ `<external>/11263917310783833665/math.h:101:12`!; |
| 392 | |
| 393 | inst->typecxx . . $ xccdf_value_instance#type. = type; |
| 394 | inst->choicescxx . . $ xccdf_value_instance#choices. = oscap_list_newcxx . . $ oscap_list_new(ea215f73c8361bff).(); |
| 395 | return inst; |
| 396 | } |
| 397 | |
| 398 | void xccdf_value_instance_freecxx . . $ xccdf_value_instance_free(64b0065843df938d).(struct xccdf_value_instancecxx . . $ xccdf_value_instance# *inst) |
| 399 | { |
| 400 | if (inst != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 401 | oscap_list_freecxx . . $ oscap_list_free(e68e105c3900fcc1).(inst->choicescxx . . $ xccdf_value_instance#choices., freecxx . . $ free(5d22bdacc48458e8).); |
| 402 | freecxx . . $ free(5d22bdacc48458e8).(inst->selectorcxx . . $ xccdf_value_instance#selector.); |
| 403 | freecxx . . $ free(5d22bdacc48458e8).(inst->matchcxx . . $ xccdf_value_instance#match.); |
| 404 | freecxx . . $ free(5d22bdacc48458e8).(inst->valuecxx . . $ xccdf_value_instance#value.); |
| 405 | freecxx . . $ free(5d22bdacc48458e8).(inst->defvalcxx . . $ xccdf_value_instance#defval.); |
| 406 | freecxx . . $ free(5d22bdacc48458e8).(inst); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | struct xccdf_value_instancecxx . . $ xccdf_value_instance# *xccdf_value_new_instancecxx . . $ xccdf_value_new_instance(6ee3d03501c605d5).(struct xccdf_valuecxx . . $ xccdf_value# *val) |
| 411 | { |
| 412 | if (val == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 413 | return xccdf_value_instance_newcxx . . $ xccdf_value_instance_new(9ab277c33bc2a47d).(XITEMcxx . . $ `src/XCCDF/helpers.h:35:9`!(val)->subcxx . . $ xccdf_item#sub..valuecxx . . $ xccdf_item#$anonymous_type_1#value..typecxx . . $ xccdf_value_item#type.); |
| 414 | } |
| 415 | |
| 416 | #pragma GCC diagnostic ignored "-Wunused-value" |
| 417 | #define XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_STRcxx . . $ `src/XCCDF/value.c:417:9`!(WHAT) \ |
| 418 | const char *xccdf_value_instance_get_##WHAT##_string(const struct xccdf_value_instance *inst) { return inst->WHAT; } \ |
| 419 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_value_instance_set_##WHAT##_string(struct xccdf_value_instance *inst, const char *newval) { \ |
| 420 | free(inst->WHAT); inst->WHAT = oscap_strdup(newval); inst->flags.WHAT##_given = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; } |
| 421 | // TODO: Parse floats correctly instead of converting long to float |
| 422 | #define XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_NUMcxx . . $ `src/XCCDF/value.c:422:9`!(WHAT) \ |
| 423 | xccdf_numeric xccdf_value_instance_get_##WHAT##_number(const struct xccdf_value_instance *inst) { return inst->WHAT == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? NANcxx . . $ `<external>/11263917310783833665/math.h:101:12`! : (float)strtol(inst->WHAT, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 10); } \ |
| 424 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_value_instance_set_##WHAT##_number(struct xccdf_value_instance *inst, xccdf_numeric newval) { \ |
| 425 | free(inst->WHAT); inst->WHAT = oscap_sprintf("%f", newval); inst->flags.WHAT##_given = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; } |
| 426 | #define XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_BOOLcxx . . $ `src/XCCDF/value.c:426:9`!(WHAT) \ |
| 427 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_value_instance_get_##WHAT##_boolean(const struct xccdf_value_instance *inst) \ |
| 428 | { return oscap_string_to_enum(OSCAP_BOOL_MAP, inst->WHAT); } \ |
| 429 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_value_instance_set_##WHAT##_boolean(struct xccdf_value_instance *inst, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! newval) \ |
| 430 | { free(inst->WHAT); inst->WHAT = oscap_strdup(oscap_enum_to_string(OSCAP_BOOL_MAP, newval)); inst->flags.WHAT##_given = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; } |
| 431 | |
| 432 | OSCAP_ACCESSOR_STRINGcxx . . $ `src/common/util.h:245:9`!(xccdf_value_instance, selector) |
| 433 | OSCAP_GETTERcxx . . $ `src/common/util.h:111:9`!(xccdf_value_type_t, xccdf_value_instance, type) |
| 434 | OSCAP_ACCESSOR_EXPcxx . . $ `src/common/util.h:265:9`!(boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`!, xccdf_value_instance, must_match, flags.must_match) |
| 435 | OSCAP_ACCESSOR_SIMPLEcxx . . $ `src/common/util.h:258:9`!(xccdf_numeric, xccdf_value_instance, upper_bound) |
| 436 | OSCAP_ACCESSOR_SIMPLEcxx . . $ `src/common/util.h:258:9`!(xccdf_numeric, xccdf_value_instance, lower_bound) |
| 437 | OSCAP_ACCESSOR_STRINGcxx . . $ `src/common/util.h:245:9`!(xccdf_value_instance, match) |
| 438 | OSCAP_GETTERcxx . . $ `src/common/util.h:111:9`!(const char*, xccdf_value_instance, value) |
| 439 | OSCAP_IGETTERcxx . . $ `src/common/util.h:152:9`!(oscap_string, xccdf_value_instance, choices) |
| 440 | XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_STRcxx . . $ `src/XCCDF/value.c:417:9`!(value) |
| 441 | XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_STRcxx . . $ `src/XCCDF/value.c:417:9`!(defval) |
| 442 | XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_NUMcxx . . $ `src/XCCDF/value.c:422:9`!(value) |
| 443 | XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_NUMcxx . . $ `src/XCCDF/value.c:422:9`!(defval) |
| 444 | XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_BOOLcxx . . $ `src/XCCDF/value.c:426:9`!(value) |
| 445 | XCCDF_VALUE_INSTANCE_VALUE_ACCESSOR_BOOLcxx . . $ `src/XCCDF/value.c:426:9`!(defval) |