blob: 55ff9a84d69116c4b25113981a61b07fa56d279c [file] [log] [blame]
Roshan Pius9a3a84f2016-09-15 13:02:25 -07001/*
2 * Copyright 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Roshan Pius22ab8b22016-09-28 13:35:42 -070017package android.hardware.wifi.supplicant@1.0;
Roshan Pius9a3a84f2016-09-15 13:02:25 -070018
19/**
Roshan Pius8c6a8772016-11-03 09:37:57 -070020 * Callback Interface exposed by the supplicant service
Roshan Pius39f588f2016-10-31 14:51:27 -070021 * for each station mode interface (ISupplicantStaIface).
Roshan Pius9a3a84f2016-09-15 13:02:25 -070022 *
23 * Clients need to host an instance of this HIDL interface object and
Roshan Pius8c6a8772016-11-03 09:37:57 -070024 * pass a reference of the object to the supplicant via the
Roshan Pius39f588f2016-10-31 14:51:27 -070025 * corresponding |ISupplicantStaIface.registerCallback| method.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070026 */
Roshan Pius39f588f2016-10-31 14:51:27 -070027interface ISupplicantStaIfaceCallback {
Roshan Pius9a3a84f2016-09-15 13:02:25 -070028 /** Various states of the interface reported by |onStateChanged|.*/
29 enum State : uint32_t {
30 /**
31 * This state indicates that client is not associated, but is likely to
32 * start looking for an access point. This state is entered when a
33 * connection is lost.
34 */
35 DISCONNECTED = 0,
36 /**
37 * This state is entered if the network interface is disabled, e.g.,
Roshan Pius8c6a8772016-11-03 09:37:57 -070038 * due to rfkill. the supplicant refuses any new operations that would
Roshan Pius9a3a84f2016-09-15 13:02:25 -070039 * use the radio until the interface has been enabled.
40 */
Roshan Pius39f588f2016-10-31 14:51:27 -070041 IFACE_DISABLED = 1,
Roshan Pius9a3a84f2016-09-15 13:02:25 -070042 /**
43 * This state is entered if there are no enabled networks in the
Roshan Pius8c6a8772016-11-03 09:37:57 -070044 * configuration. the supplicant is not trying to associate with a new
Roshan Pius9a3a84f2016-09-15 13:02:25 -070045 * network and external interaction (e.g., ctrl_iface call to add or
46 * enable a network) is needed to start association.
47 */
48 INACTIVE = 2,
49 /**
Roshan Pius8c6a8772016-11-03 09:37:57 -070050 * This state is entered when the supplicant starts scanning for a
Roshan Pius9a3a84f2016-09-15 13:02:25 -070051 * network.
52 */
53 SCANNING = 3,
54 /**
Roshan Pius8c6a8772016-11-03 09:37:57 -070055 * This state is entered when the supplicant has found a suitable BSS
Roshan Pius9a3a84f2016-09-15 13:02:25 -070056 * to authenticate with and the driver is configured to try to
57 * authenticate with this BSS. This state is used only with drivers
Roshan Pius8c6a8772016-11-03 09:37:57 -070058 * that use the supplicant as the SME.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070059 */
60 AUTHENTICATING = 4,
61 /**
Roshan Pius8c6a8772016-11-03 09:37:57 -070062 * This state is entered when the supplicant has found a suitable BSS
Roshan Pius9a3a84f2016-09-15 13:02:25 -070063 * to associate with and the driver is configured to try to associate
64 * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
65 * state is entered when the driver is configured to try to associate
66 * with a network using the configured SSID and security policy.
67 */
68 ASSOCIATING = 5,
69 /**
70 * This state is entered when the driver reports that association has
71 * been successfully completed with an AP. If IEEE 802.1X is used
Roshan Pius8c6a8772016-11-03 09:37:57 -070072 * (with or without WPA/WPA2), the supplicant remains in this state
Roshan Pius9a3a84f2016-09-15 13:02:25 -070073 * until the IEEE 802.1X/EAPOL authentication has been completed.
74 */
75 ASSOCIATED = 6,
76 /**
77 * This state is entered when WPA/WPA2 4-Way Handshake is started. In
78 * case of WPA-PSK, this happens when receiving the first EAPOL-Key
79 * frame after association. In case of WPA-EAP, this state is entered
80 * when the IEEE 802.1X/EAPOL authentication has been completed.
81 */
82 FOURWAY_HANDSHAKE = 7,
83 /**
84 * This state is entered when 4-Way Key Handshake has been completed
85 * (i.e., when the supplicant sends out message 4/4) and when Group
86 * Key rekeying is started by the AP (i.e., when supplicant receives
87 * message 1/2).
88 */
89 GROUP_HANDSHAKE = 8,
90 /**
91 * This state is entered when the full authentication process is
92 * completed. In case of WPA2, this happens when the 4-Way Handshake is
93 * successfully completed. With WPA, this state is entered after the
94 * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
95 * completed after dynamic keys are received (or if not used, after
96 * the EAP authentication has been completed). With static WEP keys and
97 * plaintext connections, this state is entered when an association
98 * has been completed.
99 *
100 * This state indicates that the supplicant has completed its
101 * processing for the association phase and that data connection is
102 * fully configured.
103 */
104 COMPLETED = 9
105 };
106
107 /**
Roshan Piusb76dbbe2016-11-09 09:55:42 -0800108 * OSU Method. Refer to section 4.8.1.3 of the Hotspot 2.0 spec.
109 */
110 enum OsuMethod : uint8_t {
111 OMA_DM = 0,
112 SOAP_XML_SPP = 1
113 };
114
115 /**
116 * ANQP data for IEEE Std 802.11u-2011.
117 * The format of the data within these elements follows the IEEE
118 * Std 802.11u-2011 standard.
119 */
120 struct AnqpData {
121 vec<uint8_t> venueName;
122 vec<uint8_t> roamingConsortium;
123 vec<uint8_t> ipAddrTypeAvailability;
124 vec<uint8_t> naiRealm;
125 vec<uint8_t> anqp3gppCellularNetwork;
126 vec<uint8_t> domainName;
127 };
128
129 /**
130 * ANQP data for Hotspot 2.0.
131 * The format of the data within these elements follows the Hotspot 2.0
132 * standard.
133 */
134 struct Hs20AnqpData {
135 vec<uint8_t> operatorFriendlyName;
136 vec<uint8_t> wanMetrics;
137 vec<uint8_t> connectionCapability;
138 vec<uint8_t> osuProvidersList;
139 };
140
141 /**
Roshan Pius08e6bba2017-01-10 14:10:19 -0800142 * WPS Configuration Error.
143 */
144 enum WpsConfigError : uint16_t {
145 NO_ERROR = 0,
146 OOB_IFACE_READ_ERROR = 1,
147 DECRYPTION_CRC_FAILURE = 2,
148 CHAN_24_NOT_SUPPORTED = 3,
149 CHAN_50_NOT_SUPPORTED = 4,
150 SIGNAL_TOO_WEAK = 5,
151 NETWORK_AUTH_FAILURE = 6,
152 NETWORK_ASSOC_FAILURE = 7,
153 NO_DHCP_RESPONSE = 8,
154 FAILED_DHCP_CONFIG = 9,
155 IP_ADDR_CONFLICT = 10,
156 NO_CONN_TO_REGISTRAR = 11,
157 MULTIPLE_PBC_DETECTED = 12,
158 ROGUE_SUSPECTED = 13,
159 DEVICE_BUSY = 14,
160 SETUP_LOCKED = 15,
161 MSG_TIMEOUT = 16,
162 REG_SESS_TIMEOUT = 17,
163 DEV_PASSWORD_AUTH_FAILURE = 18,
164 CHAN_60G_NOT_SUPPORTED = 19,
165 PUBLIC_KEY_HASH_MISMATCH = 20
166 };
167
168 /**
169 * Vendor specific Error Indication for WPS event messages.
170 */
171 enum WpsErrorIndication : uint16_t {
172 NO_ERROR = 0,
173 SECURITY_TKIP_ONLY_PROHIBITED = 1,
174 SECURITY_WEP_PROHIBITED = 2,
175 AUTH_FAILURE = 3
176 };
177
178 /**
Roshan Pius9a3a84f2016-09-15 13:02:25 -0700179 * Used to indicate that a new network has been added.
180 *
181 * @param id Network ID allocated to the corresponding network.
182 */
183 oneway onNetworkAdded(SupplicantNetworkId id);
184
185 /**
186 * Used to indicate that a network has been removed.
187 *
188 * @param id Network ID allocated to the corresponding network.
189 */
190 oneway onNetworkRemoved(SupplicantNetworkId id);
191
192 /**
193 * Used to indicate a state change event on this particular iface. If this
194 * event is triggered by a particular network, the |SupplicantNetworkId|,
195 * |ssid|, |bssid| parameters must indicate the parameters of the network/AP
196 * which cased this state transition.
197 *
198 * @param newState New State of the interface. This must be one of the |State|
199 * values above.
200 * @param bssid BSSID of the corresponding AP which caused this state
201 * change event. This must be zero'ed if this event is not
202 * specific to a particular network.
203 * @param id ID of the corresponding network which caused this
204 * state change event. This must be invalid (UINT32_MAX) if this
205 * event is not specific to a particular network.
206 * @param ssid SSID of the corresponding network which caused this state
207 * change event. This must be empty if this event is not specific
208 * to a particular network.
209 */
210 oneway onStateChanged(
211 State newState, Bssid bssid, SupplicantNetworkId id, Ssid ssid);
Roshan Piusb76dbbe2016-11-09 09:55:42 -0800212
213 /**
214 * Used to indicate the result of ANQP (either for IEEE 802.11u Interworking
215 * or Hotspot 2.0) query.
216 *
217 * @param macAddress MAC address of the access point.
218 * @param data ANQP data fetched from the access point.
219 * All the fields in this struct must be empty if the query failed.
220 * @param hs20Data ANQP data fetched from the Hotspot 2.0 access point.
221 * All the fields in this struct must be empty if the query failed.
222 */
223 oneway onAnqpQueryDone(MacAddress macAddress,
224 AnqpData data,
225 Hs20AnqpData hs20Data);
226
227 /**
228 * Used to indicate the result of Hotspot 2.0 Icon query.
229 *
230 * @param macAddress MAC address of the access point.
231 * @param fileName Name of the file that was requested.
232 * @param data Icon data fetched from the access point.
233 * Must be empty if the query failed.
234 */
235 oneway onHs20IconQueryDone(MacAddress macAddress,
236 string fileName,
237 vec<uint8_t> data);
238
239 /**
240 * Used to indicate a Hotspot 2.0 subscription remediation event.
241 *
242 * @param osuMethod OSU method.
243 * @param url URL of the server.
244 */
245 oneway onHs20SubscriptionRemediation(OsuMethod osuMethod, string url);
246
247 /**
248 * Used to indicate a Hotspot 2.0 imminent deauth notice.
Roshan Piusd11fc7e2016-12-12 13:04:25 -0800249 *
Roshan Pius9e01c512016-11-16 10:29:37 -0800250 * @param reasonCode Code to indicate the deauth reason.
Roshan Piusb76dbbe2016-11-09 09:55:42 -0800251 * Refer to section 3.2.1.2 of the Hotspot 2.0 spec.
252 * @param reAuthDelayInSec Delay before reauthenticating.
253 * @param url URL of the server.
254 */
Roshan Pius9e01c512016-11-16 10:29:37 -0800255 oneway onHs20DeauthImminentNotice(uint32_t reasonCode,
Roshan Piusb76dbbe2016-11-09 09:55:42 -0800256 uint32_t reAuthDelayInSec,
257 string url);
Roshan Piusd11fc7e2016-12-12 13:04:25 -0800258
259 /**
260 * Used to indicate a disconnect from the currently connected
261 * network on this iface,.
262 *
263 * @param bssid BSSID of the AP from which we disconnected.
264 * @param locallyGenerated If the disconnect was triggered by
265 * wpa_supplicant.
266 * @param reasonCode 802.11 code to indicate the disconnect reason
267 * from access point. Refer to section 8.4.1.7 of IEEE802.11 spec.
268 */
269 oneway onDisconnected(
270 Bssid bssid, bool locallyGenerated, uint32_t reasonCode);
271
272 /**
273 * Used to indicate an association rejection recieved from the AP
274 * to which the connection is being attempted.
275 *
276 * @param bssid BSSID of the corresponding AP which sent this
277 * reject.
278 * @param statusCode 802.11 code to indicate the reject reason.
279 * Refer to section 8.4.1.9 of IEEE 802.11 spec.
280 */
281 oneway onAssociationRejected(Bssid bssid, uint32_t statusCode);
Roshan Pius08e6bba2017-01-10 14:10:19 -0800282
283 /**
284 * Used to indicate the success of a WPS connection attempt.
285 */
286 oneway onWpsEventSuccess();
287
288 /**
289 * Used to indicate the failure of a WPS connection attempt.
290 *
291 * @param bssid BSSID of the AP to which we initiated WPS
292 * connection.
293 * @param configError Configuration error code.
294 * @param errorInd Error indication code.
295 */
296 oneway onWpsEventFail(
297 Bssid bssid, WpsConfigError configError, WpsErrorIndication errorInd);
298
299 /**
300 * Used to indicate the overlap of a WPS PBC connection attempt.
301 */
302 oneway onWpsEventPbcOverlap();
Roshan Pius9a3a84f2016-09-15 13:02:25 -0700303};