Migrated all SIM/AKA code to libsimaka, use SIM and AKA backend managers registered by name
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user