mlme.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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,
  23. struct wpa_driver_scan_params *params);
  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. #else /* CONFIG_CLIENT_MLME */
  42. static inline int ieee80211_sta_init(struct wpa_supplicant *wpa_s)
  43. {
  44. return 0;
  45. }
  46. static inline void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s)
  47. {
  48. }
  49. static inline int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
  50. struct wpa_driver_scan_params *params)
  51. {
  52. return -1;
  53. }
  54. static inline int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s,
  55. u16 reason)
  56. {
  57. return -1;
  58. }
  59. static inline int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s,
  60. u16 reason)
  61. {
  62. return -1;
  63. }
  64. static inline int
  65. ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
  66. struct wpa_driver_associate_params *params)
  67. {
  68. return -1;
  69. }
  70. static inline int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s,
  71. u8 *ssid, size_t *len)
  72. {
  73. return -1;
  74. }
  75. static inline void
  76. ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
  77. size_t num_hw_features)
  78. {
  79. }
  80. static inline void
  81. ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
  82. struct ieee80211_rx_status *rx_status)
  83. {
  84. }
  85. static inline struct wpa_scan_results *
  86. ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s)
  87. {
  88. return NULL;
  89. }
  90. static inline int
  91. ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
  92. const u8 *ies, size_t ies_len)
  93. {
  94. return -1;
  95. }
  96. static inline int
  97. ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
  98. const u8 *target_ap,
  99. const u8 *ies, size_t ies_len)
  100. {
  101. return -1;
  102. }
  103. #endif /* CONFIG_CLIENT_MLME */
  104. #endif /* MLME_H */