Home | History | Annotate | Download | only in ap
      1 /*
      2  * hostapd / WPS integration
      3  * Copyright (c) 2008-2010, Jouni Malinen <j (at) w1.fi>
      4  *
      5  * This program is free software; you can redistribute it and/or modify
      6  * it under the terms of the GNU General Public License version 2 as
      7  * published by the Free Software Foundation.
      8  *
      9  * Alternatively, this software may be distributed under the terms of BSD
     10  * license.
     11  *
     12  * See README and COPYING for more details.
     13  */
     14 
     15 #ifndef WPS_HOSTAPD_H
     16 #define WPS_HOSTAPD_H
     17 
     18 #ifdef CONFIG_WPS
     19 
     20 int hostapd_init_wps(struct hostapd_data *hapd,
     21 		     struct hostapd_bss_config *conf);
     22 int hostapd_init_wps_complete(struct hostapd_data *hapd);
     23 void hostapd_deinit_wps(struct hostapd_data *hapd);
     24 void hostapd_update_wps(struct hostapd_data *hapd);
     25 int hostapd_wps_add_pin(struct hostapd_data *hapd, const u8 *addr,
     26 			const char *uuid, const char *pin, int timeout);
     27 int hostapd_wps_button_pushed(struct hostapd_data *hapd,
     28 			      const u8 *p2p_dev_addr);
     29 int hostapd_wps_start_oob(struct hostapd_data *hapd, char *device_type,
     30 			  char *path, char *method, char *name);
     31 int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
     32 			    char *buf, size_t buflen);
     33 void hostapd_wps_ap_pin_disable(struct hostapd_data *hapd);
     34 const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout);
     35 const char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd);
     36 int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
     37 			   int timeout);
     38 void hostapd_wps_update_ie(struct hostapd_data *hapd);
     39 int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid,
     40 			  const char *auth, const char *encr, const char *key);
     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 #endif /* CONFIG_WPS */
     77 
     78 #endif /* WPS_HOSTAPD_H */
     79