xccdf_policy.h File Reference
XCCDF_POLICY

Open-scap XCCDF Policy library interface. More...

`#include <xccdf_benchmark.h>`
`#include <stdbool.h>`
`#include <time.h>`
`#include <oscap.h>`

Go to the source code of this file.

## Typedefs

typedef void *(* | xccdf_policy_engine_query_fn )(void *, xccdf_policy_engine_query_t, void *)
| Type of function which implements queries defined within xccdf_policy_engine_query_t. More...
typedef xccdf_test_result_type_t(* | xccdf_policy_engine_eval_fn )(struct xccdf_policy *policy, const char *rule_id, const char *definition_id, const char *href_if, struct xccdf_value_binding_iterator *value_binding_it, struct xccdf_check_import_iterator *check_imports_it, void *user_data)
| Type of function which implements OpenSCAP checking engine. More...
typedef int(* | policy_reporter_output )(struct xccdf_rule_result *, void *)
typedef int(* | policy_reporter_start )(struct xccdf_rule *, void *)

## Enumerations

enum | xccdf_policy_engine_query_t { POLICY_ENGINE_QUERY_NAMES_FOR_HREF = 1 }
| Type of a query over checking-engine data. More...

## Functions

bool | xccdf_policy_model_set_tailoring (struct xccdf_policy_model *model, struct xccdf_tailoring *tailoring)
| Sets the Tailoring element to use in the policy. More...
bool | xccdf_policy_model_add_cpe_dict (struct xccdf_policy_model *model, const char *cpe_dict)
| Registers an additional CPE dictionary for applicability testing The one embedded in the evaluated XCCDF take precedence!
bool | xccdf_policy_model_add_cpe_lang_model (struct xccdf_policy_model *model, const char *cpe_lang)
| Registers an additional CPE lang model for applicability testing The one embedded in the evaluated XCCDF take precedence!
bool | xccdf_policy_model_add_cpe_autodetect (struct xccdf_policy_model *model, const char *filepath)
| Registers an additional CPE resource (either dictionary or language) Autodetects given file and acts accordingly. More...
struct oscap_htable_iterator * | xccdf_policy_model_get_cpe_oval_sessions (struct xccdf_policy_model *model)
| Retrieves an iterator of all OVAL sessions created for CPE applicability evaluation key is the OVAL href, value is the OVAL session itself (type oval_agent_session*)
Setters
For lists use add functions. Parameters of set functions are duplicated in memory and need to be freed by caller.
int | xccdf_policy_get_selected_rules_count (struct xccdf_policy *policy)
| Retrieves number of selected items in the policy. More...
Evaluators
struct xccdf_item * | xccdf_policy_tailor_item (struct xccdf_policy *policy, struct xccdf_item *item)
| Clone the item and tailor it against given policy (profile) More...
struct oscap_file_entry_list * | xccdf_policy_model_get_systems_and_files (struct xccdf_policy_model *policy_model)
| Return names of files that are used in checks of particular rules. More...
struct oscap_file_entry_list * | xccdf_item_get_systems_and_files (struct xccdf_item *item)
| Return names of files that are used in checks of particular rules. More...
struct oscap_stringlist * | xccdf_policy_model_get_files (struct xccdf_policy_model *policy_model)
| Return names of files that are used in checks of particular rules. More...
struct oscap_stringlist * | xccdf_item_get_files (struct xccdf_item *item)
| Return names of files that are used in checks of particular rules. More...
xccdf_test_result_type_t | xccdf_test_result_resolve_and_operation (xccdf_test_result_type_t A, xccdf_test_result_type_t B)
| Return result of the AND operation for two given attributes. More...
Iterators
struct xccdf_score * | xccdf_policy_get_score (struct xccdf_policy *policy, struct xccdf_result *test_result, const char *system)
| Get score of the XCCDF Benchmark. More...
char * | xccdf_policy_substitute (const char *text, struct xccdf_policy *policy)
| Perform textual substitution of cdf:sub elements with respect to given XCCDF policy. More...

## Detailed Description

Open-scap XCCDF Policy library interface.

Author
  Maros Barabas mbara.nosp@m.bas@.nosp@m.redha.nosp@m.t.co.nosp@m.m
  Dave Niemoller david.nosp@m..nie.nosp@m.molle.nosp@m.r@g2.nosp@m.-inc..nosp@m.com