00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef XCCDF_ITEM_
00024 #define XCCDF_ITEM_
00025
00026 #include "public/xccdf.h"
00027 #include <assert.h>
00028 #include "elements.h"
00029 #include "../common/list.h"
00030 #include "../common/util.h"
00031 #include "../common/text_priv.h"
00032
00033 OSCAP_HIDDEN_START;
00034
00035 struct xccdf_flags {
00036 unsigned selected:1;
00037 unsigned hidden:1;
00038 unsigned resolved:1;
00039 unsigned abstract:1;
00040 unsigned prohibit_changes:1;
00041 unsigned interactive:1;
00042 unsigned multiple:1;
00043 };
00044
00045 struct xccdf_item;
00046 struct xccdf_check;
00047
00048 struct xccdf_item_base {
00049 char *id;
00050 char *cluster_id;
00051 float weight;
00052
00053 struct oscap_list *title;
00054 struct oscap_list *description;
00055 struct oscap_list *question;
00056 struct oscap_list *rationale;
00057 struct oscap_list *warnings;
00058
00059 char *version;
00060 char *version_update;
00061 time_t version_time;
00062
00063 struct xccdf_item *extends;
00064 struct xccdf_item *parent;
00065 struct oscap_list *statuses;
00066 struct oscap_list *references;
00067 struct oscap_list *platforms;
00068 struct xccdf_flags flags;
00069 struct xccdf_item *benchmark;
00070 };
00071
00072 struct xccdf_rule_item {
00073 char *impact_metric;
00074 xccdf_role_t role;
00075 xccdf_level_t severity;
00076 struct xccdf_check *check;
00077
00078 struct oscap_list *requires;
00079 struct oscap_list *conflicts;
00080
00081 struct oscap_list *profile_notes;
00082 struct oscap_list *idents;
00083 struct oscap_list *checks;
00084 struct oscap_list *fixes;
00085 struct oscap_list *fixtexts;
00086 };
00087
00088 struct xccdf_group_item {
00089 struct oscap_list *requires;
00090 struct oscap_list *conflicts;
00091
00092 struct oscap_list *values;
00093 struct oscap_list *content;
00094 };
00095
00096 union xccdf_value_unit {
00097 xccdf_numeric n;
00098 char *s;
00099 bool b;
00100 };
00101
00102 struct xccdf_value_val {
00103 union xccdf_value_unit value;
00104 union xccdf_value_unit defval;
00105 struct oscap_list *choices;
00106 bool must_match;
00107 union {
00108 struct {
00109 xccdf_numeric lower_bound;
00110 xccdf_numeric upper_bound;
00111 } n;
00112 struct {
00113 char *match;
00114 } s;
00115 } limits;
00116 };
00117
00118 struct xccdf_value_item {
00119 xccdf_value_type_t type;
00120 xccdf_interface_hint_t interface_hint;
00121 xccdf_operator_t oper;
00122 char *selector;
00123
00124 struct xccdf_value_val *value;
00125 struct oscap_htable *values;
00126
00127 struct oscap_list *sources;
00128 };
00129
00130
00131 struct xccdf_result_item {
00132 struct oscap_list *status;
00133 time_t start_time;
00134 time_t end_time;
00135 char *test_system;
00136 char *remark;
00137 char *organization;
00138 char *benchmark_uri;
00139
00140 struct xccdf_item *profile;
00141 struct oscap_list *identities;
00142 struct oscap_list *targets;
00143 struct oscap_list *target_addresses;
00144 struct oscap_list *target_facts;
00145 struct oscap_list *set_values;
00146 struct oscap_list *rule_results;
00147 struct oscap_list *scores;
00148 };
00149
00150 struct xccdf_profile_item {
00151 char *note_tag;
00152 struct oscap_list *selects;
00153 struct oscap_list *set_values;
00154 struct oscap_list *refine_values;
00155 struct oscap_list *refine_rules;
00156 };
00157
00158 struct xccdf_benchmark_item {
00159
00160 struct oscap_htable *dict;
00161 struct oscap_htable *auxdict;
00162 struct oscap_list *idrefs;
00163 struct oscap_list *notices;
00164 struct oscap_htable *plain_texts;
00165
00166 char *style;
00167 char *style_href;
00168 char *metadata;
00169
00170 struct oscap_list *front_matter;
00171 struct oscap_list *rear_matter;
00172
00173 struct oscap_list *models;
00174 struct oscap_list *profiles;
00175 struct oscap_list *values;
00176 struct oscap_list *content;
00177 struct oscap_list *results;
00178 };
00179
00180 struct xccdf_item {
00181 xccdf_type_t type;
00182 struct xccdf_item_base item;
00183 union {
00184 struct xccdf_profile_item profile;
00185 struct xccdf_benchmark_item bench;
00186 struct xccdf_rule_item rule;
00187 struct xccdf_group_item group;
00188 struct xccdf_value_item value;
00189 struct xccdf_result_item result;
00190 } sub;
00191 };
00192
00193 struct xccdf_warning {
00194 struct oscap_text *text;
00195 xccdf_warning_category_t category;
00196 };
00197
00198 struct xccdf_notice {
00199 char *id;
00200 struct oscap_text *text;
00201 };
00202
00203 struct xccdf_status {
00204 xccdf_status_type_t status;
00205 time_t date;
00206 };
00207
00208 struct xccdf_model {
00209 char *system;
00210 struct oscap_htable *params;
00211 };
00212
00213 struct xccdf_select {
00214 struct xccdf_item *item;
00215 bool selected;
00216 struct oscap_list *remarks;
00217 };
00218
00219 struct xccdf_refine_rule {
00220 struct xccdf_item *item;
00221 char *remark;
00222 char *selector;
00223 xccdf_role_t role;
00224 xccdf_level_t severity;
00225 float weight;
00226 };
00227
00228 struct xccdf_refine_value {
00229 struct xccdf_item *item;
00230 char *remark;
00231 char *selector;
00232 xccdf_operator_t oper;
00233 };
00234
00235 struct xccdf_set_value {
00236 struct xccdf_item *item;
00237 char *value;
00238 };
00239
00240 struct xccdf_ident {
00241 char *id;
00242 char *system;
00243 };
00244
00245 struct xccdf_check {
00246 xccdf_bool_operator_t oper;
00247 struct oscap_list *children;
00248 struct xccdf_item *parent;
00249 char *id;
00250 char *system;
00251 char *selector;
00252 char *content;
00253 struct oscap_list *imports;
00254 struct oscap_list *exports;
00255 struct oscap_list *content_refs;
00256 };
00257
00258 struct xccdf_check_content_ref {
00259 char *href;
00260 char *name;
00261 };
00262
00263 struct xccdf_check_import {
00264 char *name;
00265 char *content;
00266 };
00267
00268 struct xccdf_check_export {
00269 char *name;
00270 struct xccdf_item *value;
00271 };
00272
00273 struct xccdf_profile_note {
00274 char *reftag;
00275 struct oscap_text *text;
00276 };
00277
00278 struct xccdf_fix {
00279 bool reboot;
00280 xccdf_strategy_t strategy;
00281 xccdf_level_t disruption;
00282 xccdf_level_t complexity;
00283 char *id;
00284 char *content;
00285 char *system;
00286 char *platform;
00287 };
00288
00289 struct xccdf_fixtext {
00290 bool reboot;
00291 xccdf_strategy_t strategy;
00292 xccdf_level_t disruption;
00293 xccdf_level_t complexity;
00294 struct xccdf_fix *fixref;
00295 char *content;
00296 };
00297
00298 struct xccdf_reference {
00299 bool override;
00300 char *href;
00301 char *content;
00302 char *lang;
00303 };
00304
00305 extern const struct oscap_string_map XCCDF_LEVEL_MAP[];
00306 extern const struct oscap_string_map XCCDF_ROLE_MAP[];
00307 extern const struct oscap_string_map XCCDF_OPERATOR_MAP[];
00308 extern const struct oscap_string_map XCCDF_STRATEGY_MAP[];
00309
00310 struct xccdf_item *xccdf_item_new(xccdf_type_t type, struct xccdf_item *bench, struct xccdf_item *parent);
00311 void xccdf_item_release(struct xccdf_item *item);
00312 void xccdf_item_print(struct xccdf_item *item, int depth);
00313 void xccdf_item_dump(struct xccdf_item *item, int depth);
00314 void xccdf_item_free(struct xccdf_item *item);
00315
00316 struct xccdf_item *xccdf_benchmark_new(void);
00317 bool xccdf_benchmark_parse(struct xccdf_item *benchmark, xmlTextReaderPtr reader);
00318 bool xccdf_benchmark_add_ref(struct xccdf_item *benchmark, struct xccdf_item **ptr, const char *id, xccdf_type_t type);
00319 void xccdf_benchmark_dump(struct xccdf_benchmark *benchmark);
00320
00321 struct xccdf_item *xccdf_profile_new(struct xccdf_item *bench);
00322 struct xccdf_item *xccdf_profile_parse(xmlTextReaderPtr reader, struct xccdf_item *bench);
00323 void xccdf_profile_dump(struct xccdf_item *prof, int depth);
00324 void xccdf_profile_free(struct xccdf_item *prof);
00325
00326 bool xccdf_item_process_attributes(struct xccdf_item *item, xmlTextReaderPtr reader);
00327 bool xccdf_item_process_element(struct xccdf_item *item, xmlTextReaderPtr reader);
00328
00329 bool xccdf_content_parse(xmlTextReaderPtr reader, struct xccdf_item *parent);
00330 struct xccdf_item *xccdf_group_parse(xmlTextReaderPtr reader, struct xccdf_item *parent);
00331 struct xccdf_item *xccdf_group_new(struct xccdf_item *parent);
00332 void xccdf_group_dump(struct xccdf_item *group, int depth);
00333 void xccdf_group_free(struct xccdf_item *group);
00334
00335 struct xccdf_item *xccdf_rule_new(struct xccdf_item *parent);
00336 struct xccdf_item *xccdf_rule_parse(xmlTextReaderPtr reader, struct xccdf_item *parent);
00337 void xccdf_rule_dump(struct xccdf_item *rule, int depth);
00338 void xccdf_rule_free(struct xccdf_item *rule);
00339
00340 struct xccdf_item *xccdf_value_parse(xmlTextReaderPtr reader, struct xccdf_item *parent);
00341 struct xccdf_item *xccdf_value_new(struct xccdf_item *parent, xccdf_value_type_t type);
00342 void xccdf_value_dump(struct xccdf_item *value, int depth);
00343 void xccdf_value_free(struct xccdf_item *val);
00344
00345
00346
00347 struct xccdf_notice *xccdf_notice_new(void);
00348 struct xccdf_notice *xccdf_notice_new_parse(xmlTextReaderPtr reader);
00349 void xccdf_notice_dump(struct xccdf_notice *notice, int depth);
00350 void xccdf_notice_free(struct xccdf_notice *notice);
00351
00352 struct xccdf_status *xccdf_status_new(const char *status, const char *date);
00353 void xccdf_status_dump(struct xccdf_status *status, int depth);
00354 void xccdf_status_free(struct xccdf_status *status);
00355
00356 struct xccdf_model *xccdf_model_new_xml(xmlTextReaderPtr reader);
00357 void xccdf_model_free(struct xccdf_model *model);
00358
00359 void xccdf_cstring_dump(const char *data, int depth);
00360
00361 struct xccdf_ident *xccdf_ident_new(const char *id, const char *system);
00362 void xccdf_ident_free(struct xccdf_ident *ident);
00363
00364 struct xccdf_check *xccdf_check_new(struct xccdf_item *parent);
00365 struct xccdf_check *xccdf_check_parse(xmlTextReaderPtr reader, struct xccdf_item *parent);
00366 void xccdf_check_dump(struct xccdf_check *check, int depth);
00367 void xccdf_check_free(struct xccdf_check *check);
00368 void xccdf_check_content_ref_free(struct xccdf_check_content_ref *ref);
00369 void xccdf_check_content_ref_dump(struct xccdf_check_content_ref *ref, int depth);
00370 struct xccdf_ident *xccdf_ident_new(const char *id, const char *system);
00371 struct xccdf_ident *xccdf_ident_parse(xmlTextReaderPtr reader);
00372 void xccdf_ident_dump(struct xccdf_ident *ident, int depth);
00373 void xccdf_ident_free(struct xccdf_ident *ident);
00374 void xccdf_profile_note_free(struct xccdf_profile_note *note);
00375 void xccdf_check_import_free(struct xccdf_check_import *item);
00376 void xccdf_check_export_free(struct xccdf_check_export *item);
00377 struct xccdf_fix *xccdf_fix_parse(xmlTextReaderPtr reader, struct xccdf_item *parent);
00378 struct xccdf_fixtext *xccdf_fixtext_parse(xmlTextReaderPtr reader, struct xccdf_item *parent);
00379 void xccdf_fixtext_free(struct xccdf_fixtext *item);
00380 void xccdf_fix_free(struct xccdf_fix *item);
00381 void xccdf_set_value_free(struct xccdf_set_value *sv);
00382
00383 struct xccdf_warning *xccdf_warning_new(void);
00384 struct xccdf_warning *xccdf_warning_new_parse(xmlTextReaderPtr reader);
00385 void xccdf_warning_free(struct xccdf_warning * warn);
00386
00387 struct xccdf_reference *xccdf_reference_new(void);
00388 struct xccdf_reference *xccdf_reference_new_parse(xmlTextReaderPtr reader);
00389 void xccdf_reference_free(struct xccdf_reference * ref);
00390
00391
00392 struct xccdf_warning_iterator *xccdf_profile_get_warnings(const struct xccdf_profile *profile);
00393
00394 #define MACRO_BLOCK(code) do { code } while(false)
00395 #define ASSERT_TYPE(item,t) assert((item)->type & t)
00396 #define ASSERT_BENCHMARK(item) ASSERT_TYPE(item, XCCDF_BENCHMARK)
00397 #define XBENCHMARK(item) ((struct xccdf_benchmark*)item)
00398 #define XPROFILE(item) ((struct xccdf_profile*)item)
00399 #define XGROUP(item) ((struct xccdf_group*)item)
00400 #define XRULE(item) ((struct xccdf_rule*)item)
00401 #define XITEM(item) ((struct xccdf_item*)item)
00402 #define XVALUE(item) ((struct xccdf_value*)item)
00403
00404 #define XCCDF_STATUS_CURRENT(TYPE) \
00405 xccdf_status_type_t xccdf_##TYPE##_get_status_current(const struct xccdf_##TYPE* item) {\
00406 return xccdf_item_get_current_status(XITEM(item)); }
00407
00408 #define XCCDF_TEXT_IGETTER(SNAME,MNAME,MEXP) \
00409 struct oscap_text_iterator* xccdf_##SNAME##_get_##MNAME(const struct xccdf_##SNAME* item) \
00410 { return oscap_iterator_new(XITEM(item)->MEXP); }
00411 #define XCCDF_GENERIC_GETTER(RTYPE,TNAME,MEMBER) \
00412 RTYPE xccdf_##TNAME##_get_##MEMBER(const struct xccdf_##TNAME* item) { return (RTYPE)((item)->MEMBER); }
00413 #define XCCDF_GENERIC_IGETTER(ITYPE,TNAME,MNAME) \
00414 struct xccdf_##ITYPE##_iterator* xccdf_##TNAME##_get_##MNAME(const struct xccdf_##TNAME* item) \
00415 { return oscap_iterator_new(item->MNAME); }
00416 #define XCCDF_ABSTRACT_GETTER(RTYPE,TNAME,MNAME,MEMBER) \
00417 RTYPE xccdf_##TNAME##_get_##MNAME(const struct xccdf_##TNAME* item) { return (RTYPE)(XITEM(item)->MEMBER); }
00418 #define XCCDF_ITERATOR_GETTER(ITYPE,TNAME,MNAME,MEMBER) \
00419 struct xccdf_##ITYPE##_iterator* xccdf_##TNAME##_get_##MNAME(const struct xccdf_##TNAME* item) \
00420 { return oscap_iterator_new(XITEM(item)->MEMBER); }
00421 #define XCCDF_SITERATOR_GETTER(TNAME,MNAME,MEMBER) \
00422 struct oscap_string_iterator* xccdf_##TNAME##_get_##MNAME(const struct xccdf_##TNAME* item) \
00423 { return oscap_iterator_new(XITEM(item)->MEMBER); }
00424 #define XCCDF_TITERATOR_GETTER(TNAME,MNAME,MEMBER) \
00425 struct oscap_text_iterator* xccdf_##TNAME##_get_##MNAME(const struct xccdf_##TNAME* item) \
00426 { return oscap_iterator_new(XITEM(item)->MEMBER); }
00427 #define XCCDF_HTABLE_GETTER(RTYPE,TNAME,MNAME,MEMBER) \
00428 RTYPE xccdf_##TNAME##_get_##MNAME(const struct xccdf_##TNAME* item, const char* key) \
00429 { return (RTYPE)oscap_htable_get(XITEM(item)->MEMBER, key); }
00430 #define XCCDF_SIGETTER(TNAME,MNAME) \
00431 struct oscap_string_iterator* xccdf_##TNAME##_get_##MNAME(const struct xccdf_##TNAME* item) \
00432 { return oscap_iterator_new(XITEM(item)->sub.TNAME.MNAME); }
00433
00434 #define XCCDF_BENCHMARK_GETTER_A(RTYPE,MNAME,MEMBER) XCCDF_ABSTRACT_GETTER(RTYPE,benchmark,MNAME,MEMBER)
00435 #define XCCDF_BENCHMARK_GETTER_I(RTYPE,MNAME) XCCDF_BENCHMARK_GETTER_A(RTYPE,MNAME,item.MNAME)
00436 #define XCCDF_BENCHMARK_IGETTER_I(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,benchmark,MNAME,item.MNAME)
00437 #define XCCDF_BENCHMARK_GETTER(RTYPE,MNAME) XCCDF_BENCHMARK_GETTER_A(RTYPE,MNAME,sub.bench.MNAME)
00438 #define XCCDF_BENCHMARK_IGETTER(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,benchmark,MNAME,sub.bench.MNAME)
00439
00440 #define XCCDF_PROFILE_GETTER_A(RTYPE,MNAME,MEMBER) XCCDF_ABSTRACT_GETTER(RTYPE,profile,MNAME,MEMBER)
00441 #define XCCDF_PROFILE_GETTER_I(RTYPE,MNAME) XCCDF_PROFILE_GETTER_A(RTYPE,MNAME,item.MNAME)
00442 #define XCCDF_PROFILE_IGETTER_I(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,profile,MNAME,item.MNAME)
00443 #define XCCDF_PROFILE_GETTER(RTYPE,MNAME) XCCDF_PROFILE_GETTER_A(RTYPE,MNAME,sub.profile.MNAME)
00444 #define XCCDF_PROFILE_IGETTER(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,profile,MNAME,sub.profile.MNAME)
00445
00446 #define XCCDF_RULE_GETTER_A(RTYPE,MNAME,MEMBER) XCCDF_ABSTRACT_GETTER(RTYPE,rule,MNAME,MEMBER)
00447 #define XCCDF_RULE_GETTER_I(RTYPE,MNAME) XCCDF_RULE_GETTER_A(RTYPE,MNAME,item.MNAME)
00448 #define XCCDF_RULE_IGETTER_I(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,rule,MNAME,item.MNAME)
00449 #define XCCDF_RULE_GETTER(RTYPE,MNAME) XCCDF_RULE_GETTER_A(RTYPE,MNAME,sub.rule.MNAME)
00450 #define XCCDF_RULE_IGETTER(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,rule,MNAME,sub.rule.MNAME)
00451
00452 #define XCCDF_GROUP_GETTER_A(RTYPE,MNAME,MEMBER) XCCDF_ABSTRACT_GETTER(RTYPE,group,MNAME,MEMBER)
00453 #define XCCDF_GROUP_GETTER_I(RTYPE,MNAME) XCCDF_GROUP_GETTER_A(RTYPE,MNAME,item.MNAME)
00454 #define XCCDF_GROUP_IGETTER_I(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,group,MNAME,item.MNAME)
00455 #define XCCDF_GROUP_GETTER(RTYPE,MNAME) XCCDF_GROUP_GETTER_A(RTYPE,MNAME,sub.group.MNAME)
00456 #define XCCDF_GROUP_IGETTER(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,group,MNAME,sub.group.MNAME)
00457
00458 #define XCCDF_VALUE_GETTER_A(RTYPE,MNAME,MEMBER) XCCDF_ABSTRACT_GETTER(RTYPE,value,MNAME,MEMBER)
00459 #define XCCDF_VALUE_GETTER_I(RTYPE,MNAME) XCCDF_VALUE_GETTER_A(RTYPE,MNAME,item.MNAME)
00460 #define XCCDF_VALUE_IGETTER_I(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,value,MNAME,item.MNAME)
00461 #define XCCDF_VALUE_GETTER(RTYPE,MNAME) XCCDF_VALUE_GETTER_A(RTYPE,MNAME,sub.value.MNAME)
00462 #define XCCDF_VALUE_IGETTER(ITYPE,MNAME) XCCDF_ITERATOR_GETTER(ITYPE,value,MNAME,sub.value.MNAME)
00463
00464 #define XCCDF_ITEM_GETTER(RTYPE,MNAME) \
00465 XCCDF_ABSTRACT_GETTER(RTYPE,item,MNAME,item.MNAME) \
00466 XCCDF_BENCHMARK_GETTER_A(RTYPE,MNAME,item.MNAME) \
00467 XCCDF_PROFILE_GETTER_A(RTYPE,MNAME,item.MNAME) \
00468 XCCDF_RULE_GETTER_A(RTYPE,MNAME,item.MNAME) \
00469 XCCDF_VALUE_GETTER_A(RTYPE,MNAME,item.MNAME) \
00470 XCCDF_GROUP_GETTER_A(RTYPE,MNAME,item.MNAME)
00471 #define XCCDF_ITEM_IGETTER(RTYPE,MNAME) \
00472 XCCDF_ITERATOR_GETTER(RTYPE,item,MNAME,item.MNAME) \
00473 XCCDF_ITERATOR_GETTER(RTYPE,benchmark,MNAME,item.MNAME) \
00474 XCCDF_ITERATOR_GETTER(RTYPE,profile,MNAME,item.MNAME) \
00475 XCCDF_ITERATOR_GETTER(RTYPE,rule,MNAME,item.MNAME) \
00476 XCCDF_ITERATOR_GETTER(RTYPE,value,MNAME,item.MNAME) \
00477 XCCDF_ITERATOR_GETTER(RTYPE,group,MNAME,item.MNAME)
00478 #define XCCDF_ITEM_SIGETTER(MNAME) \
00479 XCCDF_SITERATOR_GETTER(item,MNAME,item.MNAME) \
00480 XCCDF_SITERATOR_GETTER(benchmark,MNAME,item.MNAME) \
00481 XCCDF_SITERATOR_GETTER(profile,MNAME,item.MNAME) \
00482 XCCDF_SITERATOR_GETTER(rule,MNAME,item.MNAME) \
00483 XCCDF_SITERATOR_GETTER(value,MNAME,item.MNAME) \
00484 XCCDF_SITERATOR_GETTER(group,MNAME,item.MNAME)
00485 #define XCCDF_ITEM_TIGETTER(MNAME) \
00486 XCCDF_TITERATOR_GETTER(item,MNAME,item.MNAME) \
00487 XCCDF_TITERATOR_GETTER(benchmark,MNAME,item.MNAME) \
00488 XCCDF_TITERATOR_GETTER(profile,MNAME,item.MNAME) \
00489 XCCDF_TITERATOR_GETTER(rule,MNAME,item.MNAME) \
00490 XCCDF_TITERATOR_GETTER(value,MNAME,item.MNAME) \
00491 XCCDF_TITERATOR_GETTER(group,MNAME,item.MNAME)
00492 #define XCCDF_FLAG_GETTER(MNAME) \
00493 XCCDF_BENCHMARK_GETTER_A(bool,MNAME,item.flags.MNAME) \
00494 XCCDF_PROFILE_GETTER_A(bool,MNAME,item.flags.MNAME) \
00495 XCCDF_RULE_GETTER_A(bool,MNAME,item.flags.MNAME) \
00496 XCCDF_VALUE_GETTER_A(bool,MNAME,item.flags.MNAME) \
00497 XCCDF_GROUP_GETTER_A(bool,MNAME,item.flags.MNAME)
00498
00499 #define XITERATOR(x) ((struct oscap_iterator*)(x))
00500 #define XCCDF_ITERATOR(n) struct xccdf_##n##_iterator*
00501 #define XCCDF_ITERATOR_FWD(n) struct xccdf_##n##_iterator;
00502 #define XCCDF_ITERATOR_HAS_MORE(n) bool xccdf_##n##_iterator_has_more(XCCDF_ITERATOR(n) it) { return oscap_iterator_has_more(XITERATOR(it)); }
00503 #define XCCDF_ITERATOR_NEXT(t,n) t xccdf_##n##_iterator_next(XCCDF_ITERATOR(n) it) { return oscap_iterator_next(XITERATOR(it)); }
00504 #define XCCDF_ITERATOR_FREE(n) void xccdf_##n##_iterator_free(XCCDF_ITERATOR(n) it) { oscap_iterator_free(XITERATOR(it)); }
00505 #define XCCDF_ITERATOR_GEN_T(t,n) XCCDF_ITERATOR_FWD(n) XCCDF_ITERATOR_HAS_MORE(n) XCCDF_ITERATOR_NEXT(t,n) XCCDF_ITERATOR_FREE(n)
00506 #define XCCDF_ITERATOR_GEN_S(n) XCCDF_ITERATOR_GEN_T(struct xccdf_##n*,n)
00507 #define XCCDF_ITERATOR_GEN_TEXT(n) XCCDF_ITERATOR_GEN_T(struct oscap_text *,n)
00508
00509 OSCAP_HIDDEN_END;
00510
00511 #endif