diff options
author | Martin Willi <martin@strongswan.org> | 2009-03-24 10:24:58 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-03-24 10:24:58 +0000 |
commit | 4a6b84a93461b5ef7a3ad491c1894418db2c555b (patch) | |
tree | 4b532a5b23d5d250158b44f00cd0f914359da5d2 /src/charon/plugins/eap_radius/eap_radius_plugin.c | |
parent | 623bca407be12418fbaccdca977546ed4853e36e (diff) | |
download | strongswan-4a6b84a93461b5ef7a3ad491c1894418db2c555b.tar.bz2 strongswan-4a6b84a93461b5ef7a3ad491c1894418db2c555b.tar.xz |
reintegrated eap-radius branch into trunk
Diffstat (limited to 'src/charon/plugins/eap_radius/eap_radius_plugin.c')
-rw-r--r-- | src/charon/plugins/eap_radius/eap_radius_plugin.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/charon/plugins/eap_radius/eap_radius_plugin.c b/src/charon/plugins/eap_radius/eap_radius_plugin.c new file mode 100644 index 000000000..a429859a7 --- /dev/null +++ b/src/charon/plugins/eap_radius/eap_radius_plugin.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2009 Martin Willi + * Hochschule fuer Technik Rapperswil + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * $Id$ + */ + +#include "eap_radius_plugin.h" + +#include "eap_radius.h" +#include "radius_client.h" + +#include <daemon.h> + +/** + * Implementation of plugin_t.destroy + */ +static void destroy(eap_radius_plugin_t *this) +{ + charon->eap->remove_method(charon->eap, (eap_constructor_t)eap_radius_create); + radius_client_cleanup(); + free(this); +} + +/* + * see header file + */ +plugin_t *plugin_create() +{ + eap_radius_plugin_t *this; + + if (!radius_client_init()) + { + DBG1(DBG_CFG, "RADIUS plugin initialization failed"); + return NULL; + } + + this = malloc_thing(eap_radius_plugin_t); + this->plugin.destroy = (void(*)(plugin_t*))destroy; + + charon->eap->add_method(charon->eap, EAP_RADIUS, 0, + EAP_SERVER, (eap_constructor_t)eap_radius_create); + + return &this->plugin; +} + |