18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/* 28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * hostapd / WPS integration 304949598a23f501be6eec21697465fd46a28840aDmitry Shmidt * Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi> 48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * 5c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license. 6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details. 78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */ 88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef WPS_HOSTAPD_H 108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define WPS_HOSTAPD_H 118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_WPS 138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_init_wps(struct hostapd_data *hapd, 158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt struct hostapd_bss_config *conf); 1687fd279308af3f806848c8f2ab65ef18c6ac4c30Jouni Malinenint hostapd_init_wps_complete(struct hostapd_data *hapd); 178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid hostapd_deinit_wps(struct hostapd_data *hapd); 188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid hostapd_update_wps(struct hostapd_data *hapd); 19fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidtvoid hostapd_wps_eap_completed(struct hostapd_data *hapd); 208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_wps_add_pin(struct hostapd_data *hapd, const u8 *addr, 218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *uuid, const char *pin, int timeout); 228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_wps_button_pushed(struct hostapd_data *hapd, 238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *p2p_dev_addr); 2404949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint hostapd_wps_cancel(struct hostapd_data *hapd); 258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr, 268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt char *buf, size_t buflen); 278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid hostapd_wps_ap_pin_disable(struct hostapd_data *hapd); 288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtconst char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout); 298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtconst char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd); 308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin, 318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt int timeout); 328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid hostapd_wps_update_ie(struct hostapd_data *hapd); 338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid, 348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const char *auth, const char *encr, const char *key); 3504949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint hostapd_wps_nfc_tag_read(struct hostapd_data *hapd, 3604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt const struct wpabuf *data); 3704949598a23f501be6eec21697465fd46a28840aDmitry Shmidtstruct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd, 3804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt int ndef); 39f86232838cf712377867cb42417c1613ab5dc425Dmitry Shmidtstruct wpabuf * hostapd_wps_nfc_hs_cr(struct hostapd_data *hapd, int ndef); 40cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidtint hostapd_wps_nfc_report_handover(struct hostapd_data *hapd, 41cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt const struct wpabuf *req, 42cf32e60fa7e0d33fe1551a6dba8dcbbec47ea50eDmitry Shmidt const struct wpabuf *sel); 4304949598a23f501be6eec21697465fd46a28840aDmitry Shmidtstruct wpabuf * hostapd_wps_nfc_token_gen(struct hostapd_data *hapd, int ndef); 4404949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint hostapd_wps_nfc_token_enable(struct hostapd_data *hapd); 4504949598a23f501be6eec21697465fd46a28840aDmitry Shmidtvoid hostapd_wps_nfc_token_disable(struct hostapd_data *hapd); 468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#else /* CONFIG_WPS */ 488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_init_wps(struct hostapd_data *hapd, 508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt struct hostapd_bss_config *conf) 518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{ 528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt return 0; 538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt} 548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline void hostapd_deinit_wps(struct hostapd_data *hapd) 568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{ 578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt} 588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 5987fd279308af3f806848c8f2ab65ef18c6ac4c30Jouni Malinenstatic inline int hostapd_init_wps_complete(struct hostapd_data *hapd) 6087fd279308af3f806848c8f2ab65ef18c6ac4c30Jouni Malinen{ 6187fd279308af3f806848c8f2ab65ef18c6ac4c30Jouni Malinen return 0; 6287fd279308af3f806848c8f2ab65ef18c6ac4c30Jouni Malinen} 6387fd279308af3f806848c8f2ab65ef18c6ac4c30Jouni Malinen 648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline void hostapd_update_wps(struct hostapd_data *hapd) 658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{ 668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt} 678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 68fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidtstatic inline void hostapd_wps_eap_completed(struct hostapd_data *hapd) 69fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt{ 70fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt} 71fb79edc9df1f20461e90e478363d207348213d35Dmitry Shmidt 728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, 738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *addr, 748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt char *buf, size_t buflen) 758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{ 768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt return 0; 778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt} 788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_wps_button_pushed(struct hostapd_data *hapd, 808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt const u8 *p2p_dev_addr) 818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{ 828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt return 0; 838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt} 848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 8504949598a23f501be6eec21697465fd46a28840aDmitry Shmidtstatic inline int hostapd_wps_cancel(struct hostapd_data *hapd) 8604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt{ 8704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt return 0; 8804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt} 8904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt 908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_WPS */ 918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt 928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* WPS_HOSTAPD_H */ 93