xref: /freebsd/contrib/wpa/src/common/privsep_commands.h (revision c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5)
139beb93cSSam Leffler /*
239beb93cSSam Leffler  * WPA Supplicant - privilege separation commands
339beb93cSSam Leffler  * Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
739beb93cSSam Leffler  */
839beb93cSSam Leffler 
939beb93cSSam Leffler #ifndef PRIVSEP_COMMANDS_H
1039beb93cSSam Leffler #define PRIVSEP_COMMANDS_H
1139beb93cSSam Leffler 
1285732ac8SCy Schubert #include "drivers/driver.h"
13325151a3SRui Paulo #include "common/ieee802_11_defs.h"
14325151a3SRui Paulo 
1539beb93cSSam Leffler enum privsep_cmd {
1639beb93cSSam Leffler 	PRIVSEP_CMD_REGISTER,
1739beb93cSSam Leffler 	PRIVSEP_CMD_UNREGISTER,
1839beb93cSSam Leffler 	PRIVSEP_CMD_SCAN,
1939beb93cSSam Leffler 	PRIVSEP_CMD_GET_SCAN_RESULTS,
2039beb93cSSam Leffler 	PRIVSEP_CMD_ASSOCIATE,
2139beb93cSSam Leffler 	PRIVSEP_CMD_GET_BSSID,
2239beb93cSSam Leffler 	PRIVSEP_CMD_GET_SSID,
2339beb93cSSam Leffler 	PRIVSEP_CMD_SET_KEY,
2439beb93cSSam Leffler 	PRIVSEP_CMD_GET_CAPA,
2539beb93cSSam Leffler 	PRIVSEP_CMD_L2_REGISTER,
2639beb93cSSam Leffler 	PRIVSEP_CMD_L2_UNREGISTER,
2739beb93cSSam Leffler 	PRIVSEP_CMD_L2_NOTIFY_AUTH_START,
2839beb93cSSam Leffler 	PRIVSEP_CMD_L2_SEND,
2939beb93cSSam Leffler 	PRIVSEP_CMD_SET_COUNTRY,
30325151a3SRui Paulo 	PRIVSEP_CMD_AUTHENTICATE,
31325151a3SRui Paulo };
32325151a3SRui Paulo 
3385732ac8SCy Schubert #define PRIVSEP_MAX_SCAN_FREQS 50
3485732ac8SCy Schubert 
3585732ac8SCy Schubert struct privsep_cmd_scan {
3685732ac8SCy Schubert 	unsigned int num_ssids;
3785732ac8SCy Schubert 	u8 ssids[WPAS_MAX_SCAN_SSIDS][32];
3885732ac8SCy Schubert 	u8 ssid_lens[WPAS_MAX_SCAN_SSIDS];
3985732ac8SCy Schubert 	unsigned int num_freqs;
4085732ac8SCy Schubert 	u16 freqs[PRIVSEP_MAX_SCAN_FREQS];
4185732ac8SCy Schubert };
4285732ac8SCy Schubert 
4385732ac8SCy Schubert struct privsep_cmd_authenticate {
44325151a3SRui Paulo 	int freq;
45325151a3SRui Paulo 	u8 bssid[ETH_ALEN];
46325151a3SRui Paulo 	u8 ssid[SSID_MAX_LEN];
47325151a3SRui Paulo 	size_t ssid_len;
48325151a3SRui Paulo 	int auth_alg;
49325151a3SRui Paulo 	size_t ie_len;
50325151a3SRui Paulo 	u8 wep_key[4][16];
51325151a3SRui Paulo 	size_t wep_key_len[4];
52325151a3SRui Paulo 	int wep_tx_keyidx;
53325151a3SRui Paulo 	int local_state_change;
54325151a3SRui Paulo 	int p2p;
5585732ac8SCy Schubert 	size_t auth_data_len;
56325151a3SRui Paulo 	/* followed by ie_len bytes of ie */
5785732ac8SCy Schubert 	/* followed by auth_data_len bytes of auth_data */
5839beb93cSSam Leffler };
5939beb93cSSam Leffler 
6085732ac8SCy Schubert struct privsep_cmd_associate {
6139beb93cSSam Leffler 	u8 bssid[ETH_ALEN];
62325151a3SRui Paulo 	u8 ssid[SSID_MAX_LEN];
6339beb93cSSam Leffler 	size_t ssid_len;
645b9c547cSRui Paulo 	int hwmode;
6539beb93cSSam Leffler 	int freq;
665b9c547cSRui Paulo 	int channel;
6739beb93cSSam Leffler 	int pairwise_suite;
6839beb93cSSam Leffler 	int group_suite;
6939beb93cSSam Leffler 	int key_mgmt_suite;
7039beb93cSSam Leffler 	int auth_alg;
7139beb93cSSam Leffler 	int mode;
7239beb93cSSam Leffler 	size_t wpa_ie_len;
7339beb93cSSam Leffler 	/* followed by wpa_ie_len bytes of wpa_ie */
7439beb93cSSam Leffler };
7539beb93cSSam Leffler 
7685732ac8SCy Schubert struct privsep_cmd_set_key {
7739beb93cSSam Leffler 	int alg;
7839beb93cSSam Leffler 	u8 addr[ETH_ALEN];
7939beb93cSSam Leffler 	int key_idx;
8039beb93cSSam Leffler 	int set_tx;
8139beb93cSSam Leffler 	u8 seq[8];
8239beb93cSSam Leffler 	size_t seq_len;
8339beb93cSSam Leffler 	u8 key[32];
8439beb93cSSam Leffler 	size_t key_len;
85*c1d255d3SCy Schubert 	enum key_flag key_flag;
8639beb93cSSam Leffler };
8739beb93cSSam Leffler 
8839beb93cSSam Leffler enum privsep_event {
8939beb93cSSam Leffler 	PRIVSEP_EVENT_SCAN_RESULTS,
9039beb93cSSam Leffler 	PRIVSEP_EVENT_ASSOC,
9139beb93cSSam Leffler 	PRIVSEP_EVENT_DISASSOC,
9239beb93cSSam Leffler 	PRIVSEP_EVENT_ASSOCINFO,
9339beb93cSSam Leffler 	PRIVSEP_EVENT_MICHAEL_MIC_FAILURE,
9439beb93cSSam Leffler 	PRIVSEP_EVENT_INTERFACE_STATUS,
9539beb93cSSam Leffler 	PRIVSEP_EVENT_PMKID_CANDIDATE,
9639beb93cSSam Leffler 	PRIVSEP_EVENT_FT_RESPONSE,
9739beb93cSSam Leffler 	PRIVSEP_EVENT_RX_EAPOL,
98325151a3SRui Paulo 	PRIVSEP_EVENT_SCAN_STARTED,
99325151a3SRui Paulo 	PRIVSEP_EVENT_AUTH,
100325151a3SRui Paulo };
101325151a3SRui Paulo 
102325151a3SRui Paulo struct privsep_event_auth {
103325151a3SRui Paulo 	u8 peer[ETH_ALEN];
104325151a3SRui Paulo 	u8 bssid[ETH_ALEN];
105325151a3SRui Paulo 	u16 auth_type;
106325151a3SRui Paulo 	u16 auth_transaction;
107325151a3SRui Paulo 	u16 status_code;
108325151a3SRui Paulo 	size_t ies_len;
109325151a3SRui Paulo 	/* followed by ies_len bytes of ies */
11039beb93cSSam Leffler };
11139beb93cSSam Leffler 
11239beb93cSSam Leffler #endif /* PRIVSEP_COMMANDS_H */
113