Wi-Fi Protected Setup - Registrar. More...
#include "includes.h"
#include "common.h"
#include "sha256.h"
#include "base64.h"
#include "ieee802_11_defs.h"
#include "eloop.h"
#include "wps_i.h"
#include "wps_dev_attr.h"
#include "wps_upnp.h"
#include "crypto.h"
#include "uuid.h"
Go to the source code of this file.
Data Structures | |
struct | wps_uuid_pin |
struct | wps_pbc_session |
struct | wps_registrar_device |
struct | wps_registrar |
Defines | |
#define | WPS_WORKAROUNDS |
#define | PIN_LOCKED BIT(0) |
#define | PIN_EXPIRES BIT(1) |
#define | WPS_STRDUP(n) |
Functions | |
int | wps_device_store (struct wps_registrar *reg, struct wps_device_data *dev, const u8 *uuid) |
struct wps_registrar * | wps_registrar_init (struct wps_context *wps, const struct wps_registrar_config *cfg) |
Initialize WPS Registrar data. | |
void | wps_registrar_deinit (struct wps_registrar *reg) |
Deinitialize WPS Registrar data. | |
int | wps_registrar_add_pin (struct wps_registrar *reg, const u8 *uuid, const u8 *pin, size_t pin_len, int timeout) |
Configure a new PIN for Registrar. | |
int | wps_registrar_invalidate_pin (struct wps_registrar *reg, const u8 *uuid) |
Invalidate a PIN for a specific UUID-E. | |
int | wps_registrar_unlock_pin (struct wps_registrar *reg, const u8 *uuid) |
Unlock a PIN for a specific UUID-E. | |
int | wps_registrar_button_pushed (struct wps_registrar *reg) |
Notify Registrar that AP button was pushed. | |
void | wps_registrar_probe_req_rx (struct wps_registrar *reg, const u8 *addr, const struct wpabuf *wps_data) |
Notify Registrar of Probe Request. | |
int | wps_build_cred (struct wps_data *wps, struct wpabuf *msg) |
struct wpabuf * | wps_registrar_get_msg (struct wps_data *wps, enum wsc_op_code *op_code) |
enum wps_process_res | wps_registrar_process_msg (struct wps_data *wps, enum wsc_op_code op_code, const struct wpabuf *msg) |
int | wps_registrar_update_ie (struct wps_registrar *reg) |
int | wps_registrar_set_selected_registrar (struct wps_registrar *reg, const struct wpabuf *msg) |
Notification of SetSelectedRegistrar. | |
int | wps_registrar_get_info (struct wps_registrar *reg, const u8 *addr, char *buf, size_t buflen) |
Wi-Fi Protected Setup - Registrar.
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_registrar.c.
#define WPS_STRDUP | ( | n | ) |
os_free(dst->n); \ dst->n = src->n ? os_strdup(src->n) : NULL
int wps_registrar_add_pin | ( | struct wps_registrar * | reg, | |
const u8 * | uuid, | |||
const u8 * | pin, | |||
size_t | pin_len, | |||
int | timeout | |||
) |
Configure a new PIN for Registrar.
reg | Registrar data from wps_registrar_init() | |
uuid | UUID-E or NULL for wildcard (any UUID) | |
pin | PIN (Device Password) | |
pin_len | Length of pin in octets | |
timeout | Time (in seconds) when the PIN will be invalidated; 0 = no timeout |
Definition at line 511 of file wps_registrar.c.
int wps_registrar_button_pushed | ( | struct wps_registrar * | reg | ) |
Notify Registrar that AP button was pushed.
reg | Registrar data from wps_registrar_init() |
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 728 of file wps_registrar.c.
void wps_registrar_deinit | ( | struct wps_registrar * | reg | ) |
Deinitialize WPS Registrar data.
reg | Registrar data from wps_registrar_init() |
Definition at line 487 of file wps_registrar.c.
struct wps_registrar* wps_registrar_init | ( | struct wps_context * | wps, | |
const struct wps_registrar_config * | cfg | |||
) | [read] |
Initialize WPS Registrar data.
wps | Pointer to longterm WPS context | |
cfg | Registrar configuration |
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 445 of file wps_registrar.c.
int wps_registrar_invalidate_pin | ( | struct wps_registrar * | reg, | |
const u8 * | uuid | |||
) |
Invalidate a PIN for a specific UUID-E.
reg | Registrar data from wps_registrar_init() | |
uuid | UUID-E |
Definition at line 592 of file wps_registrar.c.
void wps_registrar_probe_req_rx | ( | struct wps_registrar * | reg, | |
const u8 * | addr, | |||
const struct wpabuf * | wps_data | |||
) |
Notify Registrar of Probe Request.
reg | Registrar data from wps_registrar_init() | |
addr | MAC address of the Probe Request sender | |
wps_data | 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 778 of file wps_registrar.c.
int wps_registrar_set_selected_registrar | ( | struct wps_registrar * | reg, | |
const struct wpabuf * | msg | |||
) |
Notification of SetSelectedRegistrar.
reg | Registrar data from wps_registrar_init() | |
msg | Received message from SetSelectedRegistrar |
This function is called when an AP receives a SetSelectedRegistrar UPnP message.
Definition at line 2765 of file wps_registrar.c.
int wps_registrar_unlock_pin | ( | struct wps_registrar * | reg, | |
const u8 * | uuid | |||
) |
Unlock a PIN for a specific UUID-E.
reg | Registrar data from wps_registrar_init() | |
uuid | UUID-E |
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 677 of file wps_registrar.c.