Add features support to eap-gtc plugin
[strongswan.git] / src / libcharon / plugins / eap_gtc / eap_gtc_plugin.c
index 4eb587d..bd70b75 100644 (file)
 /* missing in cababilities.h */
 #define CAP_AUDIT_WRITE 29
 
+METHOD(plugin_t, get_name, char*,
+       eap_gtc_plugin_t *this)
+{
+       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);
 }
 
@@ -41,6 +56,8 @@ plugin_t *eap_gtc_plugin_create()
 
        INIT(this,
                .plugin = {
+                       .get_name = _get_name,
+                       .get_features = _get_features,
                        .destroy = _destroy,
                },
        );