1e5b75505Sopenharmony_ci/*
2e5b75505Sopenharmony_ci * Generic advertisement service (GAS) query
3e5b75505Sopenharmony_ci * Copyright (c) 2009, Atheros Communications
4e5b75505Sopenharmony_ci * Copyright (c) 2011, Qualcomm Atheros
5e5b75505Sopenharmony_ci *
6e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license.
7e5b75505Sopenharmony_ci * See README for more details.
8e5b75505Sopenharmony_ci */
9e5b75505Sopenharmony_ci
10e5b75505Sopenharmony_ci#ifndef GAS_QUERY_H
11e5b75505Sopenharmony_ci#define GAS_QUERY_H
12e5b75505Sopenharmony_ci
13e5b75505Sopenharmony_cistruct gas_query;
14e5b75505Sopenharmony_ci
15e5b75505Sopenharmony_ci#ifdef CONFIG_GAS
16e5b75505Sopenharmony_ci
17e5b75505Sopenharmony_cistruct gas_query * gas_query_init(struct wpa_supplicant *wpa_s);
18e5b75505Sopenharmony_civoid gas_query_deinit(struct gas_query *gas);
19e5b75505Sopenharmony_ciint gas_query_rx(struct gas_query *gas, const u8 *da, const u8 *sa,
20e5b75505Sopenharmony_ci		 const u8 *bssid, u8 categ, const u8 *data, size_t len,
21e5b75505Sopenharmony_ci		 int freq);
22e5b75505Sopenharmony_ciint pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr);
23e5b75505Sopenharmony_ci
24e5b75505Sopenharmony_ci/**
25e5b75505Sopenharmony_ci * enum gas_query_result - GAS query result
26e5b75505Sopenharmony_ci */
27e5b75505Sopenharmony_cienum gas_query_result {
28e5b75505Sopenharmony_ci	GAS_QUERY_SUCCESS,
29e5b75505Sopenharmony_ci	GAS_QUERY_FAILURE,
30e5b75505Sopenharmony_ci	GAS_QUERY_TIMEOUT,
31e5b75505Sopenharmony_ci	GAS_QUERY_PEER_ERROR,
32e5b75505Sopenharmony_ci	GAS_QUERY_INTERNAL_ERROR,
33e5b75505Sopenharmony_ci	GAS_QUERY_STOPPED,
34e5b75505Sopenharmony_ci	GAS_QUERY_DELETED_AT_DEINIT
35e5b75505Sopenharmony_ci};
36e5b75505Sopenharmony_ci
37e5b75505Sopenharmony_ciint gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
38e5b75505Sopenharmony_ci		  int wildcard_bssid, struct wpabuf *req,
39e5b75505Sopenharmony_ci		  void (*cb)(void *ctx, const u8 *dst, u8 dialog_token,
40e5b75505Sopenharmony_ci			     enum gas_query_result result,
41e5b75505Sopenharmony_ci			     const struct wpabuf *adv_proto,
42e5b75505Sopenharmony_ci			     const struct wpabuf *resp, u16 status_code),
43e5b75505Sopenharmony_ci		  void *ctx);
44e5b75505Sopenharmony_ciint gas_query_stop(struct gas_query *gas, u8 dialog_token);
45e5b75505Sopenharmony_ci
46e5b75505Sopenharmony_ci#else /* CONFIG_GAS */
47e5b75505Sopenharmony_ci
48e5b75505Sopenharmony_cistatic inline struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
49e5b75505Sopenharmony_ci{
50e5b75505Sopenharmony_ci	return (void *) 1;
51e5b75505Sopenharmony_ci}
52e5b75505Sopenharmony_ci
53e5b75505Sopenharmony_cistatic inline void gas_query_deinit(struct gas_query *gas)
54e5b75505Sopenharmony_ci{
55e5b75505Sopenharmony_ci}
56e5b75505Sopenharmony_ci
57e5b75505Sopenharmony_ci#endif /* CONFIG_GAS */
58e5b75505Sopenharmony_ci
59e5b75505Sopenharmony_ci
60e5b75505Sopenharmony_ci#endif /* GAS_QUERY_H */
61