|
Open SCAP Library
|
00001 00012 /* 00013 * Copyright 2013 Red Hat Inc., Durham, North Carolina. 00014 * All Rights Reserved. 00015 * 00016 * This library is free software; you can redistribute it and/or 00017 * modify it under the terms of the GNU Lesser General Public 00018 * License as published by the Free Software Foundation; either 00019 * version 2.1 of the License, or (at your option) any later version. 00020 * 00021 * This library is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 * Lesser General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU Lesser General Public 00027 * License along with this library; if not, write to the Free Software 00028 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00029 * 00030 */ 00031 00032 #ifndef XCCDF_SESSION_H_ 00033 #define XCCDF_SESSION_H_ 00034 00035 #include "xccdf_policy.h" 00036 #include "oscap_download_cb.h" 00037 00042 struct xccdf_session; 00043 00049 typedef enum { 00050 XCCDF_SESSION_LOAD_NONE = 0, 00051 XCCDF_SESSION_LOAD_XCCDF = 1 << 0, 00052 XCCDF_SESSION_LOAD_CPE = 1 << 1, 00053 XCCDF_SESSION_LOAD_OVAL = 1 << 2, 00054 XCCDF_SESSION_LOAD_CHECK_ENGINE_PLUGINS = 1 << 3, 00055 XCCDF_SESSION_LOAD_ALL = XCCDF_SESSION_LOAD_XCCDF | XCCDF_SESSION_LOAD_CPE | XCCDF_SESSION_LOAD_OVAL | XCCDF_SESSION_LOAD_CHECK_ENGINE_PLUGINS 00056 } xccdf_session_loading_flags_t; 00057 00065 struct xccdf_session *xccdf_session_new(const char *filename); 00066 00074 struct xccdf_session *xccdf_session_new_from_source(struct oscap_source *source); 00075 00081 void xccdf_session_free(struct xccdf_session *session); 00082 00087 const char *xccdf_session_get_filename(const struct xccdf_session *session); 00088 00095 bool xccdf_session_is_sds(const struct xccdf_session *session); 00096 00104 void xccdf_session_set_rule(struct xccdf_session *session, const char *rule); 00105 00116 void xccdf_session_set_validation(struct xccdf_session *session, bool validate, bool full_validation); 00117 00126 void xccdf_session_set_thin_results(struct xccdf_session *session, bool thin_result); 00127 00136 void xccdf_session_set_datastream_id(struct xccdf_session *session, const char *datastream_id); 00137 00143 const char *xccdf_session_get_datastream_id(struct xccdf_session *session); 00144 00153 void xccdf_session_set_component_id(struct xccdf_session *session, const char *component_id); 00154 00160 const char *xccdf_session_get_component_id(struct xccdf_session *session); 00161 00168 void xccdf_session_set_benchmark_id(struct xccdf_session *session, const char *benchmark_id); 00169 00175 const char *xccdf_session_get_benchmark_id(struct xccdf_session *session); 00176 00181 const char *xccdf_session_get_result_id(struct xccdf_session *session); 00182 00190 void xccdf_session_set_user_cpe(struct xccdf_session *session, const char *user_cpe); 00191 00199 void xccdf_session_set_user_tailoring_file(struct xccdf_session *session, const char *user_tailoring_file); 00200 00208 void xccdf_session_set_user_tailoring_cid(struct xccdf_session *session, const char *user_tailoring_cid); 00209 00218 void xccdf_session_set_remote_resources(struct xccdf_session *session, bool allowed, download_progress_calllback_t callback); 00219 00226 void xccdf_session_set_loading_flags(struct xccdf_session *session, xccdf_session_loading_flags_t flags); 00227 00236 void xccdf_session_set_custom_oval_files(struct xccdf_session *session, char **oval_filenames); 00237 00245 void xccdf_session_set_custom_oval_eval_fn(struct xccdf_session *session, xccdf_policy_engine_eval_fn eval_fn); 00246 00254 bool xccdf_session_set_product_cpe(struct xccdf_session *session, const char *product_cpe); 00255 00262 void xccdf_session_set_without_sys_chars_export(struct xccdf_session *session, bool without_sys_chars); 00263 00270 void xccdf_session_set_oval_results_export(struct xccdf_session *session, bool to_export_oval_results); 00271 00278 void xccdf_session_set_check_engine_plugins_results_export(struct xccdf_session *session, bool to_export_results); 00279 00286 OSCAP_DEPRECATED(void xccdf_session_set_sce_results_export(struct xccdf_session *session, bool to_export_sce_results)); 00287 00294 void xccdf_session_set_oval_variables_export(struct xccdf_session *session, bool to_export_oval_variables); 00295 00303 bool xccdf_session_set_xccdf_export(struct xccdf_session *session, const char *xccdf_file); 00304 00312 bool xccdf_session_set_xccdf_stig_viewer_export(struct xccdf_session *session, const char *xccdf_stig_viewer_file); 00313 00321 bool xccdf_session_set_arf_export(struct xccdf_session *session, const char *arf_file); 00322 00330 bool xccdf_session_set_report_export(struct xccdf_session *session, const char *report_file); 00331 00339 bool xccdf_session_set_profile_id(struct xccdf_session *session, const char *profile_id); 00340 00349 int xccdf_session_set_profile_id_by_suffix(struct xccdf_session *session, const char *profile_suffix); 00350 00356 const char *xccdf_session_get_profile_id(struct xccdf_session *session); 00357 00365 struct ds_sds_index *xccdf_session_get_sds_idx(struct xccdf_session *session); 00366 00374 int xccdf_session_load(struct xccdf_session *session); 00375 00388 int xccdf_session_load_xccdf(struct xccdf_session *session); 00389 00397 int xccdf_session_load_cpe(struct xccdf_session *session); 00398 00405 int xccdf_session_load_oval(struct xccdf_session *session); 00406 00421 int xccdf_session_load_check_engine_plugin2(struct xccdf_session *session, const char* plugin_name, bool quiet); 00422 int xccdf_session_load_check_engine_plugin(struct xccdf_session *session, const char* plugin_name); 00423 00434 int xccdf_session_load_check_engine_plugins(struct xccdf_session *session); 00435 00441 OSCAP_DEPRECATED(int xccdf_session_load_sce(struct xccdf_session *session)); 00442 00449 int xccdf_session_load_tailoring(struct xccdf_session *session); 00450 00457 int xccdf_session_evaluate(struct xccdf_session *session); 00458 00465 int xccdf_session_export_xccdf(struct xccdf_session *session); 00466 00473 int xccdf_session_export_oval(struct xccdf_session *session); 00474 00483 int xccdf_session_export_check_engine_plugins(struct xccdf_session *session); 00484 00493 OSCAP_DEPRECATED(int xccdf_session_export_sce(struct xccdf_session *session)); 00494 00501 int xccdf_session_export_arf(struct xccdf_session *session); 00502 00510 struct xccdf_policy_model *xccdf_session_get_policy_model(const struct xccdf_session *session); 00511 00518 struct xccdf_policy *xccdf_session_get_xccdf_policy(const struct xccdf_session *session); 00519 00526 float xccdf_session_get_base_score(const struct xccdf_session *session); 00527 00534 unsigned int xccdf_session_get_oval_agents_count(const struct xccdf_session *session); 00535 00544 unsigned int xccdf_session_get_cpe_oval_agents_count(const struct xccdf_session *session); 00545 00552 bool xccdf_session_contains_fail_result(const struct xccdf_session *session); 00553 00562 int xccdf_session_remediate(struct xccdf_session *session); 00563 00574 int xccdf_session_build_policy_from_testresult(struct xccdf_session *session, const char *testresult_id); 00575 00583 int xccdf_session_add_report_from_source(struct xccdf_session *session, struct oscap_source *report_source); 00584 00587 #endif
1.7.3