mlme.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. #ifdef CONFIG_CLIENT_MLME
  20. int ieee80211_sta_init(struct wpa_supplicant *wpa_s);
  21. void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s);
  22. int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s, const u8 *ssid,
  23. size_t ssid_len);
  24. int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s, u16 reason);
  25. int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s, u16 reason);
  26. int ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
  27. struct wpa_driver_associate_params *params);
  28. int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid,
  29. size_t *len);
  30. void ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
  31. size_t num_hw_features);
  32. void ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
  33. struct ieee80211_rx_status *rx_status);
  34. struct wpa_scan_results *
  35. ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s);
  36. int ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
  37. const u8 *ies, size_t ies_len);
  38. int ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
  39. const u8 *target_ap,
  40. const u8 *ies, size_t ies_len);
  41. int ieee80211_sta_set_probe_req_ie(struct wpa_supplicant *wpa_s, const u8 *ies,
  42. size_t ies_len);
  43. #else /* CONFIG_CLIENT_MLME */
  44. static inline int ieee80211_sta_init(struct wpa_supplicant *wpa_s)
  45. {
  46. return 0;
  47. }
  48. static inline void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s)
  49. {
  50. }
  51. static inline int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
  52. const u8 *ssid, size_t ssid_len)
  53. {
  54. return -1;
  55. }
  56. static inline int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s,
  57. u16 reason)
  58. {
  59. return -1;
  60. }
  61. static inline int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s,
  62. u16 reason)
  63. {
  64. return -1;
  65. }
  66. static inline int
  67. ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
  68. struct wpa_driver_associate_params *params)
  69. {
  70. return -1;
  71. }
  72. static inline int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s,
  73. u8 *ssid, size_t *len)
  74. {
  75. return -1;
  76. }
  77. static inline void
  78. ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
  79. size_t num_hw_features)
  80. {
  81. }
  82. static inline void
  83. ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
  84. struct ieee80211_rx_status *rx_status)
  85. {
  86. }
  87. static inline struct wpa_scan_results *
  88. ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s)
  89. {
  90. return NULL;
  91. }
  92. static inline int
  93. ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
  94. const u8 *ies, size_t ies_len)
  95. {
  96. return -1;
  97. }
  98. static inline int
  99. ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
  100. const u8 *target_ap,
  101. const u8 *ies, size_t ies_len)
  102. {
  103. return -1;
  104. }
  105. static inline int
  106. ieee80211_sta_set_probe_req_ie(struct wpa_supplicant *wpa_s, const u8 *ies,
  107. size_t ies_len)
  108. {
  109. return -1;
  110. }
  111. #endif /* CONFIG_CLIENT_MLME */
  112. #endif /* MLME_H */