Open SCAP Library

ds_sds_session.h
1 /*
2 * Copyright 2014 Red Hat Inc., Durham, North Carolina.
3 * All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author:
20 * Šimon Lukašík
21 */
22 #ifndef DS_SDS_SESSION_H
23 #define DS_SDS_SESSION_H
24
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
28
29 #include "oscap.h"
30 #include "oscap_source.h"
31 #include "scap_ds.h"
32 #include "oscap_download_cb.h"
33
47 struct ds_sds_session;
48
57 struct ds_sds_session *ds_sds_session_new_from_source(struct oscap_source *source);
58
65 struct ds_sds_index *ds_sds_session_get_sds_idx(struct ds_sds_session *session);
66
71 void ds_sds_session_free(struct ds_sds_session *sds_session);
72
83 struct oscap_source *ds_sds_session_select_checklist(struct ds_sds_session *session, const char *datastream_id, const char *component_id, const char *benchmark_id);
84
93 struct oscap_source *ds_sds_session_select_tailoring(struct ds_sds_session *session, const char *component_id);
94
103 int ds_sds_session_set_datastream_id(struct ds_sds_session *session, const char *datastream_id);
104
111 const char *ds_sds_session_get_datastream_id(const struct ds_sds_session *session);
112
119 const char *ds_sds_session_get_checklist_id(const struct ds_sds_session *session);
120
132 struct oscap_source *ds_sds_session_get_component_by_href(struct ds_sds_session *session, const char *href);
133
142 bool ds_sds_session_can_register_component(struct ds_sds_session *session, const char *container_name, const char *component_id);
143
155 int ds_sds_session_register_component_with_dependencies(struct ds_sds_session *session, const char *container_name, const char *component_id, const char *target_filename);
156
163 int ds_sds_session_dump_component_files(struct ds_sds_session *session);
164
172 int ds_sds_session_set_target_dir(struct ds_sds_session *session, const char *target_dir);
173
184 void ds_sds_session_reset(struct ds_sds_session *session);
185
194 void ds_sds_session_set_remote_resources(struct ds_sds_session *session, bool allowed, download_progress_calllback_t callback);
195
204 char *ds_sds_session_get_html_guide(struct ds_sds_session *session, const char *profile_id);
205
206 #endif
ds_sds_session::ds_sds_session_select_checklist
struct oscap_source * ds_sds_session_select_checklist(struct ds_sds_session *session, const char *datastream_id, const char *component_id, const char *benchmark_id)
Select Checklist (XCCDF presumably) from DataStream collection.
Definition: ds_sds_session.c:180
ds_sds_session::ds_sds_session_dump_component_files
int ds_sds_session_dump_component_files(struct ds_sds_session *session)
Store cached component files to the disc.
Definition: ds_sds_session.c:329
oscap.h
General OpenScap functions and types.
ds_sds_session::ds_sds_session_get_checklist_id
const char * ds_sds_session_get_checklist_id(const struct ds_sds_session *session)
Return ID of currently selected component representing XCCDF within the DataStream.
Definition: ds_sds_session.c:162
ds_sds_session::ds_sds_session_new_from_source
struct ds_sds_session * ds_sds_session_new_from_source(struct oscap_source *source)
Create new ds_sds_session from existing oscap_source.
Definition: ds_sds_session.c:66
ds_sds_session::ds_sds_session_set_target_dir
int ds_sds_session_set_target_dir(struct ds_sds_session *session, const char *target_dir)
Set target directory for the component files.
Definition: ds_sds_session.c:131
ds_sds_session::ds_sds_session_reset
void ds_sds_session_reset(struct ds_sds_session *session)
Reset session for further use.
Definition: ds_sds_session.c:92
ds_sds_index
Represents <data-stream-collection> element - the root element of each source datastream.
Definition: sds_index.c:215
ds_sds_session::ds_sds_session_set_datastream_id
int ds_sds_session_set_datastream_id(struct ds_sds_session *session, const char *datastream_id)
Set the ID of DataStream within collection to use.
Definition: ds_sds_session.c:144
ds_sds_session::ds_sds_session_get_html_guide
char * ds_sds_session_get_html_guide(struct ds_sds_session *session, const char *profile_id)
Returns HTML representation of selected checklist in form of OpenSCAP guide.
Definition: ds_sds_session.c:344
ds_sds_session::source
struct oscap_source * source
Source DataStream raw representation.
Definition: ds_sds_session.c:48
ds_sds_session::ds_sds_session_set_remote_resources
void ds_sds_session_set_remote_resources(struct ds_sds_session *session, bool allowed, download_progress_calllback_t callback)
Set property of remote content.
Definition: ds_sds_session.c:323
oscap_source
Definition: oscap_source.c:62
ds_sds_session::ds_sds_session_get_component_by_href
struct oscap_source * ds_sds_session_get_component_by_href(struct ds_sds_session *session, const char *href)
Get component from Source DataStream by its href.
Definition: ds_sds_session.c:263
ds_sds_session::ds_sds_session_register_component_with_dependencies
int ds_sds_session_register_component_with_dependencies(struct ds_sds_session *session, const char *container_name, const char *component_id, const char *target_filename)
Register component and its dependencies to internal cache.
Definition: ds_sds_session.c:287
scap_ds.h
Open-scap Data Stream interface.
ds_sds_session::ds_sds_session_get_datastream_id
const char * ds_sds_session_get_datastream_id(const struct ds_sds_session *session)
Return ID of currently selected DataStream within the DataStream collection.
Definition: ds_sds_session.c:157
ds_sds_session::ds_sds_session_select_tailoring
struct oscap_source * ds_sds_session_select_tailoring(struct ds_sds_session *session, const char *component_id)
Select XCCDF Tailoring from DataStream collection.
Definition: ds_sds_session.c:221
ds_sds_session
Definition: ds_sds_session.c:47
ds_sds_session::ds_sds_session_get_sds_idx
struct ds_sds_index * ds_sds_session_get_sds_idx(struct ds_sds_session *session)
Get Source DataStream index.
Definition: ds_sds_session.c:101