XCCDF_POLICY

Data Structures

struct  xccdf_policy_model
 XCCDF policy model structure contains xccdf_benchmark as reference to Benchmark element in XML file and list of policies that are abstract structure of Profile element from benchmark file. More...
struct  xccdf_policy
 XCCDF policy structure is abstract (class) structure of Profile element from benchmark. More...
struct  xccdf_value_binding
 XCCDF value binding structure is binding between Refine values, Set values, Value element and Check export element of benchmark. More...
struct  xccdf_policy_iterator
 Iterate through policies. More...

Files

file  xccdf_policy.h
 

Open-scap XCCDF Policy library interface.


Functions

struct xccdf_policy_modelxccdf_policy_model::xccdf_policy_model_new (struct xccdf_benchmark *benchmark)
 Constructor of Policy Model structure.
struct xccdf_policyxccdf_policy::xccdf_policy_new (struct xccdf_policy_model *model, struct xccdf_profile *profile)
 Constructor of Policy structure.
struct xccdf_value_bindingxccdf_value_binding::xccdf_value_binding_new (void)
 Constructor for Value binding.
void xccdf_policy_model::xccdf_policy_model_free (struct xccdf_policy_model *)
 Destructor of Policy Model structure.
void xccdf_policy::xccdf_policy_free (struct xccdf_policy *)
 Destructor of Policy structure.
void xccdf_value_binding::xccdf_value_binding_free (struct xccdf_value_binding *)
 Destructor of Value binding structure.
void xccdf_policy::xccdf_policy_export_variables (struct xccdf_policy *, char *export_namespace, struct oscap_export_target *)
 Import/Export function Not yet implemented.
void xccdf_policy::xccdf_policy_export_controls (struct xccdf_policy *, char *export_namespace, struct oscap_export_target *)
 Import/Export function Not yet implemented.
void xccdf_policy::xccdf_policy_import_results (struct xccdf_policy *, char *import_namespace, struct oscap_import_source *)
 Import/Export function Not yet implemented.
void xccdf_policy::xccdf_policy_export_results (struct xccdf_policy *, char *scoring_model_namespace, struct oscap_export_target *)
 Import/Export function Not yet implemented.
bool xccdf_policy_model::xccdf_policy_model_register_callback (struct xccdf_policy_model *model, char *sys, void *func, void *usr)
 Function to register callback for checking system.

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::xccdf_policy_get_model (const struct xccdf_policy *policy)
 Get model from Policy (parent structure of Policy to access the benchmark).
struct xccdf_benchmarkxccdf_policy_model::xccdf_policy_model_get_benchmark (const struct xccdf_policy_model *item)
 Get Benchmark from Policy Model.
struct
xccdf_value_binding_iterator * 
xccdf_policy::xccdf_policy_get_values (const struct xccdf_policy *item)
 Get Value Bindings from XCCDF Policy.
struct xccdf_policy_iteratorxccdf_policy_model::xccdf_policy_model_get_policies (const struct xccdf_policy_model *model)
 Get policies from Policy Model.
struct xccdf_select_iteratorxccdf_policy::xccdf_policy_get_selected_rules (struct xccdf_policy *)
 Get selected rules from policy.
struct xccdf_profilexccdf_policy::xccdf_policy_get_profile (const struct xccdf_policy *)
 Get XCCDF Profile from Policy.
struct xccdf_select_iteratorxccdf_policy::xccdf_policy_get_rules (const struct xccdf_policy *)
 Get rules from Policy.
struct xccdf_refine_valuexccdf_value_binding::xccdf_value_binding_get_refine_value (const struct xccdf_value_binding *)
 Get refine value from value bindings.
struct xccdf_setvaluexccdf_value_binding::xccdf_value_binding_get_set_value (const struct xccdf_value_binding *)
 Get set value from value bindings.
struct xccdf_valuexccdf_value_binding::xccdf_value_binding_get_rule_value (const struct xccdf_value_binding *)
 get value (element value) from value bindings
struct
xccdf_check_export_iterator
xccdf_value_binding::xccdf_value_binding_get_check_exports (const struct xccdf_value_binding *)
 get check export elements from value bindings
struct xccdf_result_iteratorxccdf_policy_model::xccdf_policy_model_get_results (const struct xccdf_policy_model *model)
 Get results of all XCCDF Policy results.
struct xccdf_resultxccdf_policy_model::xccdf_policy_model_get_result_by_id (struct xccdf_policy_model *model, const char *id)
 Get XCCDF Result structure by it's idetificator if there is one.
const char * xccdf_policy::xccdf_policy_get_id (struct xccdf_policy *policy)
 Get ID of XCCDF Profile that is implemented by XCCDF Policy.
struct xccdf_policyxccdf_policy_model::xccdf_policy_model_get_policy_by_id (struct xccdf_policy_model *policy_model, const char *id)
 Get XCCDF Policy from Policy model by speciefied ID of Profile.
struct oval_variable_modelxccdf_policy::xccdf_policy_get_variables (struct xccdf_policy *policy, struct oval_definition_model *def_model)
 Get external variables from XCCDF for given Policy and export them to OVAL Variable model.

Setters

For lists use add functions.

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



bool xccdf_policy_model::xccdf_policy_model_add_policy (struct xccdf_policy_model *, struct xccdf_policy *)
 Add Policy to Policy Model.
bool xccdf_policy::xccdf_policy_add_rule (struct xccdf_policy *, struct xccdf_select *)
 Add rule to Policy.
bool xccdf_value_binding::xccdf_value_binding_add_refine_rule (struct xccdf_value_binding *, struct xccdf_refine_rule *)
 Add refine rule to the Value Binding structure.
bool xccdf_value_binding::xccdf_value_binding_add_refine_value (struct xccdf_value_binding *, struct xccdf_refine_value *)
 Add refine value to the Value Binding structure.
bool xccdf_value_binding::xccdf_value_binding_add_setvalue (struct xccdf_value_binding *, struct xccdf_setvalue *)
 Add value to the Value Binding structure.
bool xccdf_policy::xccdf_policy_set_selected (struct xccdf_policy *policy, char *idref)
 Set a new selector to the Policy structure.
bool xccdf_policy_model::xccdf_policy_model_add_result (struct xccdf_policy_model *model, struct xccdf_result *item)
 Add result to XCCDF Policy Model.
bool xccdf_policy::xccdf_policy_add_value (struct xccdf_policy *, struct xccdf_value_binding *)
 Add value binding to the Policy structure.
bool xccdf_value_binding::xccdf_value_binding_add_check_export (struct xccdf_value_binding *, struct xccdf_check_export *)
 Add check export to the Value Binding structure.

Evaluators



bool xccdf_policy::xccdf_policy_evaluate (struct xccdf_policy *policy)
 Call the checking engine for each selected rule in given policy structure.
bool xccdf_policy::xccdf_policy_resolve (struct xccdf_policy *policy)
 Resolve benchmark by applying all refine_rules and refine_values to rules / values of benchmark.

Iterators



bool xccdf_policy_iterator::xccdf_policy_iterator_has_more (struct xccdf_policy_iterator *it)
 Return true if the list is not empty, false otherwise.
struct xccdf_policyxccdf_policy_iterator::xccdf_policy_iterator_next (struct xccdf_policy_iterator *it)
 Return the next xccdf_policy structure from the list and increment the iterator.
void xccdf_policy_iterator::xccdf_policy_iterator_free (struct xccdf_policy_iterator *it)
 Free the iterator structure (it makes no changes to the list structure).

Function Documentation

bool xccdf_policy_add_rule ( struct xccdf_policy ,
struct xccdf_select  
) [inherited]

Add rule to Policy.

Returns:
true if rule has been added succesfully
bool xccdf_policy_add_value ( struct xccdf_policy ,
struct xccdf_value_binding  
) [inherited]

Add value binding to the Policy structure.

Returns:
true if rule has been added succesfully
bool xccdf_policy_evaluate ( struct xccdf_policy policy  )  [inherited]

Call the checking engine for each selected rule in given policy structure.

Parameters:
policy given Policy to evaluate
Returns:
true if evaluation pass or false in case of error
const char * xccdf_policy_get_id ( struct xccdf_policy policy  )  [inherited]

Get ID of XCCDF Profile that is implemented by XCCDF Policy.

Parameters:
policy XCCDF Policy
Returns:
ID of Policy's Profile
struct xccdf_policy_model * xccdf_policy_get_model ( const struct xccdf_policy policy  )  [read, inherited]

Get model from Policy (parent structure of Policy to access the benchmark).

Parameters:
policy XCCDF Policy
Returns:
Policy model
struct xccdf_profile * xccdf_policy_get_profile ( const struct xccdf_policy  )  [read, inherited]

Get XCCDF Profile from Policy.

Returns:
XCCDF Profile
struct xccdf_select_iterator * xccdf_policy_get_rules ( const struct xccdf_policy  )  [read, inherited]

Get rules from Policy.

Returns:
xccdf_select_iterator
struct xccdf_select_iterator * xccdf_policy_get_selected_rules ( struct xccdf_policy  )  [read, inherited]

Get selected rules from policy.

Returns:
Pointer to select iterator.
Return values:
NULL on faliure
struct oval_variable_model * xccdf_policy_get_variables ( struct xccdf_policy policy,
struct oval_definition_model def_model 
) [read, inherited]

Get external variables from XCCDF for given Policy and export them to OVAL Variable model.

Parameters:
policy XCCDF Policy
def_model OVAL definition model
Returns:
OVAL Variable model
See also:
oval_variable_model
bool xccdf_policy_model_add_policy ( struct xccdf_policy_model ,
struct xccdf_policy  
) [inherited]

Add Policy to Policy Model.

Returns:
true if policy has been added succesfully
struct xccdf_benchmark * xccdf_policy_model_get_benchmark ( const struct xccdf_policy_model item  )  [read, inherited]

Get Benchmark from Policy Model.

Parameters:
item Policy model structure
Returns:
XCCDF Benchmark for given policy model
struct xccdf_policy_iterator * xccdf_policy_model_get_policies ( const struct xccdf_policy_model model  )  [read, inherited]

Get policies from Policy Model.

Parameters:
model Policy Model
Returns:
Iterator for list of policies
struct xccdf_policy * xccdf_policy_model_get_policy_by_id ( struct xccdf_policy_model policy_model,
const char *  id 
) [read, inherited]

Get XCCDF Policy from Policy model by speciefied ID of Profile.

Parameters:
policy_model XCCDF Policy model
id ID of Profile
Returns:
XCCDF Policy
struct xccdf_result * xccdf_policy_model_get_result_by_id ( struct xccdf_policy_model model,
const char *  id 
) [read, inherited]

Get XCCDF Result structure by it's idetificator if there is one.

Returns:
structure xccdf_result if found, NULL otherwise
struct xccdf_policy_model * xccdf_policy_model_new ( struct xccdf_benchmark benchmark  )  [read, inherited]

Constructor of Policy Model structure.

Parameters:
benchmark Struct xccdf_benchmark with benchmark model
Returns:
new xccdf_policy_model
bool xccdf_policy_model_register_callback ( struct xccdf_policy_model model,
char *  sys,
void *  func,
void *  usr 
) [inherited]

Function to register callback for checking system.

Parameters:
model XCCDF Policy Model
sys String representing given checking system
func Callback - pointer to function called by XCCDF Policy system when rule parsed
usr optional parameter for passing user data to callback
Returns:
true if callback registered succesfully, false otherwise
struct xccdf_policy * xccdf_policy_new ( struct xccdf_policy_model model,
struct xccdf_profile profile 
) [read, inherited]

Constructor of Policy structure.

Parameters:
model Policy model
profile Profile from XCCDF Benchmark
bool xccdf_policy_resolve ( struct xccdf_policy policy  )  [inherited]

Resolve benchmark by applying all refine_rules and refine_values to rules / values of benchmark.

All properties in benchmark will be irreversible changed and user has to load benchmark (from XML) again to discard these changes.

Parameters:
policy XCCDF policy containing rules/values that will be applied to benchmark rules/values.
Returns:
true if process ends succesfuly or false in case of error
bool xccdf_policy_set_selected ( struct xccdf_policy policy,
char *  idref 
) [inherited]

Set a new selector to the Policy structure.

Returns:
true if rule has been added succesfully
bool xccdf_value_binding_add_check_export ( struct xccdf_value_binding ,
struct xccdf_check_export  
) [inherited]

Add check export to the Value Binding structure.

Returns:
true if rule has been added succesfully
bool xccdf_value_binding_add_refine_rule ( struct xccdf_value_binding ,
struct xccdf_refine_rule  
) [inherited]

Add refine rule to the Value Binding structure.

Returns:
true if rule has been added succesfully
bool xccdf_value_binding_add_refine_value ( struct xccdf_value_binding ,
struct xccdf_refine_value  
) [inherited]

Add refine value to the Value Binding structure.

Returns:
true if rule has been added succesfully
bool xccdf_value_binding_add_setvalue ( struct xccdf_value_binding ,
struct xccdf_setvalue  
) [inherited]

Add value to the Value Binding structure.

Returns:
true if rule has been added succesfully
struct xccdf_check_export_iterator * xccdf_value_binding_get_check_exports ( const struct xccdf_value_binding  )  [read, inherited]

get check export elements from value bindings

Returns:
xccdf_check_export_iterator
struct xccdf_refine_value * xccdf_value_binding_get_refine_value ( const struct xccdf_value_binding  )  [read, inherited]

Get refine value from value bindings.

Returns:
xccdf_refine_value
struct xccdf_value * xccdf_value_binding_get_rule_value ( const struct xccdf_value_binding  )  [read, inherited]

get value (element value) from value bindings

Returns:
xccdf_value
struct xccdf_setvalue * xccdf_value_binding_get_set_value ( const struct xccdf_value_binding  )  [read, inherited]

Get set value from value bindings.

Returns:
xccdf_setvalue
struct xccdf_value_binding * xccdf_value_binding_new ( void   )  [read, inherited]

Constructor for Value binding.

Constructor of structure with profile bindings - refine_rules, refine_values and set_values.

Returns:
new structure of xccdf_value_binding

Generated on 26 May 2010 for Open SCAP Library by  doxygen 1.6.1