|
wpa_supplicant / hostapd
2.5
|
Wi-Fi Protected Setup. More...
#include "includes.h"#include "common.h"#include "crypto/dh_group5.h"#include "common/ieee802_11_defs.h"#include "wps_i.h"#include "wps_dev_attr.h"Functions | |
| struct wps_data * | wps_init (const struct wps_config *cfg) |
| Initialize WPS Registration protocol data. More... | |
| void | wps_deinit (struct wps_data *data) |
| Deinitialize WPS Registration protocol data. More... | |
| 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. More... | |
| struct wpabuf * | wps_get_msg (struct wps_data *wps, enum wsc_op_code *op_code) |
| Build a WPS message. More... | |
| int | wps_is_selected_pbc_registrar (const struct wpabuf *msg) |
| Check whether WPS IE indicates active PBC. More... | |
| int | wps_is_selected_pin_registrar (const struct wpabuf *msg) |
| Check whether WPS IE indicates active PIN. More... | |
| int | wps_is_addr_authorized (const struct wpabuf *msg, const u8 *addr, int ver1_compat) |
| Check whether WPS IE authorizes MAC address. More... | |
| int | wps_ap_priority_compar (const struct wpabuf *wps_a, const struct wpabuf *wps_b) |
| Prioritize WPS IE from two APs. More... | |
| const u8 * | wps_get_uuid_e (const struct wpabuf *msg) |
| Get UUID-E from WPS IE. More... | |
| int | wps_is_20 (const struct wpabuf *msg) |
| Check whether WPS attributes claim support for WPS 2.0. | |
| struct wpabuf * | wps_build_assoc_req_ie (enum wps_request_type req_type) |
| Build WPS IE for (Re)Association Request. More... | |
| struct wpabuf * | wps_build_assoc_resp_ie (void) |
| Build WPS IE for (Re)Association Response. More... | |
| struct wpabuf * | wps_build_probe_req_ie (u16 pw_id, struct wps_device_data *dev, const u8 *uuid, enum wps_request_type req_type, unsigned int num_req_dev_types, const u8 *req_dev_types) |
| Build WPS IE for Probe Request. More... | |
| void | wps_free_pending_msgs (struct upnp_pending_message *msgs) |
| int | wps_attr_text (struct wpabuf *data, char *buf, char *end) |
| const char * | wps_ei_str (enum wps_error_indication ei) |
Wi-Fi Protected Setup.
Prioritize WPS IE from two APs.
| wps_a | WPS IE contents from Beacon or Probe Response frame |
| wps_b | WPS IE contents from Beacon or Probe Response frame |
| struct wpabuf* wps_build_assoc_req_ie | ( | enum wps_request_type | req_type | ) |
Build WPS IE for (Re)Association Request.
| req_type | Value for Request Type attribute |
The caller is responsible for freeing the buffer.
| struct wpabuf* wps_build_assoc_resp_ie | ( | void | ) |
Build WPS IE for (Re)Association Response.
The caller is responsible for freeing the buffer.
| struct wpabuf* wps_build_probe_req_ie | ( | u16 | pw_id, |
| struct wps_device_data * | dev, | ||
| const u8 * | uuid, | ||
| enum wps_request_type | req_type, | ||
| unsigned int | num_req_dev_types, | ||
| const u8 * | req_dev_types | ||
| ) |
Build WPS IE for Probe Request.
| pw_id | Password ID (DEV_PW_PUSHBUTTON for active PBC and DEV_PW_DEFAULT for most other use cases) |
| dev | Device attributes |
| uuid | Own UUID |
| req_type | Value for Request Type attribute |
| num_req_dev_types | Number of requested device types |
| req_dev_types | Requested device types (8 * num_req_dev_types octets) or NULL if none |
The caller is responsible for freeing the buffer.
| void wps_deinit | ( | struct wps_data * | data | ) |
Deinitialize WPS Registration protocol data.
| data | WPS Registration protocol data from wps_init() |
| struct wpabuf* wps_get_msg | ( | struct wps_data * | wps, |
| enum wsc_op_code * | op_code | ||
| ) |
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 | ) |
Get UUID-E from WPS IE.
| msg | WPS IE contents from Beacon or Probe Response frame |
The returned pointer is to the msg contents and it remains valid only as long as the msg buffer is valid.
| struct wps_data* wps_init | ( | const struct wps_config * | cfg | ) |
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().
| int wps_is_addr_authorized | ( | const struct wpabuf * | msg, |
| const u8 * | addr, | ||
| int | ver1_compat | ||
| ) |
Check whether WPS IE authorizes MAC address.
| msg | WPS IE contents from Beacon or Probe Response frame |
| addr | MAC address to search for |
| ver1_compat | Whether to use version 1 compatibility mode |
| int wps_is_selected_pbc_registrar | ( | const struct wpabuf * | msg | ) |
Check whether WPS IE indicates active PBC.
| msg | WPS IE contents from Beacon or Probe Response frame |
| int wps_is_selected_pin_registrar | ( | const struct wpabuf * | msg | ) |
Check whether WPS IE indicates active PIN.
| msg | WPS IE contents from Beacon or Probe Response frame |
| 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().
1.8.6