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