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)
41 #define IWINFO_KMGMT_NONE (1 << 0)
42 #define IWINFO_KMGMT_8021x (1 << 1)
43 #define IWINFO_KMGMT_PSK (1 << 2)
45 #define IWINFO_AUTH_OPEN (1 << 0)
46 #define IWINFO_AUTH_SHARED (1 << 1)
48 extern const char *IWINFO_CIPHER_NAMES[];
49 extern const char *IWINFO_KMGMT_NAMES[];
50 extern const char *IWINFO_AUTH_NAMES[];
54 IWINFO_OPMODE_UNKNOWN = 0,
55 IWINFO_OPMODE_MASTER = 1,
56 IWINFO_OPMODE_ADHOC = 2,
57 IWINFO_OPMODE_CLIENT = 3,
58 IWINFO_OPMODE_MONITOR = 4,
59 IWINFO_OPMODE_AP_VLAN = 5,
60 IWINFO_OPMODE_WDS = 6,
61 IWINFO_OPMODE_MESHPOINT = 7,
62 IWINFO_OPMODE_P2P_CLIENT = 8,
63 IWINFO_OPMODE_P2P_GO = 9,
66 extern const char *IWINFO_OPMODE_NAMES[];
70 IWINFO_HTMODE_HT20 = (1 << 0),
71 IWINFO_HTMODE_HT40 = (1 << 1),
72 IWINFO_HTMODE_VHT20 = (1 << 2),
73 IWINFO_HTMODE_VHT40 = (1 << 3),
74 IWINFO_HTMODE_VHT80 = (1 << 4),
75 IWINFO_HTMODE_VHT80_80 = (1 << 5),
76 IWINFO_HTMODE_VHT160 = (1 << 6),
78 IWINFO_HTMODE_COUNT = 7
81 extern const char *IWINFO_HTMODE_NAMES[IWINFO_HTMODE_COUNT];
84 struct iwinfo_rate_entry {
88 uint8_t is_short_gi:1;
91 struct iwinfo_assoclist_entry {
98 struct iwinfo_rate_entry rx_rate;
99 struct iwinfo_rate_entry tx_rate;
105 uint8_t is_authorized:1;
106 uint8_t is_authenticated:1;
107 uint8_t is_preamble_short:1;
113 struct iwinfo_txpwrlist_entry {
118 struct iwinfo_freqlist_entry {
124 struct iwinfo_crypto_entry {
127 uint8_t group_ciphers;
128 uint8_t pair_ciphers;
133 struct iwinfo_scanlist_entry {
135 char ssid[IWINFO_ESSID_MAX_SIZE+1];
136 enum iwinfo_opmode mode;
141 struct iwinfo_crypto_entry crypto;
144 struct iwinfo_country_entry {
149 struct iwinfo_iso3166_label {
154 struct iwinfo_hardware_id {
157 uint16_t subsystem_vendor_id;
158 uint16_t subsystem_device_id;
161 struct iwinfo_hardware_entry {
162 char vendor_name[64];
163 char device_name[64];
166 uint16_t subsystem_vendor_id;
167 uint16_t subsystem_device_id;
168 int16_t txpower_offset;
169 int16_t frequency_offset;
172 extern const struct iwinfo_iso3166_label IWINFO_ISO3166_NAMES[];
174 #define IWINFO_HARDWARE_FILE "/usr/share/libiwinfo/hardware.txt"
180 int (*probe)(const char *ifname);
181 int (*mode)(const char *, int *);
182 int (*channel)(const char *, int *);
183 int (*frequency)(const char *, int *);
184 int (*frequency_offset)(const char *, int *);
185 int (*txpower)(const char *, int *);
186 int (*txpower_offset)(const char *, int *);
187 int (*bitrate)(const char *, int *);
188 int (*signal)(const char *, int *);
189 int (*noise)(const char *, int *);
190 int (*quality)(const char *, int *);
191 int (*quality_max)(const char *, int *);
192 int (*mbssid_support)(const char *, int *);
193 int (*hwmodelist)(const char *, int *);
194 int (*htmodelist)(const char *, int *);
195 int (*ssid)(const char *, char *);
196 int (*bssid)(const char *, char *);
197 int (*country)(const char *, char *);
198 int (*hardware_id)(const char *, char *);
199 int (*hardware_name)(const char *, char *);
200 int (*encryption)(const char *, char *);
201 int (*phyname)(const char *, char *);
202 int (*assoclist)(const char *, char *, int *);
203 int (*txpwrlist)(const char *, char *, int *);
204 int (*scanlist)(const char *, char *, int *);
205 int (*freqlist)(const char *, char *, int *);
206 int (*countrylist)(const char *, char *, int *);
207 int (*lookup_phy)(const char *, char *);
211 const char * iwinfo_type(const char *ifname);
212 const struct iwinfo_ops * iwinfo_backend(const char *ifname);
213 const struct iwinfo_ops * iwinfo_backend_by_name(const char *name);
214 void iwinfo_finish(void);
216 extern const struct iwinfo_ops wext_ops;
217 extern const struct iwinfo_ops madwifi_ops;
218 extern const struct iwinfo_ops nl80211_ops;
219 extern const struct iwinfo_ops wl_ops;
221 #include "iwinfo/utils.h"