ap_list.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * hostapd / AP table
  3. * Copyright 2002-2003, Jouni Malinen <j@w1.fi>
  4. * Copyright 2003-2004, Instant802 Networks, Inc.
  5. * Copyright 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 AP_LIST_H
  17. #define AP_LIST_H
  18. struct ap_info {
  19. /* Note: next/prev pointers are updated whenever a new beacon is
  20. * received because these are used to find the least recently used
  21. * entries. iter_next/iter_prev are updated only when adding new BSSes
  22. * and when removing old ones. These should be used when iterating
  23. * through the table in a manner that allows beacons to be received
  24. * during the iteration. */
  25. struct ap_info *next; /* next entry in AP list */
  26. struct ap_info *prev; /* previous entry in AP list */
  27. struct ap_info *hnext; /* next entry in hash table list */
  28. struct ap_info *iter_next; /* next entry in AP iteration list */
  29. struct ap_info *iter_prev; /* previous entry in AP iteration list */
  30. u8 addr[6];
  31. u16 beacon_int;
  32. u16 capability;
  33. u8 supported_rates[WLAN_SUPP_RATES_MAX];
  34. u8 ssid[33];
  35. size_t ssid_len;
  36. int wpa;
  37. int erp; /* ERP Info or -1 if ERP info element not present */
  38. int phytype; /* .11a / .11b / .11g / Atheros Turbo */
  39. int channel;
  40. int datarate; /* in 100 kbps */
  41. int ssi_signal;
  42. int ht_support;
  43. unsigned int num_beacons; /* number of beacon frames received */
  44. time_t last_beacon;
  45. int already_seen; /* whether API call AP-NEW has already fetched
  46. * information about this AP */
  47. };
  48. struct ieee802_11_elems;
  49. struct hostapd_frame_info;
  50. struct ap_info * ap_get_ap(struct hostapd_iface *iface, u8 *sta);
  51. int ap_ap_for_each(struct hostapd_iface *iface,
  52. int (*func)(struct ap_info *s, void *data), void *data);
  53. void ap_list_process_beacon(struct hostapd_iface *iface,
  54. struct ieee80211_mgmt *mgmt,
  55. struct ieee802_11_elems *elems,
  56. struct hostapd_frame_info *fi);
  57. int ap_list_init(struct hostapd_iface *iface);
  58. void ap_list_deinit(struct hostapd_iface *iface);
  59. int ap_list_reconfig(struct hostapd_iface *iface,
  60. struct hostapd_config *oldconf);
  61. #endif /* AP_LIST_H */