blob: 77423ed46eccd1012bf51f9bd42d947e2d17be3c [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 /**
108 * Used to indicate that a new network has been added.
109 *
110 * @param id Network ID allocated to the corresponding network.
111 */
112 oneway onNetworkAdded(SupplicantNetworkId id);
113
114 /**
115 * Used to indicate that a network has been removed.
116 *
117 * @param id Network ID allocated to the corresponding network.
118 */
119 oneway onNetworkRemoved(SupplicantNetworkId id);
120
121 /**
122 * Used to indicate a state change event on this particular iface. If this
123 * event is triggered by a particular network, the |SupplicantNetworkId|,
124 * |ssid|, |bssid| parameters must indicate the parameters of the network/AP
125 * which cased this state transition.
126 *
127 * @param newState New State of the interface. This must be one of the |State|
128 * values above.
129 * @param bssid BSSID of the corresponding AP which caused this state
130 * change event. This must be zero'ed if this event is not
131 * specific to a particular network.
132 * @param id ID of the corresponding network which caused this
133 * state change event. This must be invalid (UINT32_MAX) if this
134 * event is not specific to a particular network.
135 * @param ssid SSID of the corresponding network which caused this state
136 * change event. This must be empty if this event is not specific
137 * to a particular network.
138 */
139 oneway onStateChanged(
140 State newState, Bssid bssid, SupplicantNetworkId id, Ssid ssid);
141};