aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/gas_query.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-12-26 06:38:42 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-26 14:55:45 (GMT)
commit6ffa1687eefe99a2f9677c09ef2fe459e1af5667 (patch)
tree4dc48dfff286ea4bb9ac6423df8fec91ab66ec2e /wpa_supplicant/gas_query.c
parent93827f456a4d741084369d4a1786479223bf365f (diff)
downloadhostap-6ffa1687eefe99a2f9677c09ef2fe459e1af5667.zip
hostap-6ffa1687eefe99a2f9677c09ef2fe459e1af5667.tar.gz
hostap-6ffa1687eefe99a2f9677c09ef2fe459e1af5667.tar.bz2
Add GAS-QUERY-START and GAS-QUERY-DONE event messages
External programs can use these new control interface events to better track progress of GAS operations. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/gas_query.c')
-rw-r--r--wpa_supplicant/gas_query.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/wpa_supplicant/gas_query.c b/wpa_supplicant/gas_query.c
index f9885e3..dd10a75 100644
--- a/wpa_supplicant/gas_query.c
+++ b/wpa_supplicant/gas_query.c
@@ -13,6 +13,7 @@
#include "utils/eloop.h"
#include "common/ieee802_11_defs.h"
#include "common/gas.h"
+#include "common/wpa_ctrl.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
#include "offchannel.h"
@@ -82,10 +83,37 @@ struct gas_query * gas_query_init(struct wpa_supplicant *wpa_s)
}
+static const char * gas_result_txt(enum gas_query_result result)
+{
+ switch (result) {
+ case GAS_QUERY_SUCCESS:
+ return "SUCCESS";
+ case GAS_QUERY_FAILURE:
+ return "FAILURE";
+ case GAS_QUERY_TIMEOUT:
+ return "TIMEOUT";
+ case GAS_QUERY_PEER_ERROR:
+ return "PEER_ERROR";
+ case GAS_QUERY_INTERNAL_ERROR:
+ return "INTERNAL_ERROR";
+ case GAS_QUERY_CANCELLED:
+ return "CANCELLED";
+ case GAS_QUERY_DELETED_AT_DEINIT:
+ return "DELETED_AT_DEINIT";
+ }
+
+ return "N/A";
+}
+
+
static void gas_query_done(struct gas_query *gas,
struct gas_query_pending *query,
enum gas_query_result result)
{
+ wpa_msg(gas->wpa_s, MSG_INFO, GAS_QUERY_DONE "addr=" MACSTR
+ " dialog_token=%u freq=%d status_code=%u result=%s",
+ MAC2STR(query->addr), query->dialog_token, query->freq,
+ query->status_code, gas_result_txt(result));
if (gas->current == query)
gas->current = NULL;
if (query->offchannel_tx_started)
@@ -581,8 +609,9 @@ int gas_query_req(struct gas_query *gas, const u8 *dst, int freq,
*(wpabuf_mhead_u8(req) + 2) = dialog_token;
- wpa_printf(MSG_DEBUG, "GAS: Starting request for " MACSTR
- " dialog_token %u", MAC2STR(dst), dialog_token);
+ wpa_msg(gas->wpa_s, MSG_INFO, GAS_QUERY_START "addr=" MACSTR
+ " dialog_token=%u freq=%d",
+ MAC2STR(query->addr), query->dialog_token, query->freq);
eloop_register_timeout(0, 0, gas_service_timeout, gas, query);