Home | History | Annotate | Download | only in rsn_supp

Lines Matching refs:entry

27 	void (*free_cb)(struct rsn_pmksa_cache_entry *entry, void *ctx,
36 static void _pmksa_cache_free_entry(struct rsn_pmksa_cache_entry *entry)
38 os_free(entry);
43 struct rsn_pmksa_cache_entry *entry,
46 wpa_sm_remove_pmkid(pmksa->sm, entry->aa, entry->pmkid);
48 pmksa->free_cb(entry, pmksa->ctx, reason);
49 _pmksa_cache_free_entry(entry);
60 struct rsn_pmksa_cache_entry *entry = pmksa->pmksa;
61 pmksa->pmksa = entry->next;
62 wpa_printf(MSG_DEBUG, "RSN: expired PMKSA cache entry for "
63 MACSTR, MAC2STR(entry->aa));
64 pmksa_cache_free_entry(pmksa, entry, PMKSA_EXPIRE);
82 struct rsn_pmksa_cache_entry *entry;
95 entry = pmksa->sm->cur_pmksa ? pmksa->sm->cur_pmksa :
97 if (entry) {
108 * pmksa_cache_add - Add a PMKSA cache entry
116 * Returns: Pointer to the added PMKSA cache entry or %NULL on error
118 * This function create a PMKSA entry for a new PMK and adds it to the PMKSA
119 * cache. If an old entry is already in the cache for the same Authenticator,
120 * this entry will be replaced with the new entry. PMKID will be calculated
127 struct rsn_pmksa_cache_entry *entry, *pos, *prev;
133 entry = os_zalloc(sizeof(*entry));
134 if (entry == NULL)
136 os_memcpy(entry->pmk, pmk, pmk_len);
137 entry->pmk_len = pmk_len;
138 rsn_pmkid(pmk, pmk_len, aa, spa, entry->pmkid,
141 entry->expiration = now.sec + pmksa->sm->dot11RSNAConfigPMKLifetime;
142 entry->reauth_time = now.sec + pmksa->sm->dot11RSNAConfigPMKLifetime *
144 entry->akmp = akmp;
145 os_memcpy(entry->aa, aa, ETH_ALEN);
146 entry->network_ctx = network_ctx;
148 /* Replace an old entry for the same Authenticator (if found) with the
149 * new entry */
156 os_memcmp(pos->pmkid, entry->pmkid, PMKID_LEN) ==
159 "PMKSA entry");
160 os_free(entry);
171 * flushed so that a new entry can be created based on
177 wpa_printf(MSG_DEBUG, "RSN: Replace PMKSA entry for "
178 "the current AP and any PMKSA cache entry "
191 /* Remove the oldest entry to make room for the new entry */
196 * Never remove the current PMKSA cache entry, since
207 "PMKSA cache entry (for " MACSTR ") to "
214 /* Add the new entry; order by expiration time */
218 if (pos->expiration > entry->expiration)
224 entry->next = pmksa->pmksa;
225 pmksa->pmksa = entry;
228 entry->next = prev->next;
229 prev->next = entry;
232 wpa_printf(MSG_DEBUG, "RSN: Added PMKSA cache entry for " MACSTR
233 " network_ctx=%p", MAC2STR(entry->aa), network_ctx);
234 wpa_sm_add_pmkid(pmksa->sm, entry->aa, entry->pmkid);
236 return entry;
250 struct rsn_pmksa_cache_entry *entry, *prev = NULL, *tmp;
253 entry = pmksa->pmksa;
254 while (entry) {
255 if ((entry->network_ctx == network_ctx ||
258 (pmk_len == entry->pmk_len &&
259 os_memcmp(pmk, entry->pmk, pmk_len) == 0))) {
260 wpa_printf(MSG_DEBUG, "RSN: Flush PMKSA cache entry "
261 "for " MACSTR, MAC2STR(entry->aa));
263 prev->next = entry->next;
265 pmksa->pmksa = entry->next;
266 tmp = entry;
267 entry = entry->next;
271 prev = entry;
272 entry = entry->next;
286 struct rsn_pmksa_cache_entry *entry, *prev;
291 entry = pmksa->pmksa;
293 while (entry) {
294 prev = entry;
295 entry = entry->next;
304 * pmksa_cache_get - Fetch a PMKSA cache entry
309 * Returns: Pointer to PMKSA cache entry or %NULL if no match was found
315 struct rsn_pmksa_cache_entry *entry = pmksa->pmksa;
316 while (entry) {
317 if ((aa == NULL || os_memcmp(entry->aa, aa, ETH_ALEN) == 0) &&
319 os_memcmp(entry->pmkid, pmkid, PMKID_LEN) == 0) &&
320 (network_ctx == NULL || network_ctx == entry->network_ctx))
321 return entry;
322 entry = entry->next;
350 * pmksa_cache_get_opportunistic - Try to get an opportunistic PMKSA entry
354 * Returns: Pointer to a new PMKSA cache entry or %NULL if not available
356 * Try to create a new PMKSA cache entry opportunistically by guessing that the
358 * already an entry in PMKSA cache.
364 struct rsn_pmksa_cache_entry *entry = pmksa->pmksa;
369 while (entry) {
370 if (entry->network_ctx == network_ctx) {
371 entry = pmksa_cache_clone_entry(pmksa, entry, aa);
372 if (entry) {
374 "opportunistic PMKSA cache entry "
377 return entry;
379 entry = entry->next;
386 * pmksa_cache_get_current - Get the current used PMKSA entry
388 * Returns: Pointer to the current PMKSA cache entry or %NULL if not available
399 * pmksa_cache_clear_current - Clear the current PMKSA entry selection
411 * pmksa_cache_set_current - Set the current PMKSA entry selection
417 * Returns: 0 if PMKSA was found or -1 if no matching entry was found
445 wpa_hexdump(MSG_DEBUG, "RSN: PMKSA cache entry found - PMKID",
449 wpa_printf(MSG_DEBUG, "RSN: No PMKSA cache entry found");
468 struct rsn_pmksa_cache_entry *entry;
479 entry = pmksa->pmksa;
480 while (entry) {
483 i, MAC2STR(entry->aa));
487 pos += wpa_snprintf_hex(pos, buf + len - pos, entry->pmkid,
490 (int) (entry->expiration - now.sec),
491 entry->opportunistic);
495 entry = entry->next;
503 * @free_cb: Callback function to be called when a PMKSA cache entry is freed
509 pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,