Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * wpa_supplicant / WPS integration |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 3 | * Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi> |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 4 | * |
Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef WPS_SUPPLICANT_H |
| 10 | #define WPS_SUPPLICANT_H |
| 11 | |
| 12 | struct wpa_scan_res; |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 13 | struct wpa_scan_results; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 14 | |
| 15 | #ifdef CONFIG_WPS |
| 16 | |
| 17 | #include "wps/wps.h" |
| 18 | #include "wps/wps_defs.h" |
| 19 | |
| 20 | struct wpa_bss; |
| 21 | |
| 22 | struct wps_new_ap_settings { |
| 23 | const char *ssid_hex; |
| 24 | const char *auth; |
| 25 | const char *encr; |
| 26 | const char *key_hex; |
| 27 | }; |
| 28 | |
| 29 | int wpas_wps_init(struct wpa_supplicant *wpa_s); |
| 30 | void wpas_wps_deinit(struct wpa_supplicant *wpa_s); |
| 31 | int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s); |
| 32 | enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid); |
| 33 | int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid, |
| 34 | int p2p_group); |
| 35 | int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid, |
| 36 | const char *pin, int p2p_group, u16 dev_pw_id); |
| 37 | int wpas_wps_cancel(struct wpa_supplicant *wpa_s); |
| 38 | int wpas_wps_start_oob(struct wpa_supplicant *wpa_s, char *device_type, |
| 39 | char *path, char *method, char *name); |
| 40 | int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid, |
| 41 | const char *pin, struct wps_new_ap_settings *settings); |
| 42 | int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
| 43 | struct wpa_ssid *ssid, struct wpa_scan_res *bss); |
| 44 | int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, |
| 45 | struct wpa_ssid *ssid, struct wpa_scan_res *bss); |
| 46 | int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, |
| 47 | struct wpa_bss *selected, struct wpa_ssid *ssid); |
| 48 | void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s); |
| 49 | int wpas_wps_searching(struct wpa_supplicant *wpa_s); |
| 50 | int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos, |
| 51 | char *end); |
| 52 | int wpas_wps_er_start(struct wpa_supplicant *wpa_s, const char *filter); |
| 53 | int wpas_wps_er_stop(struct wpa_supplicant *wpa_s); |
| 54 | int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const u8 *addr, |
| 55 | const char *uuid, const char *pin); |
| 56 | int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid); |
| 57 | int wpas_wps_er_learn(struct wpa_supplicant *wpa_s, const char *uuid, |
| 58 | const char *pin); |
| 59 | int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid, |
| 60 | int id); |
| 61 | int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid, |
| 62 | const char *pin, struct wps_new_ap_settings *settings); |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 63 | struct wpabuf * wpas_wps_er_nfc_config_token(struct wpa_supplicant *wpa_s, |
| 64 | int ndef, const char *uuid); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 65 | int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s); |
| 66 | int wpas_wps_in_progress(struct wpa_supplicant *wpa_s); |
| 67 | void wpas_wps_update_config(struct wpa_supplicant *wpa_s); |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 68 | struct wpabuf * wpas_wps_nfc_token(struct wpa_supplicant *wpa_s, int ndef); |
| 69 | int wpas_wps_start_nfc(struct wpa_supplicant *wpa_s, const u8 *bssid); |
| 70 | int wpas_wps_nfc_tag_read(struct wpa_supplicant *wpa_s, |
| 71 | const struct wpabuf *data); |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 72 | void wpas_wps_update_ap_info(struct wpa_supplicant *wpa_s, |
| 73 | struct wpa_scan_results *scan_res); |
| 74 | void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s, const u8 *bssid); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 75 | |
| 76 | #else /* CONFIG_WPS */ |
| 77 | |
| 78 | static inline int wpas_wps_init(struct wpa_supplicant *wpa_s) |
| 79 | { |
| 80 | return 0; |
| 81 | } |
| 82 | |
| 83 | static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s) |
| 84 | { |
| 85 | } |
| 86 | |
| 87 | static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s) |
| 88 | { |
| 89 | return 0; |
| 90 | } |
| 91 | |
| 92 | static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid) |
| 93 | { |
| 94 | return 0; |
| 95 | } |
| 96 | |
| 97 | static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
| 98 | struct wpa_ssid *ssid, |
| 99 | struct wpa_scan_res *bss) |
| 100 | { |
| 101 | return -1; |
| 102 | } |
| 103 | |
| 104 | static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, |
| 105 | struct wpa_ssid *ssid, |
| 106 | struct wpa_scan_res *bss) |
| 107 | { |
| 108 | return 0; |
| 109 | } |
| 110 | |
| 111 | static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, |
| 112 | struct wpa_bss *selected, |
| 113 | struct wpa_ssid *ssid) |
| 114 | { |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s) |
| 119 | { |
| 120 | } |
| 121 | |
| 122 | static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s) |
| 123 | { |
| 124 | return 0; |
| 125 | } |
| 126 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 127 | static inline void wpas_wps_update_ap_info(struct wpa_supplicant *wpa_s, |
| 128 | struct wpa_scan_results *scan_res) |
| 129 | { |
| 130 | } |
| 131 | |
| 132 | static inline void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s, |
| 133 | const u8 *bssid) |
| 134 | { |
| 135 | } |
| 136 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 137 | #endif /* CONFIG_WPS */ |
| 138 | |
| 139 | #endif /* WPS_SUPPLICANT_H */ |