wps.c File Reference

Wi-Fi Protected Setup. More...

#include "includes.h"
#include "common.h"
#include "dh_group5.h"
#include "wps_i.h"
#include "wps_dev_attr.h"
#include "ieee802_11_defs.h"
Include dependency graph for wps.c:

Go to the source code of this file.

Functions

struct wps_datawps_init (const struct wps_config *cfg)
 Initialize WPS Registration protocol data.
void wps_deinit (struct wps_data *data)
 Deinitialize WPS Registration protocol data.
enum wps_process_res wps_process_msg (struct wps_data *wps, enum wsc_op_code op_code, const struct wpabuf *msg)
 Process a WPS message.
struct wpabufwps_get_msg (struct wps_data *wps, enum wsc_op_code *op_code)
 Build a WPS message.
int wps_is_selected_pbc_registrar (const struct wpabuf *msg)
 Check whether WPS IE indicates active PBC.
int wps_is_selected_pin_registrar (const struct wpabuf *msg)
 Check whether WPS IE indicates active PIN.
const u8 * wps_get_uuid_e (const struct wpabuf *msg)
 Get UUID-E from WPS IE.
struct wpabufwps_build_assoc_req_ie (enum wps_request_type req_type)
 Build WPS IE for (Re)Association Request.
struct wpabufwps_build_probe_req_ie (int pbc, struct wps_device_data *dev, const u8 *uuid, enum wps_request_type req_type)
 Build WPS IE for Probe Request.
void wps_free_pending_msgs (struct upnp_pending_message *msgs)
int wps_attr_text (struct wpabuf *data, char *buf, char *end)

Detailed Description

Wi-Fi Protected Setup.

Copyright
Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>

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.

Definition in file wps.c.


Function Documentation

struct wpabuf* wps_build_assoc_req_ie ( enum wps_request_type  req_type  )  [read]

Build WPS IE for (Re)Association Request.

Parameters:
req_type Value for Request Type attribute
Returns:
WPS IE or NULL on failure

The caller is responsible for freeing the buffer.

Definition at line 271 of file wps.c.

Here is the call graph for this function:

struct wpabuf* wps_build_probe_req_ie ( int  pbc,
struct wps_device_data dev,
const u8 *  uuid,
enum wps_request_type  req_type 
) [read]

Build WPS IE for Probe Request.

Parameters:
pbc Whether searching for PBC mode APs
dev Device attributes
uuid Own UUID
req_type Value for Request Type attribute
Returns:
WPS IE or NULL on failure

The caller is responsible for freeing the buffer.

Definition at line 309 of file wps.c.

Here is the call graph for this function:

void wps_deinit ( struct wps_data data  ) 

Deinitialize WPS Registration protocol data.

Parameters:
data WPS Registration protocol data from wps_init()

Definition at line 118 of file wps.c.

Here is the call graph for this function:

struct wpabuf* wps_get_msg ( struct wps_data wps,
enum wsc_op_code op_code 
) [read]

Build a WPS message.

Parameters:
wps WPS Registration protocol data from wps_init()
op_code Buffer for returning message OP Code
Returns:
The generated WPS message or NULL on failure

This function is used to build a response to a message processed by calling wps_process_msg(). The caller is responsible for freeing the buffer.

Definition at line 176 of file wps.c.

const u8* wps_get_uuid_e ( const struct wpabuf msg  ) 

Get UUID-E from WPS IE.

Parameters:
msg WPS IE contents from Beacon or Probe Response frame
Returns:
Pointer to UUID-E or NULL if not included

The returned pointer is to the msg contents and it remains valid only as long as the msg buffer is valid.

Definition at line 253 of file wps.c.

struct wps_data* wps_init ( const struct wps_config cfg  )  [read]

Initialize WPS Registration protocol data.

Parameters:
cfg WPS configuration
Returns:
Pointer to allocated data or NULL on failure

This function is used to initialize WPS data for a registration protocol instance (i.e., each run of registration protocol as a Registrar of Enrollee. The caller is responsible for freeing this data after the registration run has been completed by calling wps_deinit().

Definition at line 36 of file wps.c.

Here is the call graph for this function:

int wps_is_selected_pbc_registrar ( const struct wpabuf msg  ) 

Check whether WPS IE indicates active PBC.

Parameters:
msg WPS IE contents from Beacon or Probe Response frame
Returns:
1 if PBC Registrar is active, 0 if not

Definition at line 191 of file wps.c.

int wps_is_selected_pin_registrar ( const struct wpabuf msg  ) 

Check whether WPS IE indicates active PIN.

Parameters:
msg WPS IE contents from Beacon or Probe Response frame
Returns:
1 if PIN Registrar is active, 0 if not

Definition at line 218 of file wps.c.

enum wps_process_res wps_process_msg ( struct wps_data wps,
enum wsc_op_code  op_code,
const struct wpabuf msg 
)

Process a WPS message.

Parameters:
wps WPS Registration protocol data from wps_init()
op_code Message OP Code
msg Message data
Returns:
Processing result

This function is used to process WPS messages with OP Codes WSC_ACK, WSC_NACK, WSC_MSG, and WSC_Done. The caller (e.g., EAP server/peer) is responsible for reassembling the messages before calling this function. Response to this message is built by calling wps_get_msg().

Definition at line 155 of file wps.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:24:10 2009 for hostapd by  doxygen 1.6.1