blob: 5c3d161adfb15210aac288511cee93412bad0e3a [file] [log] [blame]
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08001/*
2 * Generic advertisement service (GAS) query
3 * Copyright (c) 2009, Atheros Communications
4 * Copyright (c) 2011, Qualcomm Atheros
5 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08006 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -08008 */
9
10#ifndef GAS_QUERY_H
11#define GAS_QUERY_H
12
13struct gas_query;
14
15#ifdef CONFIG_GAS
16
17struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s);
18void gas_query_deinit(struct gas_query *gas);
19int gas_query_rx(struct gas_query *gas, const u8 *da, const u8 *sa,
20 const u8 *bssid, const u8 *data, size_t len, int freq);
21
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -080022/**
23 * enum gas_query_result - GAS query result
24 */
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -080025enum gas_query_result {
26 GAS_QUERY_SUCCESS,
27 GAS_QUERY_FAILURE,
28 GAS_QUERY_TIMEOUT,
29 GAS_QUERY_PEER_ERROR,
30 GAS_QUERY_INTERNAL_ERROR,
31 GAS_QUERY_CANCELLED,
32 GAS_QUERY_DELETED_AT_DEINIT
33};
34
35int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
36 struct wpabuf *req,
37 void (*cb)(void *ctx, const u8 *dst, u8 dialog_token,
38 enum gas_query_result result,
39 const struct wpabuf *adv_proto,
40 const struct wpabuf *resp, u16 status_code),
41 void *ctx);
42void gas_query_cancel(struct gas_query *gas, const u8 *dst, u8 dialog_token);
43
44#else /* CONFIG_GAS */
45
46static inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
47{
48 return (void *) 1;
49}
50
51static inline void gas_query_deinit(struct gas_query *gas)
52{
53}
54
55#endif /* CONFIG_GAS */
56
57
58#endif /* GAS_QUERY_H */