wps_hostapd.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. #ifndef WPS_HOSTAPD_H
  9. #define WPS_HOSTAPD_H
  10. #ifdef CONFIG_WPS
  11. int hostapd_init_wps(struct hostapd_data *hapd,
  12. struct hostapd_bss_config *conf);
  13. int hostapd_init_wps_complete(struct hostapd_data *hapd);
  14. void hostapd_deinit_wps(struct hostapd_data *hapd);
  15. void hostapd_update_wps(struct hostapd_data *hapd);
  16. int hostapd_wps_add_pin(struct hostapd_data *hapd, const u8 *addr,
  17. const char *uuid, const char *pin, int timeout);
  18. int hostapd_wps_button_pushed(struct hostapd_data *hapd,
  19. const u8 *p2p_dev_addr);
  20. int hostapd_wps_cancel(struct hostapd_data *hapd);
  21. int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
  22. char *buf, size_t buflen);
  23. void hostapd_wps_ap_pin_disable(struct hostapd_data *hapd);
  24. const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout);
  25. const char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd);
  26. int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
  27. int timeout);
  28. void hostapd_wps_update_ie(struct hostapd_data *hapd);
  29. int hostapd_wps_config_ap(struct hostapd_data *hapd, const char *ssid,
  30. const char *auth, const char *encr, const char *key);
  31. int hostapd_wps_nfc_tag_read(struct hostapd_data *hapd,
  32. const struct wpabuf *data);
  33. struct wpabuf * hostapd_wps_nfc_config_token(struct hostapd_data *hapd,
  34. int ndef);
  35. struct wpabuf * hostapd_wps_nfc_hs_cr(struct hostapd_data *hapd, int ndef);
  36. struct wpabuf * hostapd_wps_nfc_token_gen(struct hostapd_data *hapd, int ndef);
  37. int hostapd_wps_nfc_token_enable(struct hostapd_data *hapd);
  38. void hostapd_wps_nfc_token_disable(struct hostapd_data *hapd);
  39. #else /* CONFIG_WPS */
  40. static inline int hostapd_init_wps(struct hostapd_data *hapd,
  41. struct hostapd_bss_config *conf)
  42. {
  43. return 0;
  44. }
  45. static inline void hostapd_deinit_wps(struct hostapd_data *hapd)
  46. {
  47. }
  48. static inline int hostapd_init_wps_complete(struct hostapd_data *hapd)
  49. {
  50. return 0;
  51. }
  52. static inline void hostapd_update_wps(struct hostapd_data *hapd)
  53. {
  54. }
  55. static inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd,
  56. const u8 *addr,
  57. char *buf, size_t buflen)
  58. {
  59. return 0;
  60. }
  61. static inline int hostapd_wps_button_pushed(struct hostapd_data *hapd,
  62. const u8 *p2p_dev_addr)
  63. {
  64. return 0;
  65. }
  66. static inline int hostapd_wps_cancel(struct hostapd_data *hapd)
  67. {
  68. return 0;
  69. }
  70. #endif /* CONFIG_WPS */
  71. #endif /* WPS_HOSTAPD_H */