ap_list.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * hostapd / AP table
  3. * Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
  4. * Copyright (c) 2003-2004, Instant802 Networks, Inc.
  5. * Copyright (c) 2006, Devicescape Software, Inc.
  6. *
  7. * This software may be distributed under the terms of the BSD license.
  8. * See README for more details.
  9. */
  10. #ifndef AP_LIST_H
  11. #define AP_LIST_H
  12. struct ap_info {
  13. /* Note: next/prev pointers are updated whenever a new beacon is
  14. * received because these are used to find the least recently used
  15. * entries. iter_next/iter_prev are updated only when adding new BSSes
  16. * and when removing old ones. These should be used when iterating
  17. * through the table in a manner that allows beacons to be received
  18. * during the iteration. */
  19. struct ap_info *next; /* next entry in AP list */
  20. struct ap_info *prev; /* previous entry in AP list */
  21. struct ap_info *hnext; /* next entry in hash table list */
  22. struct ap_info *iter_next; /* next entry in AP iteration list */
  23. struct ap_info *iter_prev; /* previous entry in AP iteration list */
  24. u8 addr[6];
  25. u16 beacon_int;
  26. u16 capability;
  27. u8 supported_rates[WLAN_SUPP_RATES_MAX];
  28. u8 ssid[33];
  29. size_t ssid_len;
  30. int wpa;
  31. int erp; /* ERP Info or -1 if ERP info element not present */
  32. int channel;
  33. int datarate; /* in 100 kbps */
  34. int ht_support;
  35. unsigned int num_beacons; /* number of beacon frames received */
  36. os_time_t last_beacon;
  37. int already_seen; /* whether API call AP-NEW has already fetched
  38. * information about this AP */
  39. };
  40. struct ieee802_11_elems;
  41. struct hostapd_frame_info;
  42. struct ap_info * ap_get_ap(struct hostapd_iface *iface, const u8 *sta);
  43. int ap_ap_for_each(struct hostapd_iface *iface,
  44. int (*func)(struct ap_info *s, void *data), void *data);
  45. void ap_list_process_beacon(struct hostapd_iface *iface,
  46. const struct ieee80211_mgmt *mgmt,
  47. struct ieee802_11_elems *elems,
  48. struct hostapd_frame_info *fi);
  49. #ifdef NEED_AP_MLME
  50. int ap_list_init(struct hostapd_iface *iface);
  51. void ap_list_deinit(struct hostapd_iface *iface);
  52. #else /* NEED_AP_MLME */
  53. static inline int ap_list_init(struct hostapd_iface *iface)
  54. {
  55. return 0;
  56. }
  57. static inline void ap_list_deinit(struct hostapd_iface *iface)
  58. {
  59. }
  60. #endif /* NEED_AP_MLME */
  61. #endif /* AP_LIST_H */