iwpriv是Wireless Extensions 操作的特定驱动。通过iwpriv,可以得到AP的一些参数设置,也可以设置自己的WIFI参数。
[root@root- /]#iwpriv
wlan0 Available private ioctls :
extscan (8BFA) : set 0 int & get 2 char
hostcmd (8BE4) : set 2047 byte & get 2047 byte
arpfilter (8BE6) : set 2047 byte & get 2047 byte
regrdwr (8BE3) : set 256 char & get 256 char
sdcmd52rw (8BFE) : set 7 byte & get 7 byte
sdcmd53rw (8BFF) : set 0 char & get 0 char
setgetconf (8BEA) : set 2000 byte & get 2000 byte
getcis (8BE1) : set 0 & get 512 byte
scantype (8BEB) : set 8 char & get 8 char
deauth (0001) : set 1 addr & get 0
getNF (0001) : set 1 int & get 1 int
getRSSI (0002) : set 1 int & get 1 int
bgscan (0004) : set 1 int & get 1 int
enable11d (0005) : set 1 int & get 1 int
adhocgrate (0006) : set 1 int & get 1 int
sdioclock (0007) : set 1 int & get 1 int
wmm (0008) : set 1 int & get 1 int
uapsdnullgen (000A) : set 1 int & get 1 int
setcoalescing (000B) : set 1 int & get 1 int
adhocgprot (000C) : set 1 int & get 1 int
disable_chsw (000F) : set 1 int & get 1 int
setpowercons (0001) : set 1 int & get 1 int
wmm_qosinfo (0002) : set 1 int & get 1 int
lolisteninter (0003) : set 1 int & get 1 int
psnullinterval (0005) : set 1 int & get 1 int
bcnmisto (0006) : set 1 int & get 1 int
ldocfg (0008) : set 1 int & get 1 int
rtsctsctrl (000F) : set 1 int & get 1 int
moduletype (000B) : set 1 int & get 1 int
autodeepsleep (000C) : set 1 int & get 1 int
enhanceps (000D) : set 1 int & get 1 int
wakeupmt (000E) : set 1 int & get 1 int
setrxant (0001) : set 1 int & get 0
settxant (0002) : set 1 int & get 0
authalgs (0004) : set 1 int & get 0
encryptionmode (0005) : set 1 int & get 0
setregioncode (0006) : set 1 int & get 0
setlisteninter (0007) : set 1 int & get 0
setmultipledtim (0008) : set 1 int & get 0
setbcnavg (0009) : set 1 int & get 0
setdataavg (000A) : set 1 int & get 0
associate (000B) : set 1 int & get 0
getregioncode (0001) : set 0 & get 1 int
getlisteninter (0002) : set 0 & get 1 int
getmultipledtim (0003) : set 0 & get 1 int
gettxrate (0004) : set 0 & get 1 int
getbcnavg (0005) : set 0 & get 1 int
getdataavg (0006) : set 0 & get 1 int
getauthtype (0007) : set 0 & get 1 int
getrsnmode (0008) : set 0 & get 1 int
act_paircipher (0009) : set 0 & get 1 int
act_groupcipher (000A) : set 0 & get 1 int
getdtim (000B) : set 0 & get 1 int
getrxant (0001) : set 0 & get 12 char
gettxant (0002) : set 0 & get 12 char
gettsf (0003) : set 0 & get 12 char
wpssession (0004) : set 0 & get 12 char
deepsleep (8BFB) : set 1 char & get 6 char
adhocstop (0004) : set 0 & get 0
radioon (0001) : set 0 & get 0
radiooff (0002) : set 0 & get 0
rmaeskey (0003) : set 0 & get 0
crypto_test (0006) : set 0 & get 0
reasso-on (0007) : set 0 & get 0
reasso-off (0008) : set 0 & get 0
wlanidle-on (0009) : set 0 & get 0
wlanidle-off (000A) : set 0 & get 0
softreset (000C) : set 0 & get 0
sleepparams (0002) : set 64 char & get 64 char
requesttpc (0004) : set 64 char & get 64 char
powercap (0005) : set 64 char & get 64 char
measreq (000C) : set 64 char & get 64 char
bca-ts (0003) : set 64 char & get 64 char
scanmode (0006) : set 64 char & get 64 char
getadhocstatus (0009) : set 64 char & get 64 char
setgenie (000A) : set 64 char & get 64 char
getgenie (000B) : set 64 char & get 64 char
qstatus (000D) : set 64 char & get 64 char
ts_status (000E) : set 64 char & get 64 char
setaeskey (0001) : set 32 char & get 0
getaeskey (0001) : set 1 int & get 128 char
version (0002) : set 1 int & get 128 char
verext (0003) : set 1 int & get 128 char
setwpaie (8BE0) : set 24 char & get 0
setband (0001) : set 10 char & get 0
setadhocch (0002) : set 10 char & get 0
chanswann (0003) : set 10 char & get 0
getband (0001) : set 0 & get 10 char
getadhocch (0002) : set 0 & get 10 char
getlog (8BE9) : set 0 & get 512 char
tpccfg (0001) : set 16 int & get 16 int
scanprobes (0006) : set 16 int & get 16 int
ledgpio (0005) : set 16 int & get 16 int
sleeppd (0007) : set 16 int & get 16 int
rateadapt (0008) : set 16 int & get 16 int
getSNR (0009) : set 16 int & get 16 int
getrate (000A) : set 16 int & get 16 int
getrxinfo (000B) : set 16 int & get 16 int
atimwindow (000C) : set 16 int & get 16 int
bcninterval (000D) : set 16 int & get 16 int
sdiopullctrl (000E) : set 16 int & get 16 int
scantime (000F) : set 16 int & get 16 int
sysclock (0010) : set 16 int & get 16 int
txcontrol (0012) : set 16 int & get 16 int
hscfg (0014) : set 16 int & get 16 int
hssetpara (0015) : set 16 int & get 16 int
inactoext (0016) : set 16 int & get 16 int
dbgscfg (0017) : set 16 int & get 16 int
drvdbg (0018) : set 16 int & get 16 int
drvdelaymax (001A) : set 16 int & get 16 int
intfctrl (001B) : set 16 int & get 16 int
setquietie (001C) : set 16 int & get 16 int
ctspowerctrl (001E) : set 16 int & get 16 int
psmode (001F) : set 16 int & get 16 int
setuserscan (0001) : set 2000 byte & get 2000 byte
getscantable (0002) : set 2000 byte & get 2000 byte
setmrvltlv (0003) : set 2000 byte & get 2000 byte
getassocrsp (0004) : set 2000 byte & get 2000 byte
addts (0005) : set 2000 byte & get 2000 byte
delts (0006) : set 2000 byte & get 2000 byte
qconfig (0007) : set 2000 byte & get 2000 byte
qstats (0008) : set 2000 byte & get 2000 byte
txpktstats (000C) : set 2000 byte & get 2000 byte
getcfptable (0009) : set 2000 byte & get 2000 byte
mefcfg (000A) : set 2000 byte & get 2000 byte
getmem (000B) : set 2000 byte & get 2000 byte
iwpriv源码中的main函数,内容如下:
/*------------------------------------------------------------------*/
/*
* The main !
*/
int
main(int argc,
char ** argv)
{
int skfd; /* generic raw socket desc. */
int goterr = 0;
/* Create a channel to the NET kernel. */
if((skfd = iw_sockets_open()) < 0)
{
perror("socket");
return(-1);
}
/* No argument : show the list of all devices + ioctl list */
if(argc == 1)
iw_enum_devices(skfd, &print_priv_info, NULL, 0);
else
/* Special cases take one... */
/* All */
if((!strncmp(argv[1], "-a", 2)) || (!strcmp(argv[1], "--all")))
iw_enum_devices(skfd, &print_priv_all, NULL, 0);
else
/* Help */
if((!strncmp(argv[1], "-h", 2)) || (!strcmp(argv[1],