removed trailing spaces ([[:space:]]+$)
This commit is contained in:
@@ -25,22 +25,22 @@ typedef struct eap_entry_t eap_entry_t;
|
||||
* EAP constructor entry
|
||||
*/
|
||||
struct eap_entry_t {
|
||||
|
||||
|
||||
/**
|
||||
* EAP method type, vendor specific if vendor is set
|
||||
*/
|
||||
eap_type_t type;
|
||||
|
||||
|
||||
/**
|
||||
* vendor ID, 0 for default EAP methods
|
||||
*/
|
||||
u_int32_t vendor;
|
||||
|
||||
|
||||
/**
|
||||
* Role of the method returned by the constructor, EAP_SERVER or EAP_PEER
|
||||
*/
|
||||
eap_role_t role;
|
||||
|
||||
|
||||
/**
|
||||
* constructor function to create instance
|
||||
*/
|
||||
@@ -56,12 +56,12 @@ struct private_eap_manager_t {
|
||||
* public functions
|
||||
*/
|
||||
eap_manager_t public;
|
||||
|
||||
|
||||
/**
|
||||
* list of eap_entry_t's
|
||||
*/
|
||||
linked_list_t *methods;
|
||||
|
||||
|
||||
/**
|
||||
* rwlock to lock methods
|
||||
*/
|
||||
@@ -76,7 +76,7 @@ static void add_method(private_eap_manager_t *this, eap_type_t type,
|
||||
eap_constructor_t constructor)
|
||||
{
|
||||
eap_entry_t *entry = malloc_thing(eap_entry_t);
|
||||
|
||||
|
||||
entry->type = type;
|
||||
entry->vendor = vendor;
|
||||
entry->role = role;
|
||||
@@ -94,7 +94,7 @@ static void remove_method(private_eap_manager_t *this, eap_constructor_t constru
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
eap_entry_t *entry;
|
||||
|
||||
|
||||
this->lock->write_lock(this->lock);
|
||||
enumerator = this->methods->create_enumerator(this->methods);
|
||||
while (enumerator->enumerate(enumerator, &entry))
|
||||
@@ -120,7 +120,7 @@ static eap_method_t* create_instance(private_eap_manager_t *this,
|
||||
enumerator_t *enumerator;
|
||||
eap_entry_t *entry;
|
||||
eap_method_t *method = NULL;
|
||||
|
||||
|
||||
this->lock->read_lock(this->lock);
|
||||
enumerator = this->methods->create_enumerator(this->methods);
|
||||
while (enumerator->enumerate(enumerator, &entry))
|
||||
@@ -156,15 +156,15 @@ static void destroy(private_eap_manager_t *this)
|
||||
eap_manager_t *eap_manager_create()
|
||||
{
|
||||
private_eap_manager_t *this = malloc_thing(private_eap_manager_t);
|
||||
|
||||
|
||||
this->public.add_method = (void(*)(eap_manager_t*, eap_type_t type, u_int32_t vendor, eap_role_t role, eap_constructor_t constructor))add_method;
|
||||
this->public.remove_method = (void(*)(eap_manager_t*, eap_constructor_t constructor))remove_method;
|
||||
this->public.create_instance = (eap_method_t*(*)(eap_manager_t*, eap_type_t type, u_int32_t vendor, eap_role_t role, identification_t*,identification_t*))create_instance;
|
||||
this->public.destroy = (void(*)(eap_manager_t*))destroy;
|
||||
|
||||
|
||||
this->methods = linked_list_create();
|
||||
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
|
||||
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,14 +45,14 @@ struct eap_manager_t {
|
||||
*/
|
||||
void (*add_method)(eap_manager_t *this, eap_type_t type, u_int32_t vendor,
|
||||
eap_role_t role, eap_constructor_t constructor);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister a EAP method implementation using it's constructor.
|
||||
*
|
||||
* @param constructor constructor function to remove, as added in add_method
|
||||
*/
|
||||
void (*remove_method)(eap_manager_t *this, eap_constructor_t constructor);
|
||||
|
||||
|
||||
/**
|
||||
* Create a new EAP method instance.
|
||||
*
|
||||
@@ -67,7 +67,7 @@ struct eap_manager_t {
|
||||
u_int32_t vendor, eap_role_t role,
|
||||
identification_t *server,
|
||||
identification_t *peer);
|
||||
|
||||
|
||||
/**
|
||||
* Destroy a eap_manager instance.
|
||||
*/
|
||||
|
||||
@@ -53,7 +53,7 @@ eap_type_t eap_type_from_string(char *name)
|
||||
{"mschapv2", EAP_MSCHAPV2},
|
||||
{"radius", EAP_RADIUS},
|
||||
};
|
||||
|
||||
|
||||
for (i = 0; i < countof(types); i++)
|
||||
{
|
||||
if (strcaseeq(name, types[i].name))
|
||||
|
||||
@@ -107,7 +107,7 @@ extern enum_name_t *eap_code_names;
|
||||
* EAP-Identity exchange always uses identifier 0.
|
||||
*/
|
||||
struct eap_method_t {
|
||||
|
||||
|
||||
/**
|
||||
* Initiate the EAP exchange.
|
||||
*
|
||||
@@ -121,7 +121,7 @@ struct eap_method_t {
|
||||
* - FAILED, if unable to create eap request payload
|
||||
*/
|
||||
status_t (*initiate) (eap_method_t *this, eap_payload_t **out);
|
||||
|
||||
|
||||
/**
|
||||
* Process a received EAP message.
|
||||
*
|
||||
@@ -136,7 +136,7 @@ struct eap_method_t {
|
||||
*/
|
||||
status_t (*process) (eap_method_t *this, eap_payload_t *in,
|
||||
eap_payload_t **out);
|
||||
|
||||
|
||||
/**
|
||||
* Get the EAP type implemented in this method.
|
||||
*
|
||||
@@ -144,17 +144,17 @@ struct eap_method_t {
|
||||
* @return type of the EAP method
|
||||
*/
|
||||
eap_type_t (*get_type) (eap_method_t *this, u_int32_t *vendor);
|
||||
|
||||
|
||||
/**
|
||||
* Check if this EAP method authenticates the server.
|
||||
*
|
||||
* Some EAP methods provide mutual authentication and
|
||||
* Some EAP methods provide mutual authentication and
|
||||
* allow authentication using only EAP, if the peer supports it.
|
||||
*
|
||||
* @return TRUE if methods provides mutual authentication
|
||||
*/
|
||||
bool (*is_mutual) (eap_method_t *this);
|
||||
|
||||
|
||||
/**
|
||||
* Get the MSK established by this EAP method.
|
||||
*
|
||||
@@ -167,7 +167,7 @@ struct eap_method_t {
|
||||
* - FAILED, if MSK not established (yet)
|
||||
*/
|
||||
status_t (*get_msk) (eap_method_t *this, chunk_t *msk);
|
||||
|
||||
|
||||
/**
|
||||
* Destroys a eap_method_t object.
|
||||
*/
|
||||
|
||||
@@ -23,17 +23,17 @@ typedef struct private_sim_manager_t private_sim_manager_t;
|
||||
* Private data of an sim_manager_t object.
|
||||
*/
|
||||
struct private_sim_manager_t {
|
||||
|
||||
|
||||
/**
|
||||
* Public sim_manager_t interface.
|
||||
*/
|
||||
sim_manager_t public;
|
||||
|
||||
|
||||
/**
|
||||
* list of added cards
|
||||
*/
|
||||
linked_list_t *cards;
|
||||
|
||||
|
||||
/**
|
||||
* list of added provider
|
||||
*/
|
||||
@@ -106,7 +106,7 @@ static void destroy(private_sim_manager_t *this)
|
||||
sim_manager_t *sim_manager_create()
|
||||
{
|
||||
private_sim_manager_t *this = malloc_thing(private_sim_manager_t);
|
||||
|
||||
|
||||
this->public.add_card = (void(*)(sim_manager_t*, sim_card_t *card))add_card;
|
||||
this->public.remove_card = (void(*)(sim_manager_t*, sim_card_t *card))remove_card;
|
||||
this->public.create_card_enumerator = (enumerator_t*(*)(sim_manager_t*))create_card_enumerator;
|
||||
@@ -114,10 +114,10 @@ sim_manager_t *sim_manager_create()
|
||||
this->public.remove_provider = (void(*)(sim_manager_t*, sim_provider_t *provider))remove_provider;
|
||||
this->public.create_provider_enumerator = (enumerator_t*(*)(sim_manager_t*))create_provider_enumerator;
|
||||
this->public.destroy = (void(*)(sim_manager_t*))destroy;
|
||||
|
||||
|
||||
this->cards = linked_list_create();
|
||||
this->provider = linked_list_create();
|
||||
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ struct sim_card_t {
|
||||
* @return identity
|
||||
*/
|
||||
identification_t* (*get_imsi)(sim_card_t *this);
|
||||
|
||||
|
||||
/**
|
||||
* Calculate SRES/KC from a RAND.
|
||||
*
|
||||
@@ -59,7 +59,7 @@ struct sim_card_t {
|
||||
* Interface for a triplet provider (used as EAP server).
|
||||
*/
|
||||
struct sim_provider_t {
|
||||
|
||||
|
||||
/**
|
||||
* Get a single triplet to authenticate a EAP client.
|
||||
*
|
||||
@@ -77,49 +77,49 @@ struct sim_provider_t {
|
||||
* The EAP-SIM manager handles multiple SIM cards and providers.
|
||||
*/
|
||||
struct sim_manager_t {
|
||||
|
||||
|
||||
/**
|
||||
* Register a SIM card (client) at the manager.
|
||||
*
|
||||
* @param card sim card to register
|
||||
*/
|
||||
void (*add_card)(sim_manager_t *this, sim_card_t *card);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister a previously registered card from the manager.
|
||||
*
|
||||
* @param card sim card to unregister
|
||||
*/
|
||||
void (*remove_card)(sim_manager_t *this, sim_card_t *card);
|
||||
|
||||
|
||||
/**
|
||||
* Create an enumerator over all registered cards.
|
||||
*
|
||||
* @return enumerator over sim_card_t's
|
||||
*/
|
||||
enumerator_t* (*create_card_enumerator)(sim_manager_t *this);
|
||||
|
||||
|
||||
/**
|
||||
* Register a triplet provider (server) at the manager.
|
||||
*
|
||||
* @param card sim card to register
|
||||
*/
|
||||
void (*add_provider)(sim_manager_t *this, sim_provider_t *provider);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister a previously registered provider from the manager.
|
||||
*
|
||||
* @param card sim card to unregister
|
||||
*/
|
||||
void (*remove_provider)(sim_manager_t *this, sim_provider_t *provider);
|
||||
|
||||
|
||||
/**
|
||||
* Create an enumerator over all registered provider.
|
||||
*
|
||||
* @return enumerator over sim_provider_t's
|
||||
*/
|
||||
enumerator_t* (*create_provider_enumerator)(sim_manager_t *this);
|
||||
|
||||
|
||||
/**
|
||||
* Destroy a manager instance.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user