| version 1.39, 2006/10/07 00:47:18 |
version 1.40, 2007/06/08 21:47:20 |
| Line 112 static void wi_printwords __P((struct wi |
|
| Line 112 static void wi_printwords __P((struct wi |
|
| static void wi_printbool __P((struct wi_req *)); |
static void wi_printbool __P((struct wi_req *)); |
| static void wi_printhex __P((struct wi_req *)); |
static void wi_printhex __P((struct wi_req *)); |
| static void wi_printbits __P((struct wi_req *)); |
static void wi_printbits __P((struct wi_req *)); |
| |
static void wi_checkwifi __P((char *)); |
| static void wi_dumpinfo __P((char *)); |
static void wi_dumpinfo __P((char *)); |
| static void wi_printkeys __P((struct wi_req *)); |
static void wi_printkeys __P((struct wi_req *)); |
| static void wi_printvendor __P((struct wi_req *)); |
static void wi_printvendor __P((struct wi_req *)); |
| Line 638 wi_optlookup(table, opt) |
|
| Line 639 wi_optlookup(table, opt) |
|
| return (NULL); |
return (NULL); |
| } |
} |
| |
|
| |
static void wi_checkwifi(iface) |
| |
char *iface; |
| |
{ |
| |
struct ifreq ifr; |
| |
struct ieee80211_nwid nwid; |
| |
int s; |
| |
|
| |
bzero((char *)&ifr, sizeof(ifr)); |
| |
|
| |
strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)); |
| |
ifr.ifr_data = (void *)&nwid; |
| |
|
| |
s = socket(AF_INET, SOCK_DGRAM, 0); |
| |
|
| |
if (s == -1) |
| |
err(1, "socket"); |
| |
|
| |
/* Choice of ioctl inspired by ifconfig/ieee80211.c */ |
| |
if (ioctl(s, SIOCG80211NWID, &ifr) == -1) |
| |
err(1, "SIOCG80211NWID"); |
| |
|
| |
close(s); |
| |
} |
| |
|
| static void wi_dumpinfo(iface) |
static void wi_dumpinfo(iface) |
| char *iface; |
char *iface; |
| { |
{ |
| Line 865 int main(argc, argv) |
|
| Line 890 int main(argc, argv) |
|
| if (iface == NULL) |
if (iface == NULL) |
| usage(); |
usage(); |
| |
|
| |
/* Check interface is wireless. Will not return on error */ |
| |
wi_checkwifi(iface); |
| |
|
| for (table = wi_tables; *table != NULL; table++) |
for (table = wi_tables; *table != NULL; table++) |
| for (wt = *table; wt->wi_code != WI_NONE; wt++) |
for (wt = *table; wt->wi_code != WI_NONE; wt++) |
| if (wt->wi_optval != NULL) { |
if (wt->wi_optval != NULL) { |