modules/admin-{mini,full}: implement wpa-wpa2 mixed mode

modules/admin-core: extend uci schema to cover mixed mode and mesh mode (802.11s)
This commit is contained in:
Jo-Philipp Wich 2009-03-04 22:43:45 +00:00
parent f1b667fc6f
commit 0feb0a4607
3 changed files with 19 additions and 4 deletions

View file

@ -220,6 +220,11 @@ config enum
option value 'wds' option value 'wds'
option title 'WDS' option title 'WDS'
config enum
option variable 'wireless.wifi-iface.mode'
option value 'mesh'
option title 'Mesh (802.11s)'
config variable config variable
option name 'bssid' option name 'bssid'
option section 'wireless.wifi-iface' option section 'wireless.wifi-iface'
@ -453,6 +458,8 @@ config variable
list depends 'encryption=wpa,mode=ap' list depends 'encryption=wpa,mode=ap'
list depends 'encryption=psk2' list depends 'encryption=psk2'
list depends 'encryption=wpa2i,mode=ap' list depends 'encryption=wpa2i,mode=ap'
list depends 'encryption=psk+psk2'
list depends 'encryption=mixed'
config variable config variable
option name 'nasid' option name 'nasid'

View file

@ -291,17 +291,20 @@ if hwtype == "atheros" or hwtype == "mac80211" then
if hostapd and supplicant then if hostapd and supplicant then
encr:value("psk", "WPA-PSK") encr:value("psk", "WPA-PSK")
encr:value("psk2", "WPA2-PSK") encr:value("psk2", "WPA2-PSK")
encr:value("mixed", "WPA-PSK/WPA2-PSK Mixed Mode")
encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="sta"}) encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="sta"})
encr:value("wpa2i", "WPA2-EAP", {mode="ap"}, {mode="sta"}) encr:value("wpa2i", "WPA2-EAP", {mode="ap"}, {mode="sta"})
elseif hostapd and not supplicant then elseif hostapd and not supplicant then
encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="adhoc"}, {mode="ahdemo"}) encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="adhoc"}, {mode="ahdemo"})
encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="adhoc"}, {mode="ahdemo"}) encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="adhoc"}, {mode="ahdemo"})
encr:value("mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="adhoc"}, {mode="ahdemo"})
encr:value("wpa", "WPA-EAP", {mode="ap"}) encr:value("wpa", "WPA-EAP", {mode="ap"})
encr:value("wpa2i", "WPA2-EAP", {mode="ap"}) encr:value("wpa2i", "WPA2-EAP", {mode="ap"})
encr.description = translate("wifi_wpareq") encr.description = translate("wifi_wpareq")
elseif not hostapd and supplicant then elseif not hostapd and supplicant then
encr:value("psk", "WPA-PSK", {mode="sta"}) encr:value("psk", "WPA-PSK", {mode="sta"})
encr:value("psk2", "WPA2-PSK", {mode="sta"}) encr:value("psk2", "WPA2-PSK", {mode="sta"})
encr:value("mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"})
encr:value("wpa", "WPA-EAP", {mode="sta"}) encr:value("wpa", "WPA-EAP", {mode="sta"})
encr:value("wpa2i", "WPA2-EAP", {mode="sta"}) encr:value("wpa2i", "WPA2-EAP", {mode="sta"})
encr.description = translate("wifi_wpareq") encr.description = translate("wifi_wpareq")
@ -311,6 +314,7 @@ if hwtype == "atheros" or hwtype == "mac80211" then
elseif hwtype == "broadcom" then elseif hwtype == "broadcom" then
encr:value("psk", "WPA-PSK") encr:value("psk", "WPA-PSK")
encr:value("psk2", "WPA2-PSK") encr:value("psk2", "WPA2-PSK")
encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
end end
encr:depends("mode", "ap") encr:depends("mode", "ap")

View file

@ -60,7 +60,7 @@ essid = s:option(DummyValue, "ssid", "ESSID")
bssid = s:option(DummyValue, "_bsiid", "BSSID") bssid = s:option(DummyValue, "_bsiid", "BSSID")
function bssid.cfgvalue(self, section) function bssid.cfgvalue(self, section)
local ifname = self.map:get(section, "ifname") local ifname = self.map:get(section, "ifname")
return (wifidata[ifname] and (wifidata[ifname].Cell return (wifidata[ifname] and (wifidata[ifname].Cell
or wifidata[ifname]["Access Point"])) or "-" or wifidata[ifname]["Access Point"])) or "-"
end end
@ -118,7 +118,7 @@ function chan.cfgvalue(self, section)
return self.map:get(section, "Channel") return self.map:get(section, "Channel")
or self.map:get(section, "Frequency") or self.map:get(section, "Frequency")
or "-" or "-"
end end
t2:option(DummyValue, "Encryption key", translate("iwscan_encr")) t2:option(DummyValue, "Encryption key", translate("iwscan_encr"))
@ -180,7 +180,7 @@ luci.model.uci.cursor():foreach("wireless", "wifi-device",
function (section) function (section)
table.insert(devs, section[".name"]) table.insert(devs, section[".name"])
end) end)
if #devs > 1 then if #devs > 1 then
device = s:option(DummyValue, "device", translate("device")) device = s:option(DummyValue, "device", translate("device"))
else else
@ -224,17 +224,20 @@ if hwtype == "atheros" or hwtype == "mac80211" then
if hostapd and supplicant then if hostapd and supplicant then
encr:value("psk", "WPA-PSK") encr:value("psk", "WPA-PSK")
encr:value("psk2", "WPA2-PSK") encr:value("psk2", "WPA2-PSK")
encr:value("mixed", "WPA-PSK/WPA2-PSK Mixed Mode")
encr:value("wpa", "WPA-Radius", {mode="ap"}) encr:value("wpa", "WPA-Radius", {mode="ap"})
encr:value("wpa2i", "WPA2-Radius", {mode="ap"}) encr:value("wpa2i", "WPA2-Radius", {mode="ap"})
elseif hostapd and not supplicant then elseif hostapd and not supplicant then
encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="adhoc"}) encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="adhoc"})
encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="adhoc"}) encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="adhoc"})
encr:value("mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="adhoc"})
encr:value("wpa", "WPA-Radius", {mode="ap"}) encr:value("wpa", "WPA-Radius", {mode="ap"})
encr:value("wpa2i", "WPA2-Radius", {mode="ap"}) encr:value("wpa2i", "WPA2-Radius", {mode="ap"})
encr.description = translate("wifi_wpareq") encr.description = translate("wifi_wpareq")
elseif not hostapd and supplicant then elseif not hostapd and supplicant then
encr:value("psk", "WPA-PSK", {mode="sta"}) encr:value("psk", "WPA-PSK", {mode="sta"})
encr:value("psk2", "WPA2-PSK", {mode="sta"}) encr:value("psk2", "WPA2-PSK", {mode="sta"})
encr:value("mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"})
encr.description = translate("wifi_wpareq") encr.description = translate("wifi_wpareq")
else else
encr.description = translate("wifi_wpareq") encr.description = translate("wifi_wpareq")
@ -242,6 +245,7 @@ if hwtype == "atheros" or hwtype == "mac80211" then
elseif hwtype == "broadcom" then elseif hwtype == "broadcom" then
encr:value("psk", "WPA-PSK") encr:value("psk", "WPA-PSK")
encr:value("psk2", "WPA2-PSK") encr:value("psk2", "WPA2-PSK")
encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
end end
key = s:option(Value, "key", translate("key")) key = s:option(Value, "key", translate("key"))
@ -267,7 +271,7 @@ if hwtype == "atheros" or hwtype == "broadcom" then
iso = s:option(Flag, "isolate", translate("a_w_apisolation"), translate("a_w_apisolation1")) iso = s:option(Flag, "isolate", translate("a_w_apisolation"), translate("a_w_apisolation1"))
iso.rmempty = true iso.rmempty = true
iso:depends("mode", "ap") iso:depends("mode", "ap")
hide = s:option(Flag, "hidden", translate("a_w_hideessid")) hide = s:option(Flag, "hidden", translate("a_w_hideessid"))
hide.rmempty = true hide.rmempty = true
hide:depends("mode", "ap") hide:depends("mode", "ap")