plugin-loader: Optionally use load option in each plugin section to load plugins
This now works because all plugins use the same config namespace.
If <ns>.load_modular is true, the list of plugins to load is determined
via the value of the <ns>.plugins.<name>.load options.
Using includes the following is possible:
charon {
load_modular = yes
plugins {
include strongswan.d/charon/*.conf
}
}
charon-cmd {
load_modular = yes
plugins {
include strongswan.d/charon-cmd/*.conf
}
}
Where each .conf file would contain something like:
<name> {
load = yes
<option> = <value>
}
To increase the priority of individual plugins load = <priority> can be
used (the default is 1). For instance, to use openssl instead of the
built-in crypto plugins set in strongswan.d/charon/openssl.conf:
openssl {
load = 10
}
If two plugins have the same priority their order in the default plugin
list is preserved. Plugins not found in that list are ordered
alphabetically before other plugins with the same priority.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Tobias Brunner
|
||||
* Copyright (C) 2012-2014 Tobias Brunner
|
||||
* Copyright (C) 2007 Martin Willi
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
@@ -67,6 +67,13 @@ struct plugin_loader_t {
|
||||
* for the plugins first, in the order they were added, then the default
|
||||
* path follows.
|
||||
*
|
||||
* If <ns>.load_modular is enabled (where <ns> is lib->ns) the plugins to
|
||||
* load are determined via a load option in their respective plugin config
|
||||
* section e.g. <ns>.plugins.<plugin>.load = <priority|bool>.
|
||||
* The oder is determined by the configured priority. If two plugins have
|
||||
* the same priority the order as seen in list is preserved. Plugins not
|
||||
* found in list are loaded first, in alphabetical order.
|
||||
*
|
||||
* @note Even though this method could be called multiple times this is
|
||||
* currently not really supported in regards to plugin features and their
|
||||
* dependencies (in particular soft dependencies).
|
||||
|
||||
Reference in New Issue
Block a user