diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-11-25 23:17:18 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-11-25 23:17:18 +0100 |
commit | 8ac5fb345f28e9b9fbbc264732874edf41bcff34 (patch) | |
tree | 41993047ce2d71cf9d12338e6ca3ec9689015d91 | |
parent | cd5feee356e4b67b6d276d70f96bd50549dfd2b0 (diff) | |
download | strongswan-8ac5fb345f28e9b9fbbc264732874edf41bcff34.tar.bz2 strongswan-8ac5fb345f28e9b9fbbc264732874edf41bcff34.tar.xz |
Migrated kernel_pfroute_plugin_t to INIT/METHOD macros
-rw-r--r-- | src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c index 5f351bd72..a4cb53edd 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c @@ -32,10 +32,8 @@ struct private_kernel_pfroute_plugin_t { kernel_pfroute_plugin_t public; }; -/** - * Implementation of plugin_t.destroy - */ -static void destroy(private_kernel_pfroute_plugin_t *this) +METHOD(plugin_t, destroy, void, + private_kernel_pfroute_plugin_t *this) { hydra->kernel_interface->remove_net_interface(hydra->kernel_interface, (kernel_net_constructor_t)kernel_pfroute_net_create); @@ -47,10 +45,15 @@ static void destroy(private_kernel_pfroute_plugin_t *this) */ plugin_t *kernel_pfroute_plugin_create() { - private_kernel_pfroute_plugin_t *this = malloc_thing(private_kernel_pfroute_plugin_t); - - this->public.plugin.destroy = (void(*)(plugin_t*))destroy; - + private_kernel_pfroute_plugin_t *this; + + INIT(this, + .public = { + .plugin = { + .destroy = _destroy, + }, + }, + ); hydra->kernel_interface->add_net_interface(hydra->kernel_interface, (kernel_net_constructor_t)kernel_pfroute_net_create); |