&size(24){&color(darkgreen){''Wireless-Tools''};};
#navi(Linux)
~''CONTENTS''
#contents
----
~''REFERENCES''
-[[Wireless Tools for Linux>http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html]]
----

**wireless-toolsとは? [#i2918847]
~無線LAN(IEEE802.11)のネットワークの為のツール。最新(2005-04-20現在)は27 拡張バージョン(WIRELESS_EXT)%%19%%17 iwconfig,iwlist,iwgetid,iwevent,iwpriv,iwspy コマンドがある。
-関連 kernel sources
++(kernel src)/include/linux/wireless.h
++(kernel src)/include/net/iw_handler.h
++(kernel src)/net/core/wireless.c

***iwconfig I/F ks2101 driver [#ge27c1a6]
|~parameter               |~set       |~get       |~description      |
|name                     |           |◯         |protocol name ?   |
|nwid/domain              |not support|not support|old parameter     |
|freq/channel             |◯         |◯         |                  |
|essid                    |◯         |◯         |                  |
|ap                       |not support|◯         |current AP        |
|nick[name]               |◯         |◯         |host name ?       |
|rate/bit[rate]           |◯         |◯         |                  |
|rts[_threshold]          |◯         |◯         |RTS threshold     |
|frag[mantation_threshold]|◯         |◯         |Fragment threshold|
|mode                     |◯         |◯         |ad-hoc & managed only|
|key/enc[ryption]         |◯         |◯         |WEP 40bit or 104 bit|
|txpow                    |not support|not support|Tx power |
|retry                    |not support|not support|retry limit |
|power                    |not support|not support|power management  |
|sens                     |not support|not support|sensitivity |
|wireless stats           |         |◯         |signal quality & signal level only |
***iwgetid I/F ks2101 driver [#pbeae165]
|~parameter  |~get       |~description  |
|ap          |◯         |current AP    |
|freq/channel|◯         |              |
|mode        |◯         |operation mode|
|protocol    |◯         |              |
|raw/scheme  |◯         |essid?        |
***iwlist I/F ks2101 driver [#gecf6f17]
|~parameter           |~get       |~description  |
|frequency/channel    |◯         ||
|ap/accesspoints/peers|◯         ||
|bitrate/rate         |◯         ||
|encryption/key       |◯         ||
|power                |not support||
|txpower              |not support||
|retry                |not support||
|scanning             |◯       |scanの実行|
|event                |◯       ||
***iwevent I/F ks2101 driver WIRELESS_EXT >13 [#me5a580d]
-DONE サポートするのは以下
|~EVENT     |~description  |
|SIOCGIWAP    |APのアドレスの通知(scan,connect,disconnect)|
|SIOCGIWESSID |ESSIDの通知(scan)|
|SIOCGIWMODE  |動作モードの通知(scan)|
|SIOCGIWFREQ  |周波数の通知(scan)|
|IWEVQUAL     |無線品質の通知(scan)|
|SIOCGIWENCODE|暗号化の通知(scan)|
|SIOCGIWRATE  |レートの通知(scan)|
|SIOCGIWSCAN|SCAN完了通知(scan)|

-定義されているEVENTは以下
|~EVENT     |~description  |~support?|
|IWEVTXDROP |Packet dropped to excessive retry | not support (driverはわからない)|
|IWEVQUAL   |Quality part of statistics (scan) | support |
|IWEVCUSTOM |Driver specific ascii string | not support (別に特別にないし…)|
|IWEVREGISTERED |Discovered a new node (AP mode) |not support (AP mode はサポートしてない)|
|IWEVEXPIRED   |Expired a node (AP mode) |not support (AP mode はサポートしてない)|
-man iwevent より抜粋
       New Access Point/Cell address 
              The  interface  has joined a new Access Point or Ad-Hoc Cell, or lost its
              association with it. This is the same MAC address  that  is  reported  by
              iwconfig.
       Scan request completed
              A  scanning request has been completed, results of the scan are available
              (see iwlist).
       Tx packet dropped
              A packet directed at this address has been dropped because the  interface
              believes  this  node doesn't answer anymore (usually maximum of MAC level
              retry exceeded). This is usually an early indication that  the  node  may
              have  left  the cell or gone out of range, but it may be due to fading or
              excessive contention.
       Custom driver event
              Event specific to the driver. Please check the driver documentation.
       Registered node
              The interface has successfully registered  a  new  wireless  client/peer.
              Will  be generated mostly when the interface act as an Access Point (mode
              master).
       Expired node
              The registration of the client/peer on this interface has  expired.  Will
              be  generated mostly when the interface act as an Access Point (mode mas-
              ter).
       Spy threshold crossed
              The signal strength for one of the address in the spy list went under the
              low threshold or went above than the high threshold.

***iwspy I/F ks2101 driver WIRELESS_EXT >15 [#y7ca807c]
~DONE 基本的には、signal quality,signal level, noise なんかの表示。Thresholdも指定できるらしい。頻繁にアップデートしなければ、ダメなようである。自動的に、アップデートできないので、サポートしない。
***iwpriv I/F ks2101 driver [#ma39691c]
-TODO? SCAN typeの設定いるかな? ACTIVE_SCAN or PASSIVE_SCAN
-DONE 実装コマンド
|~command          |~direction|~description |
|connect confirm   |get       |無線の接続状態の取得|
|driver version    |get       |driverのversionの取得|
|firmware version  |get       |firmwareのversionの取得|
|preamble          |set&get   |preambleの取得、設定|
|disconnect        |set       |強制的に、接続状態を切り替える|
|power management  |set&get   |これに実装することにする。TODO POWER SAVE|
|scan type  |set&get | scan type の取得、設定|
|data read  |get|一応実装。実際使うとしたら、アプリ作らないとだな。表示がみにくい|
|data write |set|一応実装。実際使うとしたら、アプリ作らないとだな。一応このコマンドでも使えるけど使いにくい。|
-設計
 private ioctl の範囲は SIOCIWFIRSTPRIV(0x8BE0)〜SIOCIWLASTPRIV(0x8BFF) 32
 set even  get odd
 function name size max 15+1(IFNAMSIZ)
-実装
 # iwpriv eth1
 eth1      Available private ioctl :
           GetDriverVer     (8BE1) : set   0       & get 129 char
           GetFirmwareVer   (8BE3) : set   0       & get 129 char
           SetDetach        (8BE4) : set   1 int   & get   0
           GetConnect       (8BE5) : set   0       & get   1 int
           SetPreamble      (8BE6) : set   1 int   & get   0
           GetPreamble      (8BE7) : set   0       & get   1 int
           SetPowerSave     (8BE8) : set   1 int   & get   0
           GetPowerSave     (8BE9) : set   0       & get   1 int
           SetScanType      (8BEA) : set   1 int   & get   0
           GetScanType      (8BEB) : set   0       & get   1 int
           DataWrite        (8BEC) : set 2047 byte  & get   0
           DataRead         (8BEE) : set   0       & get 2047 byte
 # iwpriv eth1 GetDriverVer
 eth1      GetDriverVer:ks2101 pcmcia beta0.1 linux
 # iwpriv eth1 GetFirmwareVer
 eth1      GetFirmwareVer:2970-PCMCIA-0.26 [Feb 09 2005  14:35:09]
 # iwpriv eth1 GetConnect
 eth1      GetConnect:0
 # iwpriv eth1 GetPreamble
 eth1      GetPreamble:0
 # iwpriv eth1 SetPreamble 1
 # iwpriv eth1 GetPreamble
 eth1      GetPreamble:1
 # iwpriv eth1 GetPowerSave
 eth1      GetPowerSave:0
 (PHY情報取得してみる)
 # iwpriv eth1 DataWrite 2 0 13 224
 # iwpriv eth1 DataRead
 eth1      DataRead:22  0  15  232  56  62  22  0  7  0  0  0  62  11  0  0  0  0  0  0
 5  0  0  0
 (10進のバイト列で指定、もしくは、表示する。みにくい…&使いにくい…)

-値の意味
|~function|~0|~1|~2|~description|
|SetConnect|FORCE_DISCONNECT_CANCEL|FORCE_DISCONNECT||上位側(kernel)からのデータを破棄し、上位側にデータを上げません。|
|GetConnect|CONNECT_STATUS|DISCONNECT_STATUS||現在の無線の状態。上記のSetConnectの値は反映されません|
|SetPreamble|LONG_PREAMBLE|SHORT_PREAMBLE|||
|GetPreamble|LONG_PREAMBLE|SHORT_PREAMBLE|||
|SetPowerSave|POWER_ACTIVE|POWER_SAVE1|POWER_SAVE2||
|GetPowerSave|POWER_ACTIVE|POWER_SAVE1|POWER_SAVE2||
|SetScanType|ACTIVE_SCAN|PASSIVE_SCAN|||
|GetScanType|ACTIVE_SCAN|PASSIVE_SCAN|||
***iwconfig [#n0330ce6]
~ifconfig みたいな奴。パラメータ等の設定など。
 # iwconfig -h
 Usage: iwconfig interface [essid {NN|on|off}]
                           [nwid {NN|on|off}]
                           [mode {managed|ad-hoc|...}
                           [freq N.NNNN[k|M|G]]
                           [channel N]
                           [ap {N|off|auto}]
                           [sens N]
                           [nick N]
                           [rate {N|auto|fixed}]
                           [rts {N|auto|fixed|off}]
                           [frag {N|auto|fixed|off}]
                           [enc {NNNN-NNNN|off}]
                           [power {period N|timeout N}]
                           [txpower N {mW|dBm}]
                           [commit]
 # iwconfig eth1
 eth1      IEEE 802.11-DS  ESSID:"ioAirportAp13"  Nickname:"anger"
           Mode:Managed  Frequency:2.412GHz  Access Point: 00:A0:B0:6A:09:00
           Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity=0/65535
           Retry limit:16   RTS thr:off   Fragment thr:off
           Encryption key:off
           Power Management:off
           Link Quality:4/10  Signal level:-35 dBm  Noise level:-256 dBm
           Rx invalid nwid:21  Rx invalid crypt:0  Rx invalid frag:0
           Tx excessive retries:0  Invalid misc:138   Missed beacon:0

***iwevent [#yd380c18]
~無線のEVENTを表示するらしい。どういう用途で使うのかな?
 # iwevent -h
 Usage: iwevent [OPTIONS]
    Monitors and displays Wireless Events.
    Options are:
      -h,--help     Print this message.
      -v,--version  Show version of this program.
 # iwevent
 Waiting for Wireless Events...
 07:45:35.945083    eth1     New Access Point/Cell address:00:00:00:00:00:00
 07:46:23.252446    eth1     New Access Point/Cell address:00:A0:B0:6A:09:00
 07:46:23.252864    eth1     New Access Point/Cell address:00:00:00:00:00:00
 07:46:23.585236    eth1     New Access Point/Cell address:00:A0:B0:6A:09:00
***iwgetid [#i86f48a1]
~interfaceの情報を取得する?iwconfigとの違いがいまいちわからん
 # iwgetid -h
 Usage iwgetid [OPTIONS] [ifname]
   Options are:
     -a,--ap       Print the access point address
     -f,--freq     Print the current frequency
     -m,--mode     Print the current mode
     -p,--protocol Print the protocol name
     -r,--raw      Format the output as raw value for shell scripts
     -s,--scheme   Format the output as a PCMCIA scheme identifier
     -h,--help     Print this message
 # iwgetid -a eth1
 eth1      Access Point/Cell: 00:A0:B0:6A:09:00
 # iwgetid -f eth1
 eth1      Frequency:2.412GHz
 # iwgetid -m eth1
 eth1      Mode:Managed
 # iwgetid -p eth1
 eth1      Protocol Name:"IEEE 802.11-DS"
 # iwgetid -s eth1
 ioAirportAp13
***iwlist [#xe02ac6f]
~interfaceに設定できる値や、無線環境の情報を表示。
 # iwlist -h
 Usage: iwlist [interface] frequency
               [interface] channel
               [interface] ap
               [interface] accesspoints
               [interface] bitrate
               [interface] rate
               [interface] encryption
               [interface] key
               [interface] power
               [interface] txpower
               [interface] retry
               [interface] scanning
               [interface] peers
               [interface] event
 # iwlist eth1 channel
 eth1      14 channels in total; available frequencies :
           Channel 01 : 2.412 GHz
           Channel 02 : 2.417 GHz
           Channel 03 : 2.422 GHz
           Channel 04 : 2.427 GHz
           Channel 05 : 2.432 GHz
           Channel 06 : 2.437 GHz
           Channel 07 : 2.442 GHz
           Channel 08 : 2.447 GHz
           Channel 09 : 2.452 GHz
           Channel 10 : 2.457 GHz
           Channel 11 : 2.462 GHz
           Channel 12 : 2.467 GHz
           Channel 13 : 2.472 GHz
           Channel 14 : 2.484 GHz
           Current Frequency:2.412GHz (channel 01)
 
 # iwlist eth1 ap
 eth1      Access Points in range:
     00:07:40:F1:00:5F : Quality:0/10  Signal level:-10 dBm  Noise level:-256 dBm (updated)
     00:07:40:56:DA:B7 : Quality:0/10  Signal level:-26 dBm  Noise level:-256 dBm (updated)
     00:A0:B0:6A:09:00 : Quality:0/10  Signal level:-60 dBm  Noise level:-256 dBm (updated)
 
 # iwlist eth1 rate
 eth1      4 available bit-rates :
           1Mb/s
           2Mb/s
           5.5Mb/s
           11Mb/s
           Current Bit Rate:11Mb/s
 
 # iwlist eth1 key
 eth1      2 key sizes : 40, 104bits
           4 keys available :
                 [1]: off
                 [2]: off
                 [3]: off
                 [4]: off
           Current Transmit Key: [2]
 
 
 # iwlist eth1 power
 eth1      Supported modes :
                         o Receive all packets (unicast & multicast)
                         o Receive Unicast only (discard multicast)
                         o Receive Multicast only (discard unicast)
           Fixed period  ;  min period:0us
                            max period:5s
           Fixed timeout ;  min timeout:0us
                            max timeout:67.1078s
           Current mode:off
           
 # iwlist eth1 txpower
 eth1      2 available transmit-powers :
           0 dBm         (1 mW)
           15 dBm        (30 mW)
           Current Tx-Power=15 dBm       (30 mW)
 
 # iwlist eth1 retry
 eth1      Fixed limit    ;  min limit:1
                             max limit:65535
           Fixed lifetime ;  min lifetime:1.024ms
                             max lifetime:67.1078s
           Current mode:on
                   limit:16 lifetime:5.12s
                  
 # iwlist eth1 scanning
 eth1      Scan completed :
           Cell 01 - Address: 00:07:40:56:DA:B7
                     ESSID:"default"
                     Mode:Managed
                     Frequency:2.442GHz
                     Quality:0/10  Signal level:-26 dBm  Noise level:-256 dBm
                     Encryption key:off
                     Bit Rate:1Mb/s
                     Bit Rate:2Mb/s
                     Bit Rate:5.5Mb/s
                     Bit Rate:11Mb/s
           Cell 02 - Address: 00:A0:B0:6A:09:00
                     ESSID:"ioAirportAp13"
                     Mode:Managed
                     Frequency:2.484GHz
                     Quality:0/10  Signal level:-60 dBm  Noise level:-256 dBm
                     Encryption key:off
                     Bit Rate:1Mb/s
                     Bit Rate:2Mb/s
                     Bit Rate:5.5Mb/s
                     Bit Rate:11Mb/s
                     Bit Rate:6Mb/s
                     Bit Rate:12Mb/s
                     Bit Rate:24Mb/s
                     Bit Rate:36Mb/s
 
 # iwlist eth1 event
 eth1      Wireless Events supported :

***iwpriv [#o2402664]
~device 特有のコマンドの実装。
 # iwpriv -h
 Usage: iwpriv interface [private-command [private-arguments]]
               interface [roam {on|off}]
               interface [port {ad-hoc|managed|N}]
 # iwpriv eth1
 eth1      Available private ioctl :
           airoioctl        (8BE0) : set   8 byte  & get 2047 byte
           airoidifc        (8BE1) : set   8 byte  & get   1 int

***iwspy [#xfa1b88b]
 # iwspy -h
 Usage: iwspy interface [+] [MAC address] [IP address]
 # iwspy eth1 + 00:A0:B0:6A:09:00
 # iwspy eth1
 eth1      Statistics collected:
     00:A0:B0:6A:09:00 : Quality:5/10  Signal level:-38 dBm  Noise level:-256 dBm (updated)
     typical/average   : Quality:6/10  Signal level:-70 dBm  Noise level:-256 dBm (updated)


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS