Debian Codegraph @

src/XCCDF/elements.h

raw symbols SCIP
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 #ifndef XCCDF_ELEMENTS_H_
24 #define XCCDF_ELEMENTS_H_cxx . . $ `src/XCCDF/elements.h:24:9`!
25
26 #include <stdbool.h>
27 #include <time.h>
28
29 #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/
30 #include "common/elements.h"cxx . . $ `<file>/src/common/elements.h`/
31 #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/
32
33 #include <libxml/xmlreader.h>
34
35
36 /**
37 * Detects version from given xmlTextReader
38 *
39 * The reader has to be at the root <Benchmark> element
40 */
41 const struct xccdf_version_infocxx . . $ xccdf_version_info#* xccdf_detect_version_parsercxx . . $ xccdf_detect_version_parser(7d21fc833ae00d0a).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader);
42
43 /**
44 * Detects version from the xmlTextReader.
45 *
46 * The reader needs to be at the start of document.
47 */
48 char *xccdf_detect_version_privcxx . . $ xccdf_detect_version_priv(93c99f8009311dd0).(xmlTextReadercxx . . $ xmlTextReader# *reader);
49
50 /**
51 * Return true if the given namespace is supported XCCDF namespace.
52 */
53 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_is_supported_namespacecxx . . $ xccdf_is_supported_namespace(8796ad3e3951bb1).(xmlNscxx . . $ xmlNs# *ns);
54 int xccdf_version_cmpcxx . . $ xccdf_version_cmp(90211f1159e0810f).(const struct xccdf_version_infocxx . . $ xccdf_version_info# *actual, const char *desired);
55
56 typedef enumcxx . . $ $anonymous_type_a2f00a27639995c0_0# {
57 XCCDFE_ERRORcxx . . $ XCCDFE_ERROR. = -1,
58 XCCDFE_UNMATCHEDcxx . . $ XCCDFE_UNMATCHED. = 0,
59
60 // XCCDF 1.1+ elements
61 XCCDFE_BENCHMARKcxx . . $ XCCDFE_BENCHMARK.,
62 XCCDFE_GROUPcxx . . $ XCCDFE_GROUP.,
63 XCCDFE_RULEcxx . . $ XCCDFE_RULE.,
64 XCCDFE_VALUEcxx . . $ XCCDFE_VALUE.,
65 XCCDFE_PROFILEcxx . . $ XCCDFE_PROFILE.,
66 XCCDFE_TESTRESULTcxx . . $ XCCDFE_TESTRESULT.,
67 XCCDFE_RESULT_BENCHMARKcxx . . $ XCCDFE_RESULT_BENCHMARK.,
68 XCCDFE_CHECKcxx . . $ XCCDFE_CHECK.,
69 XCCDFE_CHECK_IMPORTcxx . . $ XCCDFE_CHECK_IMPORT.,
70 XCCDFE_CHECK_EXPORTcxx . . $ XCCDFE_CHECK_EXPORT.,
71 XCCDFE_CHECK_CONTENTcxx . . $ XCCDFE_CHECK_CONTENT.,
72 XCCDFE_CHECK_CONTENT_REFcxx . . $ XCCDFE_CHECK_CONTENT_REF.,
73 XCCDFE_CHOICEScxx . . $ XCCDFE_CHOICES.,
74 XCCDFE_CHOICEcxx . . $ XCCDFE_CHOICE.,
75 XCCDFE_COMPLEX_CHECKcxx . . $ XCCDFE_COMPLEX_CHECK.,
76 XCCDFE_CONFLICTScxx . . $ XCCDFE_CONFLICTS.,
77 XCCDFE_CPE_LISTcxx . . $ XCCDFE_CPE_LIST.,
78 XCCDFE_DC_STATUScxx . . $ XCCDFE_DC_STATUS.,
79 XCCDFE_DEFAULTcxx . . $ XCCDFE_DEFAULT.,
80 XCCDFE_DESCRIPTIONcxx . . $ XCCDFE_DESCRIPTION.,
81 XCCDFE_FACTcxx . . $ XCCDFE_FACT.,
82 XCCDFE_FIXcxx . . $ XCCDFE_FIX.,
83 XCCDFE_FIXTEXTcxx . . $ XCCDFE_FIXTEXT.,
84 XCCDFE_FRONT_MATTERcxx . . $ XCCDFE_FRONT_MATTER.,
85 XCCDFE_IDENTcxx . . $ XCCDFE_IDENT.,
86 XCCDFE_IDENTITYcxx . . $ XCCDFE_IDENTITY.,
87 XCCDFE_IMPACT_METRICcxx . . $ XCCDFE_IMPACT_METRIC.,
88 XCCDFE_INSTANCEcxx . . $ XCCDFE_INSTANCE.,
89 XCCDFE_LOWER_BOUNDcxx . . $ XCCDFE_LOWER_BOUND.,
90 XCCDFE_MATCHcxx . . $ XCCDFE_MATCH.,
91 XCCDFE_MESSAGEcxx . . $ XCCDFE_MESSAGE.,
92 XCCDFE_METADATAcxx . . $ XCCDFE_METADATA.,
93 XCCDFE_MODELcxx . . $ XCCDFE_MODEL.,
94 XCCDFE_NEW_RESULTcxx . . $ XCCDFE_NEW_RESULT.,
95 XCCDFE_NOTICEcxx . . $ XCCDFE_NOTICE.,
96 XCCDFE_OLD_RESULTcxx . . $ XCCDFE_OLD_RESULT.,
97 XCCDFE_ORGANIZATIONcxx . . $ XCCDFE_ORGANIZATION.,
98 XCCDFE_OVERRIDEcxx . . $ XCCDFE_OVERRIDE.,
99 XCCDFE_PARAMcxx . . $ XCCDFE_PARAM.,
100 XCCDFE_PLAIN_TEXTcxx . . $ XCCDFE_PLAIN_TEXT.,
101 XCCDFE_PLATFORMcxx . . $ XCCDFE_PLATFORM.,
102 XCCDFE_CPE2_PLATFORMSPECcxx . . $ XCCDFE_CPE2_PLATFORMSPEC.,
103 XCCDFE_RESULT_PROFILEcxx . . $ XCCDFE_RESULT_PROFILE.,
104 XCCDFE_PROFILE_NOTEcxx . . $ XCCDFE_PROFILE_NOTE.,
105 XCCDFE_QUESTIONcxx . . $ XCCDFE_QUESTION.,
106 XCCDFE_RATIONALEcxx . . $ XCCDFE_RATIONALE.,
107 XCCDFE_REAR_MATTERcxx . . $ XCCDFE_REAR_MATTER.,
108 XCCDFE_REFERENCEcxx . . $ XCCDFE_REFERENCE.,
109 XCCDFE_REFINE_RULEcxx . . $ XCCDFE_REFINE_RULE.,
110 XCCDFE_REFINE_VALUEcxx . . $ XCCDFE_REFINE_VALUE.,
111 XCCDFE_REMARKcxx . . $ XCCDFE_REMARK.,
112 XCCDFE_REQUIREScxx . . $ XCCDFE_REQUIRES.,
113 XCCDFE_RESULTcxx . . $ XCCDFE_RESULT.,
114 XCCDFE_RULE_RESULTcxx . . $ XCCDFE_RULE_RESULT.,
115 XCCDFE_SCOREcxx . . $ XCCDFE_SCORE.,
116 XCCDFE_SELECTcxx . . $ XCCDFE_SELECT.,
117 XCCDFE_SET_VALUEcxx . . $ XCCDFE_SET_VALUE.,
118 XCCDFE_SIGNATUREcxx . . $ XCCDFE_SIGNATURE.,
119 XCCDFE_SOURCEcxx . . $ XCCDFE_SOURCE.,
120 XCCDFE_STATUScxx . . $ XCCDFE_STATUS.,
121 XCCDFE_SUBcxx . . $ XCCDFE_SUB.,
122 XCCDFE_TAILORINGcxx . . $ XCCDFE_TAILORING.,
123 XCCDFE_TARGETcxx . . $ XCCDFE_TARGET.,
124 XCCDFE_TARGET_ADDRESScxx . . $ XCCDFE_TARGET_ADDRESS.,
125 XCCDFE_TARGET_FACTScxx . . $ XCCDFE_TARGET_FACTS.,
126 XCCDFE_TARGET_IDENTIFIERcxx . . $ XCCDFE_TARGET_IDENTIFIER.,
127 XCCDFE_TITLEcxx . . $ XCCDFE_TITLE.,
128 XCCDFE_UPPER_BOUNDcxx . . $ XCCDFE_UPPER_BOUND.,
129 XCCDFE_VALUE_VALcxx . . $ XCCDFE_VALUE_VAL.,
130 XCCDFE_VERSIONcxx . . $ XCCDFE_VERSION.,
131 XCCDFE_WARNINGcxx . . $ XCCDFE_WARNING.,
132 /// benchmark ref and result benchmark have the same element name and namespace
133 XCCDFE_BENCHMARK_REFcxx . . $ XCCDFE_BENCHMARK_REF. = XCCDFE_RESULT_BENCHMARKcxx . . $ XCCDFE_RESULT_BENCHMARK.,
134
135 XCCDFE_END_cxx . . $ XCCDFE_END_.
136 } xccdf_element_tcxx . . $ xccdf_element_t#;
137
138 const char *xccdf_element_to_strcxx . . $ xccdf_element_to_str(d5bbaadd2048c040).(xccdf_element_tcxx . . $ xccdf_element_t# element);
139 xccdf_element_tcxx . . $ xccdf_element_t# xccdf_element_getcxx . . $ xccdf_element_get(a5dd71d24d1f6f1).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader);
140
141 #define XCCDF_ASSERT_ELEMENTcxx . . $ `src/XCCDF/elements.h:141:9`!(reader, element) \
142 do { \
143 if (xccdf_element_get(reader) != element) { \
144 const char *found, *expected; \
145 \
146 found = xccdf_element_to_str((xccdf_element_get(reader))); \
147 expected = xccdf_element_to_str(element); \
148 oscap_seterrcxx . . $ `src/common/_error.h:52:9`!( \
149 OSCAP_EFAMILY_XCCDFcxx . . $ `src/common/public/oscap_error.h:62:9`!, \
150 "Find element '%s' while expecting element: '%s'", \
151 found != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? found : "(null)", \
152 expected != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? expected : "(null)"); \
153 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; \
154 } \
155 } while (falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!)
156
157 typedef enumcxx . . $ $anonymous_type_a2f00a27639995c0_1# {
158 XCCDFA_NONEcxx . . $ XCCDFA_NONE.,
159 XCCDFA_ABSTRACTcxx . . $ XCCDFA_ABSTRACT.,
160 XCCDFA_AUTHENTICATEDcxx . . $ XCCDFA_AUTHENTICATED.,
161 XCCDFA_AUTHORITYcxx . . $ XCCDFA_AUTHORITY.,
162 XCCDFA_CATEGORYcxx . . $ XCCDFA_CATEGORY.,
163 XCCDFA_CLUSTER_IDcxx . . $ XCCDFA_CLUSTER_ID.,
164 XCCDFA_COMPLEXITYcxx . . $ XCCDFA_COMPLEXITY.,
165 XCCDFA_CONTEXTcxx . . $ XCCDFA_CONTEXT.,
166 XCCDFA_DATEcxx . . $ XCCDFA_DATE.,
167 XCCDFA_DISRUPTIONcxx . . $ XCCDFA_DISRUPTION.,
168 XCCDFA_END_TIMEcxx . . $ XCCDFA_END_TIME.,
169 XCCDFA_EXPORT_NAMEcxx . . $ XCCDFA_EXPORT_NAME.,
170 XCCDFA_EXTENDScxx . . $ XCCDFA_EXTENDS.,
171 XCCDFA_FIXREFcxx . . $ XCCDFA_FIXREF.,
172 XCCDFA_HIDDENcxx . . $ XCCDFA_HIDDEN.,
173 XCCDFA_HREFcxx . . $ XCCDFA_HREF.,
174 XCCDFA_IDcxx . . $ XCCDFA_ID.,
175 XCCDFA_IDREFcxx . . $ XCCDFA_IDREF.,
176 XCCDFA_IIDcxx . . $ XCCDFA_IID.,
177 XCCDFA_IMPORT_NAMEcxx . . $ XCCDFA_IMPORT_NAME.,
178 XCCDFA_IMPORT_XPATHcxx . . $ XCCDFA_IMPORT_XPATH.,
179 XCCDFA_INTERACTIVEcxx . . $ XCCDFA_INTERACTIVE.,
180 XCCDFA_INTERFACEHINTcxx . . $ XCCDFA_INTERFACEHINT.,
181 XCCDFA_MAXIMUMcxx . . $ XCCDFA_MAXIMUM.,
182 XCCDFA_MULTICHECKcxx . . $ XCCDFA_MULTICHECK.,
183 XCCDFA_MULTIPLEcxx . . $ XCCDFA_MULTIPLE.,
184 XCCDFA_MUSTMATCHcxx . . $ XCCDFA_MUSTMATCH.,
185 XCCDFA_NAMEcxx . . $ XCCDFA_NAME.,
186 XCCDFA_NEGATEcxx . . $ XCCDFA_NEGATE.,
187 XCCDFA_NOTE_TAGcxx . . $ XCCDFA_NOTE_TAG.,
188 XCCDFA_OPERATORcxx . . $ XCCDFA_OPERATOR.,
189 XCCDFA_OVERRIDEcxx . . $ XCCDFA_OVERRIDE.,
190 XCCDFA_PARENTCONTEXTcxx . . $ XCCDFA_PARENTCONTEXT.,
191 XCCDFA_PLATFORMcxx . . $ XCCDFA_PLATFORM.,
192 XCCDFA_PRIVILEDGEDcxx . . $ XCCDFA_PRIVILEDGED.,
193 XCCDFA_PROHIBITCHANGEScxx . . $ XCCDFA_PROHIBITCHANGES.,
194 XCCDFA_REBOOTcxx . . $ XCCDFA_REBOOT.,
195 XCCDFA_RESOLVEDcxx . . $ XCCDFA_RESOLVED.,
196 XCCDFA_ROLEcxx . . $ XCCDFA_ROLE.,
197 XCCDFA_SELECTEDcxx . . $ XCCDFA_SELECTED.,
198 XCCDFA_SELECTORcxx . . $ XCCDFA_SELECTOR.,
199 XCCDFA_SEVERITYcxx . . $ XCCDFA_SEVERITY.,
200 XCCDFA_START_TIMEcxx . . $ XCCDFA_START_TIME.,
201 XCCDFA_STRATEGYcxx . . $ XCCDFA_STRATEGY.,
202 XCCDFA_STYLEcxx . . $ XCCDFA_STYLE.,
203 XCCDFA_STYLE_HREFcxx . . $ XCCDFA_STYLE_HREF.,
204 XCCDFA_SYSTEMcxx . . $ XCCDFA_SYSTEM.,
205 XCCDFA_TAGcxx . . $ XCCDFA_TAG.,
206 XCCDFA_TEST_SYSTEMcxx . . $ XCCDFA_TEST_SYSTEM.,
207 XCCDFA_TIMEcxx . . $ XCCDFA_TIME.,
208 XCCDFA_TYPEcxx . . $ XCCDFA_TYPE.,
209 XCCDFA_UPDATEcxx . . $ XCCDFA_UPDATE.,
210 XCCDFA_URIcxx . . $ XCCDFA_URI.,
211 XCCDFA_VALUE_IDcxx . . $ XCCDFA_VALUE_ID.,
212 XCCDFA_VERSIONcxx . . $ XCCDFA_VERSION.,
213 XCCDFA_WEIGHTcxx . . $ XCCDFA_WEIGHT.,
214 XCCDFA_END_cxx . . $ XCCDFA_END_.
215 } xccdf_attribute_tcxx . . $ xccdf_attribute_t#;
216
217 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_attribute_hascxx . . $ xccdf_attribute_has(5c4b5ba7d6a00a2).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr);
218 const char *xccdf_attribute_getcxx . . $ xccdf_attribute_get(9e9cd2f6cdd20132).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr);
219 char *xccdf_attribute_copycxx . . $ xccdf_attribute_copy(861b5c6f59611beb).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr);
220 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! xccdf_attribute_get_boolcxx . . $ xccdf_attribute_get_bool(5c4b5ba7d6a00a2).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr);
221 int xccdf_attribute_get_intcxx . . $ xccdf_attribute_get_int(d255a977bb93c852).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr);
222 float xccdf_attribute_get_floatcxx . . $ xccdf_attribute_get_float(ff0b6e2937c2a058).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, xccdf_attribute_tcxx . . $ xccdf_attribute_t# attr);
223
224 extern const struct oscap_string_mapcxx . . $ oscap_string_map# XCCDF_BOOL_MAPcxx . . $ XCCDF_BOOL_MAP.[];
225
226 void xccdf_print_depthcxx . . $ xccdf_print_depth(d4f767463ce0a6b3).(int depth);
227 void xccdf_print_maxcxx . . $ xccdf_print_max(1e8c11a11d48e725).(const char *str, int max, const char *ellipsis);
228 void xccdf_print_max_textcxx . . $ xccdf_print_max_text(fd26ed0363f94f2c).(const struct oscap_textcxx . . $ oscap_text# *txt, int max, const char *ellipsis);
229 void xccdf_print_textlistcxx . . $ xccdf_print_textlist(87adaa5870f6d825).(struct oscap_text_iteratorcxx . . $ oscap_text_iterator# *txt, int depth, int max, const char *ellipsis);
230
231 xmlNscxx . . $ xmlNs# *lookup_xccdf_nscxx . . $ lookup_xccdf_ns(145fb009c13e3a1).(xmlDoccxx . . $ xmlDoc# *doc, xmlNodecxx . . $ xmlNode# *parent, const struct xccdf_version_infocxx . . $ xccdf_version_info# *version_info);
232
233 const struct xccdf_version_infocxx . . $ xccdf_version_info# *xccdf_version_info_findcxx . . $ xccdf_version_info_find(f9f562031eb5b14d).(const char *version);
234
235
236 #endif