Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * hostapd / 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_HOSTAPD_H |
| 10 | #define WPS_HOSTAPD_H |
| 11 | |
| 12 | #ifdef CONFIG_WPS |
| 13 | |
| 14 | int hostapd_init_wps(struct hostapd_data *hapd, |
| 15 | struct hostapd_bss_config *conf); |
Jouni Malinen | 87fd279 | 2011-05-16 18:35:42 +0300 | [diff] [blame] | 16 | int hostapd_init_wps_complete(struct hostapd_data *hapd); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 17 | void hostapd_deinit_wps(struct hostapd_data *hapd); |
| 18 | void hostapd_update_wps(struct hostapd_data *hapd); |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 19 | void hostapd_wps_eap_completed(struct hostapd_data *hapd); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 20 | int hostapd_wps_add_pin(struct hostapd_data *hapd, const u8 *addr, |
| 21 | const char *uuid, const char *pin, int timeout); |
| 22 | int hostapd_wps_button_pushed(struct hostapd_data *hapd, |
| 23 | const u8 *p2p_dev_addr); |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 24 | int hostapd_wps_cancel(struct hostapd_data *hapd); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 25 | int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr, |
| 26 | char *buf, size_t buflen); |
| 27 | void hostapd_wps_ap_pin_disable(struct hostapd_data *hapd); |
| 28 | const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout); |
| 29 | const char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd); |
| 30 | int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin, |
| 31 | int timeout); |
| 32 | void hostapd_wps_update_ie(struct hostapd_data *hapd); |
| 33 | int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid, |
| 34 | const char *auth, const char *encr, const char *key); |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 35 | int hostapd_wps_nfc_tag_read(struct hostapd_data *hapd, |
| 36 | const struct wpabuf *data); |
| 37 | struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd, |
| 38 | int ndef); |
Dmitry Shmidt | f862328 | 2013-02-20 14:34:59 -0800 | [diff] [blame] | 39 | struct wpabuf * hostapd_wps_nfc_hs_cr(struct hostapd_data *hapd, int ndef); |
Dmitry Shmidt | cf32e60 | 2014-01-28 10:57:39 -0800 | [diff] [blame] | 40 | int hostapd_wps_nfc_report_handover(struct hostapd_data *hapd, |
| 41 | const struct wpabuf *req, |
| 42 | const struct wpabuf *sel); |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 43 | struct wpabuf * hostapd_wps_nfc_token_gen(struct hostapd_data *hapd, int ndef); |
| 44 | int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd); |
| 45 | void hostapd_wps_nfc_token_disable(struct hostapd_data *hapd); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 46 | |
| 47 | #else /* CONFIG_WPS */ |
| 48 | |
| 49 | static inline int hostapd_init_wps(struct hostapd_data *hapd, |
| 50 | struct hostapd_bss_config *conf) |
| 51 | { |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | static inline void hostapd_deinit_wps(struct hostapd_data *hapd) |
| 56 | { |
| 57 | } |
| 58 | |
Jouni Malinen | 87fd279 | 2011-05-16 18:35:42 +0300 | [diff] [blame] | 59 | static inline int hostapd_init_wps_complete(struct hostapd_data *hapd) |
| 60 | { |
| 61 | return 0; |
| 62 | } |
| 63 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 64 | static inline void hostapd_update_wps(struct hostapd_data *hapd) |
| 65 | { |
| 66 | } |
| 67 | |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 68 | static inline void hostapd_wps_eap_completed(struct hostapd_data *hapd) |
| 69 | { |
| 70 | } |
| 71 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 72 | static inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, |
| 73 | const u8 *addr, |
| 74 | char *buf, size_t buflen) |
| 75 | { |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | static inline int hostapd_wps_button_pushed(struct hostapd_data *hapd, |
| 80 | const u8 *p2p_dev_addr) |
| 81 | { |
| 82 | return 0; |
| 83 | } |
| 84 | |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 85 | static inline int hostapd_wps_cancel(struct hostapd_data *hapd) |
| 86 | { |
| 87 | return 0; |
| 88 | } |
| 89 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 90 | #endif /* CONFIG_WPS */ |
| 91 | |
| 92 | #endif /* WPS_HOSTAPD_H */ |