xref: /freebsd/contrib/wpa/wpa_supplicant/nan_usd.h (revision 87b759f0fa1f7554d50ce640c40138512bbded44)
1 /*
2  * NAN unsynchronized service discovery (USD)
3  * Copyright (c) 2024, Qualcomm Innovation Center, Inc.
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef NAN_USD_H
10 #define NAN_USD_H
11 
12 struct nan_subscribe_params;
13 struct nan_publish_params;
14 enum nan_service_protocol_type;
15 
16 int wpas_nan_usd_init(struct wpa_supplicant *wpa_s);
17 void wpas_nan_usd_deinit(struct wpa_supplicant *wpa_s);
18 void wpas_nan_usd_rx_sdf(struct wpa_supplicant *wpa_s, const u8 *src,
19 			 unsigned int freq, const u8 *buf, size_t len);
20 void wpas_nan_usd_flush(struct wpa_supplicant *wpa_s);
21 int wpas_nan_usd_publish(struct wpa_supplicant *wpa_s, const char *service_name,
22 			 enum nan_service_protocol_type srv_proto_type,
23 			 const struct wpabuf *ssi,
24 			 struct nan_publish_params *params);
25 void wpas_nan_usd_cancel_publish(struct wpa_supplicant *wpa_s, int publish_id);
26 int wpas_nan_usd_update_publish(struct wpa_supplicant *wpa_s, int publish_id,
27 				const struct wpabuf *ssi);
28 int wpas_nan_usd_subscribe(struct wpa_supplicant *wpa_s,
29 			   const char *service_name,
30 			   enum nan_service_protocol_type srv_proto_type,
31 			   const struct wpabuf *ssi,
32 			   struct nan_subscribe_params *params);
33 void wpas_nan_usd_cancel_subscribe(struct wpa_supplicant *wpa_s,
34 				   int subscribe_id);
35 int wpas_nan_usd_transmit(struct wpa_supplicant *wpa_s, int handle,
36 			  const struct wpabuf *ssi, const struct wpabuf *elems,
37 			  const u8 *peer_addr, u8 req_instance_id);
38 void wpas_nan_usd_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
39 				       unsigned int freq,
40 				       unsigned int duration);
41 void wpas_nan_usd_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
42 					      unsigned int freq);
43 void wpas_nan_usd_tx_wait_expire(struct wpa_supplicant *wpa_s);
44 int * wpas_nan_usd_all_freqs(struct wpa_supplicant *wpa_s);
45 
46 #endif /* NAN_USD_H */
47