2013-07-26 10:02:59 +00:00
|
|
|
authsae_start_interface() {
|
2014-04-12 21:22:17 +00:00
|
|
|
local mcast_rate
|
|
|
|
local mesh_htmode
|
|
|
|
local mesh_band
|
|
|
|
local authsae_conf_file="/var/run/authsae-$ifname.cfg"
|
|
|
|
local ret=1
|
2013-07-26 10:02:59 +00:00
|
|
|
|
2015-11-24 18:28:19 +00:00
|
|
|
json_get_vars mcast_rate mesh_id
|
2014-04-12 21:22:17 +00:00
|
|
|
set_default mcast_rate "12"
|
2013-07-26 10:02:59 +00:00
|
|
|
|
|
|
|
case "$htmode" in
|
2014-04-12 21:22:17 +00:00
|
|
|
HT20|HT40+|HT40-) mesh_htmode="$htmode";;
|
|
|
|
*) mesh_htmode="none";;
|
2013-07-26 10:02:59 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
case "$hwmode" in
|
2014-04-12 21:22:17 +00:00
|
|
|
*g*) mesh_band=11g;;
|
|
|
|
*a*) mesh_band=11a;;
|
2013-07-26 10:02:59 +00:00
|
|
|
esac
|
|
|
|
|
2014-04-12 21:22:17 +00:00
|
|
|
cat > "$authsae_conf_file" <<EOF
|
2013-07-26 10:02:59 +00:00
|
|
|
authsae:
|
|
|
|
{
|
|
|
|
sae:
|
|
|
|
{
|
|
|
|
debug = 0;
|
|
|
|
password = "$key";
|
|
|
|
group = [19, 26, 21, 25, 20];
|
|
|
|
blacklist = 5;
|
|
|
|
thresh = 5;
|
|
|
|
lifetime = 3600;
|
|
|
|
};
|
|
|
|
meshd:
|
|
|
|
{
|
|
|
|
meshid = "$mesh_id";
|
|
|
|
interface = "$ifname";
|
|
|
|
passive = 0;
|
|
|
|
debug = 0;
|
|
|
|
mediaopt = 1;
|
2014-04-12 21:22:17 +00:00
|
|
|
band = "$mesh_band";
|
2013-07-26 10:02:59 +00:00
|
|
|
channel = $channel;
|
2014-04-12 21:22:17 +00:00
|
|
|
htmode = "$mesh_htmode";
|
2013-07-26 10:02:59 +00:00
|
|
|
mcast-rate = $mcast_rate;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
EOF
|
2014-04-12 21:22:17 +00:00
|
|
|
|
|
|
|
/usr/bin/meshd-nl80211 -i "$ifname" -s "$mesh_id" -c "$authsae_conf_file" </dev/null >/dev/null 2>/dev/null &
|
|
|
|
authsae_pid="$!"
|
|
|
|
ret="$?"
|
|
|
|
|
|
|
|
echo $authsae_pid > /var/run/authsae-$ifname.pid
|
|
|
|
wireless_add_process "$authsae_pid" "/usr/bin/meshd-nl80211" 1
|
|
|
|
|
|
|
|
[ "$ret" != 0 ] && wireless_setup_vif_failed AUTHSAE_FAILED
|
|
|
|
return $ret
|
2013-07-26 10:02:59 +00:00
|
|
|
}
|