wps_supplicant.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * wpa_supplicant / WPS integration
  3. * Copyright (c) 2008-2009, Jouni Malinen <j@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. #ifndef WPS_SUPPLICANT_H
  15. #define WPS_SUPPLICANT_H
  16. #ifdef CONFIG_WPS
  17. #include "wps/wps.h"
  18. #include "wps/wps_defs.h"
  19. struct wps_new_ap_settings {
  20. const char *ssid_hex;
  21. const char *auth;
  22. const char *encr;
  23. const char *key_hex;
  24. };
  25. int wpas_wps_init(struct wpa_supplicant *wpa_s);
  26. void wpas_wps_deinit(struct wpa_supplicant *wpa_s);
  27. int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s);
  28. enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid);
  29. int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid);
  30. int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
  31. const char *pin);
  32. int wpas_wps_start_oob(struct wpa_supplicant *wpa_s, char *device_type,
  33. char *path, char *method, char *name);
  34. int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
  35. const char *pin, struct wps_new_ap_settings *settings);
  36. int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
  37. struct wpa_ssid *ssid, struct wpa_scan_res *bss);
  38. int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
  39. struct wpa_ssid *ssid, struct wpa_scan_res *bss);
  40. int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
  41. struct wpa_scan_res *selected,
  42. struct wpa_ssid *ssid);
  43. void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s);
  44. int wpas_wps_searching(struct wpa_supplicant *wpa_s);
  45. int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos,
  46. char *end);
  47. int wpas_wps_er_start(struct wpa_supplicant *wpa_s);
  48. int wpas_wps_er_stop(struct wpa_supplicant *wpa_s);
  49. int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const char *uuid,
  50. const char *pin);
  51. int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid);
  52. #else /* CONFIG_WPS */
  53. static inline int wpas_wps_init(struct wpa_supplicant *wpa_s)
  54. {
  55. return 0;
  56. }
  57. static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s)
  58. {
  59. }
  60. static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s)
  61. {
  62. return 0;
  63. }
  64. static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid)
  65. {
  66. return 0;
  67. }
  68. static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
  69. struct wpa_ssid *ssid,
  70. struct wpa_scan_res *bss)
  71. {
  72. return -1;
  73. }
  74. static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
  75. struct wpa_ssid *ssid,
  76. struct wpa_scan_res *bss)
  77. {
  78. return 0;
  79. }
  80. static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
  81. struct wpa_scan_res *selected,
  82. struct wpa_ssid *ssid)
  83. {
  84. return 0;
  85. }
  86. static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s)
  87. {
  88. }
  89. static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s)
  90. {
  91. return 0;
  92. }
  93. #endif /* CONFIG_WPS */
  94. #endif /* WPS_SUPPLICANT_H */