summaryrefslogtreecommitdiffstats
blob: 4b201d4161171bddc00bbd90f2365aabbdde8852 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
/*
 * Copyright 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.wifi.supplicant@1.0;

/**
 * Callback Interface exposed by the supplicant service
 * for each station mode interface (ISupplicantStaIface).
 *
 * Clients need to host an instance of this HIDL interface object and
 * pass a reference of the object to the supplicant via the
 * corresponding |ISupplicantStaIface.registerCallback| method.
 */
interface ISupplicantStaIfaceCallback {
  /** Various states of the interface reported by |onStateChanged|.*/
  enum State : uint32_t {
    /**
     * This state indicates that client is not associated, but is likely to
     * start looking for an access point. This state is entered when a
     * connection is lost.
     */
    DISCONNECTED = 0,
    /**
     * This state is entered if the network interface is disabled, e.g.,
     * due to rfkill. the supplicant refuses any new operations that would
     * use the radio until the interface has been enabled.
     */
    IFACE_DISABLED = 1,
    /**
     * This state is entered if there are no enabled networks in the
     * configuration. the supplicant is not trying to associate with a new
     * network and external interaction (e.g., ctrl_iface call to add or
     * enable a network) is needed to start association.
     */
    INACTIVE = 2,
    /**
     * This state is entered when the supplicant starts scanning for a
     * network.
     */
    SCANNING = 3,
    /**
     * This state is entered when the supplicant has found a suitable BSS
     * to authenticate with and the driver is configured to try to
     * authenticate with this BSS. This state is used only with drivers
     * that use the supplicant as the SME.
     */
    AUTHENTICATING = 4,
    /**
     * This state is entered when the supplicant has found a suitable BSS
     * to associate with and the driver is configured to try to associate
     * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
     * state is entered when the driver is configured to try to associate
     * with a network using the configured SSID and security policy.
     */
    ASSOCIATING = 5,
    /**
     * This state is entered when the driver reports that association has
     * been successfully completed with an AP. If IEEE 802.1X is used
     * (with or without WPA/WPA2), the supplicant remains in this state
     * until the IEEE 802.1X/EAPOL authentication has been completed.
     */
    ASSOCIATED = 6,
    /**
     * This state is entered when WPA/WPA2 4-Way Handshake is started. In
     * case of WPA-PSK, this happens when receiving the first EAPOL-Key
     * frame after association. In case of WPA-EAP, this state is entered
     * when the IEEE 802.1X/EAPOL authentication has been completed.
     */
    FOURWAY_HANDSHAKE = 7,
    /**
     * This state is entered when 4-Way Key Handshake has been completed
     * (i.e., when the supplicant sends out message 4/4) and when Group
     * Key rekeying is started by the AP (i.e., when supplicant receives
     * message 1/2).
     */
    GROUP_HANDSHAKE = 8,
    /**
     * This state is entered when the full authentication process is
     * completed. In case of WPA2, this happens when the 4-Way Handshake is
     * successfully completed. With WPA, this state is entered after the
     * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
     * completed after dynamic keys are received (or if not used, after
     * the EAP authentication has been completed). With static WEP keys and
     * plaintext connections, this state is entered when an association
     * has been completed.
     *
     * This state indicates that the supplicant has completed its
     * processing for the association phase and that data connection is
     * fully configured.
     */
    COMPLETED = 9
  };

  /**
   * OSU Method. Refer to section 4.8.1.3 of the Hotspot 2.0 spec.
   */
  enum OsuMethod : uint8_t {
    OMA_DM = 0,
    SOAP_XML_SPP = 1
  };

  /**
   * ANQP data for IEEE Std 802.11u-2011.
   * The format of the data within these elements follows the IEEE
   * Std 802.11u-2011 standard.
   */
  struct AnqpData {
    vec<uint8_t> venueName;
    vec<uint8_t> roamingConsortium;
    vec<uint8_t> ipAddrTypeAvailability;
    vec<uint8_t> naiRealm;
    vec<uint8_t> anqp3gppCellularNetwork;
    vec<uint8_t> domainName;
  };

  /**
   * ANQP data for Hotspot 2.0.
   * The format of the data within these elements follows the Hotspot 2.0
   * standard.
   */
  struct Hs20AnqpData {
    vec<uint8_t> operatorFriendlyName;
    vec<uint8_t> wanMetrics;
    vec<uint8_t> connectionCapability;
    vec<uint8_t> osuProvidersList;
  };

  /**
   * WPS Configuration Error.
   */
  enum WpsConfigError : uint16_t {
    NO_ERROR = 0,
    OOB_IFACE_READ_ERROR = 1,
    DECRYPTION_CRC_FAILURE = 2,
    CHAN_24_NOT_SUPPORTED = 3,
    CHAN_50_NOT_SUPPORTED = 4,
    SIGNAL_TOO_WEAK = 5,
    NETWORK_AUTH_FAILURE = 6,
    NETWORK_ASSOC_FAILURE = 7,
    NO_DHCP_RESPONSE = 8,
    FAILED_DHCP_CONFIG = 9,
    IP_ADDR_CONFLICT = 10,
    NO_CONN_TO_REGISTRAR = 11,
    MULTIPLE_PBC_DETECTED = 12,
    ROGUE_SUSPECTED = 13,
    DEVICE_BUSY = 14,
    SETUP_LOCKED = 15,
    MSG_TIMEOUT = 16,
    REG_SESS_TIMEOUT = 17,
    DEV_PASSWORD_AUTH_FAILURE = 18,
    CHAN_60G_NOT_SUPPORTED = 19,
    PUBLIC_KEY_HASH_MISMATCH = 20
  };

  /**
   * Vendor specific Error Indication for WPS event messages.
   */
  enum WpsErrorIndication : uint16_t {
    NO_ERROR = 0,
    SECURITY_TKIP_ONLY_PROHIBITED = 1,
    SECURITY_WEP_PROHIBITED = 2,
    AUTH_FAILURE = 3
  };

  /**
   * Used to indicate that a new network has been added.
   *
   * @param id Network ID allocated to the corresponding network.
   */
  oneway onNetworkAdded(SupplicantNetworkId id);

  /**
   * Used to indicate that a network has been removed.
   *
   * @param id Network ID allocated to the corresponding network.
   */
  oneway onNetworkRemoved(SupplicantNetworkId id);

  /**
   * Used to indicate a state change event on this particular iface. If this
   * event is triggered by a particular network, the |SupplicantNetworkId|,
   * |ssid|, |bssid| parameters must indicate the parameters of the network/AP
   * which cased this state transition.
   *
   * @param newState New State of the interface. This must be one of the |State|
   *        values above.
   * @param bssid BSSID of the corresponding AP which caused this state
   *        change event. This must be zero'ed if this event is not
   *        specific to a particular network.
   * @param id ID of the corresponding network which caused this
   *        state change event. This must be invalid (UINT32_MAX) if this
   *        event is not specific to a particular network.
   * @param ssid SSID of the corresponding network which caused this state
   *        change event. This must be empty if this event is not specific
   *        to a particular network.
   */
  oneway onStateChanged(
      State newState, Bssid bssid, SupplicantNetworkId id, Ssid ssid);

  /**
   * Used to indicate the result of ANQP (either for IEEE 802.11u Interworking
   * or Hotspot 2.0) query.
   *
   * @param macAddress MAC address of the access point.
   * @param data ANQP data fetched from the access point.
   *        All the fields in this struct must be empty if the query failed.
   * @param hs20Data ANQP data fetched from the Hotspot 2.0 access point.
   *        All the fields in this struct must be empty if the query failed.
   */
  oneway onAnqpQueryDone(MacAddress macAddress,
                         AnqpData data,
                         Hs20AnqpData hs20Data);

  /**
   * Used to indicate the result of Hotspot 2.0 Icon query.
   *
   * @param macAddress MAC address of the access point.
   * @param fileName Name of the file that was requested.
   * @param data Icon data fetched from the access point.
   *        Must be empty if the query failed.
   */
  oneway onHs20IconQueryDone(MacAddress macAddress,
                             string fileName,
                             vec<uint8_t> data);

  /**
   * Used to indicate a Hotspot 2.0 subscription remediation event.
   *
   * @param osuMethod OSU method.
   * @param url URL of the server.
   */
  oneway onHs20SubscriptionRemediation(OsuMethod osuMethod, string url);

  /**
   * Used to indicate a Hotspot 2.0 imminent deauth notice.
   *
   * @param reasonCode Code to indicate the deauth reason.
   *        Refer to section 3.2.1.2 of the Hotspot 2.0 spec.
   * @param reAuthDelayInSec Delay before reauthenticating.
   * @param url URL of the server.
   */
  oneway onHs20DeauthImminentNotice(uint32_t reasonCode,
                                    uint32_t reAuthDelayInSec,
                                    string url);

  /**
   * Used to indicate the connection to a new network on this iface.
   *
   * @param bssid BSSID of the AP to which we connected.
   */
  oneway onConnected(Bssid bssid);

  /**
   * Used to indicate the disconnection from the currently connected
   * network on this iface.
   *
   * @param bssid BSSID of the AP from which we disconnected.
   * @param locallyGenerated If the disconnect was triggered by
   *        wpa_supplicant.
   * @param reasonCode 802.11 code to indicate the disconnect reason
   *        from access point. Refer to section 8.4.1.7 of IEEE802.11 spec.
   */
  oneway onDisconnected(
          Bssid bssid, bool locallyGenerated, uint32_t reasonCode);

  /**
   * Used to indicate the completion of association to an AP.
   *
   * @param bssid BSSID of the corresponding AP.
   */
  oneway onAssociationCompleted(Bssid bssid);

  /**
   * Used to indicate an association rejection recieved from the AP
   * to which the connection is being attempted.
   *
   * @param bssid BSSID of the corresponding AP which sent this
   *        reject.
   * @param statusCode 802.11 code to indicate the reject reason.
   *        Refer to section 8.4.1.9 of IEEE 802.11 spec.
   */
  oneway onAssociationRejected(Bssid bssid, uint32_t statusCode);

  /**
   * Used to indicate the timeout of authentication to an AP.
   *
   * @param bssid BSSID of the corresponding AP.
   */
  oneway onAuthenticationTimeout(Bssid bssid);

  /**
   * Used to indicate an EAP authentication failure.
   */
  oneway onEapFailure();

  /**
   * Used to indicate the success of a WPS connection attempt.
   */
  oneway onWpsEventSuccess();

  /**
   * Used to indicate the failure of a WPS connection attempt.
   *
   * @param bssid BSSID of the AP to which we initiated WPS
   *        connection.
   * @param configError Configuration error code.
   * @param errorInd Error indication code.
   */
  oneway onWpsEventFail(
      Bssid bssid, WpsConfigError configError, WpsErrorIndication errorInd);

  /**
   * Used to indicate the overlap of a WPS PBC connection attempt.
   */
  oneway onWpsEventPbcOverlap();
};