Open SCAP Library
Files | Functions
DS

Files

file  ds.h
 Open-scap Data Stream interface.

Functions

int ds_is_sds (const char *xccdf_file)
 checks whether given file contains a source data stream
int ds_sds_decompose (const char *input_file, const char *id, const char *target_dir, const char *xccdf_filename)
 takes given source data stream and decomposes it into separate files
int ds_sds_compose_from_xccdf (const char *xccdf_file, const char *target_datastream)
 takes given xccdf file and constructs a source datastream
int ds_rds_create (const char *sds_file, const char *xccdf_result_file, const char **oval_result_files, const char *target_file)
 takes given source data stream and XCCDF result file and makes a result data stream

Detailed Description


Function Documentation

int ds_is_sds ( const char *  xccdf_file)

checks whether given file contains a source data stream

Parameters:
xccdf_filePath to the file we want checked
Returns:
0 if given file is likely a source data stream 1 if given file is likely not a source data stream -1 in case of errors (file not found or root element not found)
This check is only "preliminary", it is designed to be reasonably fast and won't do validation! It looks at the root element only.
int ds_rds_create ( const char *  sds_file,
const char *  xccdf_result_file,
const char **  oval_result_files,
const char *  target_file 
)

takes given source data stream and XCCDF result file and makes a result data stream

Parameters:
sds_filePath to the source data stream file that was used to generate the result XCCDF
xccdf_result_fileContains xccdf:TestResult(s) and the embedded Benchmark (optionally). The embedded Benchmark (source data) will not be included in the result data stream, we will instead bundle the source data stream.
oval_result_filesNULL terminated list of paths to OVAL result files that should be bundled in the result data stream.
target_filePath to the file where the result data stream will be stored
Returns:
0 if no errors were encountered -1 in case of errors
int ds_sds_compose_from_xccdf ( const char *  xccdf_file,
const char *  target_datastream 
)

takes given xccdf file and constructs a source datastream

Parameters:
xccdf_filePath to the XCCDF file that should be included in the datastream (including its dependencies).
target_datastreamID of the datastream that should contain the XCCDF file. It will be the only datastream in the resulting data-stream-collection.
Returns:
0 if no errors were encountered -1 in case of errors
int ds_sds_decompose ( const char *  input_file,
const char *  id,
const char *  target_dir,
const char *  xccdf_filename 
)

takes given source data stream and decomposes it into separate files

Parameters:
input_fileFile containing a datastream collection we want to decompose parts from
idID of a datastream we want to use from the given datastream collection. The first encountered datastream is used if id is NULL.
target_dirDirectory where the resulting files will be stored, names of the files are deduced using component-refs inside the datastream.
xccdf_filenameBase name of the target XCCDF file, if NULL is given the filename will be deduced from the contents of the datastream.
Returns:
0 if no errors were encountered -1 in case of errors