wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Functions
gas_query.c File Reference

Generic advertisement service (GAS) query Copyright (c) 2011-2014, Qualcomm Atheros, Inc. Copyright (c) 2011-2014, Jouni Malinen j@w1..nosp@m.fi More...

#include "includes.h"
#include "common.h"
#include "utils/eloop.h"
#include "common/ieee802_11_defs.h"
#include "common/gas.h"
#include "common/wpa_ctrl.h"
#include "rsn_supp/wpa.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
#include "offchannel.h"
#include "gas_query.h"

Data Structures

struct  gas_query_pending
 Pending GAS query. More...
 
struct  gas_query
 Internal GAS query data. More...
 

Macros

#define GAS_QUERY_TIMEOUT_PERIOD   2
 GAS query timeout in seconds.
 

Functions

struct gas_querygas_query_init (struct wpa_supplicant *wpa_s)
 Initialize GAS query component. More...
 
void gas_query_deinit (struct gas_query *gas)
 Deinitialize GAS query component. More...
 
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)
 Indicate reception of a Public Action or Protected Dual frame. More...
 
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)
 Request a GAS query. More...
 
void gas_query_cancel (struct gas_query *gas, const u8 *dst, u8 dialog_token)
 Cancel a pending GAS query. More...
 

Detailed Description

Generic advertisement service (GAS) query Copyright (c) 2011-2014, Qualcomm Atheros, Inc. Copyright (c) 2011-2014, Jouni Malinen j@w1..nosp@m.fi

Function Documentation

void gas_query_cancel ( struct gas_query gas,
const u8 *  dst,
u8  dialog_token 
)

Cancel a pending GAS query.

Parameters
gasGAS query data from gas_query_init()
dstDestination MAC address for the query
dialog_tokenDialog token from gas_query_req()
void gas_query_deinit ( struct gas_query gas)

Deinitialize GAS query component.

Parameters
gasGAS query data from gas_query_init()
struct gas_query* gas_query_init ( struct wpa_supplicant wpa_s)

Initialize GAS query component.

Parameters
wpa_sPointer to wpa_supplicant data
Returns
Pointer to GAS query data or NULL on failure
int gas_query_req ( struct gas_query gas,
const u8 *  dst,
int  freq,
struct wpabuf req,
void(*)(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)  cb,
void *  ctx 
)

Request a GAS query.

Parameters
gasGAS query data from gas_query_init()
dstDestination MAC address for the query
freqFrequency (in MHz) for the channel on which to send the query
reqGAS query payload (to be freed by gas_query module in case of success return)
cbCallback function for reporting GAS query result and response
ctxContext pointer to use with the cb call
Returns
dialog token (>= 0) on success or -1 on failure
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 
)

Indicate reception of a Public Action or Protected Dual frame.

Parameters
gasGAS query data from gas_query_init()
daDestination MAC address of the Action frame
saSource MAC address of the Action frame
bssidBSSID of the Action frame
categCategory of the Action frame
dataPayload of the Action frame
lenLength of data
freqFrequency (in MHz) on which the frame was received
Returns
0 if the Public Action frame was a GAS frame or -1 if not