|
Open SCAP Library
|
00001 00011 /* 00012 * Copyright 2013 Red Hat Inc., Durham, North Carolina. 00013 * All Rights Reserved. 00014 * 00015 * This library is free software; you can redistribute it and/or 00016 * modify it under the terms of the GNU Lesser General Public 00017 * License as published by the Free Software Foundation; either 00018 * version 2.1 of the License, or (at your option) any later version. 00019 * 00020 * This library is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 * Lesser General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU Lesser General Public 00026 * License along with this library; if not, write to the Free Software 00027 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00028 * 00029 */ 00030 00031 #ifndef OPENSCAP_CHECK_ENGINE_PLUGIN_H_ 00032 #define OPENSCAP_CHECK_ENGINE_PLUGIN_H_ 00033 00034 #include "xccdf_policy.h" 00035 00036 struct check_engine_plugin_def 00037 { 00038 int _reserved; // FIXME: version checking? 00039 00040 void *module_handle; 00041 void *user_data; 00042 00043 // NB: path hint is the input file path, can be used for relative path resolution 00044 00045 // first arg: policy model to register with, second arg: path hint, third arg: user data 00046 int (*register_fn)(struct xccdf_policy_model *, const char*, void**); 00047 // first arg: policy model, second arg: user data 00048 int (*cleanup_fn)(struct xccdf_policy_model *, void**); 00049 // first arg: policy model, second arg: validate, third arg: path hint, fourth arg: user data 00050 int (*export_results_fn)(struct xccdf_policy_model *, bool, const char*, void**); 00051 // first arg: user data 00052 const char *(*get_capabilities_fn)(void**); 00053 }; 00054 00055 struct check_engine_plugin_def *check_engine_plugin_load2(const char* path, bool quiet); 00056 struct check_engine_plugin_def *check_engine_plugin_load(const char* path); 00057 void check_engine_plugin_unload(struct check_engine_plugin_def *plugin); 00058 00059 int check_engine_plugin_register(struct check_engine_plugin_def *plugin, struct xccdf_policy_model *model, const char *path_hint); 00060 int check_engine_plugin_cleanup(struct check_engine_plugin_def *plugin, struct xccdf_policy_model *model); 00061 int check_engine_plugin_export_results(struct check_engine_plugin_def *plugin, struct xccdf_policy_model *model, bool validate, const char *path_hint); 00062 const char *check_engine_plugin_get_capabilities(struct check_engine_plugin_def *plugin); 00063 00067 typedef int (*check_engine_plugin_entry_fn) (struct check_engine_plugin_def*); 00068 00069 #define OPENSCAP_CHECK_ENGINE_PLUGIN_ENTRY OPENSCAP_CHECK_ENGINE_PLUGIN_ENTRY 00070 00076 const char * const *check_engine_plugin_get_known_plugins(void); 00077 00080 #endif
1.7.3