Migrated remaining plugin_t implementations to INIT/METHOD macros
This commit is contained in:
@@ -20,10 +20,8 @@
|
||||
|
||||
#include <daemon.h>
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(eap_aka_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
eap_aka_plugin_t *this)
|
||||
{
|
||||
charon->eap->remove_method(charon->eap,
|
||||
(eap_constructor_t)eap_aka_server_create);
|
||||
@@ -37,9 +35,13 @@ static void destroy(eap_aka_plugin_t *this)
|
||||
*/
|
||||
plugin_t *eap_aka_plugin_create()
|
||||
{
|
||||
eap_aka_plugin_t *this = malloc_thing(eap_aka_plugin_t);
|
||||
eap_aka_plugin_t *this;
|
||||
|
||||
this->plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
);
|
||||
|
||||
charon->eap->add_method(charon->eap, EAP_AKA, 0, EAP_SERVER,
|
||||
(eap_constructor_t)eap_aka_server_create);
|
||||
|
||||
@@ -48,10 +48,8 @@ struct private_eap_aka_3gpp2_t {
|
||||
eap_aka_3gpp2_functions_t *functions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of eap_aka_3gpp2_t.destroy.
|
||||
*/
|
||||
static void destroy(private_eap_aka_3gpp2_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_eap_aka_3gpp2_t *this)
|
||||
{
|
||||
charon->sim->remove_card(charon->sim, &this->card->card);
|
||||
charon->sim->remove_provider(charon->sim, &this->provider->provider);
|
||||
@@ -66,11 +64,17 @@ static void destroy(private_eap_aka_3gpp2_t *this)
|
||||
*/
|
||||
plugin_t *eap_aka_3gpp2_plugin_create()
|
||||
{
|
||||
private_eap_aka_3gpp2_t *this = malloc_thing(private_eap_aka_3gpp2_t);
|
||||
private_eap_aka_3gpp2_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
this->functions = eap_aka_3gpp2_functions_create();
|
||||
);
|
||||
|
||||
this->functions = eap_aka_3gpp2_functions_create();
|
||||
if (!this->functions)
|
||||
{
|
||||
free(this);
|
||||
|
||||
@@ -22,10 +22,8 @@
|
||||
/* missing in cababilities.h */
|
||||
#define CAP_AUDIT_WRITE 29
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(eap_gtc_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
eap_gtc_plugin_t *this)
|
||||
{
|
||||
charon->eap->remove_method(charon->eap,
|
||||
(eap_constructor_t)eap_gtc_create_server);
|
||||
@@ -39,9 +37,13 @@ static void destroy(eap_gtc_plugin_t *this)
|
||||
*/
|
||||
plugin_t *eap_gtc_plugin_create()
|
||||
{
|
||||
eap_gtc_plugin_t *this = malloc_thing(eap_gtc_plugin_t);
|
||||
eap_gtc_plugin_t *this;
|
||||
|
||||
this->plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
);
|
||||
|
||||
/* required for PAM authentication */
|
||||
charon->keep_cap(charon, CAP_AUDIT_WRITE);
|
||||
|
||||
@@ -19,10 +19,8 @@
|
||||
|
||||
#include <daemon.h>
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(eap_mschapv2_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
eap_mschapv2_plugin_t *this)
|
||||
{
|
||||
charon->eap->remove_method(charon->eap,
|
||||
(eap_constructor_t)eap_mschapv2_create_server);
|
||||
@@ -36,9 +34,13 @@ static void destroy(eap_mschapv2_plugin_t *this)
|
||||
*/
|
||||
plugin_t *eap_mschapv2_plugin_create()
|
||||
{
|
||||
eap_mschapv2_plugin_t *this = malloc_thing(eap_mschapv2_plugin_t);
|
||||
eap_mschapv2_plugin_t *this;
|
||||
|
||||
this->plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
);
|
||||
|
||||
charon->eap->add_method(charon->eap, EAP_MSCHAPV2, 0, EAP_SERVER,
|
||||
(eap_constructor_t)eap_mschapv2_create_server);
|
||||
|
||||
@@ -20,10 +20,8 @@
|
||||
|
||||
#include <daemon.h>
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(eap_sim_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
eap_sim_plugin_t *this)
|
||||
{
|
||||
charon->eap->remove_method(charon->eap,
|
||||
(eap_constructor_t)eap_sim_server_create);
|
||||
@@ -37,9 +35,13 @@ static void destroy(eap_sim_plugin_t *this)
|
||||
*/
|
||||
plugin_t *eap_sim_plugin_create()
|
||||
{
|
||||
eap_sim_plugin_t *this = malloc_thing(eap_sim_plugin_t);
|
||||
eap_sim_plugin_t *this;
|
||||
|
||||
this->plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
);
|
||||
|
||||
charon->eap->add_method(charon->eap, EAP_SIM, 0, EAP_SERVER,
|
||||
(eap_constructor_t)eap_sim_server_create);
|
||||
|
||||
@@ -50,10 +50,8 @@ struct private_eap_sim_file_t {
|
||||
eap_sim_file_triplets_t *triplets;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of eap_sim_file_t.destroy.
|
||||
*/
|
||||
static void destroy(private_eap_sim_file_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_eap_sim_file_t *this)
|
||||
{
|
||||
charon->sim->remove_card(charon->sim, &this->card->card);
|
||||
charon->sim->remove_provider(charon->sim, &this->provider->provider);
|
||||
@@ -68,12 +66,18 @@ static void destroy(private_eap_sim_file_t *this)
|
||||
*/
|
||||
plugin_t *eap_sim_file_plugin_create()
|
||||
{
|
||||
private_eap_sim_file_t *this = malloc_thing(private_eap_sim_file_t);
|
||||
private_eap_sim_file_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.triplets = eap_sim_file_triplets_create(TRIPLET_FILE),
|
||||
.provider = eap_sim_file_provider_create(this->triplets),
|
||||
);
|
||||
|
||||
this->triplets = eap_sim_file_triplets_create(TRIPLET_FILE);
|
||||
this->provider = eap_sim_file_provider_create(this->triplets);
|
||||
if (!this->provider)
|
||||
{
|
||||
this->triplets->destroy(this->triplets);
|
||||
|
||||
@@ -42,10 +42,8 @@ struct private_eap_simaka_pseudonym_t {
|
||||
eap_simaka_pseudonym_provider_t *provider;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of eap_simaka_pseudonym_t.destroy.
|
||||
*/
|
||||
static void destroy(private_eap_simaka_pseudonym_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_eap_simaka_pseudonym_t *this)
|
||||
{
|
||||
charon->sim->remove_card(charon->sim, &this->card->card);
|
||||
charon->sim->remove_provider(charon->sim, &this->provider->provider);
|
||||
@@ -61,11 +59,15 @@ plugin_t *eap_simaka_pseudonym_plugin_create()
|
||||
{
|
||||
private_eap_simaka_pseudonym_t *this;
|
||||
|
||||
this = malloc_thing(private_eap_simaka_pseudonym_t);
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.provider = eap_simaka_pseudonym_provider_create(),
|
||||
);
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
|
||||
this->provider = eap_simaka_pseudonym_provider_create();
|
||||
if (!this->provider)
|
||||
{
|
||||
free(this);
|
||||
|
||||
@@ -42,10 +42,8 @@ struct private_eap_simaka_reauth_t {
|
||||
eap_simaka_reauth_provider_t *provider;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of eap_simaka_reauth_t.destroy.
|
||||
*/
|
||||
static void destroy(private_eap_simaka_reauth_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_eap_simaka_reauth_t *this)
|
||||
{
|
||||
charon->sim->remove_card(charon->sim, &this->card->card);
|
||||
charon->sim->remove_provider(charon->sim, &this->provider->provider);
|
||||
@@ -59,11 +57,17 @@ static void destroy(private_eap_simaka_reauth_t *this)
|
||||
*/
|
||||
plugin_t *eap_simaka_reauth_plugin_create()
|
||||
{
|
||||
private_eap_simaka_reauth_t *this = malloc_thing(private_eap_simaka_reauth_t);
|
||||
private_eap_simaka_reauth_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.provider = eap_simaka_reauth_provider_create(),
|
||||
);
|
||||
|
||||
this->provider = eap_simaka_reauth_provider_create();
|
||||
if (!this->provider)
|
||||
{
|
||||
free(this);
|
||||
|
||||
@@ -146,10 +146,8 @@ static job_requeue_t do_load_test(private_load_tester_plugin_t *this)
|
||||
return JOB_REQUEUE_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(private_load_tester_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_load_tester_plugin_t *this)
|
||||
{
|
||||
this->iterations = -1;
|
||||
this->mutex->lock(this->mutex);
|
||||
@@ -188,32 +186,37 @@ plugin_t *load_tester_plugin_create()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
this = malloc_thing(private_load_tester_plugin_t);
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.delay = lib->settings->get_int(lib->settings,
|
||||
"charon.plugins.load-tester.delay", 0),
|
||||
.iterations = lib->settings->get_int(lib->settings,
|
||||
"charon.plugins.load-tester.iterations", 1),
|
||||
.initiators = lib->settings->get_int(lib->settings,
|
||||
"charon.plugins.load-tester.initiators", 0),
|
||||
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
|
||||
.condvar = condvar_create(CONDVAR_TYPE_DEFAULT),
|
||||
.config = load_tester_config_create(),
|
||||
.creds = load_tester_creds_create(),
|
||||
.listener = load_tester_listener_create(shutdown_on),
|
||||
);
|
||||
|
||||
lib->crypto->add_dh(lib->crypto, MODP_NULL, plugin_name,
|
||||
(dh_constructor_t)load_tester_diffie_hellman_create);
|
||||
charon->backends->add_backend(charon->backends, &this->config->backend);
|
||||
lib->credmgr->add_set(lib->credmgr, &this->creds->credential_set);
|
||||
charon->bus->add_listener(charon->bus, &this->listener->listener);
|
||||
|
||||
this->delay = lib->settings->get_int(lib->settings,
|
||||
"charon.plugins.load-tester.delay", 0);
|
||||
this->iterations = lib->settings->get_int(lib->settings,
|
||||
"charon.plugins.load-tester.iterations", 1);
|
||||
this->initiators = lib->settings->get_int(lib->settings,
|
||||
"charon.plugins.load-tester.initiators", 0);
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"charon.plugins.load-tester.shutdown_when_complete", 0))
|
||||
{
|
||||
shutdown_on = this->iterations * this->initiators;
|
||||
}
|
||||
|
||||
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
|
||||
this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
|
||||
this->config = load_tester_config_create();
|
||||
this->creds = load_tester_creds_create();
|
||||
this->listener = load_tester_listener_create(shutdown_on);
|
||||
charon->backends->add_backend(charon->backends, &this->config->backend);
|
||||
lib->credmgr->add_set(lib->credmgr, &this->creds->credential_set);
|
||||
charon->bus->add_listener(charon->bus, &this->listener->listener);
|
||||
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"charon.plugins.load-tester.fake_kernel", FALSE))
|
||||
|
||||
@@ -54,10 +54,8 @@ struct private_medcli_plugin_t {
|
||||
medcli_listener_t *listener;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(private_medcli_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_medcli_plugin_t *this)
|
||||
{
|
||||
charon->bus->remove_listener(charon->bus, &this->listener->listener);
|
||||
charon->backends->remove_backend(charon->backends, &this->config->backend);
|
||||
@@ -75,9 +73,15 @@ static void destroy(private_medcli_plugin_t *this)
|
||||
plugin_t *medcli_plugin_create()
|
||||
{
|
||||
char *uri;
|
||||
private_medcli_plugin_t *this = malloc_thing(private_medcli_plugin_t);
|
||||
private_medcli_plugin_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"medcli.database", NULL);
|
||||
|
||||
@@ -48,10 +48,8 @@ struct private_medsrv_plugin_t {
|
||||
medsrv_config_t *config;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(private_medsrv_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_medsrv_plugin_t *this)
|
||||
{
|
||||
charon->backends->remove_backend(charon->backends, &this->config->backend);
|
||||
lib->credmgr->remove_set(lib->credmgr, &this->creds->set);
|
||||
@@ -67,9 +65,15 @@ static void destroy(private_medsrv_plugin_t *this)
|
||||
plugin_t *medsrv_plugin_create()
|
||||
{
|
||||
char *uri;
|
||||
private_medsrv_plugin_t *this = malloc_thing(private_medsrv_plugin_t);
|
||||
private_medsrv_plugin_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"medsrv.database", NULL);
|
||||
|
||||
@@ -67,10 +67,8 @@ static job_requeue_t run(private_nm_plugin_t *this)
|
||||
return JOB_REQUEUE_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(private_nm_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_nm_plugin_t *this)
|
||||
{
|
||||
if (this->loop)
|
||||
{
|
||||
@@ -96,22 +94,27 @@ static void destroy(private_nm_plugin_t *this)
|
||||
*/
|
||||
plugin_t *nm_plugin_create()
|
||||
{
|
||||
private_nm_plugin_t *this = malloc_thing(private_nm_plugin_t);
|
||||
private_nm_plugin_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
|
||||
this->loop = NULL;
|
||||
g_type_init ();
|
||||
if (!g_thread_supported())
|
||||
{
|
||||
g_thread_init(NULL);
|
||||
}
|
||||
|
||||
this->creds = nm_creds_create();
|
||||
this->handler = nm_handler_create();
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.creds = nm_creds_create(),
|
||||
.handler = nm_handler_create(),
|
||||
.plugin = nm_strongswan_plugin_new(this->creds, this->handler),
|
||||
);
|
||||
|
||||
hydra->attributes->add_handler(hydra->attributes, &this->handler->handler);
|
||||
lib->credmgr->add_set(lib->credmgr, &this->creds->set);
|
||||
this->plugin = nm_strongswan_plugin_new(this->creds, this->handler);
|
||||
if (!this->plugin)
|
||||
{
|
||||
DBG1(DBG_CFG, "DBUS binding failed");
|
||||
|
||||
@@ -707,10 +707,8 @@ static job_requeue_t dispatch(private_smp_t *this)
|
||||
return JOB_REQUEUE_DIRECT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of itnerface_t.destroy.
|
||||
*/
|
||||
static void destroy(private_smp_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_smp_t *this)
|
||||
{
|
||||
this->job->cancel(this->job);
|
||||
close(this->socket);
|
||||
@@ -723,10 +721,16 @@ static void destroy(private_smp_t *this)
|
||||
plugin_t *smp_plugin_create()
|
||||
{
|
||||
struct sockaddr_un unix_addr = { AF_UNIX, IPSEC_PIDDIR "/charon.xml"};
|
||||
private_smp_t *this = malloc_thing(private_smp_t);
|
||||
private_smp_t *this;
|
||||
mode_t old;
|
||||
|
||||
this->public.plugin.destroy = (void (*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
/* set up unix socket */
|
||||
this->socket = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
||||
@@ -58,10 +58,8 @@ struct private_uci_plugin_t {
|
||||
uci_control_t *control;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(private_uci_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_uci_plugin_t *this)
|
||||
{
|
||||
charon->backends->remove_backend(charon->backends, &this->config->backend);
|
||||
lib->credmgr->remove_set(lib->credmgr, &this->creds->credential_set);
|
||||
@@ -77,14 +75,20 @@ static void destroy(private_uci_plugin_t *this)
|
||||
*/
|
||||
plugin_t *uci_plugin_create()
|
||||
{
|
||||
private_uci_plugin_t *this = malloc_thing(private_uci_plugin_t);
|
||||
private_uci_plugin_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.parser = uci_parser_create(UCI_PACKAGE),
|
||||
.config = uci_config_create(this->parser),
|
||||
.creds = uci_creds_create(this->parser),
|
||||
.control = uci_control_create(),
|
||||
);
|
||||
|
||||
this->parser = uci_parser_create(UCI_PACKAGE);
|
||||
this->config = uci_config_create(this->parser);
|
||||
this->creds = uci_creds_create(this->parser);
|
||||
this->control = uci_control_create();
|
||||
charon->backends->add_backend(charon->backends, &this->config->backend);
|
||||
lib->credmgr->add_set(lib->credmgr, &this->creds->credential_set);
|
||||
|
||||
|
||||
@@ -92,10 +92,8 @@ static void run_tests(private_unit_tester_t *this)
|
||||
success, run, failed, skipped);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of 2007_t.destroy
|
||||
*/
|
||||
static void destroy(private_unit_tester_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_unit_tester_t *this)
|
||||
{
|
||||
free(this);
|
||||
}
|
||||
@@ -105,9 +103,15 @@ static void destroy(private_unit_tester_t *this)
|
||||
*/
|
||||
plugin_t *unit_tester_plugin_create()
|
||||
{
|
||||
private_unit_tester_t *this = malloc_thing(private_unit_tester_t);
|
||||
private_unit_tester_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
run_tests(this);
|
||||
|
||||
|
||||
@@ -36,10 +36,8 @@ struct private_updown_plugin_t {
|
||||
updown_listener_t *listener;
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(private_updown_plugin_t *this)
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_updown_plugin_t *this)
|
||||
{
|
||||
charon->bus->remove_listener(charon->bus, &this->listener->listener);
|
||||
this->listener->destroy(this->listener);
|
||||
@@ -51,11 +49,17 @@ static void destroy(private_updown_plugin_t *this)
|
||||
*/
|
||||
plugin_t *updown_plugin_create()
|
||||
{
|
||||
private_updown_plugin_t *this = malloc_thing(private_updown_plugin_t);
|
||||
private_updown_plugin_t *this;
|
||||
|
||||
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.listener = updown_listener_create(),
|
||||
);
|
||||
|
||||
this->listener = updown_listener_create();
|
||||
charon->bus->add_listener(charon->bus, &this->listener->listener);
|
||||
|
||||
return &this->public.plugin;
|
||||
|
||||
@@ -258,7 +258,7 @@ plugin_loader_t *plugin_loader_create()
|
||||
|
||||
INIT(this,
|
||||
.public = {
|
||||
.load = _load,
|
||||
.load = _load_plugins,
|
||||
.unload = _unload,
|
||||
.create_plugin_enumerator = _create_plugin_enumerator,
|
||||
.destroy = _destroy,
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
#include "xauth_plugin.h"
|
||||
#include "xauth_default_provider.h"
|
||||
#include "xauth_default_verifier.h"
|
||||
/**
|
||||
* Implementation of plugin_t.destroy
|
||||
*/
|
||||
static void destroy(xauth_plugin_t *this)
|
||||
|
||||
METHOD(plugin_t, destroy, void,
|
||||
xauth_plugin_t *this)
|
||||
{
|
||||
free(this);
|
||||
}
|
||||
@@ -31,9 +30,13 @@ static void destroy(xauth_plugin_t *this)
|
||||
*/
|
||||
plugin_t *xauth_plugin_create()
|
||||
{
|
||||
xauth_plugin_t *this = malloc_thing(xauth_plugin_t);
|
||||
xauth_plugin_t *this;
|
||||
|
||||
this->plugin.destroy = (void(*)(plugin_t*))destroy;
|
||||
INIT(this,
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
);
|
||||
|
||||
pluto->xauth->add_provider(pluto->xauth, xauth_default_provider_create());
|
||||
pluto->xauth->add_verifier(pluto->xauth, xauth_default_verifier_create());
|
||||
|
||||
Reference in New Issue
Block a user