Import hostapd 0.5.8
[dragonfly.git] / contrib / hostapd-0.5.8 / pmksa_cache.h
blobdd9074eefa94153e5c4c4ac2a8bf51147a602347
1 /*
2 * hostapd - PMKSA cache for IEEE 802.11i RSN
3 * Copyright (c) 2004-2006, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #ifndef PMKSA_CACHE_H
16 #define PMKSA_CACHE_H
18 /**
19 * struct rsn_pmksa_cache_entry - PMKSA cache entry
21 struct rsn_pmksa_cache_entry {
22 struct rsn_pmksa_cache_entry *next, *hnext;
23 u8 pmkid[PMKID_LEN];
24 u8 pmk[PMK_LEN];
25 size_t pmk_len;
26 os_time_t expiration;
27 int akmp; /* WPA_KEY_MGMT_* */
28 u8 spa[ETH_ALEN];
30 u8 *identity;
31 size_t identity_len;
32 struct radius_class_data radius_class;
33 u8 eap_type_authsrv;
34 int vlan_id;
37 struct rsn_pmksa_cache;
39 struct rsn_pmksa_cache *
40 pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
41 void *ctx), void *ctx);
42 void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa);
43 struct rsn_pmksa_cache_entry * pmksa_cache_get(struct rsn_pmksa_cache *pmksa,
44 const u8 *spa, const u8 *pmkid);
45 struct rsn_pmksa_cache_entry *
46 pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
47 const u8 *aa, const u8 *spa, int session_timeout,
48 struct eapol_state_machine *eapol);
49 void pmksa_cache_to_eapol_data(struct rsn_pmksa_cache_entry *entry,
50 struct eapol_state_machine *eapol);
51 void rsn_pmkid(const u8 *pmk, size_t pmk_len, const u8 *aa, const u8 *spa,
52 u8 *pmkid);
54 #endif /* PMKSA_CACHE_H */