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 [email protected];
18
19import @1.0::SupplicantStatus;
20import @1.1::ISupplicantStaIface;
21import @1.2::ISupplicantStaIfaceCallback;
22import @1.2::ISupplicantStaNetwork;
23
24/**
25 * Interface exposed by the supplicant for each station mode network
26 * interface (e.g wlan0) it controls.
27 */
28interface ISupplicantStaIface extends @1.1::ISupplicantStaIface {
29    /**
30     * Register for callbacks from this interface.
31     *
32     * These callbacks are invoked for events that are specific to this interface.
33     * Registration of multiple callback objects is supported. These objects must
34     * be automatically deleted when the corresponding client process is dead or
35     * if this interface is removed.
36     *
37     * @param callback An instance of the |ISupplicantStaIfaceCallback| HIDL
38     *        interface object.
39     * @return status Status of the operation.
40     *         Possible status codes:
41     *         |SupplicantStatusCode.SUCCESS|,
42     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
43     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
44     */
45    registerCallback_1_2(ISupplicantStaIfaceCallback callback)
46        generates (SupplicantStatus status);
47
48    /**
49     * Get Key management capabilities of the device
50     *
51     * @return status Status of the operation, and a bitmap of key management mask.
52     *         Possible status codes:
53     *         |SupplicantStatusCode.SUCCESS|,
54     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
55     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
56     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
57     */
58    getKeyMgmtCapabilities()
59        generates (SupplicantStatus status, bitfield<KeyMgmtMask> keyMgmtMask);
60
61    /**
62     * Add a DPP peer URI. URI is acquired externally, e.g. by scanning a QR code
63     *
64     * @param uri Peer's DPP URI.
65     * @return status Status of the operation, and an ID for the URI.
66     *         Possible status codes:
67     *         |SupplicantStatusCode.SUCCESS|,
68     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
69     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
70     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
71     */
72    addDppPeerUri(string uri)
73        generates (SupplicantStatus status, uint32_t id);
74
75    /**
76     * Remove a DPP peer URI.
77     *
78     * @param id The ID of the URI, as returned by |addDppPeerUri|.
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    removeDppUri(uint32_t id)
87        generates (SupplicantStatus status);
88
89    /**
90     * Start DPP in Configurator-Initiator mode.
91     *
92     * @param peerBootstrapId Peer device's URI ID.
93     * @param ownBootstrapId Local device's URI ID (0 for none, optional).
94     * @param ssid Network SSID to send to peer (SAE/PSK mode).
95     * @param password Network password to send to peer (SAE/PSK mode).
96     * @param psk Network PSK to send to peer (PSK mode only). Either password or psk should be set.
97     * @param netRole Role to configure the peer, |DppNetRole.DPP_NET_ROLE_STA| or
98     *        |DppNetRole.DPP_NET_ROLE_AP|.
99     * @param securityAkm Security AKM to use (See DppAkm).
100     * @return status Status of the operation.
101     *         Possible status codes:
102     *         |SupplicantStatusCode.SUCCESS|,
103     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
104     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
105     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
106     */
107    startDppConfiguratorInitiator(uint32_t peerBootstrapId,
108        uint32_t ownBootstrapId, string ssid, string password,
109        string psk, DppNetRole netRole, DppAkm securityAkm)
110        generates (SupplicantStatus status);
111
112    /**
113     * Start DPP in Enrollee-Initiator mode.
114     *
115     * @param peerBootstrapId Peer device's URI ID.
116     * @param ownBootstrapId Local device's URI ID (0 for none, optional).
117     * @return status Status of the operation.
118     *         Possible status codes:
119     *         |SupplicantStatusCode.SUCCESS|,
120     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
121     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
122     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
123     */
124    startDppEnrolleeInitiator(uint32_t peerBootstrapId,
125        uint32_t ownBootstrapId)
126        generates (SupplicantStatus status);
127
128    /**
129     * Stop DPP Initiator operation.
130     *
131     * @return status Status of the operation.
132     *         Possible status codes:
133     *         |SupplicantStatusCode.SUCCESS|,
134     *         |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
135     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
136     *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
137     */
138     stopDppInitiator()
139        generates (SupplicantStatus status);
140};
141