wps_hostapd.h 2.8 KB

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