1 /*
2  * SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef __ESP_WPA_H__
8 #define __ESP_WPA_H__
9 
10 #include <stdint.h>
11 #include <stdbool.h>
12 #include "esp_err.h"
13 #include "esp_wifi_crypto_types.h"
14 #include "esp_wifi_types.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 /** \defgroup WiFi_APIs WiFi Related APIs
21   * @brief WiFi APIs
22   */
23 
24 /** @addtogroup WiFi_APIs
25   * @{
26   */
27 
28 /** \defgroup WPA_APIs  WPS APIs
29   * @brief Supplicant APIs
30   *
31   */
32 
33 /** @addtogroup WPA_APIs
34   * @{
35   */
36 /* Crypto callback functions */
37 extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; // NOLINT(readability-redundant-declaration)
38 
39 /* Mesh crypto callback functions */
40 extern const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs;
41 
42 /**
43   * @brief     Supplicant initialization
44   *
45   * @return
46   *          - ESP_OK : succeed
47   *          - ESP_ERR_NO_MEM : out of memory
48   */
49 esp_err_t esp_supplicant_init(void);
50 
51 /**
52   * @brief     Supplicant deinitialization
53   *
54   * @return
55   *          - ESP_OK : succeed
56   *          - others: failed
57   */
58 esp_err_t esp_supplicant_deinit(void);
59 
60 /**
61  * @brief Disable or enable the caching of Pairwise Master Keys (PMK) in the supplicant.
62  *
63  * This function allows disabling or enabling the caching of Pairwise Master Keys (PMK).
64  * PMK caching is used in Wi-Fi Protected Access (WPA/WPA2/WPA3) networks to speed up the reconnection process
65  * by storing the PMK generated during the initial connection. Disabling PMK caching may result in slightly
66  * longer reconnection times. PMK caching is enabled by default, this configuration has been provided
67  * in case the AP is known not to support PMK caching or has a buggy implementation for PMK caching.
68  *
69  * @param disable Boolean indicating whether to disable (true) or enable (false) PMK caching.
70  * @return
71  *     - ESP_OK: Success
72  *     - An error code if disabling or enabling PMK caching fails.
73  */
74 esp_err_t esp_supplicant_disable_pmk_caching(bool disable);
75 
76 /**
77   * @}
78   */
79 
80 /**
81   * @}
82   */
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* __ESP_WPA_H__ */
89