From d9474958d7e4c36c52d1b447e319d683d3ccfb01 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 26 Dec 2013 11:44:28 +0200 Subject: [PATCH] tests: Clean up GAS/ANQP message processing Signed-hostap: Jouni Malinen --- tests/hwsim/test_gas.py | 75 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 9 deletions(-) diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index 9a5a91ff3..f1c5f3bd3 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -11,6 +11,7 @@ import binascii import logging logger = logging.getLogger() import re +import struct import hostapd @@ -240,6 +241,66 @@ def test_gas_timeout(dev, apdev): expect_gas_result(dev[0], "TIMEOUT") +MGMT_SUBTYPE_ACTION = 13 +ACTION_CATEG_PUBLIC = 4 + +GAS_INITIAL_REQUEST = 10 +GAS_INITIAL_RESPONSE = 11 +GAS_COMEBACK_REQUEST = 12 +GAS_COMEBACK_RESPONSE = 13 +GAS_ACTIONS = [ GAS_INITIAL_REQUEST, GAS_INITIAL_RESPONSE, + GAS_COMEBACK_REQUEST, GAS_COMEBACK_RESPONSE ] + +def anqp_adv_proto(): + return struct.pack('BBBB', 108, 2, 127, 0) + +def anqp_comeback_resp(dialog_token): + return struct.pack('