}
data.phy_suffix = phy_suffix(data.config.radio, ":");
data.vif_phy_suffix = phy_suffix(data.config.radio, ".");
+ data.ifname_prefix = data.config.ifname_prefix;
+ if (!data.ifname_prefix)
+ data.ifname_prefix = data.phy + data.vif_phy_suffix + "-";
let active_ifnames = [];
log('Starting');
let mode_idx = idx[mode]++;
if (!v.config.ifname)
- v.config.ifname = data.phy + data.vif_phy_suffix + "-" + mode + mode_idx;
+ v.config.ifname = data.ifname_prefix + mode + mode_idx;
push(active_ifnames, v.config.ifname);
if (v.config.encryption == 'owe' && v.config.owe_transition) {
mode_idx = idx[mode]++;
- v.config.owe_transition_ifname = data.phy + data.vif_phy_suffix + "-" + mode + mode_idx;
+ v.config.owe_transition_ifname = data.ifname_prefix + mode + mode_idx;
push(active_ifnames, v.config.ifname);
}
config_add_string path phy 'macaddr:macaddr'
config_add_string tx_burst
config_add_string distance
+ config_add_string ifname_prefix
config_add_int radio beacon_int chanbw frag rts
config_add_int rxantenna txantenna txpower min_tx_power
config_add_int num_global_macaddr multiple_bssid
}
mac80211_set_ifname() {
- local phy="$1"
- local prefix="$2"
- eval "ifname=\"$phy-$prefix\${idx_$prefix:-0}\"; idx_$prefix=\$((\${idx_$prefix:-0 } + 1))"
+ local prefix="$1"
+ local type="$2"
+ eval "ifname=\"$prefix$type\${idx_$type:-0}\"; idx_$type=\$((\${idx_$type:-0 } + 1))"
}
mac80211_prepare_vif() {
monitor) prefix=mon;;
esac
- mac80211_set_ifname "$phy$vif_phy_suffix" "$prefix"
+ mac80211_set_ifname "$ifname_prefix" "$prefix"
}
append active_ifnames "$ifname"
txpower \
rxantenna txantenna \
frag rts beacon_int:100 htmode \
- num_global_macaddr:1 multiple_bssid
+ num_global_macaddr:1 multiple_bssid \
+ ifname_prefix
json_get_values basic_rate_list basic_rate
json_get_values scan_list scan_list
json_select ..
return 1
}
+ set_default ifname_prefix "$phy$vif_phy_suffix-"
+
local wdev
local cwdev
local found