Changeset 20b4760 in freewrt for package/broadcom-wl-util


Ignore:
Timestamp:
Nov 1, 2006, 2:23:04 AM (19 years ago)
Author:
Dirk Nehring <dnehring@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
325a270
Parents:
679f318
Message:

Add client WEP support

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@1035 afb5a338-a214-0410-bd46-81f09a774fd1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package/broadcom-wl-util/files/wireless-broadcom.pre-up

    r679f318 r20b4760  
    5959        wl ap 0
    6060        ;;
    61     Monitor)
     61    monitor)
    6262        wl ap 0
    6363        wl monitor 1
     
    9898#
    9999[ "$IF_WIRELESS_AFTERBURNER" ] && wl afterburner_override $IF_WIRELESS_AFTERBURNER
    100 
    101 #
    102 # security "open"
    103 #
    104 [ "$IF_WIRELESS_SECURITY" = "open" ] && {
    105     wl wep 0
    106     wl ssid $IF_WIRELESS_SSID
    107     exit 0
    108 }
    109 
    110 #
    111 # security "wep"
    112 #
    113 [ "$IF_WIRELESS_SECURITY" = "wep" ] && {
    114     wl wep 1
    115     wl eap off
    116     wl wpa_auth 0
    117     wl wsec 1
    118     case "$IF_WIRELESS_AUTHORIZATION" in
    119         "open")
    120             echo "wep authorization not supported for now"
    121             exit 1
    122             ;;
    123         "shared")
    124             echo "wep authorization not supported for now"
    125             exit 1
    126             ;;
    127         "open+shared")
    128             echo "wep authorization not supported for now"
    129             exit 1
    130             ;;
    131     esac
    132     [ "$IF_WIRELESS_KEY1" ] && wl addwep 0 $IF_WIRELESS_KEY1
    133     [ "$IF_WIRELESS_KEY2" ] && wl addwep 1 $IF_WIRELESS_KEY2
    134     [ "$IF_WIRELESS_KEY3" ] && wl addwep 2 $IF_WIRELESS_KEY3
    135     [ "$IF_WIRELESS_KEY4" ] && wl addwep 3 $IF_WIRELESS_KEY4
    136     [ "$IF_WIRELESS_KEY" ] && wl primary_key $(($IF_WIRELESS_KEY-1))
    137 
    138     wl ssid $IF_WIRELESS_SSID
    139     exit 0
    140 }
    141100
    142101#
     
    171130wl wsec $crypto_num
    172131
     132#
     133# security "open"
     134#
     135[ "$IF_WIRELESS_SECURITY" = "open" ] && {
     136    wl wep 0
     137    wl ssid $IF_WIRELESS_SSID
     138    exit 0
     139}
     140
     141#
     142# security "wep"
     143#
     144[ "$IF_WIRELESS_SECURITY" = "wep" ] && {
     145    wl wep 1
     146    wl eap off
     147    wl wpa_auth 0
     148    wl wsec 1
     149
     150    [ "$IF_WIRELESS_MODE" = "ap" ] && {
     151        case "$IF_WIRELESS_AUTHORIZATION" in
     152            open)
     153                echo "This option is not supported for now"
     154                exit 1
     155                ;;
     156            shared)
     157                echo "This option is not supported for now"
     158                exit 1
     159                ;;
     160            open+shared)
     161                echo "This option is not supported for now"
     162                exit 1
     163                ;;
     164        esac
     165        [ "$IF_WIRELESS_KEY1" ] && wl addwep 0 $IF_WIRELESS_KEY1
     166        [ "$IF_WIRELESS_KEY2" ] && wl addwep 1 $IF_WIRELESS_KEY2
     167        [ "$IF_WIRELESS_KEY3" ] && wl addwep 2 $IF_WIRELESS_KEY3
     168        [ "$IF_WIRELESS_KEY4" ] && wl addwep 3 $IF_WIRELESS_KEY4
     169        [ "$IF_WIRELESS_KEY" ] && wl primary_key $(($IF_WIRELESS_KEY-1))
     170
     171        wl ssid $IF_WIRELESS_SSID
     172    }
     173
     174    [ "$IF_WIRELESS_MODE" = "sta" ] && {
     175        case "$IF_WIRELESS_AUTHORIZATION" in
     176            open)
     177                authorization="open"
     178                ;;
     179            shared)
     180                authorization="shared"
     181                ;;
     182            *)
     183                authorization="open"
     184                ;;
     185        esac
     186
     187        wl join $IF_WIRELESS_SSID key $IF_WIRELESS_KEY1 amode $authorization
     188    }
     189    exit 0
     190}
     191
    173192# wpa rekeying
    174193gtk_rekey=$IF_WIRELESS_WPA_GTK_REKEY
     
    182201    wl eap off
    183202    case "$IF_WIRELESS_AUTHORIZATION" in
    184         "psk")
     203        psk)
    185204            auth=4
    186205            ;;
    187         "psk2")
     206        psk2)
    188207            auth=128
    189208            ;;
     
    202221        ) &
    203222    }
    204 
    205     /usr/sbin/nas -P /var/run/nas.lan.pid ${ifname:+ -l $ifname} -H 34954 -i $IFACE $nas_auth -m $auth -k "$IF_WIRELESS_WPA_KEY" -s "$IF_WIRELESS_SSID" -w $crypto_num -g $gtk_rekey &
    206     exit 0
    207 }
    208 
    209 exit 0
     223    [ "$IF_WIRELESS_MODE" = "ap" ] && {
     224        /usr/sbin/nas -P /var/run/nas.lan.pid ${ifname:+ -l $ifname} -H 34954 -i $IFACE $nas_auth -m $auth -k "$IF_WIRELESS_WPA_KEY" -s "$IF_WIRELESS_SSID" -w $crypto_num -g $gtk_rekey &
     225    }
     226
     227    [ "$IF_WIRELESS_MODE" = "sta" ] && {
     228        # XXX Does not work for now! XXX
     229        wl join $IF_WIRELESS_SSID $IF_WIRELESS_WPA_KEY wpapsk
     230    }
     231    exit 0
     232}
    210233
    211234#
     
    214237[ "$IF_WIRELESS_SECURITY" = "8021x" ] && {
    215238    case "$IF_WIRELESS_AUTHORIZATION" in
    216         "wep")
     239        wep)
    217240            wl wpa_auth 0
    218241            /usr/sbin/nas -P /var/run/nas.lan.pid ${ifname:+ -l ${ifname}} -H 34954 -i $IFACE &
    219242            exit 0
    220243            ;;
    221         "wpa")
     244        wpa)
    222245            auth=2
    223246            ;;
    224         "wpa2")
     247        wpa2)
    225248            auth=64
    226249            ;;
Note: See TracChangeset for help on using the changeset viewer.