aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-10-13 11:29:52 +0200
committerMartin Willi <martin@revosec.ch>2011-10-14 10:05:47 +0200
commit278e5f3d7a4c88ab1eb5842fb207052ef42836ae (patch)
tree61a2091ab86914d536d189324a1b99468515b2da /src/libhydra
parent33a8860eac90b73ca650f55961615e5d80488a4c (diff)
downloadstrongswan-278e5f3d7a4c88ab1eb5842fb207052ef42836ae.tar.bz2
strongswan-278e5f3d7a4c88ab1eb5842fb207052ef42836ae.tar.xz
Add features support to kernel-netlink plugin
Diffstat (limited to 'src/libhydra')
-rw-r--r--src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c b/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c
index 779466472..0eb00dadf 100644
--- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c
+++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c
@@ -39,13 +39,22 @@ METHOD(plugin_t, get_name, char*,
return "kernel-netlink";
}
+METHOD(plugin_t, get_features, int,
+ private_kernel_netlink_plugin_t *this, plugin_feature_t *features[])
+{
+ static plugin_feature_t f[] = {
+ PLUGIN_CALLBACK(kernel_ipsec_register, kernel_netlink_ipsec_create),
+ PLUGIN_PROVIDE(CUSTOM, "kernel-ipsec"),
+ PLUGIN_CALLBACK(kernel_net_register, kernel_netlink_net_create),
+ PLUGIN_PROVIDE(CUSTOM, "kernel-net"),
+ };
+ *features = f;
+ return countof(f);
+}
+
METHOD(plugin_t, destroy, void,
private_kernel_netlink_plugin_t *this)
{
- hydra->kernel_interface->remove_ipsec_interface(hydra->kernel_interface,
- (kernel_ipsec_constructor_t)kernel_netlink_ipsec_create);
- hydra->kernel_interface->remove_net_interface(hydra->kernel_interface,
- (kernel_net_constructor_t)kernel_netlink_net_create);
free(this);
}
@@ -60,15 +69,11 @@ plugin_t *kernel_netlink_plugin_create()
.public = {
.plugin = {
.get_name = _get_name,
- .reload = (void*)return_false,
+ .get_features = _get_features,
.destroy = _destroy,
},
},
);
- hydra->kernel_interface->add_ipsec_interface(hydra->kernel_interface,
- (kernel_ipsec_constructor_t)kernel_netlink_ipsec_create);
- hydra->kernel_interface->add_net_interface(hydra->kernel_interface,
- (kernel_net_constructor_t)kernel_netlink_net_create);
return &this->public.plugin;
}