Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * wpa_supplicant - IBSS RSN |
| 3 | * Copyright (c) 2009, Jouni Malinen <j@w1.fi> |
| 4 | * |
Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef IBSS_RSN_H |
| 10 | #define IBSS_RSN_H |
| 11 | |
| 12 | struct ibss_rsn; |
| 13 | |
Dmitry Shmidt | c2ebb4b | 2013-07-24 12:57:51 -0700 | [diff] [blame] | 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 |
Dmitry Shmidt | b7b4d0e | 2013-08-26 12:09:05 -0700 | [diff] [blame] | 22 | /* PTK derived as supplicant */ |
| 23 | #define IBSS_RSN_SET_PTK_SUPP 0x08 |
| 24 | /* PTK derived as authenticator */ |
| 25 | #define IBSS_RSN_SET_PTK_AUTH 0x10 |
| 26 | /* PTK completion reported */ |
| 27 | #define IBSS_RSN_REPORTED_PTK 0x20 |
Dmitry Shmidt | c2ebb4b | 2013-07-24 12:57:51 -0700 | [diff] [blame] | 28 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 29 | struct ibss_rsn_peer { |
| 30 | struct ibss_rsn_peer *next; |
| 31 | struct ibss_rsn *ibss_rsn; |
| 32 | |
| 33 | u8 addr[ETH_ALEN]; |
| 34 | |
| 35 | struct wpa_sm *supp; |
| 36 | enum wpa_states supp_state; |
| 37 | u8 supp_ie[80]; |
| 38 | size_t supp_ie_len; |
| 39 | |
| 40 | struct wpa_state_machine *auth; |
Dmitry Shmidt | c2ebb4b | 2013-07-24 12:57:51 -0700 | [diff] [blame] | 41 | int authentication_status; |
Dmitry Shmidt | 92c368d | 2013-08-29 12:37:21 -0700 | [diff] [blame] | 42 | |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 43 | struct os_reltime own_auth_tx; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | struct ibss_rsn { |
| 47 | struct wpa_supplicant *wpa_s; |
| 48 | struct wpa_authenticator *auth_group; |
| 49 | struct ibss_rsn_peer *peers; |
| 50 | u8 psk[PMK_LEN]; |
| 51 | }; |
| 52 | |
| 53 | |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 54 | struct ibss_rsn * ibss_rsn_init(struct wpa_supplicant *wpa_s, |
| 55 | struct wpa_ssid *ssid); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 56 | void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn); |
| 57 | int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr); |
| 58 | void ibss_rsn_stop(struct ibss_rsn *ibss_rsn, const u8 *peermac); |
| 59 | int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr, |
| 60 | const u8 *buf, size_t len); |
| 61 | void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk); |
Dmitry Shmidt | c2ebb4b | 2013-07-24 12:57:51 -0700 | [diff] [blame] | 62 | void ibss_rsn_handle_auth(struct ibss_rsn *ibss_rsn, const u8 *auth_frame, |
| 63 | size_t len); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 64 | |
| 65 | #endif /* IBSS_RSN_H */ |