Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Generic advertisement service (GAS) server |
| 3 | * Copyright (c) 2017, Qualcomm Atheros, Inc. |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 4 | * Copyright (c) 2020, The Linux Foundation |
Hai Shalom | c1a2144 | 2022-02-04 13:43:00 -0800 | [diff] [blame^] | 5 | * Copyright (c) 2022, Qualcomm Innovation Center, Inc. |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 6 | * |
| 7 | * This software may be distributed under the terms of the BSD license. |
| 8 | * See README for more details. |
| 9 | */ |
| 10 | |
| 11 | #ifndef GAS_SERVER_H |
| 12 | #define GAS_SERVER_H |
| 13 | |
| 14 | #ifdef CONFIG_GAS_SERVER |
| 15 | |
| 16 | struct gas_server; |
| 17 | |
| 18 | struct gas_server * gas_server_init(void *ctx, |
| 19 | void (*tx)(void *ctx, int freq, |
| 20 | const u8 *da, |
| 21 | struct wpabuf *buf, |
| 22 | unsigned int wait_time)); |
| 23 | void gas_server_deinit(struct gas_server *gas); |
| 24 | int gas_server_register(struct gas_server *gas, |
| 25 | const u8 *adv_proto_id, u8 adv_proto_id_len, |
| 26 | struct wpabuf * |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 27 | (*req_cb)(void *ctx, void *resp_ctx, const u8 *sa, |
| 28 | const u8 *query, size_t query_len, |
Hai Shalom | c1a2144 | 2022-02-04 13:43:00 -0800 | [diff] [blame^] | 29 | int *comeback_delay), |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 30 | void (*status_cb)(void *ctx, struct wpabuf *resp, |
| 31 | int ok), |
| 32 | void *ctx); |
| 33 | int gas_server_rx(struct gas_server *gas, const u8 *da, const u8 *sa, |
| 34 | const u8 *bssid, u8 categ, const u8 *data, size_t len, |
| 35 | int freq); |
| 36 | void gas_server_tx_status(struct gas_server *gas, const u8 *dst, const u8 *data, |
| 37 | size_t data_len, int ack); |
Hai Shalom | c1a2144 | 2022-02-04 13:43:00 -0800 | [diff] [blame^] | 38 | int gas_server_set_comeback_delay(struct gas_server *gas, void *resp_ctx, |
| 39 | u16 comeback_delay); |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 40 | int gas_server_set_resp(struct gas_server *gas, void *resp_ctx, |
| 41 | struct wpabuf *resp); |
Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 42 | bool gas_server_response_sent(struct gas_server *gas, void *resp_ctx); |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 43 | |
| 44 | #else /* CONFIG_GAS_SERVER */ |
| 45 | |
| 46 | static inline void gas_server_deinit(struct gas_server *gas) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | #endif /* CONFIG_GAS_SERVER */ |
| 51 | |
| 52 | #endif /* GAS_SERVER_H */ |