You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. struct wpa_scan_res;
  17. #ifdef CONFIG_WPS
  18. #include "wps/wps.h"
  19. #include "wps/wps_defs.h"
  20. struct wpa_bss;
  21. struct wps_new_ap_settings {
  22. const char *ssid_hex;
  23. const char *auth;
  24. const char *encr;
  25. const char *key_hex;
  26. };
  27. int wpas_wps_init(struct wpa_supplicant *wpa_s);
  28. void wpas_wps_deinit(struct wpa_supplicant *wpa_s);
  29. int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s);
  30. enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid);
  31. int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
  32. int p2p_group);
  33. int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
  34. const char *pin, int p2p_group, u16 dev_pw_id);
  35. int wpas_wps_cancel(struct wpa_supplicant *wpa_s);
  36. int wpas_wps_start_oob(struct wpa_supplicant *wpa_s, char *device_type,
  37. char *path, char *method, char *name);
  38. int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
  39. const char *pin, struct wps_new_ap_settings *settings);
  40. int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
  41. struct wpa_ssid *ssid, struct wpa_scan_res *bss);
  42. int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
  43. struct wpa_ssid *ssid, struct wpa_scan_res *bss);
  44. int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
  45. struct wpa_bss *selected, struct wpa_ssid *ssid);
  46. void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s);
  47. int wpas_wps_searching(struct wpa_supplicant *wpa_s);
  48. int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos,
  49. char *end);
  50. int wpas_wps_er_start(struct wpa_supplicant *wpa_s, const char *filter);
  51. int wpas_wps_er_stop(struct wpa_supplicant *wpa_s);
  52. int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const u8 *addr,
  53. const char *uuid, const char *pin);
  54. int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid);
  55. int wpas_wps_er_learn(struct wpa_supplicant *wpa_s, const char *uuid,
  56. const char *pin);
  57. int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid,
  58. int id);
  59. int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid,
  60. const char *pin, struct wps_new_ap_settings *settings);
  61. int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s);
  62. int wpas_wps_in_progress(struct wpa_supplicant *wpa_s);
  63. void wpas_wps_update_config(struct wpa_supplicant *wpa_s);
  64. #else /* CONFIG_WPS */
  65. static inline int wpas_wps_init(struct wpa_supplicant *wpa_s)
  66. {
  67. return 0;
  68. }
  69. static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s)
  70. {
  71. }
  72. static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s)
  73. {
  74. return 0;
  75. }
  76. static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid)
  77. {
  78. return 0;
  79. }
  80. static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
  81. struct wpa_ssid *ssid,
  82. struct wpa_scan_res *bss)
  83. {
  84. return -1;
  85. }
  86. static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
  87. struct wpa_ssid *ssid,
  88. struct wpa_scan_res *bss)
  89. {
  90. return 0;
  91. }
  92. static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
  93. struct wpa_bss *selected,
  94. struct wpa_ssid *ssid)
  95. {
  96. return 0;
  97. }
  98. static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s)
  99. {
  100. }
  101. static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s)
  102. {
  103. return 0;
  104. }
  105. #endif /* CONFIG_WPS */
  106. #endif /* WPS_SUPPLICANT_H */