|
Open SCAP Library
|
00001 /* 00002 * Copyright 2012 Red Hat Inc., Durham, North Carolina. 00003 * All Rights Reserved. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * Authors: 00020 * "Martin Preisler" <mpreisle@redhat.com> 00021 */ 00022 00023 #pragma once 00024 00025 #ifndef SCE_ENGINE_API_H_ 00026 #define SCE_ENGINE_API_H_ 00027 00028 #include <xccdf_benchmark.h> 00029 #include <xccdf_policy.h> 00030 00034 struct sce_check_result* sce_check_result_new(void); 00035 00039 void sce_check_result_free(struct sce_check_result* v); 00040 00046 void sce_check_result_set_href(struct sce_check_result* v, const char* href); 00047 00051 const char* sce_check_result_get_href(struct sce_check_result* v); 00052 00058 void sce_check_result_set_basename(struct sce_check_result* v, const char* basename); 00059 00063 const char* sce_check_result_get_basename(struct sce_check_result* v); 00064 00071 void sce_check_result_set_stdout(struct sce_check_result* v, const char* details); 00072 00076 const char* sce_check_result_get_stdout(struct sce_check_result* v); 00077 00084 void sce_check_result_set_stderr(struct sce_check_result* v, const char* details); 00085 00089 const char* sce_check_result_get_stderr(struct sce_check_result* v); 00090 00095 void sce_check_result_set_exit_code(struct sce_check_result* v, int exit_code); 00096 00100 int sce_check_result_get_exit_code(struct sce_check_result* v); 00101 00107 void sce_check_result_reset_environment_variables(struct sce_check_result* v); 00108 00119 void sce_check_result_add_environment_variable(struct sce_check_result* v, const char* var); 00120 00126 void sce_check_result_set_xccdf_result(struct sce_check_result* v, xccdf_test_result_type_t result); 00127 00131 xccdf_test_result_type_t sce_check_result_get_xccdf_result(struct sce_check_result* v); 00132 00138 void sce_check_result_export(struct sce_check_result* v, const char* target_file); 00139 00143 struct sce_session* sce_session_new(void); 00144 00148 void sce_session_free(struct sce_session* s); 00149 00155 void sce_session_reset(struct sce_session* s); 00156 00164 void sce_session_add_check_result(struct sce_session* s, struct sce_check_result* result); 00165 00171 struct sce_check_result_iterator; 00172 struct sce_check_result *sce_check_result_iterator_next(struct sce_check_result_iterator *it); 00174 bool sce_check_result_iterator_has_more(struct sce_check_result_iterator *it); 00176 void sce_check_result_iterator_free(struct sce_check_result_iterator *it); 00178 void sce_check_result_iterator_reset(struct sce_check_result_iterator *it); 00179 00180 struct sce_check_result_iterator *sce_session_get_check_results(struct sce_session* s); 00181 00187 void sce_session_export_to_directory(struct sce_session* s, const char* directory); 00188 00192 struct sce_parameters* sce_parameters_new(void); 00193 00197 void sce_parameters_free(struct sce_parameters* v); 00198 00205 void sce_parameters_set_xccdf_directory(struct sce_parameters* v, const char* value); 00206 00210 const char* sce_parameters_get_xccdf_directory(struct sce_parameters* v); 00211 00219 void sce_parameters_set_session(struct sce_parameters* v, struct sce_session* value); 00220 00224 struct sce_session* sce_parameters_get_session(struct sce_parameters* v); 00225 00232 void sce_parameters_allocate_session(struct sce_parameters* v); 00233 00239 xccdf_test_result_type_t sce_engine_eval_rule(struct xccdf_policy *policy, const char *rule_id, const char *id, const char *href, 00240 struct xccdf_value_binding_iterator *value_binding_it, 00241 struct xccdf_check_import_iterator *check_import_it, 00242 void *usr); 00243 00250 bool xccdf_policy_model_register_engine_sce(struct xccdf_policy_model * model, struct sce_parameters *sce_parameters); 00251 00252 #endif
1.7.3