aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/gas_query.h
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-09-28 16:44:25 (GMT)
committerJouni Malinen <j@w1.fi>2011-09-29 19:19:15 (GMT)
commit04ea7b794735fc7183fd5b7f81030bc4d6482467 (patch)
tree31b721d834a59c86ab8d527bcfdbd8529c59a36a /wpa_supplicant/gas_query.h
parent0c840c33f7abf5cdba060e5a9bcd4061b906d9a9 (diff)
downloadhostap-04ea7b794735fc7183fd5b7f81030bc4d6482467.zip
hostap-04ea7b794735fc7183fd5b7f81030bc4d6482467.tar.gz
hostap-04ea7b794735fc7183fd5b7f81030bc4d6482467.tar.bz2
GAS: Add a generic GAS query module
This implements GAS request mechanism that is aimed at being used to replace use case specific GAS/ANQP implementations in the future. Compared to the earlier implementation in P2P SD, this implementation includes support for multiple concurrent requests and more thorough validation of frames against the pending query data. GAS header processing, including comeback and reassembly, are handled within gas_query.c and the users of this module will only need to provide the Query Request and process the (possibly reassembled) Query Response.
Diffstat (limited to 'wpa_supplicant/gas_query.h')
-rw-r--r--wpa_supplicant/gas_query.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/wpa_supplicant/gas_query.h b/wpa_supplicant/gas_query.h
new file mode 100644
index 0000000..64c3825
--- /dev/null
+++ b/wpa_supplicant/gas_query.h
@@ -0,0 +1,61 @@
+/*
+ * Generic advertisement service (GAS) query
+ * Copyright (c) 2009, Atheros Communications
+ * Copyright (c) 2011, Qualcomm Atheros
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING 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, const u8 *data, size_t len, int freq);
+
+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 */