Disconnect hostapd from building in base
[dragonfly.git] / contrib / hostapd / src / ap / pmksa_cache_auth.h
CommitLineData
ebfa2275
SZ
1/*
2 * hostapd - PMKSA cache for IEEE 802.11i RSN
4781064b 3 * Copyright (c) 2004-2008, 2012, Jouni Malinen <j@w1.fi>
ebfa2275 4 *
4781064b
JM
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
ebfa2275
SZ
7 */
8
9#ifndef PMKSA_CACHE_H
10#define PMKSA_CACHE_H
11
4781064b
JM
12#include "radius/radius.h"
13
ebfa2275
SZ
14/**
15 * struct rsn_pmksa_cache_entry - PMKSA cache entry
16 */
17struct rsn_pmksa_cache_entry {
18 struct rsn_pmksa_cache_entry *next, *hnext;
19 u8 pmkid[PMKID_LEN];
20 u8 pmk[PMK_LEN];
21 size_t pmk_len;
22 os_time_t expiration;
23 int akmp; /* WPA_KEY_MGMT_* */
24 u8 spa[ETH_ALEN];
25
26 u8 *identity;
27 size_t identity_len;
4781064b 28 struct wpabuf *cui;
ebfa2275
SZ
29 struct radius_class_data radius_class;
30 u8 eap_type_authsrv;
31 int vlan_id;
a875087d 32 int opportunistic;
ebfa2275
SZ
33};
34
35struct rsn_pmksa_cache;
36
37struct rsn_pmksa_cache *
4781064b
JM
38pmksa_cache_auth_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry,
39 void *ctx), void *ctx);
40void pmksa_cache_auth_deinit(struct rsn_pmksa_cache *pmksa);
41struct rsn_pmksa_cache_entry *
42pmksa_cache_auth_get(struct rsn_pmksa_cache *pmksa,
43 const u8 *spa, const u8 *pmkid);
a875087d
JL
44struct rsn_pmksa_cache_entry * pmksa_cache_get_okc(
45 struct rsn_pmksa_cache *pmksa, const u8 *spa, const u8 *aa,
46 const u8 *pmkid);
ebfa2275 47struct rsn_pmksa_cache_entry *
4781064b
JM
48pmksa_cache_auth_add(struct rsn_pmksa_cache *pmksa,
49 const u8 *pmk, size_t pmk_len,
50 const u8 *aa, const u8 *spa, int session_timeout,
51 struct eapol_state_machine *eapol, int akmp);
a875087d
JL
52struct rsn_pmksa_cache_entry *
53pmksa_cache_add_okc(struct rsn_pmksa_cache *pmksa,
54 const struct rsn_pmksa_cache_entry *old_entry,
55 const u8 *aa, const u8 *pmkid);
ebfa2275
SZ
56void pmksa_cache_to_eapol_data(struct rsn_pmksa_cache_entry *entry,
57 struct eapol_state_machine *eapol);
4781064b
JM
58void pmksa_cache_free_entry(struct rsn_pmksa_cache *pmksa,
59 struct rsn_pmksa_cache_entry *entry);
ebfa2275
SZ
60
61#endif /* PMKSA_CACHE_H */