aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/gas_query.h
blob: ad1349088ee1f2581e37ff7f3cac4dc7220ae2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Generic advertisement service (GAS) query
 * Copyright (c) 2009, Atheros Communications
 * Copyright (c) 2011, Qualcomm Atheros
 *
 * This software may be distributed under the terms of the BSD license.
 * See README for more details.
 */

#ifndef GAS_QUERY_H
#define GAS_QUERY_H

struct gas_query;

#ifdef CONFIG_GAS

struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s);
void gas_query_deinit(struct gas_query *gas);
int gas_query_rx(struct gas_query *gas, const u8 *da, const u8 *sa,
		 const u8 *bssid, u8 categ, const u8 *data, size_t len,
		 int freq);

/**
 * enum gas_query_result - GAS query result
 */
enum gas_query_result {
	GAS_QUERY_SUCCESS,
	GAS_QUERY_FAILURE,
	GAS_QUERY_TIMEOUT,
	GAS_QUERY_PEER_ERROR,
	GAS_QUERY_INTERNAL_ERROR,
	GAS_QUERY_CANCELLED,
	GAS_QUERY_DELETED_AT_DEINIT
};

int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
		  struct wpabuf *req,
		  void (*cb)(void *ctx, const u8 *dst, u8 dialog_token,
			     enum gas_query_result result,
			     const struct wpabuf *adv_proto,
			     const struct wpabuf *resp, u16 status_code),
		  void *ctx);
void gas_query_cancel(struct gas_query *gas, const u8 *dst, u8 dialog_token);

#else /* CONFIG_GAS */

static inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
{
	return (void *) 1;
}

static inline void gas_query_deinit(struct gas_query *gas)
{
}

#endif /* CONFIG_GAS */


#endif /* GAS_QUERY_H */