• Home
  • Raw
  • Download

Lines Matching refs:ptksa

18 	struct dl_list ptksa;  member
22 static void ptksa_cache_set_expiration(struct ptksa_cache *ptksa);
25 static void ptksa_cache_free_entry(struct ptksa_cache *ptksa, in ptksa_cache_free_entry() argument
28 ptksa->n_ptksa--; in ptksa_cache_free_entry()
37 struct ptksa_cache *ptksa = eloop_ctx; in ptksa_cache_expire() local
41 if (!ptksa) in ptksa_cache_expire()
46 dl_list_for_each_safe(e, next, &ptksa->ptksa, in ptksa_cache_expire()
54 ptksa_cache_free_entry(ptksa, e); in ptksa_cache_expire()
57 ptksa_cache_set_expiration(ptksa); in ptksa_cache_expire()
61 static void ptksa_cache_set_expiration(struct ptksa_cache *ptksa) in ptksa_cache_set_expiration() argument
67 eloop_cancel_timeout(ptksa_cache_expire, ptksa, NULL); in ptksa_cache_set_expiration()
69 if (!ptksa || !ptksa->n_ptksa) in ptksa_cache_set_expiration()
72 e = dl_list_first(&ptksa->ptksa, struct ptksa_cache_entry, list); in ptksa_cache_set_expiration()
81 eloop_register_timeout(sec + 1, 0, ptksa_cache_expire, ptksa, NULL); in ptksa_cache_set_expiration()
92 struct ptksa_cache *ptksa = os_zalloc(sizeof(struct ptksa_cache)); in ptksa_cache_init() local
96 if (ptksa) in ptksa_cache_init()
97 dl_list_init(&ptksa->ptksa); in ptksa_cache_init()
99 return ptksa; in ptksa_cache_init()
107 void ptksa_cache_deinit(struct ptksa_cache *ptksa) in ptksa_cache_deinit() argument
111 if (!ptksa) in ptksa_cache_deinit()
114 wpa_printf(MSG_DEBUG, "PTKSA: Deinit. n_ptksa=%u", ptksa->n_ptksa); in ptksa_cache_deinit()
116 dl_list_for_each_safe(e, next, &ptksa->ptksa, in ptksa_cache_deinit()
118 ptksa_cache_free_entry(ptksa, e); in ptksa_cache_deinit()
120 eloop_cancel_timeout(ptksa_cache_expire, ptksa, NULL); in ptksa_cache_deinit()
121 os_free(ptksa); in ptksa_cache_deinit()
132 struct ptksa_cache_entry * ptksa_cache_get(struct ptksa_cache *ptksa, in ptksa_cache_get() argument
137 if (!ptksa) in ptksa_cache_get()
140 dl_list_for_each(e, &ptksa->ptksa, struct ptksa_cache_entry, list) { in ptksa_cache_get()
160 int ptksa_cache_list(struct ptksa_cache *ptksa, char *buf, size_t len) in ptksa_cache_list() argument
167 if (!ptksa) in ptksa_cache_list()
178 dl_list_for_each(e, &ptksa->ptksa, struct ptksa_cache_entry, list) { in ptksa_cache_list()
228 void ptksa_cache_flush(struct ptksa_cache *ptksa, const u8 *addr, u32 cipher) in ptksa_cache_flush() argument
233 if (!ptksa) in ptksa_cache_flush()
236 dl_list_for_each_safe(e, next, &ptksa->ptksa, struct ptksa_cache_entry, in ptksa_cache_flush()
244 ptksa_cache_free_entry(ptksa, e); in ptksa_cache_flush()
250 ptksa_cache_set_expiration(ptksa); in ptksa_cache_flush()
267 struct ptksa_cache_entry * ptksa_cache_add(struct ptksa_cache *ptksa, in ptksa_cache_add() argument
275 if (!ptksa || !ptk || !addr || !life_time || cipher == WPA_CIPHER_NONE) in ptksa_cache_add()
279 ptksa_cache_flush(ptksa, addr, cipher); in ptksa_cache_add()
282 if (ptksa->n_ptksa >= PTKSA_CACHE_MAX_ENTRIES) in ptksa_cache_add()
298 dl_list_for_each(tmp, &ptksa->ptksa, struct ptksa_cache_entry, list) { in ptksa_cache_add()
309 dl_list_add(&ptksa->ptksa, &entry->list); in ptksa_cache_add()
315 ptksa->n_ptksa++; in ptksa_cache_add()