23 #ifndef XCCDF_ELEMENTS_H_
24 #define XCCDF_ELEMENTS_H_
29 #include "common/util.h"
30 #include "common/elements.h"
31 #include "common/_error.h"
33 #include <libxml/xmlreader.h>
49 char *xccdf_detect_version_priv(xmlTextReader *reader);
54 bool xccdf_is_supported_namespace(xmlNs *ns);
68 XCCDFE_RESULT_BENCHMARK,
73 XCCDFE_CHECK_CONTENT_REF,
103 XCCDFE_CPE2_PLATFORMSPEC,
104 XCCDFE_RESULT_PROFILE,
125 XCCDFE_TARGET_ADDRESS,
127 XCCDFE_TARGET_IDENTIFIER,
134 XCCDFE_BENCHMARK_REF = XCCDFE_RESULT_BENCHMARK,
139 const char *xccdf_element_to_str(xccdf_element_t element);
140 xccdf_element_t xccdf_element_get(xmlTextReaderPtr reader);
142 #define XCCDF_ASSERT_ELEMENT(reader, element) \
144 if (xccdf_element_get(reader) != element) { \
145 const char *found, *expected; \
147 found = xccdf_element_to_str((xccdf_element_get(reader))); \
148 expected = xccdf_element_to_str(element); \
150 OSCAP_EFAMILY_XCCDF, \
151 "Find element '%s' while expecting element: '%s'", \
152 found != NULL ? found : "(null)", \
153 expected != NULL ? expected : "(null)"); \
161 XCCDFA_AUTHENTICATED,
181 XCCDFA_INTERFACEHINT,
191 XCCDFA_PARENTCONTEXT,
194 XCCDFA_PROHIBITCHANGES,
218 bool xccdf_attribute_has(xmlTextReaderPtr reader, xccdf_attribute_t attr);
219 const char *xccdf_attribute_get(xmlTextReaderPtr reader, xccdf_attribute_t attr);
220 char *xccdf_attribute_copy(xmlTextReaderPtr reader, xccdf_attribute_t attr);
221 bool xccdf_attribute_get_bool(xmlTextReaderPtr reader, xccdf_attribute_t attr);
222 int xccdf_attribute_get_int(xmlTextReaderPtr reader, xccdf_attribute_t attr);
223 float xccdf_attribute_get_float(xmlTextReaderPtr reader, xccdf_attribute_t attr);
227 void xccdf_print_depth(
int depth);
228 void xccdf_print_max(
const char *str,
int max,
const char *ellipsis);
229 void xccdf_print_max_text(
const struct oscap_text *txt,
int max,
const char *ellipsis);
230 void xccdf_print_textlist(
struct oscap_text_iterator *txt,
int depth,
int max,
const char *ellipsis);
232 xmlNs *lookup_xccdf_ns(xmlDoc *doc, xmlNode *parent,
const struct xccdf_version_info *version_info);
Define mapping between symbolic constant and its string representation.
Definition: util.h:310
Definition: XCCDF/elements.c:43
Internationalized string iterator.
const char * version
MAJOR.MINOR, for example "1.1" or "1.2".
Definition: XCCDF/elements.c:44
Representation of internationalizable character strings.
Definition: text_priv.h:47