Open SCAP Library: cpedict_priv.h File Reference

Open SCAP Library

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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"`

Go to the source code of this file.

## Data Structures
struct | cpe_dict_model
| Structure representing a CPE dictionary. More...

## Functions
struct cpe_generator * | cpe_generator_parse (struct cpe_parser_ctx *ctx)
| Parse generator part of CPE dictionary XML file. More...
struct cpe_item * | cpe_item_parse (struct cpe_parser_ctx *ctx)
| New dictionary item from XML. More...
struct cpe_vendor * | cpe_vendor_parse (xmlTextReaderPtr reader)
| Parsing function to parse vendors of CPE dictionary. More...
struct cpe_dict_model * | cpe_dict_model_parse (struct cpe_parser_ctx *ctx)
| Load new CPE dictionary from XML node. More...
char * | cpe_dict_detect_version_priv (xmlTextReader *reader)
| Get a version info from xmlTextReader. More...
void | cpe_dict_model_export_xml (const struct cpe_dict_model *dict, const char *file)
| Export function for CPE dictionary model. More...
void | cpe_dict_export (const struct cpe_dict_model *dict, xmlTextWriterPtr writer)
| Internal export function for CPE dictionary model. More...
void | cpe_generator_export (const struct cpe_generator *generator, xmlTextWriterPtr writer)
| Exporting function for CPE generator - information of XML document. More...
void | cpe_item_export (const struct cpe_item *item, xmlTextWriterPtr writer, int base_version)
| Exporting function for CPE item. More...
void | cpe_vendor_export (const struct cpe_vendor *vendor, xmlTextWriterPtr writer)
| Exporting function for CPE vendor. More...

## Detailed Description

Interface to Common Platform Enumeration (CPE) Dictionary.

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

## Function Documentation

char* cpe_dict_detect_version_priv | ( | xmlTextReader * | reader | ) |

Get a version info from xmlTextReader.

Parameters

  reader | xmlTextReader

Returns
  version string that shall be disposed by caller

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

Internal export function for CPE dictionary model.

Parameters

  dict | CPE dictionary
  writer | xmlTextWriterPtr representing XML model

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

Export function for CPE dictionary model.

Parameters

  dict | CPE dictionary structure
  file | filename to export

struct cpe_dict_model* cpe_dict_model_parse | ( | struct cpe_parser_ctx * | ctx | ) |

Load new CPE dictionary from XML node.

Parameters

  ctx | CPE parser context

Returns
  new dictionary

Return values

  NULL | on failure

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

Exporting function for CPE generator - information of XML document.

Parameters

  generator | CPE generator structure
  writer | xmlTextWriterPtr representing XML model

struct cpe_generator* cpe_generator_parse | ( | struct cpe_parser_ctx * | ctx | ) |

Parse generator part of CPE dictionary XML file.

Parameters

  ctx | CPE Parser's context

Returns
  new structure cpe_generator

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

Exporting function for CPE item.

Parameters

  item | CPE item structure
  writer | xmlTextWriterPtr representing XML model
  base_version | what is the base version of target CPE dict (1 for CPE 1.x, 2 for CPE 2.x, ...)

struct cpe_item* cpe_item_parse | ( | struct cpe_parser_ctx * | ctx | ) |

New dictionary item from XML.

Parameters

  ctx | CPE parser's context

Returns
  new dictionary item

Return values

  NULL | on failure

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

Exporting function for CPE vendor.

Parameters

  vendor | CPE vendor structure
  writer | xmlTextWriterPtr representing XML model

struct cpe_vendor* cpe_vendor_parse | ( | xmlTextReaderPtr | reader | ) |

Parsing function to parse vendors of CPE dictionary.

Parameters

  reader | xmlTextReaderPtr representing XML model

Returns
  new structure cpe_vendor