Open SCAP Library
Loading...
Searching...
No Matches
oval_variable Struct Reference

An oval variable resolves an oval_value stream which specifies constraints for oval_object s and oval_state s. More...

#include <oval_definitions.h>

Public Member Functions

OSCAP_API struct oval_variableoval_variable_new (struct oval_definition_model *model, const char *id, oval_variable_type_t type)
 Construct new instance of oval_variable.
 
OSCAP_API struct oval_variableoval_variable_clone (struct oval_definition_model *new_model, struct oval_variable *old_variable)
 Clone instance of oval_variable and add it to the specified oval_definition_model.
 
OSCAP_API void oval_variable_free (struct oval_variable *)
 Free instance of oval_variable.
 
Setters
OSCAP_API void oval_variable_set_comment (struct oval_variable *, char *comment)
 set attribute oval_variable->comment.
 
OSCAP_API void oval_variable_set_version (struct oval_variable *, int version)
 set attribute oval_variable->version.
 
OSCAP_API void oval_variable_set_deprecated (struct oval_variable *, bool deprecated)
 set attribute oval_variable->deprecated.
 
OSCAP_API void oval_variable_set_datatype (struct oval_variable *, oval_datatype_t)
 set attribute oval_variable->datatype.
 
OSCAP_API void oval_variable_add_value (struct oval_variable *, struct oval_value *)
 Append an instance of Oval_value to the attribute Oval_constant->values.
 
OSCAP_API void oval_variable_add_possible_value (struct oval_variable *variable, struct oval_variable_possible_value *pv)
 Add a new possible value to an external variable.
 
OSCAP_API void oval_variable_add_possible_restriction (struct oval_variable *variable, struct oval_variable_possible_restriction *pr)
 Add a new possible restriction to an external variable.
 
OSCAP_API void oval_variable_set_component (struct oval_variable *, struct oval_component *component)
 Bind an instance of Oval_component to the attribute Oval_local->component.
 
Getters
OSCAP_API char * oval_variable_get_id (struct oval_variable *)
 Returns attribute oval_variable->id.
 
OSCAP_API char * oval_variable_get_comment (struct oval_variable *)
 Returns attribute oval_variable->comment.
 
OSCAP_API int oval_variable_get_version (struct oval_variable *)
 Returns attribute oval_variable->version.
 
OSCAP_API bool oval_variable_get_deprecated (struct oval_variable *)
 Returns attribute oval_variable->deprecated.
 
OSCAP_API oval_variable_type_t oval_variable_get_type (struct oval_variable *)
 Returns attribute oval_variable->type.
 
OSCAP_API oval_datatype_t oval_variable_get_datatype (struct oval_variable *)
 Returns attribute oval_variable->datatype.
 
OSCAP_API struct oval_value_iteratoroval_variable_get_values (struct oval_variable *)
 Returns attribute Oval_external/ Oval_constant->values.
 
OSCAP_API struct oval_componentoval_variable_get_component (struct oval_variable *)
 Returns attribute Oval_local->component.
 
OSCAP_API struct oval_variable_possible_value_iterator * oval_variable_get_possible_values2 (struct oval_variable *variable)
 Get list of allowed values for an external variable.
 
OSCAP_API struct oval_variable_possible_restriction_iterator * oval_variable_get_possible_restrictions2 (struct oval_variable *variable)
 Get list of constraints for an external variable.
 
OSCAP_API const char * oval_component_type_get_text (oval_component_type_t type)
 Returns attribute Oval_component_type->text.
 

Data Fields

 VAR_BASE
 

Detailed Description

An oval variable resolves an oval_value stream which specifies constraints for oval_object s and oval_state s.

  • if oval_variable_type == OVAL_VARIABLE_EXTERNAL
    • The value stream is determined by oval_definition_model_bind_variable_model
  • if oval_variable_type == OVAL_VARIABLE_CONSTANT
  • if oval_variable_type == OVAL_VARIABLE_LOCAL
    • The value stream is specified by either a single component or a complex function, meaning that a value can be as simple as a literal string or as complex as multiple registry keys concatenated together. Note that if an individual component is used and it returns multiple values, then there will be multiple values associated with the Oval_local. For example, if an object is specified as the local source and it references a file object that identifies a set of 5 files, then the local variable would represent these 5 values.

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