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"
Go to the source code of this file.
Functions | |
struct wps_data * | wps_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 wpabuf * | wps_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 wpabuf * | wps_build_assoc_req_ie (enum wps_request_type req_type) |
Build WPS IE for (Re)Association Request. | |
struct wpabuf * | wps_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) |
Wi-Fi Protected Setup.
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.
struct wpabuf* wps_build_assoc_req_ie | ( | enum wps_request_type | req_type | ) | [read] |
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.
pbc | Whether searching for PBC mode APs | |
dev | Device attributes | |
uuid | Own UUID | |
req_type | Value for Request Type attribute |
The caller is responsible for freeing the buffer.
Definition at line 309 of file wps.c.
void wps_deinit | ( | struct wps_data * | data | ) |
Deinitialize WPS Registration protocol data.
data | WPS Registration protocol data from wps_init() |
Definition at line 118 of file wps.c.
struct wpabuf* wps_get_msg | ( | struct wps_data * | wps, | |
enum wsc_op_code * | op_code | |||
) | [read] |
Build a WPS message.
wps | WPS Registration protocol data from wps_init() | |
op_code | Buffer for returning message OP Code |
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.
const u8* wps_get_uuid_e | ( | const struct wpabuf * | msg | ) |
struct wps_data* wps_init | ( | const struct wps_config * | cfg | ) | [read] |
Initialize WPS Registration protocol data.
cfg | WPS configuration |
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.
int wps_is_selected_pbc_registrar | ( | const struct wpabuf * | msg | ) |
int wps_is_selected_pin_registrar | ( | const struct wpabuf * | msg | ) |
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.
wps | WPS Registration protocol data from wps_init() | |
op_code | Message OP Code | |
msg | Message data |
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().