CPE Language
[CPE]


Data Structures

struct  cpe_lang_expr
 CPE language boolean expression. More...
struct  cpe_platform_spec
 CPE platform specification. More...
struct  cpe_platform
 Single platform representation in CPE language. More...

Files

file  cpelang.h
 Interface to Common Product Enumeration (CPE) Language.

Typedefs

typedef struct cpe_lang_expr cpe_lang_expr_t
 CPE language boolean expression.
typedef struct cpe_platform_spec cpe_platform_spec_t
 CPE platform specification.
typedef struct cpe_platform cpe_platform_t
 Single platform representation in CPE language.

Enumerations

enum  cpe_lang_oper_t {
  CPE_LANG_OPER_HALT = 0x00, CPE_LANG_OPER_AND = 0x01, CPE_LANG_OPER_OR = 0x02, CPE_LANG_OPER_MATCH = 0x03,
  CPE_LANG_OPER_MASK = 0xFF, CPE_LANG_OPER_NOT = 0x100, CPE_LANG_OPER_NAND = CPE_LANG_OPER_AND | CPE_LANG_OPER_NOT, CPE_LANG_OPER_NOR = CPE_LANG_OPER_OR | CPE_LANG_OPER_NOT
}
 CPE language operators. More...

Functions

cpe_platform_spec_tcpe_platformspec_new (const char *fname)
 New platform specification from file.
bool cpe_platformspec_add (cpe_platform_spec_t *platformspec, cpe_platform_t *platform)
 Add new platform entry to platformspec.
void cpe_platformspec_delete (cpe_platform_spec_t *platformspec)
 Free specified platform specification list.
bool cpe_language_match_cpe (cpe_t **cpe, size_t n, const cpe_platform_t *platform)
 Match list of CPEs against CPE language platform specification.
void cpe_platform_delete (cpe_platform_t *platform)
 Delete single CPE paltform specification.
void cpe_langexpr_delete (cpe_lang_expr_t *expr)
 Delete CPE language boolean expression.

Variables

cpe_t *   cpe_lang_expr::cpe
 CPE for match operation.
union {
   struct cpe_lang_expr *   expr
 array of subexpressions for operators
   cpe_t *   cpe_lang_expr::cpe
 CPE for match operation.
cpe_lang_expr::meta
 operation metadata
size_t cpe_platform_spec::platforms_n
 number of platforms
size_t cpe_platform_spec::alloc_
 allocated memory (internal)
char * cpe_platform::title
 human-readable platform description
char * cpe_platform::remark
 remark
struct cpe_lang_expr cpe_platform::expr
 expression for match evaluation

Enumeration Type Documentation

CPE language operators.

Enumerator:
CPE_LANG_OPER_HALT  end of instruction list
CPE_LANG_OPER_AND  logical AND
CPE_LANG_OPER_OR  logical OR
CPE_LANG_OPER_MATCH  match against specified CPE
CPE_LANG_OPER_MASK  mask to extract operator
CPE_LANG_OPER_NOT  negate


Function Documentation

void cpe_langexpr_delete ( cpe_lang_expr_t expr  ) 

Delete CPE language boolean expression.

Parameters:
expr expression to be deleted

bool cpe_language_match_cpe ( cpe_t **  cpe,
size_t  n,
const cpe_platform_t platform 
)

Match list of CPEs against CPE language platform specification.

Parameters:
cpe List of CPEs describing tested platform as a list of pointers
n number of CPEs
platform CPE language platform, that is expected (not) to match given list of CPEs
Returns:
result of expression evaluation

void cpe_platform_delete ( cpe_platform_t platform  ) 

Delete single CPE paltform specification.

Parameters:
platform platform to be deleted

bool cpe_platformspec_add ( cpe_platform_spec_t platformspec,
cpe_platform_t platform 
)

Add new platform entry to platformspec.

Note:
platformspec will take over memory management of platform
Parameters:
platformspec list of platforms being extended
platform platform to add to the list
Returns:
true on success

void cpe_platformspec_delete ( cpe_platform_spec_t platformspec  ) 

Free specified platform specification list.

Parameters:
platformspec pointer to list to be deleted

cpe_platform_spec_t* cpe_platformspec_new ( const char *  fname  ) 

New platform specification from file.

Parameters:
fname file name to load
Returns:
new platform specification list
Return values:
NULL on failure


Generated on Thu Apr 30 13:45:39 2009 for Open SCAP Library by  doxygen 1.5.7.1