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_policyxccdf_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_modelxccdf_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_iteratorxccdf_policy_get_selected_rules (struct xccdf_policy *)
 Get selected rules from policy.
 
struct xccdf_profilexccdf_policy_get_profile (const struct xccdf_policy *)
 Get XCCDF Profile from Policy.
 
struct xccdf_select_iteratorxccdf_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.
 
#define OSCAP_DEPRECATED(func)   func
 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.
 
bool xccdf_policy_is_item_selected (struct xccdf_policy *policy, const char *id)
 Get the selection settings of the item.
 
struct xccdf_selectxccdf_policy_get_select_by_id (struct xccdf_policy *policy, const char *item_id)
 Get select from policy by specified ID of XCCDF Item.
 
Evaluators
struct xccdf_resultxccdf_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_modelmodel
 XCCDF Policy model.
 
struct xccdf_profileprofile
 Profile structure (from benchmark)
 
struct oscap_listselects
 A list of all selects.
 
struct oscap_listvalues
 Bound values of profile.
 
struct oscap_listresults
 List of XCCDF results.
 
struct oscap_htableselected_internal
 A hash which for given item points to the latest selector applicable.
 
struct oscap_htableselected_final
 A hash which for given item defines final selection.
 

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.

Field Documentation

struct oscap_htable* xccdf_policy::selected_internal

A hash which for given item points to the latest selector applicable.

There might not be one. Note that it migth be a selector for cluster-id.

struct oscap_list* xccdf_policy::selects

A list of all selects.

Either from profile or later added through API.


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