1 wpa_supplicant_setup_vif
() {
6 # wpa_supplicant should use wext for mac80211 cards
7 [ "$driver" = "mac80211" ] && driver
='wext'
9 # make sure we have the psk
11 config_get key
"$vif" key
17 config_get key
"$vif" key
21 for idx
in 1 2 3 4; do
24 config_get ckey
"$vif" "key${idx}"
26 append
"wep_key${zidx}" "wep_key${zidx}=$(prepare_key_wep "$ckey")"
28 wep_tx_keyidx
="wep_tx_keyidx=$((key - 1))"
31 wep_key0
="wep_key0=$(prepare_key_wep "$key")"
32 wep_tx_keyidx
="wep_tx_keyidx=0"
38 config_get_bool usepassphrase
"$vif" passphrase
1
42 if [ "$usepassphrase" = "1" ]; then
43 passphrase
="psk=\"${key}\""
45 passphrase
="psk=${key}"
50 if [ "$usepassphrase" = "1" ]; then
51 passphrase
="psk=\"${key}\""
53 passphrase
="psk=${key}"
61 config_get ca_cert
"$vif" ca_cert
62 ca_cert
=${ca_cert:+"ca_cert=\"$ca_cert\""}
65 pairwise
='pairwise=CCMP'
67 config_get priv_key
"$vif" priv_key
68 config_get priv_key_pwd
"$vif" priv_key_pwd
69 priv_key
="private_key=\"$priv_key\""
70 priv_key_pwd
="private_key_passwd=\"$priv_key_pwd\""
73 config_get auth
"$vif" auth
74 config_get identity
"$vif" identity
75 config_get password
"$vif" password
76 phase2
="phase2=\"auth=${auth:-MSCHAPV2}\""
77 identity
="identity=\"$identity\""
78 password
="password=\"$password\""
81 eap_type
="eap=$(echo $eap_type | tr 'a-z' 'A-Z')"
84 config_get ifname
"$vif" ifname
85 config_get bridge
"$vif" bridge
86 config_get ssid
"$vif" ssid
87 config_get bssid
"$vif" bssid
88 bssid
=${bssid:+"bssid=$bssid"}
89 rm -rf /var
/run
/wpa_supplicant-
$ifname
90 cat > /var
/run
/wpa_supplicant-
$ifname.conf
<<EOF
91 ctrl_interface=/var/run/wpa_supplicant-$ifname
115 [ -z "$proto" -a "$key_mgmt" != "NONE" ] || \
116 wpa_supplicant
${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var
/run
/wpa_supplicant-
$ifname.conf