00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00031 #ifndef XCCDF_POLICY_H_
00032 #define XCCDF_POLICY_H_
00033
00034 #include <stdbool.h>
00035 #include <time.h>
00036 #include <oscap.h>
00037 #include <xccdf.h>
00038 #include <oval_definitions.h>
00039
00044 struct xccdf_policy_model;
00045
00050 struct xccdf_policy;
00051
00056 struct xccdf_value_binding;
00057
00063 struct xccdf_policy_iterator;
00064
00065
00066
00073 struct xccdf_policy_model *xccdf_policy_model_new(struct xccdf_benchmark *benchmark);
00074
00081 struct xccdf_policy * xccdf_policy_new(struct xccdf_policy_model * model, struct xccdf_profile * profile);
00082
00087 struct xccdf_value_binding * xccdf_value_binding_new(void);
00088
00094 struct xccdf_value_binding * xccdf_value_binding_new();
00095
00100 void xccdf_policy_model_free(struct xccdf_policy_model *);
00101
00106 void xccdf_policy_free(struct xccdf_policy *);
00107
00112 void xccdf_value_binding_free(struct xccdf_value_binding *);
00113
00119 void xccdf_policy_export_variables(struct xccdf_policy *, char *export_namespace, struct oscap_export_target *);
00125 void xccdf_policy_export_controls (struct xccdf_policy *, char *export_namespace, struct oscap_export_target *);
00131 void xccdf_policy_import_results(struct xccdf_policy *, char *import_namespace, struct oscap_import_source *);
00137 void xccdf_policy_export_results(struct xccdf_policy *, char *scoring_model_namespace, struct oscap_export_target *);
00138
00148 bool xccdf_policy_model_register_callback(struct xccdf_policy_model * model, char * sys, void * func, void * usr);
00149
00150
00164 struct xccdf_policy_model * xccdf_policy_get_model(const struct xccdf_policy * policy);
00165
00172 struct xccdf_benchmark * xccdf_policy_model_get_benchmark(const struct xccdf_policy_model * item);
00173
00178 struct xccdf_value_binding_iterator * xccdf_policy_get_values(const struct xccdf_policy * item);
00179
00186 struct xccdf_policy_iterator * xccdf_policy_model_get_policies(const struct xccdf_policy_model *model);
00187
00194 struct xccdf_select_iterator * xccdf_policy_get_selected_rules(struct xccdf_policy *);
00195
00201 struct xccdf_profile * xccdf_policy_get_profile(const struct xccdf_policy *);
00202
00208 struct xccdf_select_iterator * xccdf_policy_get_rules(const struct xccdf_policy *);
00209
00215 struct xccdf_refine_value * xccdf_value_binding_get_refine_value(const struct xccdf_value_binding *);
00216
00222 struct xccdf_setvalue * xccdf_value_binding_get_set_value(const struct xccdf_value_binding *);
00223
00229 struct xccdf_value * xccdf_value_binding_get_rule_value(const struct xccdf_value_binding *);
00230
00236 struct xccdf_check_export_iterator * xccdf_value_binding_get_check_exports(const struct xccdf_value_binding *);
00237
00242 struct xccdf_result_iterator * xccdf_policy_model_get_results(const struct xccdf_policy_model * model);
00243
00249 struct xccdf_result * xccdf_policy_model_get_result_by_id(struct xccdf_policy_model * model, const char * id);
00250
00257 const char * xccdf_policy_get_id(struct xccdf_policy * policy);
00258
00266 struct xccdf_policy * xccdf_policy_model_get_policy_by_id(struct xccdf_policy_model * policy_model, const char * id);
00267
00276 struct oval_variable_model * xccdf_policy_get_variables(struct xccdf_policy * policy, struct oval_definition_model * def_model);
00277
00278
00281
00294 bool xccdf_policy_model_add_policy(struct xccdf_policy_model *, struct xccdf_policy *);
00295
00301 bool xccdf_policy_add_rule(struct xccdf_policy *, struct xccdf_select *);
00302
00308 bool xccdf_value_binding_add_refine_rule(struct xccdf_value_binding *, struct xccdf_refine_rule *);
00309
00315 bool xccdf_value_binding_add_refine_value(struct xccdf_value_binding *, struct xccdf_refine_value *);
00316
00322 bool xccdf_value_binding_add_setvalue(struct xccdf_value_binding *, struct xccdf_setvalue *);
00323
00329 bool xccdf_policy_set_selected(struct xccdf_policy * policy, char * idref);
00330
00335 bool xccdf_policy_model_add_result(struct xccdf_policy_model * model, struct xccdf_result * item);
00336
00342 bool xccdf_policy_add_value(struct xccdf_policy *, struct xccdf_value_binding *);
00343
00349 bool xccdf_value_binding_add_check_export(struct xccdf_value_binding *, struct xccdf_check_export *);
00350
00351
00354
00366 bool xccdf_policy_evaluate(struct xccdf_policy * policy);
00367
00376 bool xccdf_policy_resolve(struct xccdf_policy * policy);
00377
00378
00381
00391 bool xccdf_policy_iterator_has_more(struct xccdf_policy_iterator *it);
00392
00397 struct xccdf_policy * xccdf_policy_iterator_next(struct xccdf_policy_iterator *it);
00398
00403 void xccdf_policy_iterator_free(struct xccdf_policy_iterator *it);
00404
00409 bool xccdf_value_binding_iterator_has_more(struct xccdf_value_binding_iterator *it);
00410
00415 struct xccdf_value_binding * xccdf_value_binding_iterator_next(struct xccdf_value_binding_iterator *it);
00416
00421 void xccdf_value_binding_iterator_free(struct xccdf_value_binding_iterator *it);
00422
00423
00426
00427
00428
00429 #endif
00430
00431