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