xccdf_session.h
Go to the documentation of this file.
/*
* Copyright 2013 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef XCCDF_SESSION_H_
#define XCCDF_SESSION_H_
#include "xccdf_policy.h"
typedef void (*download_progress_calllback_t) (bool warning, const char * format, ...);
struct xccdf_session;
struct xccdf_session *xccdf_session_new(const char *filename);
void xccdf_session_free(struct xccdf_session *session);
const char *xccdf_session_get_filename(const struct xccdf_session *session);
bool xccdf_session_is_sds(const struct xccdf_session *session);
void xccdf_session_set_validation(struct xccdf_session *session, bool validate, bool full_validation);
void xccdf_session_set_datastream_id(struct xccdf_session *session, const char *datastream_id);
const char *xccdf_session_get_datastream_id(struct xccdf_session *session);
void xccdf_session_set_component_id(struct xccdf_session *session, const char *component_id);
const char *xccdf_session_get_component_id(struct xccdf_session *session);
void xccdf_session_set_benchmark_id(struct xccdf_session *session, const char *benchmark_id);
const char *xccdf_session_get_benchmark_id(struct xccdf_session *session);
void xccdf_session_set_user_cpe(struct xccdf_session *session, const char *user_cpe);
void xccdf_session_set_user_tailoring_file(struct xccdf_session *session, const char *user_tailoring_file);
void xccdf_session_set_user_tailoring_cid(struct xccdf_session *session, const char *user_tailoring_cid);
void xccdf_session_set_remote_resources(struct xccdf_session *session, bool allowed, download_progress_calllback_t callback);
void xccdf_session_set_custom_oval_files(struct xccdf_session *session, char **oval_filenames);
void xccdf_session_set_custom_oval_eval_fn(struct xccdf_session *session, xccdf_policy_engine_eval_fn eval_fn);
bool xccdf_session_set_product_cpe(struct xccdf_session *session, const char *product_cpe);
void xccdf_session_set_oval_results_export(struct xccdf_session *session, bool to_export_oval_results);
void xccdf_session_set_check_engine_plugins_results_export(struct xccdf_session *session, bool to_export_results);
OSCAP_DEPRECATED(void xccdf_session_set_sce_results_export(struct xccdf_session *session, bool to_export_sce_results));
void xccdf_session_set_oval_variables_export(struct xccdf_session *session, bool to_export_oval_variables);
bool xccdf_session_set_xccdf_export(struct xccdf_session *session, const char *xccdf_file);
bool xccdf_session_set_arf_export(struct xccdf_session *session, const char *arf_file);
bool xccdf_session_set_report_export(struct xccdf_session *session, const char *report_file);
bool xccdf_session_set_profile_id(struct xccdf_session *session, const char *profile_id);
const char *xccdf_session_get_profile_id(struct xccdf_session *session);
struct ds_sds_index *xccdf_session_get_sds_idx(struct xccdf_session *session);
int xccdf_session_load(struct xccdf_session *session);
int xccdf_session_load_xccdf(struct xccdf_session *session);
int xccdf_session_load_cpe(struct xccdf_session *session);
int xccdf_session_load_oval(struct xccdf_session *session);
int xccdf_session_load_check_engine_plugin(struct xccdf_session *session, const char* plugin_name);
int xccdf_session_load_check_engine_plugins(struct xccdf_session *session);
OSCAP_DEPRECATED(int xccdf_session_load_sce(struct xccdf_session *session));
int xccdf_session_load_tailoring(struct xccdf_session *session);
int xccdf_session_evaluate(struct xccdf_session *session);
int xccdf_session_export_xccdf(struct xccdf_session *session);
int xccdf_session_export_oval(struct xccdf_session *session);
int xccdf_session_export_check_engine_plugins(struct xccdf_session *session);
OSCAP_DEPRECATED(int xccdf_session_export_sce(struct xccdf_session *session));
int xccdf_session_export_arf(struct xccdf_session *session);
struct xccdf_policy_model *xccdf_session_get_policy_model(const struct xccdf_session *session);
struct xccdf_policy *xccdf_session_get_xccdf_policy(const struct xccdf_session *session);
float xccdf_session_get_base_score(const struct xccdf_session *session);
unsigned int xccdf_session_get_oval_agents_count(const struct xccdf_session *session);
unsigned int xccdf_session_get_cpe_oval_agents_count(const struct xccdf_session *session);
bool xccdf_session_contains_fail_result(const struct xccdf_session *session);
int xccdf_session_remediate(struct xccdf_session *session);
int xccdf_session_build_policy_from_testresult(struct xccdf_session *session, const char *testresult_id);
#endif