Open SCAP Library

Public Member Functions | Data Fields
ds_rds_session Struct Reference

## Public Member Functions
struct ds_rds_session * | ds_rds_session_new_from_source (struct oscap_source *source)
| Create new ds_rds_session from existing oscap_source. More...
void | ds_rds_session_free (struct ds_rds_session *rds_session)
| Dispose ds_rds_session structure. More...
struct rds_index * | ds_rds_session_get_rds_idx (struct ds_rds_session *session)
| Get Result DataStream index. More...
int | ds_rds_session_set_target_dir (struct ds_rds_session *session, const char *target_dir)
| Set target directory for the component files. More...
int | ds_rds_session_dump_component_files (struct ds_rds_session *session)
| Store cached component files to the hard drive. More...
struct oscap_source * | ds_rds_session_select_report (struct ds_rds_session *session, const char *report_id)
| Select arf:report from result DataStream and return it in form of oscap_source. More...
struct oscap_source * | ds_rds_session_select_report_request (struct ds_rds_session *session, const char *report_request_id)
| Select arf:report-request from result DataStream and return it in form of oscap_source. More...
int | ds_rds_session_replace_report_with_source (struct ds_rds_session *session, struct oscap_source *source)
| Replace currently selected report with the content of the source. More...
char * | ds_rds_session_get_html_report (struct ds_rds_session *rds_session)
| Returns HTML representation of the given result datastream. More...

## Data Fields
struct oscap_source * | source
| Result DataStream raw representation.
struct rds_index * | index
| Result DataStream index.
const char * | target_dir
| Target directory for current split.
const char * | report_id
| Last selected report ID.
struct oscap_htable * | component_sources
| oscap_sources for parsed contents (arf:content)

## Member Function Documentation

## ◆ ds_rds_session_dump_component_files()

int ds_rds_session_dump_component_files | ( | struct ds_rds_session * | session | ) |

Store cached component files to the hard drive.

Parameters

  session | The Result DataStream session

Returns
  zero on success

## ◆ ds_rds_session_free()

void ds_rds_session_free | ( | struct ds_rds_session * | rds_session | ) |

Dispose ds_rds_session structure.

Parameters

  rds_session | The session to dispose

## ◆ ds_rds_session_get_html_report()

char * ds_rds_session_get_html_report | ( | struct ds_rds_session * | rds_session | ) |

Returns HTML representation of the given result datastream.

Parameters

  rds_session | The ds_rds_session to build HTML from

Returns
  a buffer of HTML content that should be freed by the caller

## ◆ ds_rds_session_get_rds_idx()

struct rds_index * ds_rds_session_get_rds_idx | ( | struct ds_rds_session * | session | ) |

Get Result DataStream index.

Parameters

  session | Session to query RDS index from

Returns
  Result DataStream index owned by session

## ◆ ds_rds_session_new_from_source()

struct ds_rds_session * ds_rds_session_new_from_source | ( | struct oscap_source * | source | ) |

Create new ds_rds_session from existing oscap_source.

This assumes that the given oscap_source represents result DataStream (ARF). This function does not own the oscap_source, but it needs it for operation.

Parameters

  source | The oscap_source representing a result datastream

Returns
  newly created ds_rds_session structure

## ◆ ds_rds_session_replace_report_with_source()

int ds_rds_session_replace_report_with_source | ( | struct ds_rds_session * | session,
|  | struct oscap_source * | source
| ) |  |

Replace currently selected report with the content of the source.

The previously returned oscap_source assiciated with the selected report will be disposed. The source will become owned by the session.

Parameters

  session | The Result DataStream session
  source | The oscap_source to replase selected report with.

Returns
  0 on success

## ◆ ds_rds_session_select_report()

struct oscap_source * ds_rds_session_select_report | ( | struct ds_rds_session * | session,
|  | const char * | report_id
| ) |  |

Select arf:report from result DataStream and return it in form of oscap_source.

Parameters

  session | The Result DataStream session
  report_id | The ID of arf:report. Session will find the first, if this argument is NULL. this arguement is NULL.

Returns
  oscap_source owned by the ds_rds_session or NULL on error

## ◆ ds_rds_session_select_report_request()

struct oscap_source * ds_rds_session_select_report_request | ( | struct ds_rds_session * | session,
|  | const char * | report_request_id
| ) |  |

Select arf:report-request from result DataStream and return it in form of oscap_source.

Parameters

  session | The Result DataStream session
  report_request_id | The id of arf:report-request. Session will find the report_request related (see arf:relationship) to the last selected report. If there was no report selected session will error out.

Returns
  oscap_source owned by the ds_rds_session or NULL on error

## ◆ ds_rds_session_set_target_dir()

int ds_rds_session_set_target_dir | ( | struct ds_rds_session * | session,
|  | const char * | target_dir
| ) |  |

Set target directory for the component files.

Parameters

  session | The Result DataStream session
  target_dir | PAth to the target storage dir

Returns
  0 on success

The documentation for this struct was generated from the following files:

- ds_rds_session.c
- ds_rds_session.h