Open SCAP Library
Loading...
Searching...
No Matches
Data Structures | Functions
cpedict_priv.h File Reference

Interface to Common Platform Enumeration (CPE) Dictionary. More...

#include <libxml/xmlreader.h>
#include <libxml/xmlwriter.h>
#include <stdlib.h>
#include "cpe_name.h"
#include "cpe_ctx_priv.h"
#include "cpe_dict.h"
#include "../common/public/oscap.h"
#include "../common/util.h"
#include "../common/elements.h"
Include dependency graph for cpedict_priv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cpe_dict_model
 Structure representing a CPE dictionary. More...
 

Functions

struct cpe_generatorcpe_generator_parse (struct cpe_parser_ctx *ctx)
 Parse generator part of CPE dictionary XML file.
 
struct cpe_itemcpe_item_parse (struct cpe_parser_ctx *ctx)
 New dictionary item from XML.
 
struct cpe_vendorcpe_vendor_parse (xmlTextReaderPtr reader)
 Parsing function to parse vendors of CPE dictionary.
 
struct cpe_dict_modelcpe_dict_model_parse (struct cpe_parser_ctx *ctx)
 Load new CPE dictionary from XML node.
 
char * cpe_dict_detect_version_priv (xmlTextReader *reader)
 Get a version info from xmlTextReader.
 
void cpe_dict_model_export_xml (const struct cpe_dict_model *dict, const char *file)
 Export function for CPE dictionary model.
 
void cpe_dict_export (const struct cpe_dict_model *dict, xmlTextWriterPtr writer)
 Internal export function for CPE dictionary model.
 
void cpe_generator_export (const struct cpe_generator *generator, xmlTextWriterPtr writer)
 Exporting function for CPE generator - information of XML document.
 
void cpe_item_export (const struct cpe_item *item, xmlTextWriterPtr writer, int base_version)
 Exporting function for CPE item.
 
void cpe_vendor_export (const struct cpe_vendor *vendor, xmlTextWriterPtr writer)
 Exporting function for CPE vendor.
 
bool cpe_dict_model_set_origin_file (struct cpe_dict_model *dict, const char *origin_file)
 Sets the origin file hint.
 
const char * cpe_dict_model_get_origin_file (const struct cpe_dict_model *dict)
 Gets the file the CPE dict model was loaded from This is necessary to figure out the full OVAL file path for applicability testing.
 

Detailed Description

Interface to Common Platform Enumeration (CPE) Dictionary.

See more details at http://nvd.nist.gov/cpe.cfm

Function Documentation

◆ cpe_dict_detect_version_priv()

char * cpe_dict_detect_version_priv ( xmlTextReader * reader)

Get a version info from xmlTextReader.

Parameters
readerxmlTextReader
Returns
version string that shall be disposed by caller

◆ cpe_dict_export()

void cpe_dict_export ( const struct cpe_dict_model * dict,
xmlTextWriterPtr writer )

Internal export function for CPE dictionary model.

Parameters
dictCPE dictionary
writerxmlTextWriterPtr representing XML model

◆ cpe_dict_model_export_xml()

void cpe_dict_model_export_xml ( const struct cpe_dict_model * dict,
const char * file )

Export function for CPE dictionary model.

Parameters
dictCPE dictionary structure
filefilename to export

◆ cpe_dict_model_get_origin_file()

const char * cpe_dict_model_get_origin_file ( const struct cpe_dict_model * dict)

Gets the file the CPE dict model was loaded from This is necessary to figure out the full OVAL file path for applicability testing.

We can't do applicability here in the CPE module because that would create awful interdependencies.

◆ cpe_dict_model_parse()

struct cpe_dict_model * cpe_dict_model_parse ( struct cpe_parser_ctx * ctx)

Load new CPE dictionary from XML node.

Parameters
ctxCPE parser context
Returns
new dictionary
Return values
NULLon failure

◆ cpe_dict_model_set_origin_file()

bool cpe_dict_model_set_origin_file ( struct cpe_dict_model * dict,
const char * origin_file )

Sets the origin file hint.

See also
cpe_dict_model_get_origin_file

◆ cpe_generator_export()

void cpe_generator_export ( const struct cpe_generator * generator,
xmlTextWriterPtr writer )

Exporting function for CPE generator - information of XML document.

Parameters
generatorCPE generator structure
writerxmlTextWriterPtr representing XML model

◆ cpe_generator_parse()

struct cpe_generator * cpe_generator_parse ( struct cpe_parser_ctx * ctx)

Parse generator part of CPE dictionary XML file.

Parameters
ctxCPE Parser's context
Returns
new structure cpe_generator

◆ cpe_item_export()

void cpe_item_export ( const struct cpe_item * item,
xmlTextWriterPtr writer,
int base_version )

Exporting function for CPE item.

Parameters
itemCPE item structure
writerxmlTextWriterPtr representing XML model
base_versionwhat is the base version of target CPE dict (1 for CPE 1.x, 2 for CPE 2.x, ...)

◆ cpe_item_parse()

struct cpe_item * cpe_item_parse ( struct cpe_parser_ctx * ctx)

New dictionary item from XML.

Parameters
ctxCPE parser's context
Returns
new dictionary item
Return values
NULLon failure

◆ cpe_vendor_export()

void cpe_vendor_export ( const struct cpe_vendor * vendor,
xmlTextWriterPtr writer )

Exporting function for CPE vendor.

Parameters
vendorCPE vendor structure
writerxmlTextWriterPtr representing XML model

◆ cpe_vendor_parse()

struct cpe_vendor * cpe_vendor_parse ( xmlTextReaderPtr reader)

Parsing function to parse vendors of CPE dictionary.

Parameters
readerxmlTextReaderPtr representing XML model
Returns
new structure cpe_vendor