File : parse-iwlist.awk

BEGIN { OFS = "\t"; } # OFS is a field separator used for "print"
/\<Cell/ {
    # New cell description has started, so we need to print a previous one.
    # Detect security mode first.
    if (wpa) { security = "wpa" } else { if (wep) { security = "wep" } else { security = "none" }}
    if (essid) print essid, security, quality;
    # Reset security flags.
    wep = 0; wpa = 0;
}
/\<ESSID:/ {
    essid = substr($0, index($0, ":") + 1);
    essid = substr(essid, 2, length(essid) - 2) # discard quotes
}
/\<Quality/ {
    # We should support several output formats from iwlist scan (from
    # wireless_tools package):
    #
    # 1) Quality:30/70
    # 2) Quality=20/100
    # 3) Quality:60
    #
    # Quality might be separated with '=' or with ':' and we might have maximal
    # value present or not. This depends on the driver used.
    #
    split($1, q, "[:=]"); # after split: q[1] -> "Quality", q[2] -> quality value
    split(q[2], qvalues, "/");
    if (qvalues[2]) {
        quality = int(qvalues[1] / qvalues[2] * 100); # we have both parts, divide
    } else {
        quality = qvalues[1]; # we have only one part, use it as-is
    }
}
/\<Encryption key:(o|O)n/ { wep = 1 }
/\<IE:.*WPA.*/ { wpa = 1 }
END {
    # handle last cell
    if (wpa) { security = "wpa" } else { if (wep) { security = "wep" } else { security = "none" }}
    if (essid) print essid, security, quality;
}


Command :
# iwlist wlan0 scan | awk -f parse-iwlist.awk
iptime_2 wpa 100 lab2 wep 100 PRODEA none 100 HMC_HW wep 98 kotech wpa 41 portthru none 44 orbotech wpa 58 beseto-1 wpa 58 PCMM_HMK wpa 50 Air_net_ct wpa 47 KT_WLAN wep 47 000D0B836EA6 wep 35 NHTECH_ceo wpa 41 netis wpa 47 3Team wpa 47 golf19 wpa 58 EE_2F wpa 52 FREE2USE none 41 HNB200_2G none 55 myLGNet wep 38 zero none 47 chemkosc wep 50 KT_WLAN_5D5A wpa 52 iptime none 41


Link :





Posted by eoseontaek

WI-FI Usage

=================

This is detailed explanation of each parameters for the FH7200B wi-fi use.

(Updated : 2013-09-12, by steo)


[parameters]         [val] 

{range}

-----------------   -------------------------------------------------

SSID                         {0~z, 1~32 ascii characters}

                            ::Set AP SSID

AuthMode             {AUTO,OPEN,SHARED,WPAPSK,WPA2PSK}

                                ::Set Authentication Mode

EncrypType           {NONE,WEP64,WEP128,TKIP,AES}          

::Set Encryption Type

Key                 {5 ascii characters or 10 hex number or 

                      13 ascii characters or 26 hex numbers}

                      ::Set Key String  

Examples

===================================================================

a> Config STA to link with AP which is AUTO/NONE(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 enc off

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0


b> Config STA to link with AP which is AUTO/WEP64(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 key s:AP's wep key

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0


c> Config STA to link with AP which is AUTO/WEP128(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 key s:AP's wep key

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0


d> Config STA to link with AP which is OPEN/NONE(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 enc off

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0


e> Config STA to link with AP which is OPEN/WEP64(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 key s:AP's wep key

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0

f> Config STA to link with AP which is OPEN/WEP128(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 key s:AP's wep key

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0


g> Config STA to link with AP which is SHARED/WEP64(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 key s:AP's wep key

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0


h> Config STA to link with AP which is SHARED/WEP128(Authentication/Encryption)

# iwconfig wlan0 essid "AP's SSID"

# iwconfig wlan0 key s:AP's wep key

# iwconfig wlan0 essid "AP's SSID"

# udhcpc -i wlan0


i> Config STA to link with AP which is WPAPSK/AES(Authentication/Encryption)

# wpa_passphrase "AP's SSID" "AP's wpa-preshared key" > /etc/wpa_supplicant/wpa_supplicant.conf


# vi /etc/wpa_supplicant/wpa_supplicant.conf

network={

ssid="AP's SSID"

proto=WPA

key_mgmt=WPA-PSK

pairwise=CCMP

group=CCMP

psk="생성된 psk"

}

# iwconfig wlan0 essid "AP's SSID"

# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf &

# udhcpc -i wlan0


j> Config STA to link with AP which is WPAPSK/TKIP(Authentication/Encryption)

# wpa_passphrase "AP's SSID" "AP's wpa-preshared key" > /etc/wpa_supplicant/wpa_supplicant.conf


# vi /etc/wpa_supplicant/wpa_supplicant.conf

network={

ssid="AP's SSID"

proto=WPA

key_mgmt=WPA-PSK

pairwise=TKIP

group=TKIP

psk="생성된 psk"

}


# iwconfig wlan0 essid "AP's SSID"

# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf &

# udhcpc -i wlan0


k> Config STA to link with AP which is WPA2PSK/AES(Authentication/Encryption)

# wpa_passphrase "AP's SSID" "AP's wpa-preshared key" > /etc/wpa_supplicant/wpa_supplicant.conf

# vi /etc/wpa_supplicant/wpa_supplicant.conf

network={

ssid="AP's SSID"

proto=WPA2

key_mgmt=WPA-PSK

pairwise=CCMP

group=CCMP

psk="생성된 psk"

}

# iwconfig wlan0 essid "AP's SSID"

# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf &

# udhcpc -i wlan0


l> Config STA to link with AP which is WPA2PSK/TKIP(Authentication/Encryption)

# wpa_passphrase "AP's SSID" "AP's wpa-preshared key" > /etc/wpa_supplicant/wpa_supplicant.conf

# vi /etc/wpa_supplicant/wpa_supplicant.conf

network={

ssid="AP's SSID"

proto=WPA2

key_mgmt=WPA-PSK

pairwise=TKIP

group=TKIP

psk="생성된 psk"

}

# iwconfig wlan0 essid "AP's SSID"

# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf &

# udhcpc -i wlan0


Posted by eoseontaek

[Error] 

Fedora 10에서 wpa_supplicant 빌드시, 아래와 같은 Error가 발생하였다. 


make[2]: Entering directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22'

Making all in include

make[3]: Entering directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22/include'

make[4]: Entering directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22'

make[4]: Leaving directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22'

make[3]: Nothing to be done for `all'.

make[3]: Leaving directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22/include'

Making all in lib

make[3]: Entering directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22/lib'

make[4]: Entering directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22'

make[4]: Leaving directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22'

  GEN    route/cls/ematch_syntax.c

route/cls/ematch_syntax.y:31.9-16: syntax error, unexpected identifier, expecting string

make[3]: *** [route/cls/ematch_syntax.c] Error 1

make[3]: Leaving directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22/lib'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant/libnl-3.2.22'

make[1]: *** [libnl] Error 2

make[1]: Leaving directory `/home/steo/FH7200B/src.rev2342/hmc/tools/wpa_supplicant'

make: *** [wpa_supplicant] Error 2



[Solved]

bison tool version 호환성 때문에 발생하는 error이다. 

 

아래와 같이 bison source code build & install해 준다. 

 

Download source

# wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz

 

Extract tar

# tar xvzf bison-2.5.1.tar.gz

 

Build & Install

# cd bison-2.5.1

# ./configure

# make

# make install


'[C-08] BCM7231' 카테고리의 다른 글

[BCM7231] parse iwlist  (0) 2013.11.07
[BCM7231] WIFI usage (with wireless_toos and wpa-supplicant)  (0) 2013.11.05
Posted by eoseontaek
이전버튼 1 이전버튼