From 0816d0487331646885265e8ac5e331cb122231f4 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 2 Nov 2015 21:33:48 -0600 Subject: [PATCH] eap-ttls: Convert to dynamic method registration --- src/eap-ttls.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/eap-ttls.c b/src/eap-ttls.c index 9a38de26..badba0e6 100644 --- a/src/eap-ttls.c +++ b/src/eap-ttls.c @@ -690,7 +690,7 @@ static bool eap_ttls_load_settings(struct eap_state *eap, return eap_load_settings(ttls->eap, settings, setting); } -struct eap_method eap_ttls = { +static struct eap_method eap_ttls = { .request_type = EAP_TYPE_TTLS, .exports_msk = true, .name = "TTLS", @@ -700,3 +700,17 @@ struct eap_method eap_ttls = { .handle_request = eap_ttls_handle_request, .load_settings = eap_ttls_load_settings, }; + +static int eap_ttls_init(void) +{ + l_debug(""); + return eap_register_method(&eap_ttls); +} + +static void eap_ttls_exit(void) +{ + l_debug(""); + eap_unregister_method(&eap_ttls); +} + +EAP_METHOD_BUILTIN(eap_ttls, eap_ttls_init, eap_ttls_exit)