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. |
| 4 | * |
| 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
| 7 | */ |
| 8 | |
| 9 | #ifndef GAS_SERVER_H |
| 10 | #define GAS_SERVER_H |
| 11 | |
| 12 | #ifdef CONFIG_GAS_SERVER |
| 13 | |
| 14 | struct gas_server; |
| 15 | |
| 16 | struct gas_server * gas_server_init(void *ctx, |
| 17 | void (*tx)(void *ctx, int freq, |
| 18 | const u8 *da, |
| 19 | struct wpabuf *buf, |
| 20 | unsigned int wait_time)); |
| 21 | void gas_server_deinit(struct gas_server *gas); |
| 22 | int gas_server_register(struct gas_server *gas, |
| 23 | const u8 *adv_proto_id, u8 adv_proto_id_len, |
| 24 | struct wpabuf * |
| 25 | (*req_cb)(void *ctx, const u8 *sa, |
| 26 | const u8 *query, size_t query_len), |
| 27 | void (*status_cb)(void *ctx, struct wpabuf *resp, |
| 28 | int ok), |
| 29 | void *ctx); |
| 30 | int gas_server_rx(struct gas_server *gas, const u8 *da, const u8 *sa, |
| 31 | const u8 *bssid, u8 categ, const u8 *data, size_t len, |
| 32 | int freq); |
| 33 | void gas_server_tx_status(struct gas_server *gas, const u8 *dst, const u8 *data, |
| 34 | size_t data_len, int ack); |
| 35 | |
| 36 | #else /* CONFIG_GAS_SERVER */ |
| 37 | |
| 38 | static inline void gas_server_deinit(struct gas_server *gas) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | #endif /* CONFIG_GAS_SERVER */ |
| 43 | |
| 44 | #endif /* GAS_SERVER_H */ |