Open SCAP Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Files | Enumerations | Functions
OVAL Results

Detailed Description

Interface for Results model.

Class diagram

result_model.png

Data Structures

struct  oval_results_model
 OVAL Results Model holds OVAL results structure instances. More...
 
struct  oval_result_system
 
struct  oval_result_system_iterator
 
struct  oval_result_definition
 
struct  oval_result_definition_iterator
 
struct  oval_result_test
 
struct  oval_result_test_iterator
 
struct  oval_result_item
 
struct  oval_result_item_iterator
 
struct  oval_result_criteria_node
 
struct  oval_result_criteria_node_iterator
 

Files

file  oval_results.h
 

Enumerations

enum  oval_result_t {
  OVAL_RESULT_TRUE = 1, OVAL_RESULT_FALSE = 2, OVAL_RESULT_UNKNOWN = 4, OVAL_RESULT_ERROR = 8,
  OVAL_RESULT_NOT_EVALUATED = 16, OVAL_RESULT_NOT_APPLICABLE = 32
}
 Result values for the evaluation of an OVAL Definition or an OVAL Test. More...
 

Functions

const char * oval_result_get_text (oval_result_t)
 
struct oscap_sourceoval_results_model_export_source (struct oval_results_model *results_model, struct oval_directives_model *directives_model, const char *name)
 Export OVAL results into oscap_source. More...
 
struct oval_results_modeloval_results_model::oval_results_model_new (struct oval_definition_model *definition_model, struct oval_syschar_model **)
 Create new oval_results_model. More...
 
int oval_results_model::oval_results_model_import_source (struct oval_results_model *model, struct oscap_source *source)
 Import the content from the oscap_source into an oval_result_model. More...
 
int oval_results_model::oval_results_model_import (struct oval_results_model *model, const char *file)
 Import the content from the file into an oval_result_model. More...
 
struct oval_results_modeloval_results_model::oval_results_model_clone (struct oval_results_model *)
 Copy an oval_results_model. More...
 
void oval_results_model::oval_results_model_set_export_system_characteristics (struct oval_results_model *, bool export)
 
bool oval_results_model::oval_results_model_get_export_system_characteristics (struct oval_results_model *)
 
void oval_results_model::oval_results_model_free (struct oval_results_model *model)
 Free memory allocated to a specified oval results model. More...
 
int oval_results_model::oval_results_model_export (struct oval_results_model *, struct oval_directives_model *, const char *file)
 Export oval results into file. More...
 
struct oval_result_systemoval_result_system::oval_result_system_new (struct oval_results_model *, struct oval_syschar_model *)
 
struct oval_result_systemoval_result_system::oval_result_system_clone (struct oval_results_model *new_model, struct oval_result_system *old_system)
 
void oval_result_system::oval_result_system_free (struct oval_result_system *)
 
struct oval_result_definitionoval_result_definition::oval_result_definition_new (struct oval_result_system *, char *)
 
struct oval_result_definitionoval_result_definition::oval_result_definition_clone (struct oval_result_system *new_system, struct oval_result_definition *old_definition)
 
void oval_result_definition::oval_result_definition_free (struct oval_result_definition *)
 
struct oval_result_testoval_result_test::oval_result_test_new (struct oval_result_system *, char *)
 
struct oval_result_testoval_result_test::oval_result_test_clone (struct oval_result_system *new_system, struct oval_result_test *old_test)
 
void oval_result_test::oval_result_test_free (struct oval_result_test *)
 
struct oval_result_itemoval_result_item::oval_result_item_new (struct oval_result_system *, char *)
 
struct oval_result_itemoval_result_item::oval_result_item_clone (struct oval_result_system *new_system, struct oval_result_item *old_item)
 
void oval_result_item::oval_result_item_free (struct oval_result_item *)
 
struct oval_result_criteria_nodeoval_result_criteria_node::oval_result_criteria_node_new (struct oval_result_system *, oval_criteria_node_type_t, int, int,...)
 
struct oval_result_criteria_nodeoval_result_criteria_node::oval_result_criteria_node_clone (struct oval_result_system *new_system, struct oval_result_criteria_node *old_node)
 
void oval_result_criteria_node::oval_result_criteria_node_free (struct oval_result_criteria_node *)
 

Setters

void oval_results_model_set_generator (struct oval_results_model *model, struct oval_generator *generator)
 
void oval_result_system::oval_result_system_add_definition (struct oval_result_system *, struct oval_result_definition *)
 
void oval_result_system::oval_result_system_add_test (struct oval_result_system *, struct oval_result_test *)
 
void oval_result_definition::oval_result_definition_set_result (struct oval_result_definition *, oval_result_t)
 
void oval_result_definition::oval_result_definition_set_instance (struct oval_result_definition *, int)
 
void oval_result_definition::oval_result_definition_set_criteria (struct oval_result_definition *, struct oval_result_criteria_node *)
 
void oval_result_definition::oval_result_definition_add_message (struct oval_result_definition *, struct oval_message *)
 
void oval_result_test::oval_result_test_set_result (struct oval_result_test *, oval_result_t)
 
void oval_result_test::oval_result_test_set_instance (struct oval_result_test *test, int instance)
 
void oval_result_test::oval_result_test_add_message (struct oval_result_test *, struct oval_message *)
 
void oval_result_test::oval_result_test_add_item (struct oval_result_test *, struct oval_result_item *)
 
void oval_result_test::oval_result_test_add_binding (struct oval_result_test *, struct oval_variable_binding *)
 
void oval_result_item::oval_result_item_set_result (struct oval_result_item *, oval_result_t)
 
void oval_result_item::oval_result_item_add_message (struct oval_result_item *, struct oval_message *)
 
void oval_result_criteria_node::oval_result_criteria_node_set_result (struct oval_result_criteria_node *, oval_result_t)
 
void oval_result_criteria_node::oval_result_criteria_node_set_negate (struct oval_result_criteria_node *, bool)
 
void oval_result_criteria_node::oval_result_criteria_node_set_applicability_check (struct oval_result_criteria_node *, bool)
 
void oval_result_criteria_node::oval_result_criteria_node_set_operator (struct oval_result_criteria_node *, oval_operator_t)
 
void oval_result_criteria_node::oval_result_criteria_node_add_subnode (struct oval_result_criteria_node *, struct oval_result_criteria_node *)
 
void oval_result_criteria_node::oval_result_criteria_node_set_test (struct oval_result_criteria_node *, struct oval_result_test *)
 
void oval_result_criteria_node::oval_result_criteria_node_set_extends (struct oval_result_criteria_node *, struct oval_result_definition *)
 

Getters

struct oval_generatoroval_results_model_get_generator (struct oval_results_model *model)
 
oval_criteria_node_type_t oval_result_criteria_node_get_type (struct oval_result_criteria_node *)
 
struct oval_definition_modeloval_results_model::oval_results_model_get_definition_model (struct oval_results_model *model)
 Return bound definition model from an oval_results_model. More...
 
struct oval_directives_modeloval_results_model::oval_results_model_get_directives_model (struct oval_results_model *model)
 Return the OVAL directives model.
 
struct
oval_result_system_iterator
oval_results_model::oval_results_model_get_systems (struct oval_results_model *)
 Return iterator over reporting systems. More...
 
struct oval_results_modeloval_result_system::oval_result_system_get_results_model (struct oval_result_system *)
 
struct oval_result_definitionoval_result_system::oval_result_system_get_definition (struct oval_result_system *, const char *)
 
struct
oval_result_definition_iterator
oval_result_system::oval_result_system_get_definitions (struct oval_result_system *)
 
struct oval_result_test_iteratoroval_result_system::oval_result_system_get_tests (struct oval_result_system *)
 
struct oval_syschar_modeloval_result_system::oval_result_system_get_syschar_model (struct oval_result_system *)
 
struct oval_sysinfooval_result_system::oval_result_system_get_sysinfo (struct oval_result_system *)
 
struct oval_definitionoval_result_definition::oval_result_definition_get_definition (const struct oval_result_definition *)
 
const char * oval_result_definition::oval_result_definition_get_id (const struct oval_result_definition *rslt_definition)
 Returns the attribute of a given result definition.
 
struct oval_result_systemoval_result_definition::oval_result_definition_get_system (const struct oval_result_definition *)
 
int oval_result_definition::oval_result_definition_get_instance (const struct oval_result_definition *)
 
oval_result_t oval_result_definition::oval_result_definition_eval (struct oval_result_definition *)
 
oval_result_t oval_result_definition::oval_result_definition_get_result (const struct oval_result_definition *)
 
struct oval_message_iteratoroval_result_definition::oval_result_definition_get_messages (const struct oval_result_definition *)
 
struct oval_result_criteria_nodeoval_result_definition::oval_result_definition_get_criteria (const struct oval_result_definition *)
 
struct oval_testoval_result_test::oval_result_test_get_test (struct oval_result_test *)
 
struct oval_result_systemoval_result_test::oval_result_test_get_system (struct oval_result_test *)
 
oval_result_t oval_result_test::oval_result_test_eval (struct oval_result_test *)
 
oval_result_t oval_result_test::oval_result_test_get_result (struct oval_result_test *)
 
int oval_result_test::oval_result_test_get_instance (struct oval_result_test *)
 
struct oval_message_iteratoroval_result_test::oval_result_test_get_messages (struct oval_result_test *)
 
struct oval_result_item_iteratoroval_result_test::oval_result_test_get_items (struct oval_result_test *)
 
struct
oval_variable_binding_iterator
oval_result_test::oval_result_test_get_bindings (struct oval_result_test *)
 
struct oval_sysitemoval_result_item::oval_result_item_get_sysitem (struct oval_result_item *)
 
oval_result_t oval_result_item::oval_result_item_get_result (struct oval_result_item *)
 
struct oval_message_iteratoroval_result_item::oval_result_item_get_messages (struct oval_result_item *)
 
oval_result_t oval_result_criteria_node::oval_result_criteria_node_eval (struct oval_result_criteria_node *)
 
oval_result_t oval_result_criteria_node::oval_result_criteria_node_get_result (struct oval_result_criteria_node *)
 
bool oval_result_criteria_node::oval_result_criteria_node_get_negate (struct oval_result_criteria_node *)
 
bool oval_result_criteria_node::oval_result_criteria_node_get_applicability_check (struct oval_result_criteria_node *)
 
oval_operator_t oval_result_criteria_node::oval_result_criteria_node_get_operator (struct oval_result_criteria_node *)
 
struct
oval_result_criteria_node_iterator
oval_result_criteria_node::oval_result_criteria_node_get_subnodes (struct oval_result_criteria_node *)
 
struct oval_result_testoval_result_criteria_node::oval_result_criteria_node_get_test (struct oval_result_criteria_node *)
 
struct oval_result_definitionoval_result_criteria_node::oval_result_criteria_node_get_extends (struct oval_result_criteria_node *)
 

Evaluators

int oval_results_model_eval (struct oval_results_model *)
 Evaluate all result_systems. More...
 
int oval_result_system::oval_result_system_eval (struct oval_result_system *sys)
 Function evaluates all OVAL definitions of specified result_system. More...
 
int oval_result_system::oval_result_system_eval_definition (struct oval_result_system *sys, const char *id)
 Function evaluates specified OVAL definition in result_system. More...
 

Iterators

bool oval_result_system_iterator::oval_result_system_iterator_has_more (struct oval_result_system_iterator *)
 
struct oval_result_systemoval_result_system_iterator::oval_result_system_iterator_next (struct oval_result_system_iterator *)
 
void oval_result_system_iterator::oval_result_system_iterator_free (struct oval_result_system_iterator *)
 
bool oval_result_definition_iterator::oval_result_definition_iterator_has_more (struct oval_result_definition_iterator *)
 
struct oval_result_definitionoval_result_definition_iterator::oval_result_definition_iterator_next (struct oval_result_definition_iterator *)
 
void oval_result_definition_iterator::oval_result_definition_iterator_free (struct oval_result_definition_iterator *)
 
bool oval_result_test_iterator::oval_result_test_iterator_has_more (struct oval_result_test_iterator *)
 
struct oval_result_testoval_result_test_iterator::oval_result_test_iterator_next (struct oval_result_test_iterator *)
 
void oval_result_test_iterator::oval_result_test_iterator_free (struct oval_result_test_iterator *)
 
bool oval_result_item_iterator::oval_result_item_iterator_has_more (struct oval_result_item_iterator *)
 
struct oval_result_itemoval_result_item_iterator::oval_result_item_iterator_next (struct oval_result_item_iterator *)
 
void oval_result_item_iterator::oval_result_item_iterator_free (struct oval_result_item_iterator *)
 
bool oval_result_criteria_node_iterator::oval_result_criteria_node_iterator_has_more (struct oval_result_criteria_node_iterator *)
 
struct oval_result_criteria_nodeoval_result_criteria_node_iterator::oval_result_criteria_node_iterator_next (struct oval_result_criteria_node_iterator *)
 
void oval_result_criteria_node_iterator::oval_result_criteria_node_iterator_free (struct oval_result_criteria_node_iterator *)
 

Enumeration Type Documentation

Result values for the evaluation of an OVAL Definition or an OVAL Test.

Enumerator
OVAL_RESULT_TRUE 

Characteristics being evaluated match the information represented in the system characteristic.

OVAL_RESULT_FALSE 

Characteristics being evaluated do not match the information represented in the system characteristic.

OVAL_RESULT_UNKNOWN 

Characteristics being evaluated can not be found in the system characteristic.

OVAL_RESULT_ERROR 

Characteristics being evaluated exist in the system characteristic file but there was an error either collecting information or in performing anaylsis.

OVAL_RESULT_NOT_EVALUATED 

Choice was made not to evaluate the given definition or test.

OVAL_RESULT_NOT_APPLICABLE 

Definition or test being evaluated is not valid on the given platform.

Function Documentation

struct oval_result_criteria_node * oval_result_criteria_node_clone ( struct oval_result_system new_system,
struct oval_result_criteria_node old_node 
)
Returns
A copy of the specified oval_result_criteria_node.
struct oval_result_definition * oval_result_definition_clone ( struct oval_result_system new_system,
struct oval_result_definition old_definition 
)
Returns
A copy of the specified oval_result_definition.
struct oval_result_item * oval_result_item_clone ( struct oval_result_system new_system,
struct oval_result_item old_item 
)
Returns
A copy of the specified oval_result_item.
struct oval_result_system * oval_result_system_clone ( struct oval_results_model new_model,
struct oval_result_system old_system 
)
Returns
A copy of the specified oval_result_system.
int oval_result_system_eval ( struct oval_result_system sys)

Function evaluates all OVAL definitions of specified result_system.

It assumes that all necessary system characteristics for evaluation were altready gathered.

Parameters
sysis result_system from result_model
Returns
0 on sucess and -1 on fail. Use Errors mechanism to examine the error.
int oval_result_system_eval_definition ( struct oval_result_system sys,
const char *  id 
)

Function evaluates specified OVAL definition in result_system.

It assumes that all necessary system characteristics for evaluation were altready gathered.

Parameters
sysis result_system from result_model
idof the definition from definition_model from result_model
Returns
0 on succeess, or non 0 if an error occurred. Use Errors mechanism to examine the error.
struct oval_result_test * oval_result_test_clone ( struct oval_result_system new_system,
struct oval_result_test old_test 
)
Returns
A copy of the specified oval_result_test.
struct oval_results_model * oval_results_model_clone ( struct oval_results_model )

Copy an oval_results_model.

Returns
A copy of the specified oval_results_model.
int oval_results_model_eval ( struct oval_results_model )

Evaluate all result_systems.

It's assumed that all necessary system characteristics for evaluation were altready gathered.

Returns
0 on sucess and -1 on fail. Use Errors mechanism to examine the error.
int oval_results_model_export ( struct oval_results_model ,
struct oval_directives_model ,
const char *  file 
)

Export oval results into file.

Parameters
modelthe oval_results_model
modelthe oval_directives_model
filefilename
struct oscap_source* oval_results_model_export_source ( struct oval_results_model results_model,
struct oval_directives_model directives_model,
const char *  name 
)

Export OVAL results into oscap_source.

Parameters
results_modelThe OVAL Results Model to export
directives_modelThe Directives Model to amend the export
filenameA suggested name (filename) to assign with the oscap_source This name may later be used when storing the oscap_source to disk drive.
Returns
Newly created oscap_source or NULL in case of failure
void oval_results_model_free ( struct oval_results_model model)

Free memory allocated to a specified oval results model.

Parameters
thespecified oval_results model
struct oval_definition_model * oval_results_model_get_definition_model ( struct oval_results_model model)

Return bound definition model from an oval_results_model.

Parameters
modelthe specified oval_results_model.
struct oval_result_system_iterator * oval_results_model_get_systems ( struct oval_results_model )

Return iterator over reporting systems.

Parameters
modelthe specified results model
int oval_results_model_import ( struct oval_results_model model,
const char *  file 
)

Import the content from the file into an oval_result_model.

If imported content specifies a model entity that is already registered within the model its content is overwritten.

Parameters
modelthe oval_results_model
filefilename
Returns
-1 if an error occurred
Deprecated:
This function has been deprecated and it may be dropped from later OpenSCAP releases. Please use oval_results_model_import_source instead.
int oval_results_model_import_source ( struct oval_results_model model,
struct oscap_source source 
)

Import the content from the oscap_source into an oval_result_model.

If imported content specifies a model entity that is already registered within the model its content is overwritten.

Parameters
modelthe oval_results_model
sourceThe oscap_source to import from
Returns
-1 if an error occurred
struct oval_results_model * oval_results_model_new ( struct oval_definition_model definition_model,
struct oval_syschar_model **   
)

Create new oval_results_model.

The new model is bound to a specified oval_definition_model and variable bindings.

Parameters
definition_modelthe specified oval_definition_model.
syschar_modelthe array of specified oval_syschar_model(s) terminated by NULL.