]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/wpa/src/ap/wps_hostapd.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / wpa / src / ap / wps_hostapd.h
1 /*
2  * hostapd / WPS integration
3  * Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
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);
16 int hostapd_init_wps_complete(struct hostapd_data *hapd);
17 void hostapd_deinit_wps(struct hostapd_data *hapd);
18 void hostapd_update_wps(struct hostapd_data *hapd);
19 int hostapd_wps_add_pin(struct hostapd_data *hapd, const u8 *addr,
20                         const char *uuid, const char *pin, int timeout);
21 int hostapd_wps_button_pushed(struct hostapd_data *hapd,
22                               const u8 *p2p_dev_addr);
23 int hostapd_wps_cancel(struct hostapd_data *hapd);
24 int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
25                             char *buf, size_t buflen);
26 void hostapd_wps_ap_pin_disable(struct hostapd_data *hapd);
27 const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout);
28 const char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd);
29 int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
30                            int timeout);
31 void hostapd_wps_update_ie(struct hostapd_data *hapd);
32 int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid,
33                           const char *auth, const char *encr, const char *key);
34 int hostapd_wps_nfc_tag_read(struct hostapd_data *hapd,
35                              const struct wpabuf *data);
36 struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd,
37                                              int ndef);
38 struct wpabuf * hostapd_wps_nfc_token_gen(struct hostapd_data *hapd, int ndef);
39 int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd);
40 void hostapd_wps_nfc_token_disable(struct hostapd_data *hapd);
41
42 #else /* CONFIG_WPS */
43
44 static inline int hostapd_init_wps(struct hostapd_data *hapd,
45                                    struct hostapd_bss_config *conf)
46 {
47         return 0;
48 }
49
50 static inline void hostapd_deinit_wps(struct hostapd_data *hapd)
51 {
52 }
53
54 static inline int hostapd_init_wps_complete(struct hostapd_data *hapd)
55 {
56     return 0;
57 }
58
59 static inline void hostapd_update_wps(struct hostapd_data *hapd)
60 {
61 }
62
63 static inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd,
64                                           const u8 *addr,
65                                           char *buf, size_t buflen)
66 {
67         return 0;
68 }
69
70 static inline int hostapd_wps_button_pushed(struct hostapd_data *hapd,
71                                             const u8 *p2p_dev_addr)
72 {
73         return 0;
74 }
75
76 static inline int hostapd_wps_cancel(struct hostapd_data *hapd)
77 {
78         return 0;
79 }
80
81 #endif /* CONFIG_WPS */
82
83 #endif /* WPS_HOSTAPD_H */