aboutsummaryrefslogtreecommitdiff
path: root/wpa_supplicant/ibss_rsn.h
blob: 67fae2d14ab78b4b5ae6ffd55a087ae2b4de5a44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * wpa_supplicant - IBSS RSN
 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
 *
 * This software may be distributed under the terms of the BSD license.
 * See README for more details.
 */

#ifndef IBSS_RSN_H
#define IBSS_RSN_H

struct ibss_rsn;

/* 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
/* 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

struct ibss_rsn_peer {
	struct ibss_rsn_peer *next;
	struct ibss_rsn *ibss_rsn;

	u8 addr[ETH_ALEN];

	struct wpa_sm *supp;
	enum wpa_states supp_state;
	u8 supp_ie[80];
	size_t supp_ie_len;

	struct wpa_state_machine *auth;
	int authentication_status;

	struct os_reltime own_auth_tx;
};

struct ibss_rsn {
	struct wpa_supplicant *wpa_s;
	struct wpa_authenticator *auth_group;
	struct ibss_rsn_peer *peers;
	u8 psk[PMK_LEN];
};


struct ibss_rsn * ibss_rsn_init(struct wpa_supplicant *wpa_s);
void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn);
int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr);
void ibss_rsn_stop(struct ibss_rsn *ibss_rsn, const u8 *peermac);
int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
		      const u8 *buf, size_t len);
void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk);
void ibss_rsn_handle_auth(struct ibss_rsn *ibss_rsn, const u8 *auth_frame,
			  size_t len);

#endif /* IBSS_RSN_H */