1094332d3Sopenharmony_ci/*
2094332d3Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License.
5094332d3Sopenharmony_ci * You may obtain a copy of the License at
6094332d3Sopenharmony_ci *
7094332d3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8094332d3Sopenharmony_ci *
9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and
13094332d3Sopenharmony_ci * limitations under the License.
14094332d3Sopenharmony_ci */
15094332d3Sopenharmony_ci#include "wpa_common_fuzzer.h"
16094332d3Sopenharmony_ci
17094332d3Sopenharmony_ci#define WLAN_FREQ_MAX_NUM 35
18094332d3Sopenharmony_ci#define ETH_ADDR_LEN 6
19094332d3Sopenharmony_ci#define BITS_NUM_24 24
20094332d3Sopenharmony_ci#define BITS_NUM_16 16
21094332d3Sopenharmony_ci#define BITS_NUM_8 8
22094332d3Sopenharmony_ci#define REPLY_SIZE 1024
23094332d3Sopenharmony_ci
24094332d3Sopenharmony_cistatic uint32_t g_wpaTestSize = 0;
25094332d3Sopenharmony_cistruct IWpaCallback *g_wpaCallbackObj = nullptr;
26094332d3Sopenharmony_ci
27094332d3Sopenharmony_ciuint32_t SetWpaDataSize(const uint32_t *dataSize)
28094332d3Sopenharmony_ci{
29094332d3Sopenharmony_ci    if (dataSize != nullptr) {
30094332d3Sopenharmony_ci        g_wpaTestSize = *dataSize;
31094332d3Sopenharmony_ci        return HDF_SUCCESS;
32094332d3Sopenharmony_ci    }
33094332d3Sopenharmony_ci    HDF_LOGE("%{public}s: set data size failed!", __FUNCTION__);
34094332d3Sopenharmony_ci    return HDF_FAILURE;
35094332d3Sopenharmony_ci}
36094332d3Sopenharmony_ci
37094332d3Sopenharmony_ciuint32_t GetWpaDataSize(uint32_t *dataSize)
38094332d3Sopenharmony_ci{
39094332d3Sopenharmony_ci    if (dataSize != nullptr) {
40094332d3Sopenharmony_ci        *dataSize = g_wpaTestSize;
41094332d3Sopenharmony_ci        return HDF_SUCCESS;
42094332d3Sopenharmony_ci    }
43094332d3Sopenharmony_ci    HDF_LOGE("%{public}s: get data size failed!", __FUNCTION__);
44094332d3Sopenharmony_ci    return HDF_FAILURE;
45094332d3Sopenharmony_ci}
46094332d3Sopenharmony_ci
47094332d3Sopenharmony_ciuint32_t Convert2Uint32(const uint8_t *ptr)
48094332d3Sopenharmony_ci{
49094332d3Sopenharmony_ci    if (ptr == nullptr) {
50094332d3Sopenharmony_ci        return 0;
51094332d3Sopenharmony_ci    }
52094332d3Sopenharmony_ci    /*
53094332d3Sopenharmony_ci     * Move the 0th digit 24 to the left, the first digit 16 to the left, the second digit 8 to the left,
54094332d3Sopenharmony_ci     * and the third digit no left
55094332d3Sopenharmony_ci     */
56094332d3Sopenharmony_ci    return (ptr[0] << BITS_NUM_24) | (ptr[1] << BITS_NUM_16) | (ptr[2] << BITS_NUM_8) | (ptr[3]);
57094332d3Sopenharmony_ci}
58094332d3Sopenharmony_ci
59094332d3Sopenharmony_cibool PreProcessRawData(const uint8_t *rawData, size_t size, uint8_t *tmpRawData, size_t tmpRawDataSize)
60094332d3Sopenharmony_ci{
61094332d3Sopenharmony_ci    if (rawData == nullptr || tmpRawData == nullptr) {
62094332d3Sopenharmony_ci        HDF_LOGE("%{public}s: rawData or tmpRawData is nullptr!", __FUNCTION__);
63094332d3Sopenharmony_ci        return false;
64094332d3Sopenharmony_ci    }
65094332d3Sopenharmony_ci    uint32_t dataSize = size - OFFSET;
66094332d3Sopenharmony_ci    if (memcpy_s(tmpRawData, tmpRawDataSize, rawData + OFFSET, dataSize) != EOK) {
67094332d3Sopenharmony_ci        HDF_LOGE("%{public}s: memcpy_s failed!", __FUNCTION__);
68094332d3Sopenharmony_ci        return false;
69094332d3Sopenharmony_ci    }
70094332d3Sopenharmony_ci    if (SetWpaDataSize(&dataSize) != HDF_SUCCESS) {
71094332d3Sopenharmony_ci        HDF_LOGE("%{public}s: set data size failed!", __FUNCTION__);
72094332d3Sopenharmony_ci        return false;
73094332d3Sopenharmony_ci    }
74094332d3Sopenharmony_ci    return true;
75094332d3Sopenharmony_ci}
76094332d3Sopenharmony_ci
77094332d3Sopenharmony_ci/* **********Wpa Interface********** */
78094332d3Sopenharmony_civoid FuzzWpaInterfaceStart(struct IWpaInterface *interface, const uint8_t *rawData)
79094332d3Sopenharmony_ci{
80094332d3Sopenharmony_ci    interface->Start(interface);
81094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
82094332d3Sopenharmony_ci}
83094332d3Sopenharmony_ci
84094332d3Sopenharmony_civoid FuzzWpaInterfaceStop(struct IWpaInterface *interface, const uint8_t *rawData)
85094332d3Sopenharmony_ci{
86094332d3Sopenharmony_ci    interface->Stop(interface);
87094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
88094332d3Sopenharmony_ci}
89094332d3Sopenharmony_ci
90094332d3Sopenharmony_civoid FuzzWpaInterfaceScan(struct IWpaInterface *interface, const uint8_t *rawData)
91094332d3Sopenharmony_ci{
92094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
93094332d3Sopenharmony_ci
94094332d3Sopenharmony_ci    interface->Scan(interface, ifName);
95094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
96094332d3Sopenharmony_ci}
97094332d3Sopenharmony_ci
98094332d3Sopenharmony_civoid FuzzWpaInterfaceScanResult(struct IWpaInterface *interface, const uint8_t *rawData)
99094332d3Sopenharmony_ci{
100094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
101094332d3Sopenharmony_ci    unsigned char buf[ETH_ADDR_LEN] = {0x12, 0x34, 0x56, 0x78, 0xab, 0xcd};
102094332d3Sopenharmony_ci    uint32_t bufLen = ETH_ADDR_LEN;
103094332d3Sopenharmony_ci    interface->ScanResult(interface, ifName, buf, &bufLen);
104094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
105094332d3Sopenharmony_ci}
106094332d3Sopenharmony_ci
107094332d3Sopenharmony_civoid FuzzWpaInterfaceAddNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
108094332d3Sopenharmony_ci{
109094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
110094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
111094332d3Sopenharmony_ci
112094332d3Sopenharmony_ci    interface->AddNetwork(interface, ifName, &networkId);
113094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
114094332d3Sopenharmony_ci}
115094332d3Sopenharmony_ci
116094332d3Sopenharmony_civoid FuzzWpaInterfaceRemoveNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
117094332d3Sopenharmony_ci{
118094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
119094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
120094332d3Sopenharmony_ci
121094332d3Sopenharmony_ci    interface->RemoveNetwork(interface, ifName, networkId);
122094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
123094332d3Sopenharmony_ci}
124094332d3Sopenharmony_ci
125094332d3Sopenharmony_civoid FuzzWpaInterfaceDisableNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
126094332d3Sopenharmony_ci{
127094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
128094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
129094332d3Sopenharmony_ci
130094332d3Sopenharmony_ci    interface->DisableNetwork(interface, ifName, networkId);
131094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
132094332d3Sopenharmony_ci}
133094332d3Sopenharmony_ci
134094332d3Sopenharmony_civoid FuzzWpaInterfaceSetNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
135094332d3Sopenharmony_ci{
136094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
137094332d3Sopenharmony_ci    const char *name = reinterpret_cast<const char *>(rawData);
138094332d3Sopenharmony_ci    const char *value = reinterpret_cast<const char *>(rawData);
139094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
140094332d3Sopenharmony_ci
141094332d3Sopenharmony_ci    interface->SetNetwork(interface, ifName, networkId, name, value);
142094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
143094332d3Sopenharmony_ci}
144094332d3Sopenharmony_ci
145094332d3Sopenharmony_civoid FuzzWpaInterfaceReconnect(struct IWpaInterface *interface, const uint8_t *rawData)
146094332d3Sopenharmony_ci{
147094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
148094332d3Sopenharmony_ci
149094332d3Sopenharmony_ci    interface->Reconnect(interface, ifName);
150094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
151094332d3Sopenharmony_ci}
152094332d3Sopenharmony_ci
153094332d3Sopenharmony_civoid FuzzWpaInterfaceDisconnect(struct IWpaInterface *interface, const uint8_t *rawData)
154094332d3Sopenharmony_ci{
155094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
156094332d3Sopenharmony_ci
157094332d3Sopenharmony_ci    interface->Disconnect(interface, ifName);
158094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
159094332d3Sopenharmony_ci}
160094332d3Sopenharmony_ci
161094332d3Sopenharmony_civoid FuzzWpaInterfaceSelectNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
162094332d3Sopenharmony_ci{
163094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
164094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
165094332d3Sopenharmony_ci
166094332d3Sopenharmony_ci    interface->SelectNetwork(interface, ifName, networkId);
167094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
168094332d3Sopenharmony_ci}
169094332d3Sopenharmony_ci
170094332d3Sopenharmony_civoid FuzzWpaInterfaceEnableNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
171094332d3Sopenharmony_ci{
172094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
173094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
174094332d3Sopenharmony_ci
175094332d3Sopenharmony_ci    interface->EnableNetwork(interface, ifName, networkId);
176094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
177094332d3Sopenharmony_ci}
178094332d3Sopenharmony_ci
179094332d3Sopenharmony_civoid FuzzWpaInterfaceSetPowerSave(struct IWpaInterface *interface, const uint8_t *rawData)
180094332d3Sopenharmony_ci{
181094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
182094332d3Sopenharmony_ci    int32_t enable = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
183094332d3Sopenharmony_ci
184094332d3Sopenharmony_ci    interface->SetPowerSave(interface, ifName, enable);
185094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
186094332d3Sopenharmony_ci}
187094332d3Sopenharmony_ci
188094332d3Sopenharmony_civoid FuzzWpaInterfaceAutoConnect(struct IWpaInterface *interface, const uint8_t *rawData)
189094332d3Sopenharmony_ci{
190094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
191094332d3Sopenharmony_ci    int32_t enable = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
192094332d3Sopenharmony_ci
193094332d3Sopenharmony_ci    interface->AutoConnect(interface, ifName, enable);
194094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
195094332d3Sopenharmony_ci}
196094332d3Sopenharmony_ci
197094332d3Sopenharmony_civoid FuzzWpaInterfaceSaveConfig(struct IWpaInterface *interface, const uint8_t *rawData)
198094332d3Sopenharmony_ci{
199094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
200094332d3Sopenharmony_ci
201094332d3Sopenharmony_ci    interface->SaveConfig(interface, ifName);
202094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
203094332d3Sopenharmony_ci}
204094332d3Sopenharmony_ci
205094332d3Sopenharmony_civoid FuzzWpaInterfaceWpsCancel(struct IWpaInterface *interface, const uint8_t *rawData)
206094332d3Sopenharmony_ci{
207094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
208094332d3Sopenharmony_ci
209094332d3Sopenharmony_ci    interface->WpsCancel(interface, ifName);
210094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
211094332d3Sopenharmony_ci}
212094332d3Sopenharmony_ci
213094332d3Sopenharmony_civoid FuzzWpaInterfaceGetCountryCode(struct IWpaInterface *interface, const uint8_t *rawData)
214094332d3Sopenharmony_ci{
215094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
216094332d3Sopenharmony_ci    char countryCode[3] = {0};
217094332d3Sopenharmony_ci
218094332d3Sopenharmony_ci    interface->GetCountryCode(interface, ifName, countryCode, 3);
219094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
220094332d3Sopenharmony_ci}
221094332d3Sopenharmony_ci
222094332d3Sopenharmony_civoid FuzzWpaInterfaceGetNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
223094332d3Sopenharmony_ci{
224094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
225094332d3Sopenharmony_ci    int networkId = 0;
226094332d3Sopenharmony_ci    char value[32] = {0};
227094332d3Sopenharmony_ci
228094332d3Sopenharmony_ci    interface->GetNetwork(interface, ifName, networkId, "ssid", value, 32);
229094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
230094332d3Sopenharmony_ci}
231094332d3Sopenharmony_ci
232094332d3Sopenharmony_civoid FuzzWpaInterfaceBlocklistClear(struct IWpaInterface *interface, const uint8_t *rawData)
233094332d3Sopenharmony_ci{
234094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
235094332d3Sopenharmony_ci
236094332d3Sopenharmony_ci    interface->BlocklistClear(interface, ifName);
237094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
238094332d3Sopenharmony_ci}
239094332d3Sopenharmony_ci
240094332d3Sopenharmony_civoid FuzzWpaInterfaceSetSuspendMode(struct IWpaInterface *interface, const uint8_t *rawData)
241094332d3Sopenharmony_ci{
242094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
243094332d3Sopenharmony_ci    int32_t mode = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
244094332d3Sopenharmony_ci
245094332d3Sopenharmony_ci    interface->SetSuspendMode(interface, ifName, mode);
246094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
247094332d3Sopenharmony_ci}
248094332d3Sopenharmony_ci
249094332d3Sopenharmony_civoid FuzzWpaInterfaceGetScanSsid(struct IWpaInterface *interface, const uint8_t *rawData)
250094332d3Sopenharmony_ci{
251094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
252094332d3Sopenharmony_ci    int32_t enable = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
253094332d3Sopenharmony_ci
254094332d3Sopenharmony_ci    interface->GetScanSsid(interface, ifName, &enable);
255094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
256094332d3Sopenharmony_ci}
257094332d3Sopenharmony_ci
258094332d3Sopenharmony_civoid FuzzWpaInterfaceGetPskPassphrase(struct IWpaInterface *interface, const uint8_t *rawData)
259094332d3Sopenharmony_ci{
260094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
261094332d3Sopenharmony_ci    char psk[32] = {0};
262094332d3Sopenharmony_ci
263094332d3Sopenharmony_ci    interface->GetPskPassphrase(interface, ifName, psk, 32);
264094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
265094332d3Sopenharmony_ci}
266094332d3Sopenharmony_ci
267094332d3Sopenharmony_civoid FuzzWpaInterfaceGetPsk(struct IWpaInterface *interface, const uint8_t *rawData)
268094332d3Sopenharmony_ci{
269094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
270094332d3Sopenharmony_ci    uint8_t psk[32] = {0};
271094332d3Sopenharmony_ci    uint32_t pskLen = 32;
272094332d3Sopenharmony_ci
273094332d3Sopenharmony_ci    interface->GetPsk(interface, ifName, psk, &pskLen);
274094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
275094332d3Sopenharmony_ci}
276094332d3Sopenharmony_ci
277094332d3Sopenharmony_civoid FuzzWpaInterfaceGetWepKey(struct IWpaInterface *interface, const uint8_t *rawData)
278094332d3Sopenharmony_ci{
279094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
280094332d3Sopenharmony_ci    uint8_t wepKey[16] = {0};
281094332d3Sopenharmony_ci    uint32_t wepKeyLen = 16;
282094332d3Sopenharmony_ci
283094332d3Sopenharmony_ci    interface->GetWepKey(interface, ifName, 1, wepKey, &wepKeyLen);
284094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
285094332d3Sopenharmony_ci}
286094332d3Sopenharmony_ci
287094332d3Sopenharmony_civoid FuzzWpaInterfaceGetWepTxKeyIdx(struct IWpaInterface *interface, const uint8_t *rawData)
288094332d3Sopenharmony_ci{
289094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
290094332d3Sopenharmony_ci    int keyIdx = *const_cast<int *>(reinterpret_cast<const int *>(rawData));
291094332d3Sopenharmony_ci
292094332d3Sopenharmony_ci    interface->GetWepTxKeyIdx(interface, ifName, &keyIdx);
293094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
294094332d3Sopenharmony_ci}
295094332d3Sopenharmony_ci
296094332d3Sopenharmony_civoid FuzzWpaInterfaceGetRequirePmf(struct IWpaInterface *interface, const uint8_t *rawData)
297094332d3Sopenharmony_ci{
298094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
299094332d3Sopenharmony_ci    int enable = *const_cast<int *>(reinterpret_cast<const int *>(rawData));
300094332d3Sopenharmony_ci
301094332d3Sopenharmony_ci    interface->GetRequirePmf(interface, ifName, &enable);
302094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
303094332d3Sopenharmony_ci}
304094332d3Sopenharmony_ci
305094332d3Sopenharmony_civoid FuzzWpaInterfaceSetCountryCode(struct IWpaInterface *interface, const uint8_t *rawData)
306094332d3Sopenharmony_ci{
307094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
308094332d3Sopenharmony_ci    const char countryCode[3] = {0};
309094332d3Sopenharmony_ci
310094332d3Sopenharmony_ci    interface->SetCountryCode(interface, ifName, countryCode);
311094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
312094332d3Sopenharmony_ci}
313094332d3Sopenharmony_ci
314094332d3Sopenharmony_civoid FuzzWpaInterfaceListNetworks(struct IWpaInterface *interface, const uint8_t *rawData)
315094332d3Sopenharmony_ci{
316094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
317094332d3Sopenharmony_ci    struct HdiWifiWpaNetworkInfo networkInfo;
318094332d3Sopenharmony_ci    (void)memset_s(&networkInfo, sizeof(struct HdiWifiWpaNetworkInfo), 0, sizeof(struct HdiWifiWpaNetworkInfo));
319094332d3Sopenharmony_ci    uint32_t networkInfoLen = 0;
320094332d3Sopenharmony_ci
321094332d3Sopenharmony_ci    interface->ListNetworks(interface, ifName, (struct HdiWifiWpaNetworkInfo *)&networkInfo, &networkInfoLen);
322094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
323094332d3Sopenharmony_ci}
324094332d3Sopenharmony_ci
325094332d3Sopenharmony_civoid FuzzWpaInterfaceWifiStatus(struct IWpaInterface *interface, const uint8_t *rawData)
326094332d3Sopenharmony_ci{
327094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
328094332d3Sopenharmony_ci    struct HdiWpaCmdStatus wifiStatus;
329094332d3Sopenharmony_ci    (void)memset_s(&wifiStatus, sizeof(struct HdiWpaCmdStatus), 0, sizeof(struct HdiWpaCmdStatus));
330094332d3Sopenharmony_ci
331094332d3Sopenharmony_ci    interface->WifiStatus(interface, ifName, &wifiStatus);
332094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
333094332d3Sopenharmony_ci}
334094332d3Sopenharmony_ci
335094332d3Sopenharmony_civoid FuzzWpaInterfaceWpsPbcMode(struct IWpaInterface *interface, const uint8_t *rawData)
336094332d3Sopenharmony_ci{
337094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
338094332d3Sopenharmony_ci    struct HdiWifiWpsParam wpsParam;
339094332d3Sopenharmony_ci    (void)memset_s(&wpsParam, sizeof(struct HdiWifiWpsParam), 0, sizeof(struct HdiWifiWpsParam));
340094332d3Sopenharmony_ci    wpsParam.anyFlag = 1;
341094332d3Sopenharmony_ci    wpsParam.multiAp = 1;
342094332d3Sopenharmony_ci    wpsParam.bssidLen = 6;
343094332d3Sopenharmony_ci    wpsParam.bssid = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * (wpsParam.bssidLen)));
344094332d3Sopenharmony_ci    if (wpsParam.bssid == nullptr) {
345094332d3Sopenharmony_ci        return;
346094332d3Sopenharmony_ci    }
347094332d3Sopenharmony_ci    wpsParam.bssid[0] = 0x12;
348094332d3Sopenharmony_ci    wpsParam.bssid[1] = 0x34;
349094332d3Sopenharmony_ci    wpsParam.bssid[2] = 0x56;
350094332d3Sopenharmony_ci    wpsParam.bssid[3] = 0x78;
351094332d3Sopenharmony_ci    wpsParam.bssid[4] = 0xab;
352094332d3Sopenharmony_ci    wpsParam.bssid[5] = 0xcd;
353094332d3Sopenharmony_ci
354094332d3Sopenharmony_ci    interface->WpsPbcMode(interface, ifName, &wpsParam);
355094332d3Sopenharmony_ci    OsalMemFree(wpsParam.bssid);
356094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
357094332d3Sopenharmony_ci}
358094332d3Sopenharmony_ci
359094332d3Sopenharmony_civoid FuzzWpaInterfaceWpsPinMode(struct IWpaInterface *interface, const uint8_t *rawData)
360094332d3Sopenharmony_ci{
361094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
362094332d3Sopenharmony_ci    struct HdiWifiWpsParam wpsParam;
363094332d3Sopenharmony_ci    (void)memset_s(&wpsParam, sizeof(struct HdiWifiWpsParam), 0, sizeof(struct HdiWifiWpsParam));
364094332d3Sopenharmony_ci    wpsParam.anyFlag = 1;
365094332d3Sopenharmony_ci    wpsParam.multiAp = 1;
366094332d3Sopenharmony_ci    wpsParam.bssidLen = 6;
367094332d3Sopenharmony_ci    wpsParam.bssid = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * (wpsParam.bssidLen)));
368094332d3Sopenharmony_ci    if (wpsParam.bssid == nullptr) {
369094332d3Sopenharmony_ci        return;
370094332d3Sopenharmony_ci    }
371094332d3Sopenharmony_ci    wpsParam.bssid[0] = 0x12;
372094332d3Sopenharmony_ci    wpsParam.bssid[1] = 0x34;
373094332d3Sopenharmony_ci    wpsParam.bssid[2] = 0x56;
374094332d3Sopenharmony_ci    wpsParam.bssid[3] = 0x78;
375094332d3Sopenharmony_ci    wpsParam.bssid[4] = 0xab;
376094332d3Sopenharmony_ci    wpsParam.bssid[5] = 0xcd;
377094332d3Sopenharmony_ci    int pinCode = 0;
378094332d3Sopenharmony_ci
379094332d3Sopenharmony_ci    interface->WpsPinMode(interface, ifName, &wpsParam, &pinCode);
380094332d3Sopenharmony_ci    OsalMemFree(wpsParam.bssid);
381094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
382094332d3Sopenharmony_ci}
383094332d3Sopenharmony_ci
384094332d3Sopenharmony_civoid FuzzWpaInterfaceRegisterEventCallback(struct IWpaInterface *interface, const uint8_t *rawData)
385094332d3Sopenharmony_ci{
386094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
387094332d3Sopenharmony_ci
388094332d3Sopenharmony_ci    interface->RegisterEventCallback(interface, g_wpaCallbackObj, ifName);
389094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
390094332d3Sopenharmony_ci}
391094332d3Sopenharmony_ci
392094332d3Sopenharmony_civoid FuzzWpaInterfaceUnregisterEventCallback(struct IWpaInterface *interface, const uint8_t *rawData)
393094332d3Sopenharmony_ci{
394094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
395094332d3Sopenharmony_ci
396094332d3Sopenharmony_ci    interface->UnregisterEventCallback(interface, g_wpaCallbackObj, ifName);
397094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
398094332d3Sopenharmony_ci}
399094332d3Sopenharmony_ci
400094332d3Sopenharmony_civoid FuzzWpaInterfaceGetConnectionCapabilities(struct IWpaInterface *interface, const uint8_t *rawData)
401094332d3Sopenharmony_ci{
402094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
403094332d3Sopenharmony_ci    struct ConnectionCapabilities connectionCap;
404094332d3Sopenharmony_ci    (void)memset_s(&connectionCap, sizeof(struct ConnectionCapabilities), 0, sizeof(struct ConnectionCapabilities));
405094332d3Sopenharmony_ci
406094332d3Sopenharmony_ci    interface->GetConnectionCapabilities(interface, ifName, &connectionCap);
407094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
408094332d3Sopenharmony_ci}
409094332d3Sopenharmony_ci
410094332d3Sopenharmony_civoid FuzzWpaInterfaceAddWpaIface(struct IWpaInterface *interface, const uint8_t *rawData)
411094332d3Sopenharmony_ci{
412094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
413094332d3Sopenharmony_ci    const char *configname = "/data/service/el1/public/wifi/wpa_supplicant/wpa_supplicant.conf";
414094332d3Sopenharmony_ci    interface->AddWpaIface(interface, ifName, configname);
415094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
416094332d3Sopenharmony_ci}
417094332d3Sopenharmony_ci
418094332d3Sopenharmony_civoid FuzzWpaInterfaceRemoveWpaIface(struct IWpaInterface *interface, const uint8_t *rawData)
419094332d3Sopenharmony_ci{
420094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
421094332d3Sopenharmony_ci
422094332d3Sopenharmony_ci    interface->RemoveWpaIface(interface, ifName);
423094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
424094332d3Sopenharmony_ci}
425094332d3Sopenharmony_ci
426094332d3Sopenharmony_civoid FuzzWpaInterfaceReassociate(struct IWpaInterface *interface, const uint8_t *rawData)
427094332d3Sopenharmony_ci{
428094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
429094332d3Sopenharmony_ci
430094332d3Sopenharmony_ci    interface->Reassociate(interface, ifName);
431094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
432094332d3Sopenharmony_ci}
433094332d3Sopenharmony_ci
434094332d3Sopenharmony_civoid FuzzWpaInterfaceStaShellCmd(struct IWpaInterface *interface, const uint8_t *rawData)
435094332d3Sopenharmony_ci{
436094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
437094332d3Sopenharmony_ci    const char *cmd = reinterpret_cast<const char *>(rawData);
438094332d3Sopenharmony_ci
439094332d3Sopenharmony_ci    interface->StaShellCmd(interface, ifName, cmd);
440094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
441094332d3Sopenharmony_ci}
442094332d3Sopenharmony_ci
443094332d3Sopenharmony_ci
444094332d3Sopenharmony_ci/* **********P2p Interface********** */
445094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetSsidPostfixName(struct IWpaInterface *interface, const uint8_t *rawData)
446094332d3Sopenharmony_ci{
447094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
448094332d3Sopenharmony_ci    const char *name = reinterpret_cast<const char *>(rawData);
449094332d3Sopenharmony_ci
450094332d3Sopenharmony_ci    interface->P2pSetSsidPostfixName(interface, ifName, name);
451094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
452094332d3Sopenharmony_ci}
453094332d3Sopenharmony_ci
454094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetWpsDeviceType(struct IWpaInterface *interface, const uint8_t *rawData)
455094332d3Sopenharmony_ci{
456094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
457094332d3Sopenharmony_ci    const char *type = reinterpret_cast<const char *>(rawData);
458094332d3Sopenharmony_ci
459094332d3Sopenharmony_ci    interface->P2pSetWpsDeviceType(interface, ifName, type);
460094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
461094332d3Sopenharmony_ci}
462094332d3Sopenharmony_ci
463094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetWpsConfigMethods(struct IWpaInterface *interface, const uint8_t *rawData)
464094332d3Sopenharmony_ci{
465094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
466094332d3Sopenharmony_ci    const char *methods = reinterpret_cast<const char *>(rawData);
467094332d3Sopenharmony_ci
468094332d3Sopenharmony_ci    interface->P2pSetWpsConfigMethods(interface, ifName, methods);
469094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
470094332d3Sopenharmony_ci}
471094332d3Sopenharmony_ci
472094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetGroupMaxIdle(struct IWpaInterface *interface, const uint8_t *rawData)
473094332d3Sopenharmony_ci{
474094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
475094332d3Sopenharmony_ci    int32_t time = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
476094332d3Sopenharmony_ci
477094332d3Sopenharmony_ci    interface->P2pSetGroupMaxIdle(interface, ifName, time);
478094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
479094332d3Sopenharmony_ci}
480094332d3Sopenharmony_ci
481094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetWfdEnable(struct IWpaInterface *interface, const uint8_t *rawData)
482094332d3Sopenharmony_ci{
483094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
484094332d3Sopenharmony_ci    int32_t enable = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
485094332d3Sopenharmony_ci
486094332d3Sopenharmony_ci    interface->P2pSetWfdEnable(interface, ifName, enable);
487094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
488094332d3Sopenharmony_ci}
489094332d3Sopenharmony_ci
490094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetPersistentReconnect(struct IWpaInterface *interface, const uint8_t *rawData)
491094332d3Sopenharmony_ci{
492094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
493094332d3Sopenharmony_ci    int32_t status = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
494094332d3Sopenharmony_ci
495094332d3Sopenharmony_ci    interface->P2pSetPersistentReconnect(interface, ifName, status);
496094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
497094332d3Sopenharmony_ci}
498094332d3Sopenharmony_ci
499094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetWpsSecondaryDeviceType(struct IWpaInterface *interface, const uint8_t *rawData)
500094332d3Sopenharmony_ci{
501094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
502094332d3Sopenharmony_ci    const char *type = reinterpret_cast<const char *>(rawData);
503094332d3Sopenharmony_ci
504094332d3Sopenharmony_ci    interface->P2pSetWpsSecondaryDeviceType(interface, ifName, type);
505094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
506094332d3Sopenharmony_ci}
507094332d3Sopenharmony_ci
508094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetupWpsPbc(struct IWpaInterface *interface, const uint8_t *rawData)
509094332d3Sopenharmony_ci{
510094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
511094332d3Sopenharmony_ci    const char *address = reinterpret_cast<const char *>(rawData);
512094332d3Sopenharmony_ci
513094332d3Sopenharmony_ci    interface->P2pSetupWpsPbc(interface, ifName, address);
514094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
515094332d3Sopenharmony_ci}
516094332d3Sopenharmony_ci
517094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetupWpsPin(struct IWpaInterface *interface, const uint8_t *rawData)
518094332d3Sopenharmony_ci{
519094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
520094332d3Sopenharmony_ci    const char *address = reinterpret_cast<const char *>(rawData);
521094332d3Sopenharmony_ci    const char *pin = reinterpret_cast<const char *>(rawData);
522094332d3Sopenharmony_ci    char result[32] = {0};
523094332d3Sopenharmony_ci    uint32_t resultLen = *const_cast<uint32_t *>(reinterpret_cast<const uint32_t *>(rawData));
524094332d3Sopenharmony_ci
525094332d3Sopenharmony_ci
526094332d3Sopenharmony_ci    interface->P2pSetupWpsPin(interface, ifName, address, pin, result, resultLen);
527094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
528094332d3Sopenharmony_ci}
529094332d3Sopenharmony_ci
530094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetPowerSave(struct IWpaInterface *interface, const uint8_t *rawData)
531094332d3Sopenharmony_ci{
532094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
533094332d3Sopenharmony_ci    int32_t enable = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
534094332d3Sopenharmony_ci
535094332d3Sopenharmony_ci    interface->P2pSetPowerSave(interface, ifName, enable);
536094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
537094332d3Sopenharmony_ci}
538094332d3Sopenharmony_ci
539094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetDeviceName(struct IWpaInterface *interface, const uint8_t *rawData)
540094332d3Sopenharmony_ci{
541094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
542094332d3Sopenharmony_ci    const char *name = reinterpret_cast<const char *>(rawData);
543094332d3Sopenharmony_ci
544094332d3Sopenharmony_ci    interface->P2pSetDeviceName(interface, ifName, name);
545094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
546094332d3Sopenharmony_ci}
547094332d3Sopenharmony_ci
548094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetWfdDeviceConfig(struct IWpaInterface *interface, const uint8_t *rawData)
549094332d3Sopenharmony_ci{
550094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
551094332d3Sopenharmony_ci    const char *config = reinterpret_cast<const char *>(rawData);
552094332d3Sopenharmony_ci
553094332d3Sopenharmony_ci    interface->P2pSetWfdDeviceConfig(interface, ifName, config);
554094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
555094332d3Sopenharmony_ci}
556094332d3Sopenharmony_ci
557094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetRandomMac(struct IWpaInterface *interface, const uint8_t *rawData)
558094332d3Sopenharmony_ci{
559094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
560094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
561094332d3Sopenharmony_ci
562094332d3Sopenharmony_ci    interface->P2pSetRandomMac(interface, ifName, networkId);
563094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
564094332d3Sopenharmony_ci}
565094332d3Sopenharmony_ci
566094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pStartFind(struct IWpaInterface *interface, const uint8_t *rawData)
567094332d3Sopenharmony_ci{
568094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
569094332d3Sopenharmony_ci    int32_t timeout = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
570094332d3Sopenharmony_ci
571094332d3Sopenharmony_ci    interface->P2pStartFind(interface, ifName, timeout);
572094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
573094332d3Sopenharmony_ci}
574094332d3Sopenharmony_ci
575094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetExtListen(struct IWpaInterface *interface, const uint8_t *rawData)
576094332d3Sopenharmony_ci{
577094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
578094332d3Sopenharmony_ci    int32_t enable = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
579094332d3Sopenharmony_ci    int32_t period = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
580094332d3Sopenharmony_ci    int32_t interval = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
581094332d3Sopenharmony_ci
582094332d3Sopenharmony_ci    interface->P2pSetExtListen(interface, ifName, enable, period, interval);
583094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
584094332d3Sopenharmony_ci}
585094332d3Sopenharmony_ci
586094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetListenChannel(struct IWpaInterface *interface, const uint8_t *rawData)
587094332d3Sopenharmony_ci{
588094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
589094332d3Sopenharmony_ci    int32_t channel = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
590094332d3Sopenharmony_ci    int32_t regClass = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
591094332d3Sopenharmony_ci
592094332d3Sopenharmony_ci    interface->P2pSetListenChannel(interface, ifName, channel, regClass);
593094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
594094332d3Sopenharmony_ci}
595094332d3Sopenharmony_ci
596094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pProvisionDiscovery(struct IWpaInterface *interface, const uint8_t *rawData)
597094332d3Sopenharmony_ci{
598094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
599094332d3Sopenharmony_ci    const char *peerBssid = reinterpret_cast<const char *>(rawData);
600094332d3Sopenharmony_ci    int32_t mode = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
601094332d3Sopenharmony_ci
602094332d3Sopenharmony_ci    interface->P2pProvisionDiscovery(interface, ifName, peerBssid, mode);
603094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
604094332d3Sopenharmony_ci}
605094332d3Sopenharmony_ci
606094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pAddGroup(struct IWpaInterface *interface, const uint8_t *rawData)
607094332d3Sopenharmony_ci{
608094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
609094332d3Sopenharmony_ci    int32_t isPersistent = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
610094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
611094332d3Sopenharmony_ci    int32_t freq = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
612094332d3Sopenharmony_ci
613094332d3Sopenharmony_ci    interface->P2pAddGroup(interface, ifName, isPersistent, networkId, freq);
614094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
615094332d3Sopenharmony_ci}
616094332d3Sopenharmony_ci
617094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pAddService(struct IWpaInterface *interface, const uint8_t *rawData)
618094332d3Sopenharmony_ci{
619094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
620094332d3Sopenharmony_ci    struct HdiP2pServiceInfo info = {0};
621094332d3Sopenharmony_ci    (void)memset_s(&info, sizeof(struct HdiP2pServiceInfo), 0, sizeof(struct HdiP2pServiceInfo));
622094332d3Sopenharmony_ci    info.mode = 0;
623094332d3Sopenharmony_ci    info.version = 0;
624094332d3Sopenharmony_ci    const int nameLen = 32;
625094332d3Sopenharmony_ci    const int paramLen = 1;
626094332d3Sopenharmony_ci    info.nameLen = nameLen;
627094332d3Sopenharmony_ci    info.queryLen = paramLen;
628094332d3Sopenharmony_ci    info.respLen = paramLen;
629094332d3Sopenharmony_ci    info.name = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * nameLen));
630094332d3Sopenharmony_ci    info.query = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * paramLen));
631094332d3Sopenharmony_ci    info.resp = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * paramLen));
632094332d3Sopenharmony_ci    if (info.name == nullptr || info.query == nullptr || info.resp == nullptr) {
633094332d3Sopenharmony_ci        HDF_LOGI("%{public}s: OsalMemCalloc fail", __FUNCTION__);
634094332d3Sopenharmony_ci        return;
635094332d3Sopenharmony_ci    }
636094332d3Sopenharmony_ci    strcpy_s((char *)info.name, sizeof(info.name), "p2p0");
637094332d3Sopenharmony_ci
638094332d3Sopenharmony_ci    interface->P2pAddService(interface, ifName, &info);
639094332d3Sopenharmony_ci    OsalMemFree(info.name);
640094332d3Sopenharmony_ci    OsalMemFree(info.query);
641094332d3Sopenharmony_ci    OsalMemFree(info.resp);
642094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
643094332d3Sopenharmony_ci}
644094332d3Sopenharmony_ci
645094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pRemoveService(struct IWpaInterface *interface, const uint8_t *rawData)
646094332d3Sopenharmony_ci{
647094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
648094332d3Sopenharmony_ci    struct HdiP2pServiceInfo info = {0};
649094332d3Sopenharmony_ci    (void)memset_s(&info, sizeof(struct HdiP2pServiceInfo), 0, sizeof(struct HdiP2pServiceInfo));
650094332d3Sopenharmony_ci    info.mode = 0;
651094332d3Sopenharmony_ci    info.version = 0;
652094332d3Sopenharmony_ci    const int nameLen = 32;
653094332d3Sopenharmony_ci    const int paramLen = 1;
654094332d3Sopenharmony_ci    info.nameLen = nameLen;
655094332d3Sopenharmony_ci    info.queryLen = paramLen;
656094332d3Sopenharmony_ci    info.respLen = paramLen;
657094332d3Sopenharmony_ci    info.name = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * nameLen));
658094332d3Sopenharmony_ci    info.query = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * paramLen));
659094332d3Sopenharmony_ci    info.resp = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * paramLen));
660094332d3Sopenharmony_ci    if (info.name == nullptr || info.query == nullptr || info.resp == nullptr) {
661094332d3Sopenharmony_ci        HDF_LOGI("%{public}s: OsalMemCalloc fail", __FUNCTION__);
662094332d3Sopenharmony_ci        return;
663094332d3Sopenharmony_ci    }
664094332d3Sopenharmony_ci    strcpy_s((char *)info.name, sizeof(info.name), "p2p0");
665094332d3Sopenharmony_ci
666094332d3Sopenharmony_ci    interface->P2pRemoveService(interface, ifName, &info);
667094332d3Sopenharmony_ci    OsalMemFree(info.name);
668094332d3Sopenharmony_ci    OsalMemFree(info.query);
669094332d3Sopenharmony_ci    OsalMemFree(info.resp);
670094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
671094332d3Sopenharmony_ci}
672094332d3Sopenharmony_ci
673094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pStopFind(struct IWpaInterface *interface, const uint8_t *rawData)
674094332d3Sopenharmony_ci{
675094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
676094332d3Sopenharmony_ci
677094332d3Sopenharmony_ci    interface->P2pStopFind(interface, ifName);
678094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
679094332d3Sopenharmony_ci}
680094332d3Sopenharmony_ci
681094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pFlush(struct IWpaInterface *interface, const uint8_t *rawData)
682094332d3Sopenharmony_ci{
683094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
684094332d3Sopenharmony_ci
685094332d3Sopenharmony_ci    interface->P2pFlush(interface, ifName);
686094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
687094332d3Sopenharmony_ci}
688094332d3Sopenharmony_ci
689094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pFlushService(struct IWpaInterface *interface, const uint8_t *rawData)
690094332d3Sopenharmony_ci{
691094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
692094332d3Sopenharmony_ci
693094332d3Sopenharmony_ci    interface->P2pFlushService(interface, ifName);
694094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
695094332d3Sopenharmony_ci}
696094332d3Sopenharmony_ci
697094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pRemoveNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
698094332d3Sopenharmony_ci{
699094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
700094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
701094332d3Sopenharmony_ci
702094332d3Sopenharmony_ci    interface->P2pRemoveNetwork(interface, ifName, networkId);
703094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
704094332d3Sopenharmony_ci}
705094332d3Sopenharmony_ci
706094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetGroupConfig(struct IWpaInterface *interface, const uint8_t *rawData)
707094332d3Sopenharmony_ci{
708094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
709094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
710094332d3Sopenharmony_ci    const char *name = reinterpret_cast<const char *>(rawData);
711094332d3Sopenharmony_ci    const char *value = reinterpret_cast<const char *>(rawData);
712094332d3Sopenharmony_ci
713094332d3Sopenharmony_ci    interface->P2pSetGroupConfig(interface, ifName, networkId, name, value);
714094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
715094332d3Sopenharmony_ci}
716094332d3Sopenharmony_ci
717094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pInvite(struct IWpaInterface *interface, const uint8_t *rawData)
718094332d3Sopenharmony_ci{
719094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
720094332d3Sopenharmony_ci    const char *peerBssid = reinterpret_cast<const char *>(rawData);
721094332d3Sopenharmony_ci    const char *goBssid = reinterpret_cast<const char *>(rawData);
722094332d3Sopenharmony_ci
723094332d3Sopenharmony_ci    interface->P2pInvite(interface, ifName, peerBssid, goBssid);
724094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
725094332d3Sopenharmony_ci}
726094332d3Sopenharmony_ci
727094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pReinvoke(struct IWpaInterface *interface, const uint8_t *rawData)
728094332d3Sopenharmony_ci{
729094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
730094332d3Sopenharmony_ci    const char *bssid = reinterpret_cast<const char *>(rawData);
731094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
732094332d3Sopenharmony_ci
733094332d3Sopenharmony_ci    interface->P2pReinvoke(interface, ifName, networkId, bssid);
734094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
735094332d3Sopenharmony_ci}
736094332d3Sopenharmony_ci
737094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pGetDeviceAddress(struct IWpaInterface *interface, const uint8_t *rawData)
738094332d3Sopenharmony_ci{
739094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
740094332d3Sopenharmony_ci    char deviceAddress[32] = {0};
741094332d3Sopenharmony_ci    uint32_t deviceAddressLen = *const_cast<uint32_t *>(reinterpret_cast<const uint32_t *>(rawData));
742094332d3Sopenharmony_ci
743094332d3Sopenharmony_ci    interface->P2pGetDeviceAddress(interface, ifName, deviceAddress, deviceAddressLen);
744094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
745094332d3Sopenharmony_ci}
746094332d3Sopenharmony_ci
747094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pReqServiceDiscovery(struct IWpaInterface *interface, const uint8_t *rawData)
748094332d3Sopenharmony_ci{
749094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
750094332d3Sopenharmony_ci    char *replyDisc = static_cast<char *>(calloc(REPLY_SIZE, sizeof(char)));
751094332d3Sopenharmony_ci    if (replyDisc == nullptr) {
752094332d3Sopenharmony_ci        return;
753094332d3Sopenharmony_ci    }
754094332d3Sopenharmony_ci    uint32_t replyDiscLen = REPLY_SIZE;
755094332d3Sopenharmony_ci    struct HdiP2pReqService reqService;
756094332d3Sopenharmony_ci    (void)memset_s(&reqService, sizeof(struct HdiP2pReqService), 0, sizeof(struct HdiP2pReqService));
757094332d3Sopenharmony_ci    reqService.bssidLen = ETH_ADDR_LEN;
758094332d3Sopenharmony_ci    reqService.bssid = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * (reqService.bssidLen)));
759094332d3Sopenharmony_ci    if (reqService.bssid == nullptr) {
760094332d3Sopenharmony_ci        free(replyDisc);
761094332d3Sopenharmony_ci        return;
762094332d3Sopenharmony_ci    }
763094332d3Sopenharmony_ci    reqService.bssid[0] = 0x12;
764094332d3Sopenharmony_ci    reqService.bssid[1] = 0x34;
765094332d3Sopenharmony_ci    reqService.bssid[2] = 0x56;
766094332d3Sopenharmony_ci    reqService.bssid[3] = 0x78;
767094332d3Sopenharmony_ci    reqService.bssid[4] = 0xab;
768094332d3Sopenharmony_ci    reqService.bssid[5] = 0xcd;
769094332d3Sopenharmony_ci
770094332d3Sopenharmony_ci    interface->P2pReqServiceDiscovery(interface, ifName, &reqService, replyDisc, replyDiscLen);
771094332d3Sopenharmony_ci    free(replyDisc);
772094332d3Sopenharmony_ci    OsalMemFree(reqService.bssid);
773094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
774094332d3Sopenharmony_ci}
775094332d3Sopenharmony_ci
776094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pCancelServiceDiscovery(struct IWpaInterface *interface, const uint8_t *rawData)
777094332d3Sopenharmony_ci{
778094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
779094332d3Sopenharmony_ci    const char *id = reinterpret_cast<const char *>(rawData);
780094332d3Sopenharmony_ci
781094332d3Sopenharmony_ci    interface->P2pCancelServiceDiscovery(interface, ifName, id);
782094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
783094332d3Sopenharmony_ci}
784094332d3Sopenharmony_ci
785094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pRespServerDiscovery(struct IWpaInterface *interface, const uint8_t *rawData)
786094332d3Sopenharmony_ci{
787094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
788094332d3Sopenharmony_ci    struct HdiP2pServDiscReqInfo info;
789094332d3Sopenharmony_ci    (void)memset_s(&info, sizeof(struct HdiP2pServDiscReqInfo), 0, sizeof(struct HdiP2pServDiscReqInfo));
790094332d3Sopenharmony_ci
791094332d3Sopenharmony_ci    interface->P2pRespServerDiscovery(interface, ifName, &info);
792094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
793094332d3Sopenharmony_ci}
794094332d3Sopenharmony_ci
795094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pConnect(struct IWpaInterface *interface, const uint8_t *rawData)
796094332d3Sopenharmony_ci{
797094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
798094332d3Sopenharmony_ci    struct HdiP2pConnectInfo info;
799094332d3Sopenharmony_ci    (void)memset_s(&info, sizeof(struct HdiP2pConnectInfo), 0, sizeof(struct HdiP2pConnectInfo));
800094332d3Sopenharmony_ci    char *replyPin = static_cast<char *>(calloc(REPLY_SIZE, sizeof(char)));
801094332d3Sopenharmony_ci    if (replyPin == nullptr) {
802094332d3Sopenharmony_ci        return;
803094332d3Sopenharmony_ci    }
804094332d3Sopenharmony_ci    uint32_t replyPinLen = REPLY_SIZE;
805094332d3Sopenharmony_ci
806094332d3Sopenharmony_ci    interface->P2pConnect(interface, ifName, &info, replyPin, replyPinLen);
807094332d3Sopenharmony_ci    free(replyPin);
808094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
809094332d3Sopenharmony_ci}
810094332d3Sopenharmony_ci
811094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pHid2dConnect(struct IWpaInterface *interface, const uint8_t *rawData)
812094332d3Sopenharmony_ci{
813094332d3Sopenharmony_ci    const int macAddrIndexOne = 0;
814094332d3Sopenharmony_ci    const int macAddrIndexTwo = 1;
815094332d3Sopenharmony_ci    const int macAddrIndexThree = 2;
816094332d3Sopenharmony_ci    const int macAddrIndexFour = 3;
817094332d3Sopenharmony_ci    const int macAddrIndexFive = 4;
818094332d3Sopenharmony_ci    const int macAddrIndexSix = 5;
819094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
820094332d3Sopenharmony_ci    struct HdiHid2dConnectInfo info;
821094332d3Sopenharmony_ci    (void)memset_s(&info, sizeof(struct HdiHid2dConnectInfo), 0, sizeof(struct HdiHid2dConnectInfo));
822094332d3Sopenharmony_ci    info.bssidLen = ETH_ADDR_LEN;
823094332d3Sopenharmony_ci    info.bssid = static_cast<uint8_t *>(OsalMemCalloc(sizeof(uint8_t) * (info.bssidLen)));
824094332d3Sopenharmony_ci    if (info.bssid == nullptr) {
825094332d3Sopenharmony_ci        return;
826094332d3Sopenharmony_ci    }
827094332d3Sopenharmony_ci    info.bssid[macAddrIndexOne] = 0x00;
828094332d3Sopenharmony_ci    info.bssid[macAddrIndexTwo] = 0x00;
829094332d3Sopenharmony_ci    info.bssid[macAddrIndexThree] = 0x00;
830094332d3Sopenharmony_ci    info.bssid[macAddrIndexFour] = 0x00;
831094332d3Sopenharmony_ci    info.bssid[macAddrIndexFive] = 0x00;
832094332d3Sopenharmony_ci    info.bssid[macAddrIndexSix] = 0x00;
833094332d3Sopenharmony_ci    interface->P2pHid2dConnect(interface, ifName, &info);
834094332d3Sopenharmony_ci    OsalMemFree(info.bssid);
835094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
836094332d3Sopenharmony_ci}
837094332d3Sopenharmony_ci
838094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSetServDiscExternal(struct IWpaInterface *interface, const uint8_t *rawData)
839094332d3Sopenharmony_ci{
840094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
841094332d3Sopenharmony_ci    int32_t mode = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
842094332d3Sopenharmony_ci
843094332d3Sopenharmony_ci    interface->P2pSetServDiscExternal(interface, ifName, mode);
844094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
845094332d3Sopenharmony_ci}
846094332d3Sopenharmony_ci
847094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pRemoveGroup(struct IWpaInterface *interface, const uint8_t *rawData)
848094332d3Sopenharmony_ci{
849094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
850094332d3Sopenharmony_ci    const char *groupName = reinterpret_cast<const char *>(rawData);
851094332d3Sopenharmony_ci
852094332d3Sopenharmony_ci    interface->P2pRemoveGroup(interface, ifName, groupName);
853094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
854094332d3Sopenharmony_ci}
855094332d3Sopenharmony_ci
856094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pCancelConnect(struct IWpaInterface *interface, const uint8_t *rawData)
857094332d3Sopenharmony_ci{
858094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
859094332d3Sopenharmony_ci
860094332d3Sopenharmony_ci    interface->P2pCancelConnect(interface, ifName);
861094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
862094332d3Sopenharmony_ci}
863094332d3Sopenharmony_ci
864094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pGetGroupConfig(struct IWpaInterface *interface, const uint8_t *rawData)
865094332d3Sopenharmony_ci{
866094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
867094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
868094332d3Sopenharmony_ci    const char *param = reinterpret_cast<const char *>(rawData);
869094332d3Sopenharmony_ci    char value[32] = {0};
870094332d3Sopenharmony_ci    uint32_t valueLen = *const_cast<uint32_t *>(reinterpret_cast<const uint32_t *>(rawData));
871094332d3Sopenharmony_ci
872094332d3Sopenharmony_ci    interface->P2pGetGroupConfig(interface, ifName, networkId, param, value, valueLen);
873094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
874094332d3Sopenharmony_ci}
875094332d3Sopenharmony_ci
876094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pAddNetwork(struct IWpaInterface *interface, const uint8_t *rawData)
877094332d3Sopenharmony_ci{
878094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
879094332d3Sopenharmony_ci    int32_t networkId = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
880094332d3Sopenharmony_ci
881094332d3Sopenharmony_ci    interface->P2pAddNetwork(interface, ifName, &networkId);
882094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
883094332d3Sopenharmony_ci}
884094332d3Sopenharmony_ci
885094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pGetPeer(struct IWpaInterface *interface, const uint8_t *rawData)
886094332d3Sopenharmony_ci{
887094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
888094332d3Sopenharmony_ci    const char *bssid = reinterpret_cast<const char *>(rawData);
889094332d3Sopenharmony_ci    struct HdiP2pDeviceInfo info;
890094332d3Sopenharmony_ci    (void)memset_s(&info, sizeof(struct HdiP2pDeviceInfo), 0, sizeof(struct HdiP2pDeviceInfo));
891094332d3Sopenharmony_ci
892094332d3Sopenharmony_ci    interface->P2pGetPeer(interface, ifName, bssid, &info);
893094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
894094332d3Sopenharmony_ci}
895094332d3Sopenharmony_ci
896094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pGetGroupCapability(struct IWpaInterface *interface, const uint8_t *rawData)
897094332d3Sopenharmony_ci{
898094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
899094332d3Sopenharmony_ci    const char *bssid = reinterpret_cast<const char *>(rawData);
900094332d3Sopenharmony_ci    int32_t cap = *const_cast<int32_t *>(reinterpret_cast<const int32_t *>(rawData));
901094332d3Sopenharmony_ci
902094332d3Sopenharmony_ci    interface->P2pGetGroupCapability(interface, ifName, bssid, &cap);
903094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
904094332d3Sopenharmony_ci}
905094332d3Sopenharmony_ci
906094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pListNetworks(struct IWpaInterface *interface, const uint8_t *rawData)
907094332d3Sopenharmony_ci{
908094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
909094332d3Sopenharmony_ci    struct HdiP2pNetworkList infoList;
910094332d3Sopenharmony_ci    (void)memset_s(&infoList, sizeof(struct HdiP2pNetworkList), 0, sizeof(struct HdiP2pNetworkList));
911094332d3Sopenharmony_ci
912094332d3Sopenharmony_ci    interface->P2pListNetworks(interface, ifName, &infoList);
913094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
914094332d3Sopenharmony_ci}
915094332d3Sopenharmony_ci
916094332d3Sopenharmony_civoid FuzzWpaInterfaceP2pSaveConfig(struct IWpaInterface *interface, const uint8_t *rawData)
917094332d3Sopenharmony_ci{
918094332d3Sopenharmony_ci    const char *ifName = reinterpret_cast<const char *>(rawData);
919094332d3Sopenharmony_ci
920094332d3Sopenharmony_ci    interface->P2pSaveConfig(interface, ifName);
921094332d3Sopenharmony_ci    HDF_LOGI("%{public}s: success", __FUNCTION__);
922094332d3Sopenharmony_ci}
923