ap_list.h 2.4 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. * Copyright (c) 2007-2008, Intel Corporation
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * Alternatively, this software may be distributed under the terms of BSD
  13. * license.
  14. *
  15. * See README and COPYING for more details.
  16. */
  17. #ifndef AP_LIST_H
  18. #define AP_LIST_H
  19. struct ap_info {
  20. /* Note: next/prev pointers are updated whenever a new beacon is
  21. * received because these are used to find the least recently used
  22. * entries. iter_next/iter_prev are updated only when adding new BSSes
  23. * and when removing old ones. These should be used when iterating
  24. * through the table in a manner that allows beacons to be received
  25. * during the iteration. */
  26. struct ap_info *next; /* next entry in AP list */
  27. struct ap_info *prev; /* previous entry in AP list */
  28. struct ap_info *hnext; /* next entry in hash table list */
  29. struct ap_info *iter_next; /* next entry in AP iteration list */
  30. struct ap_info *iter_prev; /* previous entry in AP iteration list */
  31. u8 addr[6];
  32. u16 beacon_int;
  33. u16 capability;
  34. u8 supported_rates[WLAN_SUPP_RATES_MAX];
  35. u8 ssid[33];
  36. size_t ssid_len;
  37. int wpa;
  38. int erp; /* ERP Info or -1 if ERP info element not present */
  39. int phytype; /* .11a / .11b / .11g / Atheros Turbo */
  40. int channel;
  41. int datarate; /* in 100 kbps */
  42. int ssi_signal;
  43. int ht_support;
  44. unsigned int num_beacons; /* number of beacon frames received */
  45. time_t last_beacon;
  46. int already_seen; /* whether API call AP-NEW has already fetched
  47. * information about this AP */
  48. };
  49. struct ieee802_11_elems;
  50. struct hostapd_frame_info;
  51. struct ap_info * ap_get_ap(struct hostapd_iface *iface, u8 *sta);
  52. int ap_ap_for_each(struct hostapd_iface *iface,
  53. int (*func)(struct ap_info *s, void *data), void *data);
  54. void ap_list_process_beacon(struct hostapd_iface *iface,
  55. struct ieee80211_mgmt *mgmt,
  56. struct ieee802_11_elems *elems,
  57. struct hostapd_frame_info *fi);
  58. int ap_list_init(struct hostapd_iface *iface);
  59. void ap_list_deinit(struct hostapd_iface *iface);
  60. int ap_list_reconfig(struct hostapd_iface *iface,
  61. struct hostapd_config *oldconf);
  62. #endif /* AP_LIST_H */