Open SCAP Library
Public Member Functions | Data Fields
xccdf_policy Struct Reference

XCCDF policy structure is abstract (class) structure of Profile element from benchmark. More...

#include <xccdf_policy.h>

Public Member Functions

struct xccdf_policy * xccdf_policy_new (struct xccdf_policy_model *model, struct xccdf_profile *profile)
 Constructor of Policy structure.
void xccdf_policy_free (struct xccdf_policy *)
 Destructor of Policy structure.
Getters

Return value is pointer to structure's member.

Do not free unless you null the pointer in the structure. Use remove function otherwise.

struct xccdf_policy_model * xccdf_policy_get_model (const struct xccdf_policy *policy)
 Get model from Policy (parent structure of Policy to access the benchmark)
struct
xccdf_value_binding_iterator * 
xccdf_policy_get_values (const struct xccdf_policy *item)
 Get Value Bindings from XCCDF Policy.
struct xccdf_select_iterator * xccdf_policy_get_selected_rules (struct xccdf_policy *)
 Get selected rules from policy.
struct xccdf_profile * xccdf_policy_get_profile (const struct xccdf_policy *)
 Get XCCDF Profile from Policy.
struct xccdf_select_iterator * xccdf_policy_get_selects (const struct xccdf_policy *)
 Get rules from Policy.
const char * xccdf_policy_get_id (struct xccdf_policy *policy)
 Get ID of XCCDF Profile that is implemented by XCCDF Policy.
Setters

For lists use add functions.

Parameters of set functions are duplicated in memory and need to be freed by caller.

bool xccdf_policy_add_select (struct xccdf_policy *, struct xccdf_select *)
 Add rule to Policy.
bool xccdf_policy_set_selected (struct xccdf_policy *policy, char *idref)
 Set a new selector to the Policy structure.
bool xccdf_policy_add_value (struct xccdf_policy *, struct xccdf_value_binding *)
 Add value binding to the Policy structure.
struct xccdf_select * xccdf_policy_get_select_by_id (struct xccdf_policy *policy, const char *item_id)
 Add check export to the Value Binding structure.
Evaluators
struct xccdf_result * xccdf_policy_evaluate (struct xccdf_policy *policy)
 Call the checking engine for each selected rule in given policy structure.
bool xccdf_policy_resolve (struct xccdf_policy *policy)
 Resolve benchmark by applying all refine_rules and refine_values to rules / values of benchmark.

Data Fields

struct xccdf_policy_model * model
 XCCDF Policy model.
struct xccdf_profile * profile
 Profile structure (from benchmark)
struct oscap_list * selects
 Selected rules and groups of profile.
struct oscap_list * values
 Bound values of profile.
struct oscap_list * results
 List of XCCDF results.
struct oscap_htable * ht_selects
 Hash table of selects.

Detailed Description

XCCDF policy structure is abstract (class) structure of Profile element from benchmark.

Policy structure that abstract benchmark's profile.

Structure contains rules and bound values to abstract these lists from the benchmark file. Can be modified temporaly so changes can be discarded or saved to the existing model.


The documentation for this struct was generated from the following files: