ibss_rsn.h revision b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15
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 12struct 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/* 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 28 29struct 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; 41 int authentication_status; 42}; 43 44struct ibss_rsn { 45 struct wpa_supplicant *wpa_s; 46 struct wpa_authenticator *auth_group; 47 struct ibss_rsn_peer *peers; 48 u8 psk[PMK_LEN]; 49}; 50 51 52struct ibss_rsn * ibss_rsn_init(struct wpa_supplicant *wpa_s); 53void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn); 54int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr); 55void ibss_rsn_stop(struct ibss_rsn *ibss_rsn, const u8 *peermac); 56int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr, 57 const u8 *buf, size_t len); 58void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk); 59void ibss_rsn_handle_auth(struct ibss_rsn *ibss_rsn, const u8 *auth_frame, 60 size_t len); 61 62#endif /* IBSS_RSN_H */ 63