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 |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 5 | * |
| 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 | |
| 15 | struct gas_server; |
| 16 | |
| 17 | struct 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)); |
| 22 | void gas_server_deinit(struct gas_server *gas); |
| 23 | int gas_server_register(struct gas_server *gas, |
| 24 | const u8 *adv_proto_id, u8 adv_proto_id_len, |
| 25 | struct wpabuf * |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame^] | 26 | (*req_cb)(void *ctx, void *resp_ctx, const u8 *sa, |
| 27 | const u8 *query, size_t query_len, |
| 28 | u16 *comeback_delay), |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 29 | void (*status_cb)(void *ctx, struct wpabuf *resp, |
| 30 | int ok), |
| 31 | void *ctx); |
| 32 | int 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); |
| 35 | void gas_server_tx_status(struct gas_server *gas, const u8 *dst, const u8 *data, |
| 36 | size_t data_len, int ack); |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame^] | 37 | int gas_server_set_resp(struct gas_server *gas, void *resp_ctx, |
| 38 | struct wpabuf *resp); |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 39 | |
| 40 | #else /* CONFIG_GAS_SERVER */ |
| 41 | |
| 42 | static inline void gas_server_deinit(struct gas_server *gas) |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | #endif /* CONFIG_GAS_SERVER */ |
| 47 | |
| 48 | #endif /* GAS_SERVER_H */ |