xref: /freebsd/contrib/wpa/src/ap/nan_usd_ap.h (revision a90b9d01)
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_AP_H
10 #define NAN_USD_AP_H
11 
12 struct nan_subscribe_params;
13 struct nan_publish_params;
14 enum nan_service_protocol_type;
15 
16 int hostapd_nan_usd_init(struct hostapd_data *hapd);
17 void hostapd_nan_usd_deinit(struct hostapd_data *hapd);
18 void hostapd_nan_usd_rx_sdf(struct hostapd_data *hapd, const u8 *src,
19 			    unsigned int freq, const u8 *buf, size_t len);
20 void hostapd_nan_usd_flush(struct hostapd_data *hapd);
21 int hostapd_nan_usd_publish(struct hostapd_data *hapd, 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 hostapd_nan_usd_cancel_publish(struct hostapd_data *hapd, int publish_id);
26 int hostapd_nan_usd_update_publish(struct hostapd_data *hapd, int publish_id,
27 				   const struct wpabuf *ssi);
28 int hostapd_nan_usd_subscribe(struct hostapd_data *hapd,
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 hostapd_nan_usd_cancel_subscribe(struct hostapd_data *hapd,
34 				      int subscribe_id);
35 int hostapd_nan_usd_transmit(struct hostapd_data *hapd, int handle,
36 			     const struct wpabuf *ssi,
37 			     const struct wpabuf *elems,
38 			     const u8 *peer_addr, u8 req_instance_id);
39 void hostapd_nan_usd_remain_on_channel_cb(struct hostapd_data *hapd,
40 					  unsigned int freq,
41 					  unsigned int duration);
42 void hostapd_nan_usd_cancel_remain_on_channel_cb(struct hostapd_data *hapd,
43 						 unsigned int freq);
44 void hostapd_nan_usd_tx_wait_expire(struct hostapd_data *hapd);
45 
46 #endif /* NAN_USD_AP_H */
47