1/*
2 * Copyright 2018 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
17package android.hardware.wifi.supplicant@1.2;
18
19import @1.0::ISupplicantStaNetworkCallback;
20import @1.0::ISupplicantStaNetwork;
21import @1.0::SupplicantStatus;
22import @1.1::ISupplicantStaNetwork;
23
24/**
25 * Interface exposed by the supplicant for each station mode network
26 * configuration it controls.
27 */
28interface ISupplicantStaNetwork extends @1.1::ISupplicantStaNetwork {
29    /** Possble mask of values for KeyMgmt param. */
30    enum KeyMgmtMask : @1.0::ISupplicantStaNetwork.KeyMgmtMask {
31        /** WPA using EAP authentication with stronger SHA256-based algorithms */
32        WPA_EAP_SHA256 = 1 << 7,
33
34        /** WPA pre-shared key with stronger SHA256-based algorithms */
35        WPA_PSK_SHA256 = 1 << 8,
36
37        /** WPA3-Personal SAE Key management */
38        SAE = 1 << 10,
39
40        /** WPA3-Enterprise Suite-B Key management */
41        SUITE_B_192 = 1 << 17,
42
43        /** Enhacned Open (OWE) Key management */
44        OWE = 1 << 22,
45
46        /** Easy Connect (DPP) Key management */
47        DPP = 1 << 23,
48    };
49
50    /** Possble mask of values for PairwiseCipher param. */
51    enum PairwiseCipherMask : @1.0::ISupplicantStaNetwork.PairwiseCipherMask {
52        /** GCMP-256 Pairwise Cipher */
53        GCMP_256 = 1 << 8,
54    };
55
56    /** Possble mask of values for GroupCipher param. */
57    enum GroupCipherMask : @1.0::ISupplicantStaNetwork.GroupCipherMask {
58        /** GCMP-256 Group Cipher */
59        GCMP_256 = 1 << 8,
60    };
61
62    /** Possble mask of values for GroupMgmtCipher param. */
63    enum GroupMgmtCipherMask : uint32_t {
64        /** BIP_GMAC-128 Group Management Cipher */
65        BIP_GMAC_128 = 1 << 11,
66
67        /** BIP_GMAC-256 Group Management Cipher */
68        BIP_GMAC_256 = 1 << 12,
69
70        /** BIP_CMAC-256 Group Management Cipher */
71        BIP_CMAC_256 = 1 << 13,
72    };
73
74    /**
75     * Set key management mask for the network.
76     *
77     * @param keyMgmtMask value to set.
78     *        Combination of |KeyMgmtMask| values.
79     * @return status Status of the operation.
80     *         Possible status codes:
81     *         |SupplicantStatusCode.SUCCESS|,
82     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
83     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
84     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
85     */
86    setKeyMgmt_1_2(bitfield<KeyMgmtMask> keyMgmtMask) generates (SupplicantStatus status);
87
88    /**
89     * Get the key mgmt mask set for the network.
90     *
91     * @return status Status of the operation.
92     *         Possible status codes:
93     *         |SupplicantStatusCode.SUCCESS|,
94     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
95     * @return keyMgmtMask Combination of |KeyMgmtMask| values.
96     */
97    getKeyMgmt_1_2()
98        generates (SupplicantStatus status, bitfield<KeyMgmtMask> keyMgmtMask);
99
100    /**
101     * Set pairwise cipher mask for the network.
102     *
103     * @param pairwiseCipherMask value to set.
104     *        Combination of |PairwiseCipherMask| values.
105     * @return status Status of the operation.
106     *         Possible status codes:
107     *         |SupplicantStatusCode.SUCCESS|,
108     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
109     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
110     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
111     */
112    setPairwiseCipher_1_2(bitfield<PairwiseCipherMask> pairwiseCipherMask)
113        generates (SupplicantStatus status);
114
115    /**
116     * Get the pairwise cipher mask set for the network.
117     *
118     * @return status Status of the operation.
119     *         Possible status codes:
120     *         |SupplicantStatusCode.SUCCESS|,
121     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
122     * @return pairwiseCipherMask Combination of |PairwiseCipherMask| values.
123     */
124    getPairwiseCipher_1_2()
125        generates (SupplicantStatus status,
126            bitfield<PairwiseCipherMask> pairwiseCipherMask);
127
128    /**
129     * Set group cipher mask for the network.
130     *
131     * @param groupCipherMask value to set.
132     *        Combination of |GroupCipherMask| values.
133     * @return status Status of the operation.
134     *         Possible status codes:
135     *         |SupplicantStatusCode.SUCCESS|,
136     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
137     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
138     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
139     */
140    setGroupCipher_1_2(bitfield<GroupCipherMask> groupCipherMask)
141        generates (SupplicantStatus status);
142
143    /**
144     * Get the group cipher mask set for the network.
145     *
146     * @return status Status of the operation.
147     *         Possible status codes:
148     *         |SupplicantStatusCode.SUCCESS|,
149     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
150     * @return groupCipherMask Combination of |GroupCipherMask| values.
151     */
152    getGroupCipher_1_2()
153        generates (SupplicantStatus status,
154            bitfield<GroupCipherMask> groupCipherMask);
155
156    /**
157     * Set group management cipher mask for the network.
158     *
159     * @param groupMgmtCipherMask value to set.
160     *        Combination of |GroupMgmtCipherMask| values.
161     * @return status Status of the operation.
162     *         Possible status codes:
163     *         |SupplicantStatusCode.SUCCESS|,
164     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
165     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
166     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
167     */
168    setGroupMgmtCipher(bitfield<GroupMgmtCipherMask> groupMgmtCipherMask)
169        generates (SupplicantStatus status);
170
171    /**
172     * Get the group management cipher mask set for the network.
173     *
174     * @return status Status of the operation.
175     *         Possible status codes:
176     *         |SupplicantStatusCode.SUCCESS|,
177     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
178     * @return groupMgmtCipherMask Combination of |GroupMgmtCipherMask| values.
179     */
180    getGroupMgmtCipher()
181        generates (SupplicantStatus status,
182            bitfield<GroupMgmtCipherMask> groupMgmtCipherMask);
183
184    /**
185     * Enable TLS Suite-B in EAP Phase1
186     *
187     * @param enable Set to true to enable TLS Suite-B in EAP phase1
188     *
189     * @return status Status of the operation.
190     *         Possible status codes:
191     *         |SupplicantStatusCode.SUCCESS|,
192     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
193     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
194     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
195     */
196    enableTlsSuiteBEapPhase1Param(bool enable)
197        generates (SupplicantStatus status);
198
199    /**
200     * Set EAP OpenSSL Suite-B-192 ciphers for WPA3-Enterprise
201     *        Supported option:
202     *
203     * @return status Status of the operation.
204     *         Possible status codes:
205     *         |SupplicantStatusCode.SUCCESS|,
206     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
207     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
208     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
209     */
210    enableSuiteBEapOpenSslCiphers()
211        generates (SupplicantStatus status);
212
213    /**
214     * Get SAE password for WPA3-Personal
215     *
216     * @return status Status of the operation, and a string.
217     *         Possible status codes:
218     *         |SupplicantStatusCode.SUCCESS|,
219     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
220     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
221     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
222     */
223    getSaePassword()
224        generates (SupplicantStatus status, string saePassword);
225
226    /**
227     * Get SAE password ID for WPA3-Personal
228     *
229     * @return status Status of the operation, and a string.
230     *         Possible status codes:
231     *         |SupplicantStatusCode.SUCCESS|,
232     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
233     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
234     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
235     */
236    getSaePasswordId()
237        generates (SupplicantStatus status, string saePasswordId);
238
239    /**
240    * Set SAE password for WPA3-Personal
241    *
242    * @param saePassword string with the above option
243    *
244    * @return status Status of the operation.
245    *         Possible status codes:
246    *         |SupplicantStatusCode.SUCCESS|,
247    *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
248    *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
249    *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
250    */
251    setSaePassword(string saePassword)
252        generates (SupplicantStatus status);
253
254    /**
255     * Set SAE password ID for WPA3-Personal
256     *
257     * @param sae_password_id string with the above option
258     *
259     * @return status Status of the operation.
260     *         Possible status codes:
261     *         |SupplicantStatusCode.SUCCESS|,
262     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
263     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
264     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
265     */
266    setSaePasswordId(string saePasswordId)
267        generates (SupplicantStatus status);
268};
269