Lines Matching defs: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);
167 wpa_printf(MSG_DEBUG, "RSN: Replace PMKSA entry for "
174 * flushed so that a new entry can be created based on
185 /* Remove the oldest entry to make room for the new entry */
190 * Never remove the current PMKSA cache entry, since
201 "PMKSA cache entry (for " MACSTR ") to "
208 /* Add the new entry; order by expiration time */
212 if (pos->expiration > entry->expiration)
218 entry->next = pmksa->pmksa;
219 pmksa->pmksa = entry;
222 entry->next = prev->next;
223 prev->next = entry;
226 wpa_printf(MSG_DEBUG, "RSN: Added PMKSA cache entry for " MACSTR
227 " network_ctx=%p", MAC2STR(entry->aa), network_ctx);
228 wpa_sm_add_pmkid(pmksa->sm, entry->aa, entry->pmkid);
230 return entry;
241 struct rsn_pmksa_cache_entry *entry, *prev = NULL, *tmp;
244 entry = pmksa->pmksa;
245 while (entry) {
246 if (entry->network_ctx == network_ctx || network_ctx == NULL) {
247 wpa_printf(MSG_DEBUG, "RSN: Flush PMKSA cache entry "
248 "for " MACSTR, MAC2STR(entry->aa));
250 prev->next = entry->next;
252 pmksa->pmksa = entry->next;
253 tmp = entry;
254 entry = entry->next;
258 prev = entry;
259 entry = entry->next;
273 struct rsn_pmksa_cache_entry *entry, *prev;
278 entry = pmksa->pmksa;
280 while (entry) {
281 prev = entry;
282 entry = entry->next;
291 * pmksa_cache_get - Fetch a PMKSA cache entry
296 * Returns: Pointer to PMKSA cache entry or %NULL if no match was found
302 struct rsn_pmksa_cache_entry *entry = pmksa->pmksa;
303 while (entry) {
304 if ((aa == NULL || os_memcmp(entry->aa, aa, ETH_ALEN) == 0) &&
306 os_memcmp(entry->pmkid, pmkid, PMKID_LEN) == 0) &&
307 (network_ctx == NULL || network_ctx == entry->network_ctx))
308 return entry;
309 entry = entry->next;
337 * pmksa_cache_get_opportunistic - Try to get an opportunistic PMKSA entry
341 * Returns: Pointer to a new PMKSA cache entry or %NULL if not available
343 * Try to create a new PMKSA cache entry opportunistically by guessing that the
345 * already an entry in PMKSA cache.
351 struct rsn_pmksa_cache_entry *entry = pmksa->pmksa;
356 while (entry) {
357 if (entry->network_ctx == network_ctx) {
358 entry = pmksa_cache_clone_entry(pmksa, entry, aa);
359 if (entry) {
361 "opportunistic PMKSA cache entry "
364 return entry;
366 entry = entry->next;
373 * pmksa_cache_get_current - Get the current used PMKSA entry
375 * Returns: Pointer to the current PMKSA cache entry or %NULL if not available
386 * pmksa_cache_clear_current - Clear the current PMKSA entry selection
398 * pmksa_cache_set_current - Set the current PMKSA entry selection
404 * Returns: 0 if PMKSA was found or -1 if no matching entry was found
432 wpa_hexdump(MSG_DEBUG, "RSN: PMKSA cache entry found - PMKID",
436 wpa_printf(MSG_DEBUG, "RSN: No PMKSA cache entry found");
455 struct rsn_pmksa_cache_entry *entry;
466 entry = pmksa->pmksa;
467 while (entry) {
470 i, MAC2STR(entry->aa));
474 pos += wpa_snprintf_hex(pos, buf + len - pos, entry->pmkid,
477 (int) (entry->expiration - now.sec),
478 entry->opportunistic);
482 entry = entry->next;
490 * @free_cb: Callback function to be called when a PMKSA cache entry is freed
496 pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,