iwinfo_nl80211.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * iwinfo - Wireless Information Library - NL80211 Headers
  3. *
  4. * Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
  5. *
  6. * The iwinfo library is free software: you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License version 2
  8. * as published by the Free Software Foundation.
  9. *
  10. * The iwinfo library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with the iwinfo library. If not, see http://www.gnu.org/licenses/.
  17. */
  18. #ifndef __IWINFO_NL80211_H_
  19. #define __IWINFO_NL80211_H_
  20. #include <errno.h>
  21. #include <fcntl.h>
  22. #include <unistd.h>
  23. #include <string.h>
  24. #include <dirent.h>
  25. #include <signal.h>
  26. #include <sys/un.h>
  27. #include <netlink/netlink.h>
  28. #include <netlink/genl/genl.h>
  29. #include <netlink/genl/family.h>
  30. #include <netlink/genl/ctrl.h>
  31. #include "iwinfo.h"
  32. #include "iwinfo/utils.h"
  33. #include "api/nl80211.h"
  34. struct nl80211_state {
  35. struct nl_sock *nl_sock;
  36. struct nl_cache *nl_cache;
  37. struct genl_family *nl80211;
  38. struct genl_family *nlctrl;
  39. };
  40. struct nl80211_msg_conveyor {
  41. struct nl_msg *msg;
  42. struct nl_cb *cb;
  43. };
  44. struct nl80211_event_conveyor {
  45. uint32_t wait[(NL80211_CMD_MAX / 32) + !!(NL80211_CMD_MAX % 32)];
  46. int recv;
  47. };
  48. struct nl80211_group_conveyor {
  49. const char *name;
  50. int id;
  51. };
  52. struct nl80211_rssi_rate {
  53. int16_t rate;
  54. int rate_samples;
  55. int8_t rssi;
  56. int rssi_samples;
  57. };
  58. struct nl80211_array_buf {
  59. void *buf;
  60. int count;
  61. };
  62. #endif