Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * wpa_supplicant / WPS integration |
| 3 | * Copyright (c) 2008-2009, Jouni Malinen <j@w1.fi> |
| 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; |
| 13 | |
| 14 | #ifdef CONFIG_WPS |
| 15 | |
| 16 | #include "wps/wps.h" |
| 17 | #include "wps/wps_defs.h" |
| 18 | |
| 19 | struct wpa_bss; |
| 20 | |
| 21 | struct wps_new_ap_settings { |
| 22 | const char *ssid_hex; |
| 23 | const char *auth; |
| 24 | const char *encr; |
| 25 | const char *key_hex; |
| 26 | }; |
| 27 | |
| 28 | int wpas_wps_init(struct wpa_supplicant *wpa_s); |
| 29 | void wpas_wps_deinit(struct wpa_supplicant *wpa_s); |
| 30 | int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s); |
| 31 | enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid); |
| 32 | int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid, |
| 33 | int p2p_group); |
| 34 | int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid, |
| 35 | const char *pin, int p2p_group, u16 dev_pw_id); |
| 36 | int wpas_wps_cancel(struct wpa_supplicant *wpa_s); |
| 37 | int wpas_wps_start_oob(struct wpa_supplicant *wpa_s, char *device_type, |
| 38 | char *path, char *method, char *name); |
| 39 | int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid, |
| 40 | const char *pin, struct wps_new_ap_settings *settings); |
| 41 | int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
| 42 | struct wpa_ssid *ssid, struct wpa_scan_res *bss); |
| 43 | int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, |
| 44 | struct wpa_ssid *ssid, struct wpa_scan_res *bss); |
| 45 | int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, |
| 46 | struct wpa_bss *selected, struct wpa_ssid *ssid); |
| 47 | void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s); |
| 48 | int wpas_wps_searching(struct wpa_supplicant *wpa_s); |
| 49 | int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos, |
| 50 | char *end); |
| 51 | int wpas_wps_er_start(struct wpa_supplicant *wpa_s, const char *filter); |
| 52 | int wpas_wps_er_stop(struct wpa_supplicant *wpa_s); |
| 53 | int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const u8 *addr, |
| 54 | const char *uuid, const char *pin); |
| 55 | int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid); |
| 56 | int wpas_wps_er_learn(struct wpa_supplicant *wpa_s, const char *uuid, |
| 57 | const char *pin); |
| 58 | int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid, |
| 59 | int id); |
| 60 | int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid, |
| 61 | const char *pin, struct wps_new_ap_settings *settings); |
| 62 | int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s); |
| 63 | int wpas_wps_in_progress(struct wpa_supplicant *wpa_s); |
| 64 | void wpas_wps_update_config(struct wpa_supplicant *wpa_s); |
| 65 | |
| 66 | #else /* CONFIG_WPS */ |
| 67 | |
| 68 | static inline int wpas_wps_init(struct wpa_supplicant *wpa_s) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s) |
| 74 | { |
| 75 | } |
| 76 | |
| 77 | static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s) |
| 78 | { |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid) |
| 83 | { |
| 84 | return 0; |
| 85 | } |
| 86 | |
| 87 | static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s, |
| 88 | struct wpa_ssid *ssid, |
| 89 | struct wpa_scan_res *bss) |
| 90 | { |
| 91 | return -1; |
| 92 | } |
| 93 | |
| 94 | static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s, |
| 95 | struct wpa_ssid *ssid, |
| 96 | struct wpa_scan_res *bss) |
| 97 | { |
| 98 | return 0; |
| 99 | } |
| 100 | |
| 101 | static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s, |
| 102 | struct wpa_bss *selected, |
| 103 | struct wpa_ssid *ssid) |
| 104 | { |
| 105 | return 0; |
| 106 | } |
| 107 | |
| 108 | static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s) |
| 109 | { |
| 110 | } |
| 111 | |
| 112 | static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s) |
| 113 | { |
| 114 | return 0; |
| 115 | } |
| 116 | |
| 117 | #endif /* CONFIG_WPS */ |
| 118 | |
| 119 | #endif /* WPS_SUPPLICANT_H */ |