IBSS RSN: Add peer restart detection
[mech_eap.git] / wpa_supplicant / ibss_rsn.h
1 /*
2  * wpa_supplicant - IBSS RSN
3  * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8
9 #ifndef IBSS_RSN_H
10 #define IBSS_RSN_H
11
12 struct ibss_rsn;
13
14 /* not authenticated */
15 #define IBSS_RSN_AUTH_NOT_AUTHENTICATED 0x00
16 /* remote peer sent an EAPOL message */
17 #define IBSS_RSN_AUTH_EAPOL_BY_PEER     0x01
18 /* we sent an AUTH message with seq 1 */
19 #define IBSS_RSN_AUTH_BY_US             0x02
20 /* we sent an EAPOL message */
21 #define IBSS_RSN_AUTH_EAPOL_BY_US       0x04
22
23 struct ibss_rsn_peer {
24         struct ibss_rsn_peer *next;
25         struct ibss_rsn *ibss_rsn;
26
27         u8 addr[ETH_ALEN];
28
29         struct wpa_sm *supp;
30         enum wpa_states supp_state;
31         u8 supp_ie[80];
32         size_t supp_ie_len;
33
34         struct wpa_state_machine *auth;
35         int authentication_status;
36 };
37
38 struct ibss_rsn {
39         struct wpa_supplicant *wpa_s;
40         struct wpa_authenticator *auth_group;
41         struct ibss_rsn_peer *peers;
42         u8 psk[PMK_LEN];
43 };
44
45
46 struct ibss_rsn * ibss_rsn_init(struct wpa_supplicant *wpa_s);
47 void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn);
48 int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr);
49 void ibss_rsn_stop(struct ibss_rsn *ibss_rsn, const u8 *peermac);
50 int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
51                       const u8 *buf, size_t len);
52 void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk);
53 void ibss_rsn_handle_auth(struct ibss_rsn *ibss_rsn, const u8 *auth_frame,
54                           size_t len);
55
56 #endif /* IBSS_RSN_H */