xref: /dflybsd-src/contrib/wpa_supplicant/src/ap/wps_hostapd.h (revision bcf9aa4feb4a2fdf8ceac276d271a57f4b27e13d)
1*3ff40c12SJohn Marino /*
2*3ff40c12SJohn Marino  * hostapd / WPS integration
3*3ff40c12SJohn Marino  * Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi>
4*3ff40c12SJohn Marino  *
5*3ff40c12SJohn Marino  * This software may be distributed under the terms of the BSD license.
6*3ff40c12SJohn Marino  * See README for more details.
7*3ff40c12SJohn Marino  */
8*3ff40c12SJohn Marino 
9*3ff40c12SJohn Marino #ifndef WPS_HOSTAPD_H
10*3ff40c12SJohn Marino #define WPS_HOSTAPD_H
11*3ff40c12SJohn Marino 
12*3ff40c12SJohn Marino #ifdef CONFIG_WPS
13*3ff40c12SJohn Marino 
14*3ff40c12SJohn Marino int hostapd_init_wps(struct hostapd_data *hapd,
15*3ff40c12SJohn Marino 		     struct hostapd_bss_config *conf);
16*3ff40c12SJohn Marino int hostapd_init_wps_complete(struct hostapd_data *hapd);
17*3ff40c12SJohn Marino void hostapd_deinit_wps(struct hostapd_data *hapd);
18*3ff40c12SJohn Marino void hostapd_update_wps(struct hostapd_data *hapd);
19*3ff40c12SJohn Marino void hostapd_wps_eap_completed(struct hostapd_data *hapd);
20*3ff40c12SJohn Marino int hostapd_wps_add_pin(struct hostapd_data *hapd, const u8 *addr,
21*3ff40c12SJohn Marino 			const char *uuid, const char *pin, int timeout);
22*3ff40c12SJohn Marino int hostapd_wps_button_pushed(struct hostapd_data *hapd,
23*3ff40c12SJohn Marino 			      const u8 *p2p_dev_addr);
24*3ff40c12SJohn Marino int hostapd_wps_cancel(struct hostapd_data *hapd);
25*3ff40c12SJohn Marino int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
26*3ff40c12SJohn Marino 			    char *buf, size_t buflen);
27*3ff40c12SJohn Marino void hostapd_wps_ap_pin_disable(struct hostapd_data *hapd);
28*3ff40c12SJohn Marino const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout);
29*3ff40c12SJohn Marino const char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd);
30*3ff40c12SJohn Marino int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
31*3ff40c12SJohn Marino 			   int timeout);
32*3ff40c12SJohn Marino void hostapd_wps_update_ie(struct hostapd_data *hapd);
33*3ff40c12SJohn Marino int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid,
34*3ff40c12SJohn Marino 			  const char *auth, const char *encr, const char *key);
35*3ff40c12SJohn Marino int hostapd_wps_nfc_tag_read(struct hostapd_data *hapd,
36*3ff40c12SJohn Marino 			     const struct wpabuf *data);
37*3ff40c12SJohn Marino struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd,
38*3ff40c12SJohn Marino 					     int ndef);
39*3ff40c12SJohn Marino struct wpabuf * hostapd_wps_nfc_hs_cr(struct hostapd_data *hapd, int ndef);
40*3ff40c12SJohn Marino int hostapd_wps_nfc_report_handover(struct hostapd_data *hapd,
41*3ff40c12SJohn Marino 				    const struct wpabuf *req,
42*3ff40c12SJohn Marino 				    const struct wpabuf *sel);
43*3ff40c12SJohn Marino struct wpabuf * hostapd_wps_nfc_token_gen(struct hostapd_data *hapd, int ndef);
44*3ff40c12SJohn Marino int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd);
45*3ff40c12SJohn Marino void hostapd_wps_nfc_token_disable(struct hostapd_data *hapd);
46*3ff40c12SJohn Marino 
47*3ff40c12SJohn Marino #else /* CONFIG_WPS */
48*3ff40c12SJohn Marino 
hostapd_init_wps(struct hostapd_data * hapd,struct hostapd_bss_config * conf)49*3ff40c12SJohn Marino static inline int hostapd_init_wps(struct hostapd_data *hapd,
50*3ff40c12SJohn Marino 				   struct hostapd_bss_config *conf)
51*3ff40c12SJohn Marino {
52*3ff40c12SJohn Marino 	return 0;
53*3ff40c12SJohn Marino }
54*3ff40c12SJohn Marino 
hostapd_deinit_wps(struct hostapd_data * hapd)55*3ff40c12SJohn Marino static inline void hostapd_deinit_wps(struct hostapd_data *hapd)
56*3ff40c12SJohn Marino {
57*3ff40c12SJohn Marino }
58*3ff40c12SJohn Marino 
hostapd_init_wps_complete(struct hostapd_data * hapd)59*3ff40c12SJohn Marino static inline int hostapd_init_wps_complete(struct hostapd_data *hapd)
60*3ff40c12SJohn Marino {
61*3ff40c12SJohn Marino     return 0;
62*3ff40c12SJohn Marino }
63*3ff40c12SJohn Marino 
hostapd_update_wps(struct hostapd_data * hapd)64*3ff40c12SJohn Marino static inline void hostapd_update_wps(struct hostapd_data *hapd)
65*3ff40c12SJohn Marino {
66*3ff40c12SJohn Marino }
67*3ff40c12SJohn Marino 
hostapd_wps_eap_completed(struct hostapd_data * hapd)68*3ff40c12SJohn Marino static inline void hostapd_wps_eap_completed(struct hostapd_data *hapd)
69*3ff40c12SJohn Marino {
70*3ff40c12SJohn Marino }
71*3ff40c12SJohn Marino 
hostapd_wps_get_mib_sta(struct hostapd_data * hapd,const u8 * addr,char * buf,size_t buflen)72*3ff40c12SJohn Marino static inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd,
73*3ff40c12SJohn Marino 					  const u8 *addr,
74*3ff40c12SJohn Marino 					  char *buf, size_t buflen)
75*3ff40c12SJohn Marino {
76*3ff40c12SJohn Marino 	return 0;
77*3ff40c12SJohn Marino }
78*3ff40c12SJohn Marino 
hostapd_wps_button_pushed(struct hostapd_data * hapd,const u8 * p2p_dev_addr)79*3ff40c12SJohn Marino static inline int hostapd_wps_button_pushed(struct hostapd_data *hapd,
80*3ff40c12SJohn Marino 					    const u8 *p2p_dev_addr)
81*3ff40c12SJohn Marino {
82*3ff40c12SJohn Marino 	return 0;
83*3ff40c12SJohn Marino }
84*3ff40c12SJohn Marino 
hostapd_wps_cancel(struct hostapd_data * hapd)85*3ff40c12SJohn Marino static inline int hostapd_wps_cancel(struct hostapd_data *hapd)
86*3ff40c12SJohn Marino {
87*3ff40c12SJohn Marino 	return 0;
88*3ff40c12SJohn Marino }
89*3ff40c12SJohn Marino 
90*3ff40c12SJohn Marino #endif /* CONFIG_WPS */
91*3ff40c12SJohn Marino 
92*3ff40c12SJohn Marino #endif /* WPS_HOSTAPD_H */
93