Open SCAP Library
xccdf_session.h
Go to the documentation of this file.
1 
12 /*
13  * Copyright 2013 Red Hat Inc., Durham, North Carolina.
14  * All Rights Reserved.
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29  *
30  */
31 
32 #ifndef XCCDF_SESSION_H_
33 #define XCCDF_SESSION_H_
34 
35 #include "xccdf_policy.h"
36 
42 typedef void (*download_progress_calllback_t) (bool warning, const char * format, ...);
43 
48 struct xccdf_session;
49 
57 struct xccdf_session *xccdf_session_new(const char *filename);
58 
64 void xccdf_session_free(struct xccdf_session *session);
65 
70 const char *xccdf_session_get_filename(const struct xccdf_session *session);
71 
78 bool xccdf_session_is_sds(const struct xccdf_session *session);
79 
87 void xccdf_session_set_validation(struct xccdf_session *session, bool validate, bool full_validation);
88 
97 void xccdf_session_set_datastream_id(struct xccdf_session *session, const char *datastream_id);
98 
104 const char *xccdf_session_get_datastream_id(struct xccdf_session *session);
105 
114 void xccdf_session_set_component_id(struct xccdf_session *session, const char *component_id);
115 
121 const char *xccdf_session_get_component_id(struct xccdf_session *session);
122 
129 void xccdf_session_set_benchmark_id(struct xccdf_session *session, const char *benchmark_id);
130 
136 const char *xccdf_session_get_benchmark_id(struct xccdf_session *session);
137 
145 void xccdf_session_set_user_cpe(struct xccdf_session *session, const char *user_cpe);
146 
155 
164 
174 
183 void xccdf_session_set_custom_oval_files(struct xccdf_session *session, char **oval_filenames);
184 
193 
201 bool xccdf_session_set_product_cpe(struct xccdf_session *session, const char *product_cpe);
202 
209 void xccdf_session_set_oval_results_export(struct xccdf_session *session, bool to_export_oval_results);
210 
217 void xccdf_session_set_sce_results_export(struct xccdf_session *session, bool to_export_sce_results);
218 
225 void xccdf_session_set_oval_variables_export(struct xccdf_session *session, bool to_export_oval_variables);
226 
234 bool xccdf_session_set_xccdf_export(struct xccdf_session *session, const char *xccdf_file);
235 
243 bool xccdf_session_set_arf_export(struct xccdf_session *session, const char *arf_file);
244 
252 bool xccdf_session_set_report_export(struct xccdf_session *session, const char *report_file);
253 
261 bool xccdf_session_set_profile_id(struct xccdf_session *session, const char *profile_id);
262 
268 const char *xccdf_session_get_profile_id(struct xccdf_session *session);
269 
277 struct ds_sds_index *xccdf_session_get_sds_idx(struct xccdf_session *session);
278 
286 int xccdf_session_load(struct xccdf_session *session);
287 
300 int xccdf_session_load_xccdf(struct xccdf_session *session);
301 
309 int xccdf_session_load_cpe(struct xccdf_session *session);
310 
317 int xccdf_session_load_oval(struct xccdf_session *session);
318 
325 int xccdf_session_load_sce(struct xccdf_session *session);
326 
333 int xccdf_session_load_tailoring(struct xccdf_session *session);
334 
341 int xccdf_session_evaluate(struct xccdf_session *session);
342 
349 int xccdf_session_export_xccdf(struct xccdf_session *session);
350 
357 int xccdf_session_export_oval(struct xccdf_session *session);
358 
365 int xccdf_session_export_sce(struct xccdf_session *session);
366 
373 int xccdf_session_export_arf(struct xccdf_session *session);
374 
383 
390 struct xccdf_policy *xccdf_session_get_xccdf_policy(const struct xccdf_session *session);
391 
398 float xccdf_session_get_base_score(const struct xccdf_session *session);
399 
406 unsigned int xccdf_session_get_oval_agents_count(const struct xccdf_session *session);
407 
416 unsigned int xccdf_session_get_cpe_oval_agents_count(const struct xccdf_session *session);
417 
424 bool xccdf_session_contains_fail_result(const struct xccdf_session *session);
425 
434 int xccdf_session_remediate(struct xccdf_session *session);
435 
446 int xccdf_session_build_policy_from_testresult(struct xccdf_session *session, const char *testresult_id);
447 
450 #endif