2
* wpa_supplicant - WPA2/RSN PMKSA cache functions
3
* Copyright (c) 2003-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
12
* See README and COPYING for more details.
19
* struct rsn_pmksa_cache_entry - PMKSA cache entry
21
struct rsn_pmksa_cache_entry {
22
struct rsn_pmksa_cache_entry *next;
27
int akmp; /* WPA_KEY_MGMT_* */
30
os_time_t reauth_time;
31
struct wpa_ssid *ssid;
35
struct rsn_pmksa_cache;
37
#if defined(IEEE8021X_EAPOL) && !defined(CONFIG_NO_WPA2)
39
struct rsn_pmksa_cache *
40
pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
41
void *ctx, int replace),
42
void *ctx, struct wpa_sm *sm);
43
void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa);
44
struct rsn_pmksa_cache_entry * pmksa_cache_get(struct rsn_pmksa_cache *pmksa,
45
const u8 *aa, const u8 *pmkid);
46
int pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
47
struct rsn_pmksa_cache_entry *
48
pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
49
const u8 *aa, const u8 *spa, struct wpa_ssid *ssid);
50
void pmksa_cache_notify_reconfig(struct rsn_pmksa_cache *pmksa);
51
struct rsn_pmksa_cache_entry * pmksa_cache_get_current(struct wpa_sm *sm);
52
void pmksa_cache_clear_current(struct wpa_sm *sm);
53
int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
54
const u8 *bssid, struct wpa_ssid *ssid,
55
int try_opportunistic);
56
struct rsn_pmksa_cache_entry *
57
pmksa_cache_get_opportunistic(struct rsn_pmksa_cache *pmksa,
58
struct wpa_ssid *ssid, const u8 *aa);
60
#else /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
62
static inline struct rsn_pmksa_cache *
63
pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
64
void *ctx, int replace),
65
void *ctx, struct wpa_sm *sm)
70
static inline void pmksa_cache_deinit(struct rsn_pmksa_cache *pmksa)
74
static inline struct rsn_pmksa_cache_entry *
75
pmksa_cache_get(struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *pmkid)
80
static inline struct rsn_pmksa_cache_entry *
81
pmksa_cache_get_current(struct wpa_sm *sm)
86
static inline int pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len)
91
static inline struct rsn_pmksa_cache_entry *
92
pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len,
93
const u8 *aa, const u8 *spa, struct wpa_ssid *ssid)
98
static inline void pmksa_cache_notify_reconfig(struct rsn_pmksa_cache *pmksa)
102
static inline void pmksa_cache_clear_current(struct wpa_sm *sm)
106
static inline int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
108
struct wpa_ssid *ssid,
109
int try_opportunistic)
114
#endif /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
116
#endif /* PMKSA_CACHE_H */