2008-11-28 12:46:22 -05:00
|
|
|
/*
|
|
|
|
* wpa_supplicant / WPS integration
|
2012-06-28 06:59:29 -04:00
|
|
|
* Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi>
|
2008-11-28 12:46:22 -05:00
|
|
|
*
|
2012-02-11 09:46:35 -05:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-11-28 12:46:22 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WPS_SUPPLICANT_H
|
|
|
|
#define WPS_SUPPLICANT_H
|
|
|
|
|
2010-01-03 14:21:03 -05:00
|
|
|
struct wpa_scan_res;
|
|
|
|
|
2008-11-28 12:46:22 -05:00
|
|
|
#ifdef CONFIG_WPS
|
|
|
|
|
2009-01-03 12:50:49 -05:00
|
|
|
#include "wps/wps.h"
|
|
|
|
#include "wps/wps_defs.h"
|
|
|
|
|
2010-01-02 09:16:02 -05:00
|
|
|
struct wpa_bss;
|
|
|
|
|
2009-09-06 06:58:15 -04:00
|
|
|
struct wps_new_ap_settings {
|
|
|
|
const char *ssid_hex;
|
|
|
|
const char *auth;
|
|
|
|
const char *encr;
|
|
|
|
const char *key_hex;
|
|
|
|
};
|
|
|
|
|
2008-11-28 13:32:13 -05:00
|
|
|
int wpas_wps_init(struct wpa_supplicant *wpa_s);
|
|
|
|
void wpas_wps_deinit(struct wpa_supplicant *wpa_s);
|
2008-11-28 12:46:22 -05:00
|
|
|
int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s);
|
2009-01-03 12:50:49 -05:00
|
|
|
enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid);
|
2010-07-18 17:30:24 -04:00
|
|
|
int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
|
|
|
|
int p2p_group);
|
2008-11-29 13:59:45 -05:00
|
|
|
int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
|
2010-06-27 01:49:41 -04:00
|
|
|
const char *pin, int p2p_group, u16 dev_pw_id);
|
2010-09-06 13:51:06 -04:00
|
|
|
int wpas_wps_cancel(struct wpa_supplicant *wpa_s);
|
2009-02-26 14:57:38 -05:00
|
|
|
int wpas_wps_start_oob(struct wpa_supplicant *wpa_s, char *device_type,
|
2009-03-06 09:16:22 -05:00
|
|
|
char *path, char *method, char *name);
|
2008-11-29 13:59:45 -05:00
|
|
|
int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
|
2009-09-06 06:58:15 -04:00
|
|
|
const char *pin, struct wps_new_ap_settings *settings);
|
2009-01-23 06:10:58 -05:00
|
|
|
int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_ssid *ssid, struct wpa_scan_res *bss);
|
|
|
|
int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_ssid *ssid, struct wpa_scan_res *bss);
|
2008-11-29 15:06:34 -05:00
|
|
|
int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
|
2010-01-02 09:16:02 -05:00
|
|
|
struct wpa_bss *selected, struct wpa_ssid *ssid);
|
2008-12-15 13:09:57 -05:00
|
|
|
void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s);
|
2008-12-20 15:55:02 -05:00
|
|
|
int wpas_wps_searching(struct wpa_supplicant *wpa_s);
|
2009-09-11 10:14:49 -04:00
|
|
|
int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos,
|
|
|
|
char *end);
|
2010-05-27 08:23:55 -04:00
|
|
|
int wpas_wps_er_start(struct wpa_supplicant *wpa_s, const char *filter);
|
2009-11-07 05:41:01 -05:00
|
|
|
int wpas_wps_er_stop(struct wpa_supplicant *wpa_s);
|
2009-12-12 09:40:10 -05:00
|
|
|
int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const u8 *addr,
|
|
|
|
const char *uuid, const char *pin);
|
2009-11-15 11:46:03 -05:00
|
|
|
int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid);
|
2009-11-15 15:27:06 -05:00
|
|
|
int wpas_wps_er_learn(struct wpa_supplicant *wpa_s, const char *uuid,
|
|
|
|
const char *pin);
|
2010-10-20 06:37:01 -04:00
|
|
|
int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid,
|
|
|
|
int id);
|
2010-05-27 17:01:48 -04:00
|
|
|
int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid,
|
|
|
|
const char *pin, struct wps_new_ap_settings *settings);
|
2012-06-28 09:35:51 -04:00
|
|
|
struct wpabuf * wpas_wps_er_nfc_config_token(struct wpa_supplicant *wpa_s,
|
|
|
|
int ndef, const char *uuid);
|
2009-12-19 16:47:54 -05:00
|
|
|
int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s);
|
2010-06-11 16:50:13 -04:00
|
|
|
int wpas_wps_in_progress(struct wpa_supplicant *wpa_s);
|
2010-07-18 17:30:24 -04:00
|
|
|
void wpas_wps_update_config(struct wpa_supplicant *wpa_s);
|
2012-06-27 11:56:41 -04:00
|
|
|
struct wpabuf * wpas_wps_nfc_token(struct wpa_supplicant *wpa_s, int ndef);
|
|
|
|
int wpas_wps_start_nfc(struct wpa_supplicant *wpa_s, const u8 *bssid);
|
2012-06-28 06:59:29 -04:00
|
|
|
int wpas_wps_nfc_tag_read(struct wpa_supplicant *wpa_s,
|
|
|
|
const struct wpabuf *data);
|
2008-11-28 12:46:22 -05:00
|
|
|
|
|
|
|
#else /* CONFIG_WPS */
|
|
|
|
|
2008-11-28 13:32:13 -05:00
|
|
|
static inline int wpas_wps_init(struct wpa_supplicant *wpa_s)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:46:22 -05:00
|
|
|
static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-11-29 15:06:34 -05:00
|
|
|
static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-01-23 06:10:58 -05:00
|
|
|
static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_ssid *ssid,
|
2008-11-29 15:06:34 -05:00
|
|
|
struct wpa_scan_res *bss)
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-01-23 06:10:58 -05:00
|
|
|
static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
|
|
|
|
struct wpa_ssid *ssid,
|
2008-11-29 15:06:34 -05:00
|
|
|
struct wpa_scan_res *bss)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
|
2010-01-03 14:21:03 -05:00
|
|
|
struct wpa_bss *selected,
|
2008-11-29 15:06:34 -05:00
|
|
|
struct wpa_ssid *ssid)
|
2008-11-28 12:46:22 -05:00
|
|
|
{
|
2008-11-29 06:38:03 -05:00
|
|
|
return 0;
|
2008-11-28 12:46:22 -05:00
|
|
|
}
|
|
|
|
|
2008-12-15 13:09:57 -05:00
|
|
|
static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-12-20 15:55:02 -05:00
|
|
|
static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:46:22 -05:00
|
|
|
#endif /* CONFIG_WPS */
|
|
|
|
|
|
|
|
#endif /* WPS_SUPPLICANT_H */
|