+ *wpa*)
+ # required fields? formats?
+ # hostapd is particular, maybe a default configuration for failures
+ config_get server "$vif" server
+ append "$var" "auth_server_addr=$server" "$N"
+ config_get port "$vif" port
+ port=${port:-1812}
+ append "$var" "auth_server_port=$port" "$N"
+ config_get secret "$vif" key
+ append "$var" "auth_server_shared_secret=$secret" "$N"
+ config_get nasid "$vif" nasid
+ append "$var" "nas_identifier=$nasid" "$N"
+ append "$var" "eapol_key_index_workaround=1" "$N"
+ append "$var" "radius_acct_interim_interval=300" "$N"
+ append "$var" "ieee8021x=1" "$N"
+ append "$var" "auth_algs=1" "$N"
+ append "$var" "wpa_key_mgmt=WPA-EAP" "$N"
+ append "$var" "wpa_group_rekey=300" "$N"
+ append "$var" "wpa_gmk_rekey=640" "$N"
+ ;;
+ *wep*)
+ config_get key "$vif" key
+ key="${key:-1}"
+ case "$key" in
+ [1234])
+ for idx in 1 2 3 4; do
+ local zidx
+ zidx=$(($idx - 1))
+ config_get ckey "$vif" "key${idx}"
+ [ -n "$ckey" ] && \
+ append "$var" "wep_key${zidx}=$(prepare_key_wep "$ckey")" "$N"
+ done
+ append "$var" "wep_default_key=$((key - 1))" "$N"
+ ;;
+ *)
+ append "$var" "wep_key0=$(prepare_key_wep "$key")" "$N"
+ append "$var" "wep_default_key=0" "$N"
+ ;;
+ esac
+ wpa=0
+ crypto=