Migrated all SIM/AKA code to libsimaka, use SIM and AKA backend managers registered by name

This commit is contained in:
Martin Willi
2011-08-08 13:36:56 +02:00
parent 4c199e6f81
commit efee3ed80f
62 changed files with 674 additions and 440 deletions
+33 -8
View File
@@ -19,20 +19,41 @@
#include "eap_sim_peer.h"
#include <daemon.h>
#include <simaka_manager.h>
typedef struct private_eap_sim_plugin_t private_eap_sim_plugin_t;
/**
* Private data of an eap_sim_plugin_t object.
*/
struct private_eap_sim_plugin_t {
/**
* Public interface.
*/
eap_sim_plugin_t public;
/**
* EAP-SIM backend manager
*/
simaka_manager_t *mgr;
};
METHOD(plugin_t, get_name, char*,
eap_sim_plugin_t *this)
private_eap_sim_plugin_t *this)
{
return "eap-sim";
}
METHOD(plugin_t, destroy, void,
eap_sim_plugin_t *this)
private_eap_sim_plugin_t *this)
{
lib->set(lib, "sim-manager", NULL);
charon->eap->remove_method(charon->eap,
(eap_constructor_t)eap_sim_server_create);
charon->eap->remove_method(charon->eap,
(eap_constructor_t)eap_sim_peer_create);
this->mgr->destroy(this->mgr);
free(this);
}
@@ -41,21 +62,25 @@ METHOD(plugin_t, destroy, void,
*/
plugin_t *eap_sim_plugin_create()
{
eap_sim_plugin_t *this;
private_eap_sim_plugin_t *this;
INIT(this,
.plugin = {
.get_name = _get_name,
.reload = (void*)return_false,
.destroy = _destroy,
.public = {
.plugin = {
.get_name = _get_name,
.reload = (void*)return_false,
.destroy = _destroy,
},
},
.mgr = simaka_manager_create(),
);
charon->eap->add_method(charon->eap, EAP_SIM, 0, EAP_SERVER,
(eap_constructor_t)eap_sim_server_create);
charon->eap->add_method(charon->eap, EAP_SIM, 0, EAP_PEER,
(eap_constructor_t)eap_sim_peer_create);
lib->set(lib, "sim-manager", this->mgr);
return &this->plugin;
return &this->public.plugin;
}