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)
32 #define IWINFO_CIPHER_NONE (1 << 0)
33 #define IWINFO_CIPHER_WEP40 (1 << 1)
34 #define IWINFO_CIPHER_TKIP (1 << 2)
35 #define IWINFO_CIPHER_WRAP (1 << 3)
36 #define IWINFO_CIPHER_CCMP (1 << 4)
37 #define IWINFO_CIPHER_WEP104 (1 << 5)
38 #define IWINFO_CIPHER_AESOCB (1 << 6)
39 #define IWINFO_CIPHER_CKIP (1 << 7)
40 #define IWINFO_CIPHER_COUNT 8
42 #define IWINFO_KMGMT_NONE (1 << 0)
43 #define IWINFO_KMGMT_8021x (1 << 1)
44 #define IWINFO_KMGMT_PSK (1 << 2)
45 #define IWINFO_KMGMT_COUNT 3
47 #define IWINFO_AUTH_OPEN (1 << 0)
48 #define IWINFO_AUTH_SHARED (1 << 1)
49 #define IWINFO_AUTH_COUNT 2
51 #define IWINFO_FREQ_NO_10MHZ (1 << 0)
52 #define IWINFO_FREQ_NO_20MHZ (1 << 1)
53 #define IWINFO_FREQ_NO_HT40PLUS (1 << 2)
54 #define IWINFO_FREQ_NO_HT40MINUS (1 << 3)
55 #define IWINFO_FREQ_NO_80MHZ (1 << 4)
56 #define IWINFO_FREQ_NO_160MHZ (1 << 5)
58 extern const char *IWINFO_CIPHER_NAMES
[IWINFO_CIPHER_COUNT
];
59 extern const char *IWINFO_KMGMT_NAMES
[IWINFO_KMGMT_COUNT
];
60 extern const char *IWINFO_AUTH_NAMES
[IWINFO_AUTH_COUNT
];
64 IWINFO_OPMODE_UNKNOWN
= 0,
65 IWINFO_OPMODE_MASTER
= 1,
66 IWINFO_OPMODE_ADHOC
= 2,
67 IWINFO_OPMODE_CLIENT
= 3,
68 IWINFO_OPMODE_MONITOR
= 4,
69 IWINFO_OPMODE_AP_VLAN
= 5,
70 IWINFO_OPMODE_WDS
= 6,
71 IWINFO_OPMODE_MESHPOINT
= 7,
72 IWINFO_OPMODE_P2P_CLIENT
= 8,
73 IWINFO_OPMODE_P2P_GO
= 9,
76 extern const char *IWINFO_OPMODE_NAMES
[];
80 IWINFO_HTMODE_HT20
= (1 << 0),
81 IWINFO_HTMODE_HT40
= (1 << 1),
82 IWINFO_HTMODE_VHT20
= (1 << 2),
83 IWINFO_HTMODE_VHT40
= (1 << 3),
84 IWINFO_HTMODE_VHT80
= (1 << 4),
85 IWINFO_HTMODE_VHT80_80
= (1 << 5),
86 IWINFO_HTMODE_VHT160
= (1 << 6),
88 IWINFO_HTMODE_COUNT
= 7
91 extern const char *IWINFO_HTMODE_NAMES
[IWINFO_HTMODE_COUNT
];
94 struct iwinfo_rate_entry
{
98 uint8_t is_short_gi
:1;
105 struct iwinfo_assoclist_entry
{
112 struct iwinfo_rate_entry rx_rate
;
113 struct iwinfo_rate_entry tx_rate
;
119 uint8_t is_authorized
:1;
120 uint8_t is_authenticated
:1;
121 uint8_t is_preamble_short
:1;
127 struct iwinfo_txpwrlist_entry
{
132 struct iwinfo_freqlist_entry
{
139 struct iwinfo_crypto_entry
{
142 uint8_t group_ciphers
;
143 uint8_t pair_ciphers
;
148 struct iwinfo_scanlist_entry
{
150 char ssid
[IWINFO_ESSID_MAX_SIZE
+1];
151 enum iwinfo_opmode mode
;
156 struct iwinfo_crypto_entry crypto
;
159 struct iwinfo_country_entry
{
164 struct iwinfo_iso3166_label
{
169 struct iwinfo_hardware_id
{
172 uint16_t subsystem_vendor_id
;
173 uint16_t subsystem_device_id
;
176 struct iwinfo_hardware_entry
{
177 char vendor_name
[64];
178 char device_name
[64];
181 uint16_t subsystem_vendor_id
;
182 uint16_t subsystem_device_id
;
183 int16_t txpower_offset
;
184 int16_t frequency_offset
;
187 extern const struct iwinfo_iso3166_label IWINFO_ISO3166_NAMES
[];
189 #define IWINFO_HARDWARE_FILE "/usr/share/libiwinfo/hardware.txt"
195 int (*probe
)(const char *ifname
);
196 int (*mode
)(const char *, int *);
197 int (*channel
)(const char *, int *);
198 int (*frequency
)(const char *, int *);
199 int (*frequency_offset
)(const char *, int *);
200 int (*txpower
)(const char *, int *);
201 int (*txpower_offset
)(const char *, int *);
202 int (*bitrate
)(const char *, int *);
203 int (*signal
)(const char *, int *);
204 int (*noise
)(const char *, int *);
205 int (*quality
)(const char *, int *);
206 int (*quality_max
)(const char *, int *);
207 int (*mbssid_support
)(const char *, int *);
208 int (*hwmodelist
)(const char *, int *);
209 int (*htmodelist
)(const char *, int *);
210 int (*ssid
)(const char *, char *);
211 int (*bssid
)(const char *, char *);
212 int (*country
)(const char *, char *);
213 int (*hardware_id
)(const char *, char *);
214 int (*hardware_name
)(const char *, char *);
215 int (*encryption
)(const char *, char *);
216 int (*phyname
)(const char *, char *);
217 int (*assoclist
)(const char *, char *, int *);
218 int (*txpwrlist
)(const char *, char *, int *);
219 int (*scanlist
)(const char *, char *, int *);
220 int (*freqlist
)(const char *, char *, int *);
221 int (*countrylist
)(const char *, char *, int *);
222 int (*lookup_phy
)(const char *, char *);
226 const char * iwinfo_type(const char *ifname
);
227 const struct iwinfo_ops
* iwinfo_backend(const char *ifname
);
228 const struct iwinfo_ops
* iwinfo_backend_by_name(const char *name
);
229 void iwinfo_finish(void);
231 extern const struct iwinfo_ops wext_ops
;
232 extern const struct iwinfo_ops madwifi_ops
;
233 extern const struct iwinfo_ops nl80211_ops
;
234 extern const struct iwinfo_ops wl_ops
;
236 #include "iwinfo/utils.h"