blob: dd5e7db8f98c04de49b5a21538d3af6cb9c626e2 [file] [log] [blame]
Hai Shalom60840252021-02-19 19:02:11 -08001/*
2 * RSN PTKSA cache interface
3 *
4 * Copyright (C) 2019 Intel Corporation
5 *
6 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
8 */
9
10#ifndef PTKSA_CACHE_H
11#define PTKSA_CACHE_H
12
13#include "wpa_common.h"
14#include "defs.h"
15#include "list.h"
16
17/**
18 * struct ptksa_cache_entry - PTKSA cache entry
19 */
20struct ptksa_cache_entry {
21 struct dl_list list;
22 struct wpa_ptk ptk;
23 os_time_t expiration;
24 u32 cipher;
25 u8 addr[ETH_ALEN];
Sunil Ravi89eba102022-09-13 21:04:37 -070026 u8 own_addr[ETH_ALEN];
27 void (*cb)(struct ptksa_cache_entry *e);
28 void *ctx;
Sunil Ravi38ad1ed2023-01-17 23:58:31 +000029 u32 akmp;
Hai Shalom60840252021-02-19 19:02:11 -080030};
31
Hai Shalom60840252021-02-19 19:02:11 -080032
33struct ptksa_cache;
34
35struct ptksa_cache * ptksa_cache_init(void);
36void ptksa_cache_deinit(struct ptksa_cache *ptksa);
37struct ptksa_cache_entry * ptksa_cache_get(struct ptksa_cache *ptksa,
38 const u8 *addr, u32 cipher);
39int ptksa_cache_list(struct ptksa_cache *ptksa, char *buf, size_t len);
40struct ptksa_cache_entry * ptksa_cache_add(struct ptksa_cache *ptksa,
Sunil Ravi89eba102022-09-13 21:04:37 -070041 const u8 *own_addr,
Hai Shalom60840252021-02-19 19:02:11 -080042 const u8 *addr, u32 cipher,
43 u32 life_time,
Sunil Ravi89eba102022-09-13 21:04:37 -070044 const struct wpa_ptk *ptk,
45 void (*cb)
46 (struct ptksa_cache_entry *e),
Sunil Ravi38ad1ed2023-01-17 23:58:31 +000047 void *ctx, u32 akmp);
Hai Shalom60840252021-02-19 19:02:11 -080048void ptksa_cache_flush(struct ptksa_cache *ptksa, const u8 *addr, u32 cipher);
49
Hai Shalom60840252021-02-19 19:02:11 -080050#endif /* PTKSA_CACHE_H */