wps_supplicant.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * wpa_supplicant / 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_SUPPLICANT_H
  9. #define WPS_SUPPLICANT_H
  10. struct wpa_scan_results;
  11. #ifdef CONFIG_WPS
  12. #include "wps/wps.h"
  13. #include "wps/wps_defs.h"
  14. struct wpa_bss;
  15. struct wps_new_ap_settings {
  16. const char *ssid_hex;
  17. const char *auth;
  18. const char *encr;
  19. const char *key_hex;
  20. };
  21. int wpas_wps_init(struct wpa_supplicant *wpa_s);
  22. void wpas_wps_deinit(struct wpa_supplicant *wpa_s);
  23. int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s);
  24. enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid);
  25. int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
  26. int p2p_group);
  27. int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
  28. const char *pin, int p2p_group, u16 dev_pw_id);
  29. void wpas_wps_pbc_overlap(struct wpa_supplicant *wpa_s);
  30. int wpas_wps_cancel(struct wpa_supplicant *wpa_s);
  31. int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
  32. const char *pin, struct wps_new_ap_settings *settings);
  33. int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
  34. struct wpa_ssid *ssid, struct wpa_bss *bss);
  35. int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
  36. struct wpa_ssid *ssid, struct wpa_bss *bss);
  37. int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
  38. struct wpa_bss *selected, struct wpa_ssid *ssid);
  39. void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s);
  40. int wpas_wps_searching(struct wpa_supplicant *wpa_s);
  41. int wpas_wps_scan_result_text(const u8 *ies, size_t ies_len, char *pos,
  42. char *end);
  43. int wpas_wps_er_start(struct wpa_supplicant *wpa_s, const char *filter);
  44. void wpas_wps_er_stop(struct wpa_supplicant *wpa_s);
  45. int wpas_wps_er_add_pin(struct wpa_supplicant *wpa_s, const u8 *addr,
  46. const char *uuid, const char *pin);
  47. int wpas_wps_er_pbc(struct wpa_supplicant *wpa_s, const char *uuid);
  48. int wpas_wps_er_learn(struct wpa_supplicant *wpa_s, const char *uuid,
  49. const char *pin);
  50. int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid,
  51. int id);
  52. int wpas_wps_er_config(struct wpa_supplicant *wpa_s, const char *uuid,
  53. const char *pin, struct wps_new_ap_settings *settings);
  54. struct wpabuf * wpas_wps_er_nfc_config_token(struct wpa_supplicant *wpa_s,
  55. int ndef, const char *uuid);
  56. int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s);
  57. void wpas_wps_update_config(struct wpa_supplicant *wpa_s);
  58. struct wpabuf * wpas_wps_nfc_config_token(struct wpa_supplicant *wpa_s,
  59. int ndef, const char *id_str);
  60. struct wpabuf * wpas_wps_nfc_token(struct wpa_supplicant *wpa_s, int ndef);
  61. int wpas_wps_start_nfc(struct wpa_supplicant *wpa_s, const u8 *dev_addr,
  62. const u8 *bssid,
  63. const struct wpabuf *dev_pw, u16 dev_pw_id,
  64. int p2p_group, const u8 *peer_pubkey_hash,
  65. const u8 *ssid, size_t ssid_len, int freq);
  66. int wpas_wps_nfc_tag_read(struct wpa_supplicant *wpa_s,
  67. const struct wpabuf *data, int forced_freq);
  68. struct wpabuf * wpas_wps_nfc_handover_req(struct wpa_supplicant *wpa_s,
  69. int ndef);
  70. struct wpabuf * wpas_wps_nfc_handover_sel(struct wpa_supplicant *wpa_s,
  71. int ndef, int cr, const char *uuid);
  72. int wpas_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
  73. const struct wpabuf *req,
  74. const struct wpabuf *sel);
  75. int wpas_er_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
  76. const struct wpabuf *req,
  77. const struct wpabuf *sel);
  78. void wpas_wps_update_ap_info(struct wpa_supplicant *wpa_s,
  79. struct wpa_scan_results *scan_res);
  80. void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s, const u8 *bssid);
  81. int wpas_wps_reenable_networks_pending(struct wpa_supplicant *wpa_s);
  82. #else /* CONFIG_WPS */
  83. static inline int wpas_wps_init(struct wpa_supplicant *wpa_s)
  84. {
  85. return 0;
  86. }
  87. static inline void wpas_wps_deinit(struct wpa_supplicant *wpa_s)
  88. {
  89. }
  90. static inline int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s)
  91. {
  92. return 0;
  93. }
  94. static inline u8 wpas_wps_get_req_type(struct wpa_ssid *ssid)
  95. {
  96. return 0;
  97. }
  98. static inline int wpas_wps_ssid_bss_match(struct wpa_supplicant *wpa_s,
  99. struct wpa_ssid *ssid,
  100. struct wpa_bss *bss)
  101. {
  102. return -1;
  103. }
  104. static inline int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
  105. struct wpa_ssid *ssid,
  106. struct wpa_bss *bss)
  107. {
  108. return 0;
  109. }
  110. static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
  111. struct wpa_bss *selected,
  112. struct wpa_ssid *ssid)
  113. {
  114. return 0;
  115. }
  116. static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s)
  117. {
  118. }
  119. static inline int wpas_wps_searching(struct wpa_supplicant *wpa_s)
  120. {
  121. return 0;
  122. }
  123. static inline void wpas_wps_update_ap_info(struct wpa_supplicant *wpa_s,
  124. struct wpa_scan_results *scan_res)
  125. {
  126. }
  127. static inline void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s,
  128. const u8 *bssid)
  129. {
  130. }
  131. static inline int
  132. wpas_wps_reenable_networks_pending(struct wpa_supplicant *wpa_s)
  133. {
  134. return 0;
  135. }
  136. #endif /* CONFIG_WPS */
  137. #endif /* WPS_SUPPLICANT_H */