#include "wps_defs.h"
Go to the source code of this file.
enum wps_event |
enum wps_event - WPS event types
enum wps_process_res |
enum wps_process_res - WPS message processing result
enum wsc_op_code |
Definition at line 572 of file wps_common.c.
int wps_attr_text | ( | struct wpabuf * | data, | |
char * | buf, | |||
char * | end | |||
) |
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] |
u16 wps_config_methods_str2bin | ( | const char * | str | ) |
Definition at line 600 of file wps_common.c.
void wps_deinit | ( | struct wps_data * | data | ) |
wps_deinit - Deinitialize WPS Registration protocol data : WPS Registration protocol data from wps_init()
char* wps_dev_type_bin2str | ( | const u8 | dev_type[WPS_DEV_TYPE_LEN], | |
char * | buf, | |||
size_t | buf_len | |||
) |
Definition at line 557 of file wps_common.c.
int wps_dev_type_str2bin | ( | const char * | str, | |
u8 | dev_type[WPS_DEV_TYPE_LEN] | |||
) |
Definition at line 534 of file wps_common.c.
void wps_er_deinit | ( | struct wps_er * | er, | |
void(*)(void *ctx) | cb, | |||
void * | ctx | |||
) |
struct wps_er* wps_er_init | ( | struct wps_context * | wps, | |
const char * | ifname | |||
) | [read] |
void wps_free_pending_msgs | ( | struct upnp_pending_message * | msgs | ) |
unsigned int wps_generate_pin | ( | void | ) |
wps_generate_pin - Generate a random PIN Returns: Eight digit PIN (i.e., including the checksum digit)
Definition at line 239 of file wps_common.c.
struct wpabuf* wps_get_msg | ( | struct wps_data * | wps, | |
enum wsc_op_code * | op_code | |||
) | [read] |
wps_get_msg - Build a WPS message : WPS Registration protocol data from wps_init() : 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.
struct oob_device_data* wps_get_oob_device | ( | char * | device_type | ) | [read] |
int wps_get_oob_method | ( | char * | method | ) |
struct oob_nfc_device_data* wps_get_oob_nfc_device | ( | char * | device_name | ) | [read] |
struct wps_data* wps_init | ( | const struct wps_config * | cfg | ) | [read] |
wps_init - Initialize WPS Registration protocol data : 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().
int wps_is_selected_pbc_registrar | ( | const struct wpabuf * | msg | ) |
int wps_is_selected_pin_registrar | ( | const struct wpabuf * | msg | ) |
unsigned int wps_pin_checksum | ( | unsigned int | pin | ) |
wps_pin_checksum - Compute PIN checksum : Seven digit PIN (i.e., eight digit PIN without the checksum digit) Returns: Checksum digit
Definition at line 210 of file wps_common.c.
unsigned int wps_pin_valid | ( | unsigned int | pin | ) |
wps_pin_valid - Check whether a PIN has a valid checksum : Eight digit PIN (i.e., including the checksum digit) Returns: 1 if checksum digit is valid, or 0 if not
Definition at line 229 of file wps_common.c.
enum wps_process_res wps_process_msg | ( | struct wps_data * | wps, | |
enum wsc_op_code | op_code, | |||
const struct wpabuf * | msg | |||
) |
wps_process_msg - Process a WPS message : WPS Registration protocol data from wps_init() : Message OP Code : 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().
int wps_process_oob | ( | struct wps_context * | wps, | |
struct oob_device_data * | oob_dev, | |||
int | registrar | |||
) |
int wps_registrar_add_pin | ( | struct wps_registrar * | reg, | |
const u8 * | uuid, | |||
const u8 * | pin, | |||
size_t | pin_len, | |||
int | timeout | |||
) |
wps_registrar_add_pin - Configure a new PIN for Registrar : Registrar data from wps_registrar_init() : UUID-E or NULL for wildcard (any UUID) : PIN (Device Password) : Length of pin in octets : Time (in seconds) when the PIN will be invalidated; 0 = no timeout Returns: 0 on success, -1 on failure
Definition at line 519 of file wps_registrar.c.
int wps_registrar_button_pushed | ( | struct wps_registrar * | reg | ) |
wps_registrar_button_pushed - Notify Registrar that AP button was pushed : Registrar data from wps_registrar_init() Returns: 0 on success, -1 on failure
This function is called on an AP when a push button is pushed to activate PBC mode. The PBC mode will be stopped after walk time (2 minutes) timeout or when a PBC registration is completed.
Definition at line 710 of file wps_registrar.c.
void wps_registrar_deinit | ( | struct wps_registrar * | reg | ) |
wps_registrar_deinit - Deinitialize WPS Registrar data : Registrar data from wps_registrar_init()
Definition at line 496 of file wps_registrar.c.
int wps_registrar_get_info | ( | struct wps_registrar * | reg, | |
const u8 * | addr, | |||
char * | buf, | |||
size_t | buflen | |||
) |
Definition at line 2858 of file wps_registrar.c.
struct wps_registrar* wps_registrar_init | ( | struct wps_context * | wps, | |
const struct wps_registrar_config * | cfg | |||
) | [read] |
wps_registrar_init - Initialize WPS Registrar data : Pointer to longterm WPS context : Registrar configuration Returns: Pointer to allocated Registrar data or NULL on failure
This function is used to initialize WPS Registrar functionality. It can be used for a single Registrar run (e.g., when run in a supplicant) or multiple runs (e.g., when run as an internal Registrar in an AP). Caller is responsible for freeing the returned data with wps_registrar_deinit() when Registrar functionality is not needed anymore.
Definition at line 453 of file wps_registrar.c.
int wps_registrar_invalidate_pin | ( | struct wps_registrar * | reg, | |
const u8 * | uuid | |||
) |
wps_registrar_invalidate_pin - Invalidate a PIN for a specific UUID-E : Registrar data from wps_registrar_init() : UUID-E Returns: 0 on success, -1 on failure (e.g., PIN not found)
Definition at line 587 of file wps_registrar.c.
void wps_registrar_probe_req_rx | ( | struct wps_registrar * | reg, | |
const u8 * | addr, | |||
const struct wpabuf * | wps_data | |||
) |
wps_registrar_probe_req_rx - Notify Registrar of Probe Request : Registrar data from wps_registrar_init() : MAC address of the Probe Request sender : WPS IE contents
This function is called on an AP when a Probe Request with WPS IE is received. This is used to track PBC mode use and to detect possible overlap situation with other WPS APs.
Definition at line 758 of file wps_registrar.c.
int wps_registrar_unlock_pin | ( | struct wps_registrar * | reg, | |
const u8 * | uuid | |||
) |
wps_registrar_unlock_pin - Unlock a PIN for a specific UUID-E : Registrar data from wps_registrar_init() : UUID-E Returns: 0 on success, -1 on failure
PINs are locked to enforce only one concurrent use. This function unlocks a PIN to allow it to be used again. If the specified PIN was configured using a wildcard UUID, it will be removed instead of allowing multiple uses.
Definition at line 663 of file wps_registrar.c.
int wps_registrar_update_ie | ( | struct wps_registrar * | reg | ) |
Definition at line 2760 of file wps_registrar.c.