iwinfo: nl80211: add support for printing the device path for a phy
[project/iwinfo.git] / iwinfo_nl80211.h
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
19 #ifndef __IWINFO_NL80211_H_
20 #define __IWINFO_NL80211_H_
21
22 #include <errno.h>
23 #include <fcntl.h>
24 #include <unistd.h>
25 #include <string.h>
26 #include <dirent.h>
27 #include <signal.h>
28 #include <sys/un.h>
29 #include <netlink/netlink.h>
30 #include <netlink/genl/genl.h>
31 #include <netlink/genl/family.h>
32 #include <netlink/genl/ctrl.h>
33
34 #include "iwinfo.h"
35 #include "iwinfo/utils.h"
36 #include "api/nl80211.h"
37
38 struct nl80211_state {
39 struct nl_sock *nl_sock;
40 struct nl_cache *nl_cache;
41 struct genl_family *nl80211;
42 struct genl_family *nlctrl;
43 };
44
45 struct nl80211_msg_conveyor {
46 struct nl_msg *msg;
47 struct nl_cb *cb;
48 };
49
50 struct nl80211_event_conveyor {
51 uint32_t wait[(NL80211_CMD_MAX / 32) + !!(NL80211_CMD_MAX % 32)];
52 int recv;
53 };
54
55 struct nl80211_group_conveyor {
56 const char *name;
57 int id;
58 };
59
60 struct nl80211_rssi_rate {
61 int16_t rate;
62 int rate_samples;
63 int8_t rssi;
64 int rssi_samples;
65 };
66
67 struct nl80211_array_buf {
68 void *buf;
69 int count;
70 };
71
72 #endif