blob: db00f87e8de1097fe0a31925a381afd9b586b723 [file] [log] [blame]
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001/*
2 * Generic advertisement service (GAS) server
3 * Copyright (c) 2017, Qualcomm Atheros, Inc.
Hai Shalom899fcc72020-10-19 14:38:18 -07004 * Copyright (c) 2020, The Linux Foundation
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07005 *
6 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
8 */
9
10#ifndef GAS_SERVER_H
11#define GAS_SERVER_H
12
13#ifdef CONFIG_GAS_SERVER
14
15struct gas_server;
16
17struct gas_server * gas_server_init(void *ctx,
18 void (*tx)(void *ctx, int freq,
19 const u8 *da,
20 struct wpabuf *buf,
21 unsigned int wait_time));
22void gas_server_deinit(struct gas_server *gas);
23int gas_server_register(struct gas_server *gas,
24 const u8 *adv_proto_id, u8 adv_proto_id_len,
25 struct wpabuf *
Hai Shalom899fcc72020-10-19 14:38:18 -070026 (*req_cb)(void *ctx, void *resp_ctx, const u8 *sa,
27 const u8 *query, size_t query_len,
28 u16 *comeback_delay),
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070029 void (*status_cb)(void *ctx, struct wpabuf *resp,
30 int ok),
31 void *ctx);
32int gas_server_rx(struct gas_server *gas, const u8 *da, const u8 *sa,
33 const u8 *bssid, u8 categ, const u8 *data, size_t len,
34 int freq);
35void gas_server_tx_status(struct gas_server *gas, const u8 *dst, const u8 *data,
36 size_t data_len, int ack);
Hai Shalom899fcc72020-10-19 14:38:18 -070037int gas_server_set_resp(struct gas_server *gas, void *resp_ctx,
38 struct wpabuf *resp);
Hai Shalom60840252021-02-19 19:02:11 -080039bool gas_server_response_sent(struct gas_server *gas, void *resp_ctx);
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070040
41#else /* CONFIG_GAS_SERVER */
42
43static inline void gas_server_deinit(struct gas_server *gas)
44{
45}
46
47#endif /* CONFIG_GAS_SERVER */
48
49#endif /* GAS_SERVER_H */