From: Martin Willi Date: Thu, 13 Oct 2011 09:33:53 +0000 (+0200) Subject: Add features support to kernel-pfroute plugin X-Git-Tag: 4.6.0~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8da1f9f25d1391392f41fb266724b6ae01233d9e;p=thirdparty%2Fstrongswan.git Add features support to kernel-pfroute plugin --- diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c index 680caa5d0a..09068b33e3 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c @@ -38,11 +38,20 @@ METHOD(plugin_t, get_name, char*, return "kernel-pfroute"; } +METHOD(plugin_t, get_features, int, + private_kernel_pfroute_plugin_t *this, plugin_feature_t *features[]) +{ + static plugin_feature_t f[] = { + PLUGIN_CALLBACK(kernel_net_register, kernel_pfroute_net_create), + PLUGIN_PROVIDE(CUSTOM, "kernel-net"), + }; + *features = f; + return countof(f); +} + 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); free(this); } @@ -57,13 +66,11 @@ plugin_t *kernel_pfroute_plugin_create() .public = { .plugin = { .get_name = _get_name, - .reload = (void*)return_false, + .get_features = _get_features, .destroy = _destroy, }, }, ); - hydra->kernel_interface->add_net_interface(hydra->kernel_interface, - (kernel_net_constructor_t)kernel_pfroute_net_create); return &this->public.plugin; }