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