Loading...
Searching...
No Matches
xccdf_policy_model Struct Reference
XCCDF_POLICY

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...

`#include <xccdf_policy_priv.h>`

Collaboration diagram for xccdf_policy_model:
[legend]

## Public Member Functions

OSCAP_API bool | xccdf_policy_model_register_engine_oval (struct xccdf_policy_model *model, struct oval_agent_session *sess)
| Function to register predefined oval callback for XCCDF evaluation proccess.
OSCAP_API struct xccdf_policy_model * | xccdf_policy_model_new (struct xccdf_benchmark *benchmark)
| Constructor of Policy Model structure.
OSCAP_API void | xccdf_policy_model_free (struct xccdf_policy_model *)
| Destructor of Policy Model structure.
OSCAP_API struct xccdf_tailoring * | xccdf_policy_model_get_tailoring (struct xccdf_policy_model *model)
| Retrieves the Tailoring element used in this policy.
OSCAP_API bool | xccdf_policy_model_register_engine_and_query_callback (struct xccdf_policy_model *model, char *sys, xccdf_policy_engine_eval_fn eval_fn, void *usr, xccdf_policy_engine_query_fn query_fn)
| Function to register callback for checking system.
OSCAP_API bool | xccdf_policy_model_register_output_callback (struct xccdf_policy_model *model, policy_reporter_output func, void *usr)
| Function to register output callback for checking system that will be called AFTER each rule evaluation.
OSCAP_API bool | xccdf_policy_model_register_start_callback (struct xccdf_policy_model *model, policy_reporter_start func, void *usr)
| Function to register start callback for checking system that will be called BEFORE each rule evaluation.
OSCAP_API bool | xccdf_policy_model_register_multicheck_callback (struct xccdf_policy_model *model, policy_reporter_multicheck func, void *usr)
| Function to register callback for checking system that will be called DURING each rule evaluation if rule sets multi-check="true".
void | xccdf_policy_model_unregister_engines (struct xccdf_policy_model *model, const char *sys)
| Remove checking engines with given system from xccdf_policy_model.
bool | xccdf_policy_model_platforms_are_applicable (struct xccdf_policy_model *model, struct oscap_string_iterator *platforms)
| Query whether the given list platforms qualifies as 'applicable'.
bool | xccdf_policy_model_item_is_applicable (struct xccdf_policy_model *model, struct xccdf_item *item)
| Query whether the given item is applicable within given policy.
struct cpe_session * | xccdf_policy_model_get_cpe_session (struct xccdf_policy_model *model)
| Get CPE session assigned with the XCCDF Policy Model.
Getters
Return value is pointer to structure's member. Do not free unless you null the pointer in the structure. Use remove function otherwise.
OSCAP_API struct xccdf_benchmark * | xccdf_policy_model_get_benchmark (const struct xccdf_policy_model *item)
| Get Benchmark from Policy Model.
OSCAP_API struct xccdf_policy_iterator * | xccdf_policy_model_get_policies (const struct xccdf_policy_model *model)
| Get policies from Policy Model.
OSCAP_API int | xccdf_policy_model_build_all_useful_policies (struct xccdf_policy_model *policy_model)
| Build all policies that can be useful for user.
OSCAP_API struct xccdf_result_iterator * | xccdf_policy_get_results (const struct xccdf_policy *policy)
| Get results of all XCCDF Policy results.
OSCAP_API struct xccdf_result * | xccdf_policy_get_result_by_id (struct xccdf_policy *policy, const char *id)
| Get XCCDF Result structure by it's idetificator if there is one.
OSCAP_API struct xccdf_policy * | 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.
Setters
For lists use add functions. Parameters of set functions are duplicated in memory and need to be freed by caller.
OSCAP_API bool | xccdf_policy_model_add_policy (struct xccdf_policy_model *, struct xccdf_policy *)
| Add Policy to Policy Model.
OSCAP_API bool | xccdf_policy_add_result (struct xccdf_policy *policy, struct xccdf_result *item)
| Add result to XCCDF Policy Model.

## Data Fields

struct xccdf_benchmark * | benchmark
| Benchmark element (root element of XML file).
struct xccdf_tailoring * | tailoring
| Tailoring element.
struct oscap_list * | policies
| List of xccdf_policy structures.
struct oscap_list * | callbacks
| Callbacks for output callbacks (see callback_out_t).
struct oscap_list * | engines
| Callbacks for checking engines (see xccdf_policy_engine).
struct cpe_session * | cpe
bool | show_rule_details

## Detailed Description

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.

Handle all policies for given XCCDF benchmark.

## Member Function Documentation

## xccdf_policy_model_get_cpe_session()

struct cpe_session * xccdf_policy_model_get_cpe_session | ( | struct xccdf_policy_model * | model | ) |

Get CPE session assigned with the XCCDF Policy Model.

Parameters

  model | XCCDF Policy Model

Returns
  cpe_session or NULL

## xccdf_policy_model_item_is_applicable()

bool xccdf_policy_model_item_is_applicable | ( | struct xccdf_policy_model * | model,
|  | struct xccdf_item * | item )

Query whether the given item is applicable within given policy.

Parameters

  model | XCCDF Policy Model
  item | XCCDF Item

Returns
  true if the given item is applicable

## xccdf_policy_model_platforms_are_applicable()

bool xccdf_policy_model_platforms_are_applicable | ( | struct xccdf_policy_model * | model,
|  | struct oscap_string_iterator * | platforms )

Query whether the given list platforms qualifies as 'applicable'.

When considering policy_model CPE settings in the given policy model

Parameters

  model | XCCDF Policy Model
  platforms | list of CPE platform identifiers

Returns
  true if the list of platforms qualifies as 'applicable'

## xccdf_policy_model_unregister_engines()

void xccdf_policy_model_unregister_engines | ( | struct xccdf_policy_model * | model,
|  | const char * | sys )

Remove checking engines with given system from xccdf_policy_model.

Parameters

  model | XCCDF Policy Model
  sys | sytem name of the callback

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

- xccdf_policy_priv.h
- oval_agent_xccdf_api.h
- xccdf_policy.h
- xccdf_policy_model_priv.h