2009-01-15 00:21:55 +01:00
|
|
|
/*
|
|
|
|
* wpa_supplicant - IBSS RSN
|
|
|
|
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2009-01-15 00:21:55 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IBSS_RSN_H
|
|
|
|
#define IBSS_RSN_H
|
|
|
|
|
2009-01-15 23:56:31 +01:00
|
|
|
struct ibss_rsn;
|
|
|
|
|
2013-07-21 14:56:53 +02:00
|
|
|
/* not authenticated */
|
|
|
|
#define IBSS_RSN_AUTH_NOT_AUTHENTICATED 0x00
|
|
|
|
/* remote peer sent an EAPOL message */
|
|
|
|
#define IBSS_RSN_AUTH_EAPOL_BY_PEER 0x01
|
|
|
|
/* we sent an AUTH message with seq 1 */
|
|
|
|
#define IBSS_RSN_AUTH_BY_US 0x02
|
|
|
|
/* we sent an EAPOL message */
|
|
|
|
#define IBSS_RSN_AUTH_EAPOL_BY_US 0x04
|
2013-08-25 22:09:22 +02:00
|
|
|
/* PTK derived as supplicant */
|
|
|
|
#define IBSS_RSN_SET_PTK_SUPP 0x08
|
|
|
|
/* PTK derived as authenticator */
|
|
|
|
#define IBSS_RSN_SET_PTK_AUTH 0x10
|
|
|
|
/* PTK completion reported */
|
|
|
|
#define IBSS_RSN_REPORTED_PTK 0x20
|
2013-07-21 14:56:53 +02:00
|
|
|
|
2009-01-15 00:21:55 +01:00
|
|
|
struct ibss_rsn_peer {
|
|
|
|
struct ibss_rsn_peer *next;
|
2009-01-15 23:56:31 +01:00
|
|
|
struct ibss_rsn *ibss_rsn;
|
2009-01-15 00:21:55 +01:00
|
|
|
|
|
|
|
u8 addr[ETH_ALEN];
|
|
|
|
|
|
|
|
struct wpa_sm *supp;
|
2009-12-26 09:35:08 +01:00
|
|
|
enum wpa_states supp_state;
|
2009-01-17 16:39:57 +01:00
|
|
|
u8 supp_ie[80];
|
|
|
|
size_t supp_ie_len;
|
2009-01-15 00:21:55 +01:00
|
|
|
|
|
|
|
struct wpa_state_machine *auth;
|
2013-07-21 14:56:53 +02:00
|
|
|
int authentication_status;
|
2013-08-27 01:54:35 +02:00
|
|
|
|
2013-12-16 21:08:39 +01:00
|
|
|
struct os_reltime own_auth_tx;
|
2009-01-15 00:21:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ibss_rsn {
|
|
|
|
struct wpa_supplicant *wpa_s;
|
|
|
|
struct wpa_authenticator *auth_group;
|
|
|
|
struct ibss_rsn_peer *peers;
|
|
|
|
u8 psk[PMK_LEN];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-08-13 15:22:53 +02:00
|
|
|
struct ibss_rsn * ibss_rsn_init(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_ssid *ssid);
|
2009-01-15 00:21:55 +01:00
|
|
|
void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn);
|
|
|
|
int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr);
|
2011-03-18 16:04:46 +01:00
|
|
|
void ibss_rsn_stop(struct ibss_rsn *ibss_rsn, const u8 *peermac);
|
2009-01-17 16:25:11 +01:00
|
|
|
int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
|
|
|
|
const u8 *buf, size_t len);
|
2009-01-17 16:47:25 +01:00
|
|
|
void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk);
|
2013-07-21 14:56:53 +02:00
|
|
|
void ibss_rsn_handle_auth(struct ibss_rsn *ibss_rsn, const u8 *auth_frame,
|
|
|
|
size_t len);
|
2009-01-15 00:21:55 +01:00
|
|
|
|
|
|
|
#endif /* IBSS_RSN_H */
|