Cache list of plugin names to further simplify its usage.

Also helpful for ipsec statusall to avoid having to enumerate plugins.
This commit is contained in:
Tobias Brunner
2012-01-19 12:37:42 +01:00
parent fdf1f239ef
commit f1ba06c1c6
8 changed files with 62 additions and 73 deletions
+2 -5
View File
@@ -868,11 +868,8 @@ DBG_dump(const char *label, const void *p, size_t len)
static void show_loaded_plugins()
{
char *plugins;
plugins = lib->plugins->loaded_plugins(lib->plugins);
whack_log(RC_COMMENT, "loaded plugins: %s", plugins);
free(plugins);
whack_log(RC_COMMENT, "loaded plugins: %s",
lib->plugins->loaded_plugins(lib->plugins));
}
void show_status(bool all, const char *name)
+2 -13
View File
@@ -264,18 +264,6 @@ static const char *pkcs11_init_args = NULL;
/* options read by optionsfrom */
options_t *options;
/**
* Log loaded plugins
*/
static void print_plugins()
{
char *plugins;
plugins = lib->plugins->loaded_plugins(lib->plugins);
DBG1(DBG_DMN, "loaded plugins: %s", plugins);
free(plugins);
}
int main(int argc, char **argv)
{
bool fork_desired = TRUE;
@@ -693,7 +681,8 @@ int main(int argc, char **argv)
{
exit(SS_RC_INITIALIZATION_FAILED);
}
print_plugins();
DBG1(DBG_DMN, "loaded plugins: %s",
lib->plugins->loaded_plugins(lib->plugins));
init_builder();
if (!init_secret() || !init_crypto())