blob: d2c4bbd5e8b65f221290b52640691fbdd39ec8b0 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * WPA Supplicant - privilege separation commands
3 * Copyright (c) 2007-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 PRIVSEP_COMMANDS_H
10#define PRIVSEP_COMMANDS_H
11
12#include "drivers/driver.h"
13#include "common/ieee802_11_defs.h"
14
15enum privsep_cmd {
16 PRIVSEP_CMD_REGISTER,
17 PRIVSEP_CMD_UNREGISTER,
18 PRIVSEP_CMD_SCAN,
19 PRIVSEP_CMD_GET_SCAN_RESULTS,
20 PRIVSEP_CMD_ASSOCIATE,
21 PRIVSEP_CMD_GET_BSSID,
22 PRIVSEP_CMD_GET_SSID,
23 PRIVSEP_CMD_SET_KEY,
24 PRIVSEP_CMD_GET_CAPA,
25 PRIVSEP_CMD_L2_REGISTER,
26 PRIVSEP_CMD_L2_UNREGISTER,
27 PRIVSEP_CMD_L2_NOTIFY_AUTH_START,
28 PRIVSEP_CMD_L2_SEND,
29 PRIVSEP_CMD_SET_COUNTRY,
30 PRIVSEP_CMD_AUTHENTICATE,
31};
32
33#define PRIVSEP_MAX_SCAN_FREQS 50
34
35struct privsep_cmd_scan {
36 unsigned int num_ssids;
37 u8 ssids[WPAS_MAX_SCAN_SSIDS][32];
38 u8 ssid_lens[WPAS_MAX_SCAN_SSIDS];
39 unsigned int num_freqs;
40 u16 freqs[PRIVSEP_MAX_SCAN_FREQS];
41};
42
43struct privsep_cmd_authenticate {
44 int freq;
45 u8 bssid[ETH_ALEN];
46 u8 ssid[SSID_MAX_LEN];
47 size_t ssid_len;
48 int auth_alg;
49 size_t ie_len;
50 u8 wep_key[4][16];
51 size_t wep_key_len[4];
52 int wep_tx_keyidx;
53 int local_state_change;
54 int p2p;
55 size_t auth_data_len;
56 /* followed by ie_len bytes of ie */
57 /* followed by auth_data_len bytes of auth_data */
58};
59
60struct privsep_cmd_associate {
61 u8 bssid[ETH_ALEN];
62 u8 ssid[SSID_MAX_LEN];
63 size_t ssid_len;
64 int hwmode;
65 int freq;
66 int channel;
67 int pairwise_suite;
68 int group_suite;
69 int key_mgmt_suite;
70 int auth_alg;
71 int mode;
72 size_t wpa_ie_len;
73 /* followed by wpa_ie_len bytes of wpa_ie */
74};
75
76struct privsep_cmd_set_key {
77 int alg;
78 u8 addr[ETH_ALEN];
79 int key_idx;
80 int set_tx;
81 u8 seq[8];
82 size_t seq_len;
83 u8 key[32];
84 size_t key_len;
85 enum key_flag key_flag;
86};
87
88enum privsep_event {
89 PRIVSEP_EVENT_SCAN_RESULTS,
90 PRIVSEP_EVENT_ASSOC,
91 PRIVSEP_EVENT_DISASSOC,
92 PRIVSEP_EVENT_ASSOCINFO,
93 PRIVSEP_EVENT_MICHAEL_MIC_FAILURE,
94 PRIVSEP_EVENT_INTERFACE_STATUS,
95 PRIVSEP_EVENT_PMKID_CANDIDATE,
96 PRIVSEP_EVENT_FT_RESPONSE,
97 PRIVSEP_EVENT_RX_EAPOL,
98 PRIVSEP_EVENT_SCAN_STARTED,
99 PRIVSEP_EVENT_AUTH,
100};
101
102struct privsep_event_auth {
103 u8 peer[ETH_ALEN];
104 u8 bssid[ETH_ALEN];
105 u16 auth_type;
106 u16 auth_transaction;
107 u16 status_code;
108 size_t ies_len;
109 /* followed by ies_len bytes of ies */
110};
111
112#endif /* PRIVSEP_COMMANDS_H */