From 8c78772a0598619b7bc5197662ee1c8a0703f7d0 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Mon, 8 Aug 2011 08:48:18 +0200 Subject: [PATCH] implemented tnc-ifmap reload method --- .../plugins/tnc_ifmap/tnc_ifmap_plugin.c | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/libcharon/plugins/tnc_ifmap/tnc_ifmap_plugin.c b/src/libcharon/plugins/tnc_ifmap/tnc_ifmap_plugin.c index 8708b90a9..6c97a5a1c 100644 --- a/src/libcharon/plugins/tnc_ifmap/tnc_ifmap_plugin.c +++ b/src/libcharon/plugins/tnc_ifmap/tnc_ifmap_plugin.c @@ -42,6 +42,25 @@ METHOD(plugin_t, get_name, char*, return "tnc-ifmap"; } +METHOD(plugin_t, reload, bool, + private_tnc_ifmap_plugin_t *this) +{ + if (this->listener) + { + charon->bus->remove_listener(charon->bus, &this->listener->listener); + this->listener->destroy(this->listener); + } + + this->listener = tnc_ifmap_listener_create(); + if (!this->listener) + { + return FALSE; + } + + charon->bus->add_listener(charon->bus, &this->listener->listener); + return TRUE; +} + METHOD(plugin_t, destroy, void, private_tnc_ifmap_plugin_t *this) { @@ -64,7 +83,7 @@ plugin_t *tnc_ifmap_plugin_create() .public = { .plugin = { .get_name = _get_name, - .reload = (void*)return_false, + .reload = _reload, .destroy = _destroy, }, },