/src/hostap/wpa_supplicant/nan_supplicant.h
Line | Count | Source |
1 | | /* |
2 | | * wpa_supplicant - NAN |
3 | | * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
4 | | * Copyright (C) 2025 Intel Corporation |
5 | | * |
6 | | * This software may be distributed under the terms of the BSD license. |
7 | | * See README for more details. |
8 | | */ |
9 | | |
10 | | #ifndef NAN_SUPPLICANT_H |
11 | | #define NAN_SUPPLICANT_H |
12 | | |
13 | | /* NAN synchronization only */ |
14 | | #ifdef CONFIG_NAN |
15 | | |
16 | | int wpas_nan_init(struct wpa_supplicant *wpa_s); |
17 | | void wpas_nan_deinit(struct wpa_supplicant *wpa_s); |
18 | | int wpas_nan_start(struct wpa_supplicant *wpa_s); |
19 | | int wpas_nan_set(struct wpa_supplicant *wpa_s, char *cmd); |
20 | | void wpas_nan_deinit_pik_cache(struct wpa_supplicant *wpa_s); |
21 | | int wpas_nan_update_conf(struct wpa_supplicant *wpa_s); |
22 | | int wpas_nan_stop(struct wpa_supplicant *wpa_s); |
23 | | void wpas_nan_flush(struct wpa_supplicant *wpa_s); |
24 | | void wpas_nan_flush_ndps(struct wpa_supplicant *wpa_s); |
25 | | void wpas_nan_cluster_join(struct wpa_supplicant *wpa_s, |
26 | | const u8 *cluster_id, |
27 | | bool new_cluster); |
28 | | void wpas_nan_next_dw(struct wpa_supplicant *wpa_s, u32 freq); |
29 | | void wpas_nan_sched_update_done(struct wpa_supplicant *wpa_s, |
30 | | const union wpa_event_data *data); |
31 | | void wpas_nan_ulw_update(struct wpa_supplicant *wpa_s, |
32 | | const u8 *ulw, size_t ulw_len); |
33 | | void wpas_nan_chan_evacuation(struct wpa_supplicant *wpa_s, |
34 | | const struct nan_chan_evacuation_info *info); |
35 | | int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, char *cmd); |
36 | | int wpas_nan_ndp_request(struct wpa_supplicant *wpa_s, char *cmd); |
37 | | void wpas_nan_rx_beacon(struct wpa_supplicant *wpa_s, |
38 | | const struct ieee80211_mgmt *mgmt, size_t len); |
39 | | void wpas_nan_rx_naf(struct wpa_supplicant *wpa_s, |
40 | | const struct ieee80211_mgmt *mgmt, size_t len); |
41 | | void wpas_nan_flush_niks(struct wpa_supplicant *wpa_s); |
42 | | const struct wpa_dev_ik * |
43 | | wpas_nan_find_ik_by_nonce_tag(struct wpa_supplicant *wpa_s, |
44 | | const u8 *peer_nmi, |
45 | | const u8 *nonce, const u8 *tag); |
46 | | int wpas_nan_ndp_response(struct wpa_supplicant *wpa_s, char *cmd); |
47 | | int wpas_nan_ndp_terminate(struct wpa_supplicant *wpa_s, char *cmd); |
48 | | int wpas_nan_peer_info(struct wpa_supplicant *wpa_s, const char *cmd, |
49 | | char *reply, size_t reply_size); |
50 | | int wpas_nan_status(struct wpa_supplicant *wpa_s, char *reply, |
51 | | size_t reply_size); |
52 | | int wpas_nan_bootstrap_request(struct wpa_supplicant *wpa_s, char *cmd); |
53 | | int wpas_nan_bootstrap_reset(struct wpa_supplicant *wpa_s, char *cmd); |
54 | | bool wpas_nan_is_peer_paired(struct wpa_supplicant *wpa_s, const u8 *peer_addr); |
55 | | void wpas_nan_data_interface_removed(struct wpa_supplicant *wpa_s); |
56 | | |
57 | | int wpas_nan_pair(struct wpa_supplicant *wpa_s, const u8 *peer_addr, |
58 | | u8 auth_mode, int cipher, int handle, u8 peer_instance_id, |
59 | | bool responder, const char *password, bool auto_nik_exchange); |
60 | | int wpas_nan_pairing_start(struct wpa_supplicant *wpa_s, char *cmd); |
61 | | int wpas_nan_pairing_abort(struct wpa_supplicant *wpa_s, const char *cmd); |
62 | | int wpas_nan_send_nik(struct wpa_supplicant *wpa_s, const char *cmd); |
63 | | int wpas_nan_cm_terminate(struct wpa_supplicant *wpa_s, char *cmd); |
64 | | int wpas_nan_cm_deauth(struct wpa_supplicant *wpa_s, const char *cmd); |
65 | | int wpas_nan_cm_rekey(struct wpa_supplicant *wpa_s, char *cmd); |
66 | | int wpas_nan_get_sae_pairing_tk(struct wpa_supplicant *wpa_s, const char *cmd, |
67 | | char *buf, size_t buflen); |
68 | | int wpas_nan_get_sae_pairing_pmkid(struct wpa_supplicant *wpa_s, |
69 | | const char *cmd, char *buf, size_t buflen); |
70 | | int wpas_nan_get_self_pkr(struct wpa_supplicant *wpa_s, char *buf, |
71 | | size_t buflen); |
72 | | int wpas_nan_update_pkr(struct wpa_supplicant *wpa_s, char *cmd); |
73 | | int wpas_nan_pasn_auth_tx_status(struct wpa_supplicant *wpa_s, const u8 *data, |
74 | | size_t data_len, bool acked); |
75 | | int wpas_nan_pasn_auth_rx(struct wpa_supplicant *wpa_s, |
76 | | const struct ieee80211_mgmt *mgmt, size_t len, |
77 | | int freq); |
78 | | |
79 | | #else /* CONFIG_NAN */ |
80 | | |
81 | | static inline int wpas_nan_init(struct wpa_supplicant *wpa_s) |
82 | 0 | { |
83 | 0 | return -1; |
84 | 0 | } Unexecuted instantiation: events.c:wpas_nan_init Unexecuted instantiation: wpa_supplicant.c:wpas_nan_init |
85 | | |
86 | | static inline void wpas_nan_deinit(struct wpa_supplicant *wpa_s) |
87 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_deinit Unexecuted instantiation: wpa_supplicant.c:wpas_nan_deinit |
88 | | |
89 | | static inline void wpas_nan_deinit_pik_cache(struct wpa_supplicant *wpa_s) |
90 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_deinit_pik_cache Unexecuted instantiation: wpa_supplicant.c:wpas_nan_deinit_pik_cache |
91 | | |
92 | | static inline int wpas_nan_start(struct wpa_supplicant *wpa_s) |
93 | 0 | { |
94 | 0 | return -1; |
95 | 0 | } Unexecuted instantiation: events.c:wpas_nan_start Unexecuted instantiation: wpa_supplicant.c:wpas_nan_start |
96 | | |
97 | | static inline int wpas_nan_set(struct wpa_supplicant *wpa_s, char *cmd) |
98 | 0 | { |
99 | 0 | return -1; |
100 | 0 | } Unexecuted instantiation: events.c:wpas_nan_set Unexecuted instantiation: wpa_supplicant.c:wpas_nan_set |
101 | | |
102 | | static inline int wpas_nan_update_conf(struct wpa_supplicant *wpa_s) |
103 | 0 | { |
104 | 0 | return -1; |
105 | 0 | } Unexecuted instantiation: events.c:wpas_nan_update_conf Unexecuted instantiation: wpa_supplicant.c:wpas_nan_update_conf |
106 | | |
107 | | static inline int wpas_nan_stop(struct wpa_supplicant *wpa_s) |
108 | 0 | { |
109 | 0 | return -1; |
110 | 0 | } Unexecuted instantiation: events.c:wpas_nan_stop Unexecuted instantiation: wpa_supplicant.c:wpas_nan_stop |
111 | | |
112 | | static inline void wpas_nan_flush_ndps(struct wpa_supplicant *wpa_s) |
113 | 0 | { |
114 | 0 | } Unexecuted instantiation: events.c:wpas_nan_flush_ndps Unexecuted instantiation: wpa_supplicant.c:wpas_nan_flush_ndps |
115 | | |
116 | | static inline void wpas_nan_flush(struct wpa_supplicant *wpa_s) |
117 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_flush Unexecuted instantiation: wpa_supplicant.c:wpas_nan_flush |
118 | | |
119 | | static inline void wpas_nan_cluster_join(struct wpa_supplicant *wpa_s, |
120 | | const u8 *cluster_id, |
121 | | bool new_cluster) |
122 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_cluster_join Unexecuted instantiation: wpa_supplicant.c:wpas_nan_cluster_join |
123 | | |
124 | | static inline void wpas_nan_next_dw(struct wpa_supplicant *wpa_s, u32 freq) |
125 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_next_dw Unexecuted instantiation: wpa_supplicant.c:wpas_nan_next_dw |
126 | | |
127 | | static inline void wpas_nan_sched_update_done(struct wpa_supplicant *wpa_s, |
128 | | const union wpa_event_data *data) |
129 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_sched_update_done Unexecuted instantiation: wpa_supplicant.c:wpas_nan_sched_update_done |
130 | | |
131 | | static inline void wpas_nan_ulw_update(struct wpa_supplicant *wpa_s, |
132 | | const u8 *ulw, size_t ulw_len) |
133 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_ulw_update Unexecuted instantiation: wpa_supplicant.c:wpas_nan_ulw_update |
134 | | |
135 | | static inline void wpas_nan_rx_beacon(struct wpa_supplicant *wpa_s, |
136 | | const struct ieee80211_mgmt *mgmt, |
137 | | size_t len) |
138 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_rx_beacon Unexecuted instantiation: wpa_supplicant.c:wpas_nan_rx_beacon |
139 | | |
140 | | static inline void wpas_nan_rx_naf(struct wpa_supplicant *wpa_s, |
141 | | const struct ieee80211_mgmt *mgmt, |
142 | | size_t len) |
143 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_rx_naf Unexecuted instantiation: wpa_supplicant.c:wpas_nan_rx_naf |
144 | | |
145 | | static inline void wpas_nan_flush_niks(struct wpa_supplicant *wpa_s) |
146 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_flush_niks Unexecuted instantiation: wpa_supplicant.c:wpas_nan_flush_niks |
147 | | |
148 | | static inline bool wpas_nan_is_peer_paired(struct wpa_supplicant *wpa_s, |
149 | | const u8 *peer_addr) |
150 | 0 | { |
151 | 0 | return false; |
152 | 0 | } Unexecuted instantiation: events.c:wpas_nan_is_peer_paired Unexecuted instantiation: wpa_supplicant.c:wpas_nan_is_peer_paired |
153 | | |
154 | | static inline void |
155 | | wpas_nan_chan_evacuation(struct wpa_supplicant *wpa_s, |
156 | | union wpa_event_data *data) |
157 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_chan_evacuation Unexecuted instantiation: wpa_supplicant.c:wpas_nan_chan_evacuation |
158 | | |
159 | | #endif /* CONFIG_NAN */ |
160 | | |
161 | | struct nan_subscribe_params; |
162 | | struct nan_publish_params; |
163 | | enum nan_service_protocol_type; |
164 | | |
165 | | /* NAN sync and USD common */ |
166 | | #if defined(CONFIG_NAN_USD) || defined(CONFIG_NAN) |
167 | | |
168 | | int wpas_nan_de_init(struct wpa_supplicant *wpa_s); |
169 | | void wpas_nan_de_deinit(struct wpa_supplicant *wpa_s); |
170 | | void wpas_nan_de_rx_sdf(struct wpa_supplicant *wpa_s, const u8 *src, |
171 | | const u8 *a3, unsigned int freq, |
172 | | const u8 *buf, size_t len, int rssi); |
173 | | void wpas_nan_de_flush(struct wpa_supplicant *wpa_s); |
174 | | int wpas_nan_publish(struct wpa_supplicant *wpa_s, const char *service_name, |
175 | | enum nan_service_protocol_type srv_proto_type, |
176 | | const struct wpabuf *ssi, |
177 | | struct nan_publish_params *params, bool p2p); |
178 | | void wpas_nan_cancel_publish(struct wpa_supplicant *wpa_s, int publish_id); |
179 | | int wpas_nan_update_publish(struct wpa_supplicant *wpa_s, int publish_id, |
180 | | const struct wpabuf *ssi); |
181 | | int wpas_nan_subscribe(struct wpa_supplicant *wpa_s, |
182 | | const char *service_name, |
183 | | enum nan_service_protocol_type srv_proto_type, |
184 | | const struct wpabuf *ssi, |
185 | | struct nan_subscribe_params *params, bool p2p); |
186 | | void wpas_nan_cancel_subscribe(struct wpa_supplicant *wpa_s, |
187 | | int subscribe_id); |
188 | | int wpas_nan_transmit(struct wpa_supplicant *wpa_s, int handle, |
189 | | const struct wpabuf *ssi, const struct wpabuf *elems, |
190 | | const u8 *peer_addr, u8 req_instance_id, u32 *cookie); |
191 | | int wpas_nan_tx_status(struct wpa_supplicant *wpa_s, |
192 | | const u8 *data, size_t data_len, int acked); |
193 | | |
194 | | #else /* CONFIG_NAN_USD || CONFIG_NAN */ |
195 | | |
196 | | static inline int wpas_nan_de_init(struct wpa_supplicant *wpa_s) |
197 | 0 | { |
198 | 0 | return 0; |
199 | 0 | } Unexecuted instantiation: events.c:wpas_nan_de_init Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_init |
200 | | |
201 | | static inline void wpas_nan_de_deinit(struct wpa_supplicant *wpa_s) |
202 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_de_deinit Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_deinit |
203 | | |
204 | | static inline |
205 | | void wpas_nan_de_rx_sdf(struct wpa_supplicant *wpa_s, const u8 *src, |
206 | | const u8 *a3, unsigned int freq, |
207 | | const u8 *buf, size_t len, int rssi) |
208 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_de_rx_sdf Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_rx_sdf |
209 | | |
210 | | static inline void wpas_nan_de_flush(struct wpa_supplicant *wpa_s) |
211 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_de_flush Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_flush |
212 | | |
213 | | static inline int wpas_nan_tx_status(struct wpa_supplicant *wpa_s, |
214 | | const u8 *data, size_t data_len, |
215 | | u8 acked) |
216 | 0 | { |
217 | 0 | return -1; |
218 | 0 | } Unexecuted instantiation: events.c:wpas_nan_tx_status Unexecuted instantiation: wpa_supplicant.c:wpas_nan_tx_status |
219 | | |
220 | | #endif /* CONFIG_NAN_USD || CONFIG_NAN */ |
221 | | |
222 | | /* NAN USD only */ |
223 | | #ifdef CONFIG_NAN_USD |
224 | | |
225 | | void wpas_nan_usd_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
226 | | unsigned int freq, |
227 | | unsigned int duration); |
228 | | void wpas_nan_usd_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
229 | | unsigned int freq); |
230 | | void wpas_nan_usd_tx_wait_expire(struct wpa_supplicant *wpa_s); |
231 | | int * wpas_nan_usd_all_freqs(struct wpa_supplicant *wpa_s); |
232 | | int wpas_nan_usd_unpause_publish(struct wpa_supplicant *wpa_s, int publish_id, |
233 | | u8 peer_instance_id, const u8 *peer_addr); |
234 | | int wpas_nan_usd_publish_stop_listen(struct wpa_supplicant *wpa_s, |
235 | | int publish_id); |
236 | | int wpas_nan_usd_subscribe_stop_listen(struct wpa_supplicant *wpa_s, |
237 | | int subscribe_id); |
238 | | void wpas_nan_usd_state_change_notif(struct wpa_supplicant *wpa_s); |
239 | | |
240 | | #else /* CONFIG_NAN_USD */ |
241 | | |
242 | | static inline |
243 | | void wpas_nan_usd_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
244 | | unsigned int freq, |
245 | | unsigned int duration) |
246 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_usd_remain_on_channel_cb Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_remain_on_channel_cb |
247 | | |
248 | | static inline |
249 | | void wpas_nan_usd_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
250 | | unsigned int freq) |
251 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_usd_cancel_remain_on_channel_cb Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_cancel_remain_on_channel_cb |
252 | | |
253 | | static inline void wpas_nan_usd_tx_wait_expire(struct wpa_supplicant *wpa_s) |
254 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_usd_tx_wait_expire Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_tx_wait_expire |
255 | | |
256 | | static inline |
257 | | int * wpas_nan_usd_all_freqs(struct wpa_supplicant *wpa_s) |
258 | 0 | { |
259 | 0 | return NULL; |
260 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_all_freqs Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_all_freqs |
261 | | |
262 | | static inline |
263 | | int wpas_nan_usd_unpause_publish(struct wpa_supplicant *wpa_s, int publish_id, |
264 | | u8 peer_instance_id, const u8 *peer_addr) |
265 | 0 | { |
266 | 0 | return -1; |
267 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_unpause_publish Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_unpause_publish |
268 | | |
269 | | static inline |
270 | | int wpas_nan_usd_publish_stop_listen(struct wpa_supplicant *wpa_s, |
271 | | int publish_id) |
272 | 0 | { |
273 | 0 | return -1; |
274 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_publish_stop_listen Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_publish_stop_listen |
275 | | |
276 | | static inline |
277 | | int wpas_nan_usd_subscribe_stop_listen(struct wpa_supplicant *wpa_s, |
278 | | int subscribe_id) |
279 | 0 | { |
280 | 0 | return -1; |
281 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_subscribe_stop_listen Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_subscribe_stop_listen |
282 | | |
283 | | static inline void wpas_nan_usd_state_change_notif(struct wpa_supplicant *wpa_s) |
284 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_usd_state_change_notif Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_state_change_notif |
285 | | |
286 | | #endif /* CONFIG_NAN_USD */ |
287 | | |
288 | | #endif /* NAN_SUPPLICANT_H */ |