mesh: Write close reason from Mesh Peering Close to debug log
[mech_eap.git] / wpa_supplicant / gas_query.h
1 /*
2  * Generic advertisement service (GAS) query
3  * Copyright (c) 2009, Atheros Communications
4  * Copyright (c) 2011, Qualcomm Atheros
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_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,
20                  const u8 *bssid, u8 categ, const u8 *data, size_t len,
21                  int freq);
22
23 /**
24  * enum gas_query_result - GAS query result
25  */
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,
32         GAS_QUERY_DELETED_AT_DEINIT
33 };
34
35 int 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);
42
43 #else /* CONFIG_GAS */
44
45 static inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
46 {
47         return (void *) 1;
48 }
49
50 static inline void gas_query_deinit(struct gas_query *gas)
51 {
52 }
53
54 #endif /* CONFIG_GAS */
55
56
57 #endif /* GAS_QUERY_H */