blob: f968e151fe1f8daafa928e2da7195b472f07458c [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * hostapd / WPS integration
Dmitry Shmidt04949592012-07-19 12:16:46 -07003 * Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi>
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef WPS_HOSTAPD_H
10#define WPS_HOSTAPD_H
11
12#ifdef CONFIG_WPS
13
14int hostapd_init_wps(struct hostapd_data *hapd,
15 struct hostapd_bss_config *conf);
Jouni Malinen87fd2792011-05-16 18:35:42 +030016int hostapd_init_wps_complete(struct hostapd_data *hapd);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070017void hostapd_deinit_wps(struct hostapd_data *hapd);
18void hostapd_update_wps(struct hostapd_data *hapd);
19int hostapd_wps_add_pin(struct hostapd_data *hapd, const u8 *addr,
20 const char *uuid, const char *pin, int timeout);
21int hostapd_wps_button_pushed(struct hostapd_data *hapd,
22 const u8 *p2p_dev_addr);
Dmitry Shmidt04949592012-07-19 12:16:46 -070023int hostapd_wps_cancel(struct hostapd_data *hapd);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070024int hostapd_wps_start_oob(struct hostapd_data *hapd, char *device_type,
25 char *path, char *method, char *name);
26int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
27 char *buf, size_t buflen);
28void hostapd_wps_ap_pin_disable(struct hostapd_data *hapd);
29const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout);
30const char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd);
31int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
32 int timeout);
33void hostapd_wps_update_ie(struct hostapd_data *hapd);
34int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid,
35 const char *auth, const char *encr, const char *key);
Dmitry Shmidt04949592012-07-19 12:16:46 -070036int hostapd_wps_nfc_tag_read(struct hostapd_data *hapd,
37 const struct wpabuf *data);
38struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd,
39 int ndef);
40struct wpabuf * hostapd_wps_nfc_token_gen(struct hostapd_data *hapd, int ndef);
41int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd);
42void hostapd_wps_nfc_token_disable(struct hostapd_data *hapd);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070043
44#else /* CONFIG_WPS */
45
46static inline int hostapd_init_wps(struct hostapd_data *hapd,
47 struct hostapd_bss_config *conf)
48{
49 return 0;
50}
51
52static inline void hostapd_deinit_wps(struct hostapd_data *hapd)
53{
54}
55
Jouni Malinen87fd2792011-05-16 18:35:42 +030056static inline int hostapd_init_wps_complete(struct hostapd_data *hapd)
57{
58 return 0;
59}
60
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070061static inline void hostapd_update_wps(struct hostapd_data *hapd)
62{
63}
64
65static inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd,
66 const u8 *addr,
67 char *buf, size_t buflen)
68{
69 return 0;
70}
71
72static inline int hostapd_wps_button_pushed(struct hostapd_data *hapd,
73 const u8 *p2p_dev_addr)
74{
75 return 0;
76}
77
Dmitry Shmidt04949592012-07-19 12:16:46 -070078static inline int hostapd_wps_cancel(struct hostapd_data *hapd)
79{
80 return 0;
81}
82
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070083#endif /* CONFIG_WPS */
84
85#endif /* WPS_HOSTAPD_H */