17 #include <sys/ioctl.h>
23 #define IWINFO_BUFSIZE 24 * 1024
24 #define IWINFO_ESSID_MAX_SIZE 32
26 #define IWINFO_80211_A (1 << 0)
27 #define IWINFO_80211_B (1 << 1)
28 #define IWINFO_80211_G (1 << 2)
29 #define IWINFO_80211_N (1 << 3)
30 #define IWINFO_80211_AC (1 << 4)
31 #define IWINFO_80211_AD (1 << 5)
33 #define IWINFO_CIPHER_NONE (1 << 0)
34 #define IWINFO_CIPHER_WEP40 (1 << 1)
35 #define IWINFO_CIPHER_TKIP (1 << 2)
36 #define IWINFO_CIPHER_WRAP (1 << 3)
37 #define IWINFO_CIPHER_CCMP (1 << 4)
38 #define IWINFO_CIPHER_WEP104 (1 << 5)
39 #define IWINFO_CIPHER_AESOCB (1 << 6)
40 #define IWINFO_CIPHER_CKIP (1 << 7)
41 #define IWINFO_CIPHER_COUNT 8
43 #define IWINFO_KMGMT_NONE (1 << 0)
44 #define IWINFO_KMGMT_8021x (1 << 1)
45 #define IWINFO_KMGMT_PSK (1 << 2)
46 #define IWINFO_KMGMT_SAE (1 << 3)
47 #define IWINFO_KMGMT_OWE (1 << 4)
48 #define IWINFO_KMGMT_COUNT 5
50 #define IWINFO_AUTH_OPEN (1 << 0)
51 #define IWINFO_AUTH_SHARED (1 << 1)
52 #define IWINFO_AUTH_COUNT 2
54 #define IWINFO_FREQ_NO_10MHZ (1 << 0)
55 #define IWINFO_FREQ_NO_20MHZ (1 << 1)
56 #define IWINFO_FREQ_NO_HT40PLUS (1 << 2)
57 #define IWINFO_FREQ_NO_HT40MINUS (1 << 3)
58 #define IWINFO_FREQ_NO_80MHZ (1 << 4)
59 #define IWINFO_FREQ_NO_160MHZ (1 << 5)
60 #define IWINFO_FREQ_NO_2160MHZ (1 << 6)
62 extern const char *IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT];
63 extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT];
64 extern const char *IWINFO_AUTH_NAMES[IWINFO_AUTH_COUNT];
68 IWINFO_OPMODE_UNKNOWN = 0,
69 IWINFO_OPMODE_MASTER = 1,
70 IWINFO_OPMODE_ADHOC = 2,
71 IWINFO_OPMODE_CLIENT = 3,
72 IWINFO_OPMODE_MONITOR = 4,
73 IWINFO_OPMODE_AP_VLAN = 5,
74 IWINFO_OPMODE_WDS = 6,
75 IWINFO_OPMODE_MESHPOINT = 7,
76 IWINFO_OPMODE_P2P_CLIENT = 8,
77 IWINFO_OPMODE_P2P_GO = 9,
80 extern const char *IWINFO_OPMODE_NAMES[];
84 IWINFO_HTMODE_HT20 = (1 << 0),
85 IWINFO_HTMODE_HT40 = (1 << 1),
86 IWINFO_HTMODE_VHT20 = (1 << 2),
87 IWINFO_HTMODE_VHT40 = (1 << 3),
88 IWINFO_HTMODE_VHT80 = (1 << 4),
89 IWINFO_HTMODE_VHT80_80 = (1 << 5),
90 IWINFO_HTMODE_VHT160 = (1 << 6),
91 IWINFO_HTMODE_NOHT = (1 << 7),
93 IWINFO_HTMODE_COUNT = 8
96 extern const char *IWINFO_HTMODE_NAMES[IWINFO_HTMODE_COUNT];
99 struct iwinfo_rate_entry {
103 uint8_t is_short_gi:1;
110 struct iwinfo_assoclist_entry {
116 uint32_t connected_time;
119 uint64_t rx_drop_misc;
120 struct iwinfo_rate_entry rx_rate;
121 struct iwinfo_rate_entry tx_rate;
127 uint8_t is_authorized:1;
128 uint8_t is_authenticated:1;
129 uint8_t is_preamble_short:1;
136 char plink_state[16];
142 struct iwinfo_survey_entry {
143 uint64_t active_time;
145 uint64_t busy_time_ext;
152 struct iwinfo_txpwrlist_entry {
157 struct iwinfo_freqlist_entry {
164 struct iwinfo_crypto_entry {
167 uint8_t group_ciphers;
168 uint8_t pair_ciphers;
173 struct iwinfo_scanlist_entry {
175 char ssid[IWINFO_ESSID_MAX_SIZE+1];
176 enum iwinfo_opmode mode;
181 struct iwinfo_crypto_entry crypto;
184 uint8_t has_bss_load;
185 uint8_t station_count;
186 uint8_t channel_utilization;
187 uint8_t admission_capacity;
190 struct iwinfo_country_entry {
195 struct iwinfo_iso3166_label {
200 struct iwinfo_hardware_id {
203 uint16_t subsystem_vendor_id;
204 uint16_t subsystem_device_id;
207 struct iwinfo_hardware_entry {
208 char vendor_name[64];
209 char device_name[64];
212 uint16_t subsystem_vendor_id;
213 uint16_t subsystem_device_id;
214 int16_t txpower_offset;
215 int16_t frequency_offset;
218 extern const struct iwinfo_iso3166_label IWINFO_ISO3166_NAMES[];
220 #define IWINFO_HARDWARE_FILE "/usr/share/libiwinfo/hardware.txt"
226 int (*probe)(const char *ifname);
227 int (*mode)(const char *, int *);
228 int (*channel)(const char *, int *);
229 int (*frequency)(const char *, int *);
230 int (*frequency_offset)(const char *, int *);
231 int (*txpower)(const char *, int *);
232 int (*txpower_offset)(const char *, int *);
233 int (*bitrate)(const char *, int *);
234 int (*signal)(const char *, int *);
235 int (*noise)(const char *, int *);
236 int (*quality)(const char *, int *);
237 int (*quality_max)(const char *, int *);
238 int (*mbssid_support)(const char *, int *);
239 int (*hwmodelist)(const char *, int *);
240 int (*htmodelist)(const char *, int *);
241 int (*htmode)(const char *, int *);
242 int (*ssid)(const char *, char *);
243 int (*bssid)(const char *, char *);
244 int (*country)(const char *, char *);
245 int (*hardware_id)(const char *, char *);
246 int (*hardware_name)(const char *, char *);
247 int (*encryption)(const char *, char *);
248 int (*phyname)(const char *, char *);
249 int (*assoclist)(const char *, char *, int *);
250 int (*txpwrlist)(const char *, char *, int *);
251 int (*scanlist)(const char *, char *, int *);
252 int (*freqlist)(const char *, char *, int *);
253 int (*countrylist)(const char *, char *, int *);
254 int (*survey)(const char *, char *, int *);
255 int (*lookup_phy)(const char *, char *);
259 const char * iwinfo_type(const char *ifname);
260 const struct iwinfo_ops * iwinfo_backend(const char *ifname);
261 const struct iwinfo_ops * iwinfo_backend_by_name(const char *name);
262 void iwinfo_finish(void);
264 extern const struct iwinfo_ops wext_ops;
265 extern const struct iwinfo_ops madwifi_ops;
266 extern const struct iwinfo_ops nl80211_ops;
267 extern const struct iwinfo_ops wl_ops;
269 #include "iwinfo/utils.h"