Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Generic advertisement service (GAS) query |
| 3 | * Copyright (c) 2009, Atheros Communications |
| 4 | * Copyright (c) 2011, Qualcomm Atheros |
| 5 | * |
Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 6 | * This software may be distributed under the terms of the BSD license. |
| 7 | * See README for more details. |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef GAS_QUERY_H |
| 11 | #define GAS_QUERY_H |
| 12 | |
| 13 | struct gas_query; |
| 14 | |
| 15 | #ifdef CONFIG_GAS |
| 16 | |
| 17 | struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s); |
| 18 | void gas_query_deinit(struct gas_query *gas); |
| 19 | int gas_query_rx(struct gas_query *gas, const u8 *da, const u8 *sa, |
Dmitry Shmidt | 1846323 | 2014-01-24 12:29:41 -0800 | [diff] [blame] | 20 | const u8 *bssid, u8 categ, const u8 *data, size_t len, |
| 21 | int freq); |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 22 | |
Dmitry Shmidt | a54fa5f | 2013-01-15 13:53:35 -0800 | [diff] [blame] | 23 | /** |
| 24 | * enum gas_query_result - GAS query result |
| 25 | */ |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 26 | enum gas_query_result { |
| 27 | GAS_QUERY_SUCCESS, |
| 28 | GAS_QUERY_FAILURE, |
| 29 | GAS_QUERY_TIMEOUT, |
| 30 | GAS_QUERY_PEER_ERROR, |
| 31 | GAS_QUERY_INTERNAL_ERROR, |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 32 | GAS_QUERY_STOPPED, |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 33 | GAS_QUERY_DELETED_AT_DEINIT |
| 34 | }; |
| 35 | |
| 36 | int gas_query_req(struct gas_query *gas, const u8 *dst, int freq, |
Hai Shalom | b755a2a | 2020-04-23 21:49:02 -0700 | [diff] [blame] | 37 | int wildcard_bssid, int maintain_addr, struct wpabuf *req, |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 38 | void (*cb)(void *ctx, const u8 *dst, u8 dialog_token, |
| 39 | enum gas_query_result result, |
| 40 | const struct wpabuf *adv_proto, |
| 41 | const struct wpabuf *resp, u16 status_code), |
| 42 | void *ctx); |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 43 | int gas_query_stop(struct gas_query *gas, u8 dialog_token); |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 44 | |
| 45 | #else /* CONFIG_GAS */ |
| 46 | |
| 47 | static inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s) |
| 48 | { |
| 49 | return (void *) 1; |
| 50 | } |
| 51 | |
| 52 | static inline void gas_query_deinit(struct gas_query *gas) |
| 53 | { |
| 54 | } |
| 55 | |
| 56 | #endif /* CONFIG_GAS */ |
| 57 | |
| 58 | |
| 59 | #endif /* GAS_QUERY_H */ |