/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 | | int wpas_nan_update_conf(struct wpa_supplicant *wpa_s); |
21 | | int wpas_nan_stop(struct wpa_supplicant *wpa_s); |
22 | | void wpas_nan_flush(struct wpa_supplicant *wpa_s); |
23 | | void wpas_nan_cluster_join(struct wpa_supplicant *wpa_s, |
24 | | const u8 *cluster_id, |
25 | | bool new_cluster); |
26 | | void wpas_nan_next_dw(struct wpa_supplicant *wpa_s, u32 freq); |
27 | | void wpas_nan_sched_update_done(struct wpa_supplicant *wpa_s, |
28 | | const union wpa_event_data *data); |
29 | | void wpas_nan_ulw_update(struct wpa_supplicant *wpa_s, |
30 | | const u8 *ulw, size_t ulw_len); |
31 | | void wpas_nan_chan_evacuation(struct wpa_supplicant *wpa_s, |
32 | | const struct nan_chan_evacuation_info *info); |
33 | | int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd); |
34 | | int wpas_nan_ndp_request(struct wpa_supplicant *wpa_s, char *cmd); |
35 | | void wpas_nan_rx_naf(struct wpa_supplicant *wpa_s, |
36 | | const struct ieee80211_mgmt *mgmt, size_t len); |
37 | | void wpas_nan_flush_niks(struct wpa_supplicant *wpa_s); |
38 | | int wpas_nan_ndp_response(struct wpa_supplicant *wpa_s, char *cmd); |
39 | | int wpas_nan_ndp_terminate(struct wpa_supplicant *wpa_s, char *cmd); |
40 | | int wpas_nan_peer_info(struct wpa_supplicant *wpa_s, const char *cmd, |
41 | | char *reply, size_t reply_size); |
42 | | int wpas_nan_status(struct wpa_supplicant *wpa_s, char *reply, |
43 | | size_t reply_size); |
44 | | int wpas_nan_bootstrap_request(struct wpa_supplicant *wpa_s, char *cmd); |
45 | | int wpas_nan_bootstrap_reset(struct wpa_supplicant *wpa_s, char *cmd); |
46 | | bool wpas_nan_is_peer_paired(struct wpa_supplicant *wpa_s, const u8 *peer_addr); |
47 | | void wpas_nan_data_interface_removed(struct wpa_supplicant *wpa_s); |
48 | | |
49 | | int wpas_nan_pair(struct wpa_supplicant *wpa_s, const u8 *peer_addr, |
50 | | u8 auth_mode, int cipher, int handle, u8 peer_instance_id, |
51 | | bool responder, const char *password, bool auto_nik_exchange); |
52 | | int wpas_nan_pairing_start(struct wpa_supplicant *wpa_s, char *cmd); |
53 | | int wpas_nan_pairing_abort(struct wpa_supplicant *wpa_s, const char *cmd); |
54 | | int wpas_nan_send_nik(struct wpa_supplicant *wpa_s, const char *cmd); |
55 | | int wpas_nan_get_sae_pairing_tk(struct wpa_supplicant *wpa_s, const char *cmd, |
56 | | char *buf, size_t buflen); |
57 | | int wpas_nan_get_sae_pairing_pmkid(struct wpa_supplicant *wpa_s, |
58 | | const char *cmd, char *buf, size_t buflen); |
59 | | int wpas_nan_pasn_auth_tx_status(struct wpa_supplicant *wpa_s, const u8 *data, |
60 | | size_t data_len, bool acked); |
61 | | int wpas_nan_pasn_auth_rx(struct wpa_supplicant *wpa_s, |
62 | | const struct ieee80211_mgmt *mgmt, size_t len, |
63 | | int freq); |
64 | | |
65 | | #else /* CONFIG_NAN */ |
66 | | |
67 | | static inline int wpas_nan_init(struct wpa_supplicant *wpa_s) |
68 | 0 | { |
69 | 0 | return -1; |
70 | 0 | } Unexecuted instantiation: events.c:wpas_nan_init Unexecuted instantiation: wpa_supplicant.c:wpas_nan_init |
71 | | |
72 | | static inline void wpas_nan_deinit(struct wpa_supplicant *wpa_s) |
73 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_deinit Unexecuted instantiation: wpa_supplicant.c:wpas_nan_deinit |
74 | | |
75 | | static inline int wpas_nan_start(struct wpa_supplicant *wpa_s) |
76 | 0 | { |
77 | 0 | return -1; |
78 | 0 | } Unexecuted instantiation: events.c:wpas_nan_start Unexecuted instantiation: wpa_supplicant.c:wpas_nan_start |
79 | | |
80 | | static inline int wpas_nan_set(struct wpa_supplicant *wpa_s, char *cmd) |
81 | 0 | { |
82 | 0 | return -1; |
83 | 0 | } Unexecuted instantiation: events.c:wpas_nan_set Unexecuted instantiation: wpa_supplicant.c:wpas_nan_set |
84 | | |
85 | | static inline int wpas_nan_update_conf(struct wpa_supplicant *wpa_s) |
86 | 0 | { |
87 | 0 | return -1; |
88 | 0 | } Unexecuted instantiation: events.c:wpas_nan_update_conf Unexecuted instantiation: wpa_supplicant.c:wpas_nan_update_conf |
89 | | |
90 | | static inline int wpas_nan_stop(struct wpa_supplicant *wpa_s) |
91 | 0 | { |
92 | 0 | return -1; |
93 | 0 | } Unexecuted instantiation: events.c:wpas_nan_stop Unexecuted instantiation: wpa_supplicant.c:wpas_nan_stop |
94 | | |
95 | | static inline void wpas_nan_flush(struct wpa_supplicant *wpa_s) |
96 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_flush Unexecuted instantiation: wpa_supplicant.c:wpas_nan_flush |
97 | | |
98 | | static inline void wpas_nan_cluster_join(struct wpa_supplicant *wpa_s, |
99 | | const u8 *cluster_id, |
100 | | bool new_cluster) |
101 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_cluster_join Unexecuted instantiation: wpa_supplicant.c:wpas_nan_cluster_join |
102 | | |
103 | | static inline void wpas_nan_next_dw(struct wpa_supplicant *wpa_s, u32 freq) |
104 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_next_dw Unexecuted instantiation: wpa_supplicant.c:wpas_nan_next_dw |
105 | | |
106 | | static inline void wpas_nan_sched_update_done(struct wpa_supplicant *wpa_s, |
107 | | const union wpa_event_data *data) |
108 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_sched_update_done Unexecuted instantiation: wpa_supplicant.c:wpas_nan_sched_update_done |
109 | | |
110 | | static inline void wpas_nan_ulw_update(struct wpa_supplicant *wpa_s, |
111 | | const u8 *ulw, size_t ulw_len) |
112 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_ulw_update Unexecuted instantiation: wpa_supplicant.c:wpas_nan_ulw_update |
113 | | |
114 | | static inline void wpas_nan_rx_naf(struct wpa_supplicant *wpa_s, |
115 | | const struct ieee80211_mgmt *mgmt, |
116 | | size_t len) |
117 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_rx_naf Unexecuted instantiation: wpa_supplicant.c:wpas_nan_rx_naf |
118 | | |
119 | | static inline bool wpas_nan_is_peer_paired(struct wpa_supplicant *wpa_s, |
120 | | const u8 *peer_addr) |
121 | 0 | { |
122 | 0 | return false; |
123 | 0 | } Unexecuted instantiation: events.c:wpas_nan_is_peer_paired Unexecuted instantiation: wpa_supplicant.c:wpas_nan_is_peer_paired |
124 | | |
125 | | static inline void |
126 | | wpas_nan_chan_evacuation(struct wpa_supplicant *wpa_s, |
127 | | union wpa_event_data *data) |
128 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_chan_evacuation Unexecuted instantiation: wpa_supplicant.c:wpas_nan_chan_evacuation |
129 | | |
130 | | #endif /* CONFIG_NAN */ |
131 | | |
132 | | struct nan_subscribe_params; |
133 | | struct nan_publish_params; |
134 | | enum nan_service_protocol_type; |
135 | | |
136 | | /* NAN sync and USD common */ |
137 | | #if defined(CONFIG_NAN_USD) || defined(CONFIG_NAN) |
138 | | |
139 | | int wpas_nan_de_init(struct wpa_supplicant *wpa_s); |
140 | | void wpas_nan_de_deinit(struct wpa_supplicant *wpa_s); |
141 | | void wpas_nan_de_rx_sdf(struct wpa_supplicant *wpa_s, const u8 *src, |
142 | | const u8 *a3, unsigned int freq, |
143 | | const u8 *buf, size_t len, int rssi); |
144 | | void wpas_nan_de_flush(struct wpa_supplicant *wpa_s); |
145 | | int wpas_nan_publish(struct wpa_supplicant *wpa_s, const char *service_name, |
146 | | enum nan_service_protocol_type srv_proto_type, |
147 | | const struct wpabuf *ssi, |
148 | | struct nan_publish_params *params, bool p2p); |
149 | | void wpas_nan_cancel_publish(struct wpa_supplicant *wpa_s, int publish_id); |
150 | | int wpas_nan_update_publish(struct wpa_supplicant *wpa_s, int publish_id, |
151 | | const struct wpabuf *ssi); |
152 | | int wpas_nan_subscribe(struct wpa_supplicant *wpa_s, |
153 | | const char *service_name, |
154 | | enum nan_service_protocol_type srv_proto_type, |
155 | | const struct wpabuf *ssi, |
156 | | struct nan_subscribe_params *params, bool p2p); |
157 | | void wpas_nan_cancel_subscribe(struct wpa_supplicant *wpa_s, |
158 | | int subscribe_id); |
159 | | int wpas_nan_transmit(struct wpa_supplicant *wpa_s, int handle, |
160 | | const struct wpabuf *ssi, const struct wpabuf *elems, |
161 | | const u8 *peer_addr, u8 req_instance_id, u32 *cookie); |
162 | | int wpas_nan_tx_status(struct wpa_supplicant *wpa_s, |
163 | | const u8 *data, size_t data_len, int acked); |
164 | | |
165 | | #else /* CONFIG_NAN_USD || CONFIG_NAN */ |
166 | | |
167 | | static inline int wpas_nan_de_init(struct wpa_supplicant *wpa_s) |
168 | 0 | { |
169 | 0 | return 0; |
170 | 0 | } Unexecuted instantiation: events.c:wpas_nan_de_init Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_init |
171 | | |
172 | | static inline void wpas_nan_de_deinit(struct wpa_supplicant *wpa_s) |
173 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_de_deinit Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_deinit |
174 | | |
175 | | static inline |
176 | | void wpas_nan_de_rx_sdf(struct wpa_supplicant *wpa_s, const u8 *src, |
177 | | const u8 *a3, unsigned int freq, |
178 | | const u8 *buf, size_t len, int rssi) |
179 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_de_rx_sdf Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_rx_sdf |
180 | | |
181 | | static inline void wpas_nan_de_flush(struct wpa_supplicant *wpa_s) |
182 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_de_flush Unexecuted instantiation: wpa_supplicant.c:wpas_nan_de_flush |
183 | | |
184 | | static inline int wpas_nan_tx_status(struct wpa_supplicant *wpa_s, |
185 | | const u8 *data, size_t data_len, |
186 | | u8 acked) |
187 | 0 | { |
188 | 0 | return -1; |
189 | 0 | } Unexecuted instantiation: events.c:wpas_nan_tx_status Unexecuted instantiation: wpa_supplicant.c:wpas_nan_tx_status |
190 | | |
191 | | #endif /* CONFIG_NAN_USD || CONFIG_NAN */ |
192 | | |
193 | | /* NAN USD only */ |
194 | | #ifdef CONFIG_NAN_USD |
195 | | |
196 | | void wpas_nan_usd_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
197 | | unsigned int freq, |
198 | | unsigned int duration); |
199 | | void wpas_nan_usd_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
200 | | unsigned int freq); |
201 | | void wpas_nan_usd_tx_wait_expire(struct wpa_supplicant *wpa_s); |
202 | | int * wpas_nan_usd_all_freqs(struct wpa_supplicant *wpa_s); |
203 | | int wpas_nan_usd_unpause_publish(struct wpa_supplicant *wpa_s, int publish_id, |
204 | | u8 peer_instance_id, const u8 *peer_addr); |
205 | | int wpas_nan_usd_publish_stop_listen(struct wpa_supplicant *wpa_s, |
206 | | int publish_id); |
207 | | int wpas_nan_usd_subscribe_stop_listen(struct wpa_supplicant *wpa_s, |
208 | | int subscribe_id); |
209 | | void wpas_nan_usd_state_change_notif(struct wpa_supplicant *wpa_s); |
210 | | |
211 | | #else /* CONFIG_NAN_USD */ |
212 | | |
213 | | static inline |
214 | | void wpas_nan_usd_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
215 | | unsigned int freq, |
216 | | unsigned int duration) |
217 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_usd_remain_on_channel_cb Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_remain_on_channel_cb |
218 | | |
219 | | static inline |
220 | | void wpas_nan_usd_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, |
221 | | unsigned int freq) |
222 | 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 |
223 | | |
224 | | static inline void wpas_nan_usd_tx_wait_expire(struct wpa_supplicant *wpa_s) |
225 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_usd_tx_wait_expire Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_tx_wait_expire |
226 | | |
227 | | static inline |
228 | | int * wpas_nan_usd_all_freqs(struct wpa_supplicant *wpa_s) |
229 | 0 | { |
230 | 0 | return NULL; |
231 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_all_freqs Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_all_freqs |
232 | | |
233 | | static inline |
234 | | int wpas_nan_usd_unpause_publish(struct wpa_supplicant *wpa_s, int publish_id, |
235 | | u8 peer_instance_id, const u8 *peer_addr) |
236 | 0 | { |
237 | 0 | return -1; |
238 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_unpause_publish Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_unpause_publish |
239 | | |
240 | | static inline |
241 | | int wpas_nan_usd_publish_stop_listen(struct wpa_supplicant *wpa_s, |
242 | | int publish_id) |
243 | 0 | { |
244 | 0 | return -1; |
245 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_publish_stop_listen Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_publish_stop_listen |
246 | | |
247 | | static inline |
248 | | int wpas_nan_usd_subscribe_stop_listen(struct wpa_supplicant *wpa_s, |
249 | | int subscribe_id) |
250 | 0 | { |
251 | 0 | return -1; |
252 | 0 | } Unexecuted instantiation: events.c:wpas_nan_usd_subscribe_stop_listen Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_subscribe_stop_listen |
253 | | |
254 | | static inline void wpas_nan_usd_state_change_notif(struct wpa_supplicant *wpa_s) |
255 | 0 | {}Unexecuted instantiation: events.c:wpas_nan_usd_state_change_notif Unexecuted instantiation: wpa_supplicant.c:wpas_nan_usd_state_change_notif |
256 | | |
257 | | #endif /* CONFIG_NAN_USD */ |
258 | | |
259 | | #endif /* NAN_SUPPLICANT_H */ |