cpename.c File Reference

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

#include <string.h>
#include <stdio.h>
#include <pcre.h>
#include <ctype.h>
#include "cpe_name.h"
#include "common/util.h"

Data Structures

struct  cpe_name
 Structure holding Common Platform Enumeration URI data. More...

Defines

#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#define CPE_URI_SUPPORTED   "2.3"

Enumerations

enum  cpe_field_t {
  CPE_FIELD_TYPE = 0, CPE_FIELD_VENDOR = 1, CPE_FIELD_PRODUCT = 2, CPE_FIELD_VERSION = 3,
  CPE_FIELD_UPDATE = 4, CPE_FIELD_EDITION = 5, CPE_FIELD_LANGUAGE = 6, CPE_BASIC_FIELDNUM = 7,
  CPE_FIELD_SW_EDITION = 7, CPE_FIELD_TARGET_SW = 8, CPE_FIELD_TARGET_HW = 9, CPE_FIELD_OTHER = 10,
  CPE_TOTAL_FIELDNUM = 11
}

Functions

char ** cpe_uri_split (char *str, const char *delim)
bool cpe_name_check (const char *str)
struct cpe_namecpe_name_new (const char *cpestr)
 Create a new CPE structure from string cpe.
struct cpe_namecpe_name_clone (struct cpe_name *old_name)
 Clone CPE Name.
bool cpe_name_match_one (const struct cpe_name *cpe, const struct cpe_name *against)
 Check if candidate CPE cpe matches CPE against according to CPE specification v 2.1.
bool cpe_name_match_cpes (const struct cpe_name *name, size_t n, struct cpe_name **namelist)
 Check if CPE name matches any CPE in namelist.
int cpe_name_match_strs (const char *candidate, size_t n, char **targets)
 Match CPE URI candidate against list of n CPE URIs given by targets.
cpe_format_t cpe_name_get_format_of_str (const char *str)
 Looks at given string and returns format it is in.
char * cpe_name_get_as_format (const struct cpe_name *cpe, cpe_format_t format)
 Return CPE URI as a new string in specified format.
char * cpe_name_get_as_str (const struct cpe_name *cpe)
 Return CPE URI as a new string in the format in which it was loaded.
int cpe_name_write (const struct cpe_name *cpe, FILE *f)
 Write CPE URI cpe to file a descriptor f cpe_name.
void cpe_name_free (struct cpe_name *cpe)
 Destructor.
const char * cpe_name_supported (void)
 Get supported version of CPE uri XML.


Detailed Description

Interface to Common Platform Enumeration (CPE) URI.

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


Generated on Tue Nov 14 12:18:54 2017 for Open SCAP Library by  doxygen 1.5.6