mlme.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * WPA Supplicant - Client mode MLME
  3. * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
  4. * Copyright (c) 2004, Instant802 Networks, Inc.
  5. * Copyright (c) 2005-2006, Devicescape Software, Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * Alternatively, this software may be distributed under the terms of BSD
  12. * license.
  13. *
  14. * See README and COPYING for more details.
  15. */
  16. #ifndef MLME_H
  17. #define MLME_H
  18. struct wpa_supplicant;
  19. struct ieee80211_rx_status {
  20. int freq;
  21. int channel;
  22. int ssi;
  23. };
  24. #ifdef CONFIG_CLIENT_MLME
  25. int ieee80211_sta_init(struct wpa_supplicant *wpa_s);
  26. void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s);
  27. int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
  28. struct wpa_driver_scan_params *params);
  29. int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s, u16 reason);
  30. int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s, u16 reason);
  31. int ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
  32. struct wpa_driver_associate_params *params);
  33. int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid,
  34. size_t *len);
  35. void ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
  36. size_t num_hw_features);
  37. void ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
  38. struct ieee80211_rx_status *rx_status);
  39. struct wpa_scan_results *
  40. ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s);
  41. int ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
  42. const u8 *ies, size_t ies_len);
  43. int ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
  44. const u8 *target_ap,
  45. const u8 *ies, size_t ies_len);
  46. #else /* CONFIG_CLIENT_MLME */
  47. static inline int ieee80211_sta_init(struct wpa_supplicant *wpa_s)
  48. {
  49. return 0;
  50. }
  51. static inline void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s)
  52. {
  53. }
  54. static inline int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
  55. struct wpa_driver_scan_params *params)
  56. {
  57. return -1;
  58. }
  59. static inline int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s,
  60. u16 reason)
  61. {
  62. return -1;
  63. }
  64. static inline int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s,
  65. u16 reason)
  66. {
  67. return -1;
  68. }
  69. static inline int
  70. ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
  71. struct wpa_driver_associate_params *params)
  72. {
  73. return -1;
  74. }
  75. static inline int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s,
  76. u8 *ssid, size_t *len)
  77. {
  78. return -1;
  79. }
  80. static inline void
  81. ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
  82. size_t num_hw_features)
  83. {
  84. }
  85. static inline void
  86. ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
  87. struct ieee80211_rx_status *rx_status)
  88. {
  89. }
  90. static inline struct wpa_scan_results *
  91. ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s)
  92. {
  93. return NULL;
  94. }
  95. static inline int
  96. ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
  97. const u8 *ies, size_t ies_len)
  98. {
  99. return -1;
  100. }
  101. static inline int
  102. ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
  103. const u8 *target_ap,
  104. const u8 *ies, size_t ies_len)
  105. {
  106. return -1;
  107. }
  108. #endif /* CONFIG_CLIENT_MLME */
  109. #endif /* MLME_H */