eapol: Add eapol_init and eapol_exit

This commit is contained in:
Denis Kenzior 2015-02-24 11:08:03 -06:00
parent 2e1e484f95
commit 79bf677e71
2 changed files with 21 additions and 0 deletions

View File

@ -31,6 +31,9 @@
#include "crypto.h"
#include "eapol.h"
struct l_hashmap *state_machines;
enum eapol_protocol_version protocol_version = EAPOL_PROTOCOL_VERSION_2004;
#define VERIFY_IS_ZERO(field) \
do { \
unsigned int i; \
@ -477,3 +480,18 @@ void eapol_sm_set_own_rsn(struct eapol_sm *sm, const uint8_t *rsn_ie,
l_free(sm->own_rsn);
sm->own_rsn = l_memdup(rsn_ie, len);
}
bool eapol_init()
{
state_machines = l_hashmap_new();
protocol_version = EAPOL_PROTOCOL_VERSION_2004;
return true;
}
bool eapol_exit()
{
l_hashmap_destroy(state_machines, eapol_sm_destroy);
return true;
}

View File

@ -132,3 +132,6 @@ void eapol_sm_set_ap_rsn(struct eapol_sm *sm, const uint8_t *rsn_ie,
size_t len);
void eapol_sm_set_own_rsn(struct eapol_sm *sm, const uint8_t *rsn_ie,
size_t len);
bool eapol_init();
bool eapol_exit();