Add features support to eap-gtc plugin
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 14 Oct 2011 15:39:29 +0000 (17:39 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 14 Oct 2011 15:41:08 +0000 (17:41 +0200)
src/libcharon/plugins/eap_gtc/eap_gtc_plugin.c

index c40ce60..bd70b75 100644 (file)
@@ -28,13 +28,22 @@ METHOD(plugin_t, get_name, char*,
        return "eap-gtc";
 }
 
+METHOD(plugin_t, get_features, int,
+       eap_gtc_plugin_t *this, plugin_feature_t *features[])
+{
+       static plugin_feature_t f[] = {
+               PLUGIN_CALLBACK(eap_method_register, eap_gtc_create_server),
+                       PLUGIN_PROVIDE(EAP_SERVER, EAP_GTC),
+               PLUGIN_CALLBACK(eap_method_register, eap_gtc_create_peer),
+                       PLUGIN_PROVIDE(EAP_PEER, EAP_GTC),
+       };
+       *features = f;
+       return countof(f);
+}
+
 METHOD(plugin_t, destroy, void,
        eap_gtc_plugin_t *this)
 {
-       charon->eap->remove_method(charon->eap,
-                                                          (eap_constructor_t)eap_gtc_create_server);
-       charon->eap->remove_method(charon->eap,
-                                                          (eap_constructor_t)eap_gtc_create_peer);
        free(this);
 }
 
@@ -48,7 +57,7 @@ plugin_t *eap_gtc_plugin_create()
        INIT(this,
                .plugin = {
                        .get_name = _get_name,
-                       .reload = (void*)return_false,
+                       .get_features = _get_features,
                        .destroy = _destroy,
                },
        );