2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
15 local wa = require "luci.tools.webadmin"
16 local nw = require "luci.model.network"
17 local ww = require "luci.model.wireless"
18 local fs = require "nixio.fs"
23 m = Map("wireless", "",
24 translate("The <em>Device Configuration</em> section covers physical settings of the radio " ..
25 "hardware such as channel, transmit power or antenna selection which is shared among all " ..
26 "defined wireless networks (if the radio hardware is multi-SSID capable). Per network settings " ..
27 "like encryption or operation mode are grouped in the <em>Interface Configuration</em>."))
32 { luci.dispatcher.build_url("admin/network/wireless"), translate("Wireless Networks") }
37 function m.on_commit(map)
41 local wnet = ww:get_network(arg[2])
42 if ifsection and wnet then
43 ifsection.section = wnet.sid
50 local wnet = ww:get_network(arg[2])
52 -- redirect to overview page if network does not exist anymore (e.g. after a revert)
54 luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
58 m.title = ww:get_i18n(wnet)
64 m.uci:foreach("wireless", "wifi-iface",
66 if s.device == arg[1] and not iw then
67 iw = luci.sys.wifi.getiwinfo(s.ifname or s.device)
68 tx_powers = iw.txpwrlist or { }
72 s = m:section(NamedSection, arg[1], "wifi-device", translate("Device Configuration"))
75 s:tab("general", translate("General Setup"))
76 s:tab("macfilter", translate("MAC-Filter"))
77 s:tab("advanced", translate("Advanced Settings"))
80 back = s:option(DummyValue, "_overview", translate("Overview"))
82 back.titleref = luci.dispatcher.build_url("admin", "network", "wireless")
85 en = s:taboption("general", Flag, "disabled", translate("enable"))
90 function en.cfgvalue(self, section)
91 return Flag.cfgvalue(self, section) or "0"
94 s:taboption("general", DummyValue, "type", translate("Type"))
96 local hwtype = m:get(arg[1], "type")
97 local htcaps = m:get(arg[1], "ht_capab") and true or false
100 local nsantenna = m:get(arg[1], "antenna")
102 ch = s:taboption("general", Value, "channel", translate("Channel"))
103 ch:value("auto", translate("auto"))
104 for _, f in ipairs(iw and iw.freqlist or luci.sys.wifi.channels()) do
105 ch:value(f.channel, "%i (%.3f GHz)" %{ f.channel, f.mhz / 1000 })
109 ------------------- MAC80211 Device ------------------
111 if hwtype == "mac80211" then
112 tp = s:taboption("general",
113 (tx_powers and #tx_powers > 0) and ListValue or Value,
114 "txpower", translate("Transmit Power"), "dBm")
117 tp.default = tostring(iw and iw.txpower or tx_powers[#tx_powers])
118 for _, p in ipairs(tx_powers or {}) do
119 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
122 mode = s:taboption("advanced", ListValue, "hwmode", translate("Mode"))
123 mode:value("", translate("auto"))
124 mode:value("11b", "802.11b")
125 mode:value("11g", "802.11g")
126 mode:value("11a", "802.11a")
129 mode:value("11ng", "802.11g+n")
130 mode:value("11na", "802.11a+n")
132 htmode = s:taboption("advanced", ListValue, "htmode", translate("HT mode"))
133 htmode:depends("hwmode", "11na")
134 htmode:depends("hwmode", "11ng")
135 htmode:value("HT20", "20MHz")
136 htmode:value("HT40-", translate("40MHz 2nd channel below"))
137 htmode:value("HT40+", translate("40MHz 2nd channel above"))
139 --htcapab = s:taboption("advanced", DynamicList, "ht_capab", translate("HT capabilities"))
140 --htcapab:depends("hwmode", "11na")
141 --htcapab:depends("hwmode", "11ng")
144 local cl = iw and iw.countrylist
145 if cl and #cl > 0 then
146 cc = s:taboption("advanced", ListValue, "country", translate("Country Code"), translate("Use ISO/IEC 3166 alpha2 country codes."))
147 cc.default = tostring(iw and iw.country or "00")
148 for _, c in ipairs(cl) do
149 cc:value(c.alpha2, "%s - %s" %{ c.alpha2, c.name })
152 s:taboption("advanced", Value, "country", translate("Country Code"), translate("Use ISO/IEC 3166 alpha2 country codes."))
155 s:taboption("advanced", Value, "distance", translate("Distance Optimization"),
156 translate("Distance to farthest network member in meters."))
160 ------------------- Madwifi Device ------------------
162 if hwtype == "atheros" then
163 tp = s:taboption("general",
164 (#tx_powers > 0) and ListValue or Value,
165 "txpower", translate("Transmit Power"), "dBm")
168 for _, p in ipairs(iw.txpwrlist) do
169 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
172 mode = s:taboption("advanced", ListValue, "hwmode", translate("Mode"))
173 mode:value("", translate("auto"))
174 mode:value("11b", "802.11b")
175 mode:value("11g", "802.11g")
176 mode:value("11a", "802.11a")
177 mode:value("11bg", "802.11b+g")
178 mode:value("11gst", "802.11g + Turbo")
179 mode:value("11ast", "802.11a + Turbo")
180 mode:value("fh", translate("Frequency Hopping"))
182 s:taboption("advanced", Flag, "diversity", translate("Diversity")).rmempty = false
184 if not nsantenna then
185 ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
186 ant1.widget = "radio"
187 ant1.orientation = "horizontal"
188 ant1:depends("diversity", "")
189 ant1:value("0", translate("auto"))
190 ant1:value("1", translate("Antenna 1"))
191 ant1:value("2", translate("Antenna 2"))
193 ant2 = s:taboption("advanced", ListValue, "rxantenna", translate("Receiver Antenna"))
194 ant2.widget = "radio"
195 ant2.orientation = "horizontal"
196 ant2:depends("diversity", "")
197 ant2:value("0", translate("auto"))
198 ant2:value("1", translate("Antenna 1"))
199 ant2:value("2", translate("Antenna 2"))
202 local ant = s:taboption("advanced", ListValue, "antenna", translate("Transmitter Antenna"))
204 ant:value("vertical")
205 ant:value("horizontal")
206 ant:value("external")
209 s:taboption("advanced", Value, "distance", translate("Distance Optimization"),
210 translate("Distance to farthest network member in meters."))
211 s:taboption("advanced", Value, "regdomain", translate("Regulatory Domain"))
212 s:taboption("advanced", Value, "country", translate("Country Code"))
213 s:taboption("advanced", Flag, "outdoor", translate("Outdoor Channels"))
215 --s:option(Flag, "nosbeacon", translate("Disable HW-Beacon timer"))
220 ------------------- Broadcom Device ------------------
222 if hwtype == "broadcom" then
223 tp = s:taboption("general",
224 (#tx_powers > 0) and ListValue or Value,
225 "txpower", translate("Transmit Power"), "dBm")
228 for _, p in ipairs(iw.txpwrlist) do
229 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
232 mode = s:taboption("advanced", ListValue, "hwmode", translate("Mode"))
233 mode:value("11bg", "802.11b+g")
234 mode:value("11b", "802.11b")
235 mode:value("11g", "802.11g")
236 mode:value("11gst", "802.11g + Turbo")
238 mp = s:taboption("macfilter", ListValue, "macfilter", translate("MAC-Address Filter"))
239 mp:value("", translate("disable"))
240 mp:value("allow", translate("Allow listed only"))
241 mp:value("deny", translate("Allow all except listed"))
242 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
243 ml:depends({macfilter="allow"})
244 ml:depends({macfilter="deny"})
246 ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
247 ant1.widget = "radio"
248 ant1:depends("diversity", "")
249 ant1:value("3", translate("auto"))
250 ant1:value("0", translate("Antenna 1"))
251 ant1:value("1", translate("Antenna 2"))
253 ant2 = s:taboption("advanced", ListValue, "rxantenna", translate("Receiver Antenna"))
254 ant2.widget = "radio"
255 ant2:depends("diversity", "")
256 ant2:value("3", translate("auto"))
257 ant2:value("0", translate("Antenna 1"))
258 ant2:value("1", translate("Antenna 2"))
260 s:taboption("advanced", Flag, "frameburst", translate("Frame Bursting"))
262 s:taboption("advanced", Value, "distance", translate("Distance Optimization"))
263 --s:option(Value, "slottime", translate("Slot time"))
265 s:taboption("advanced", Value, "country", translate("Country Code"))
266 s:taboption("advanced", Value, "maxassoc", translate("Connection Limit"))
270 --------------------- HostAP Device ---------------------
272 if hwtype == "prism2" then
273 s:taboption("advanced", Value, "txpower", translate("Transmit Power"), "att units").rmempty = true
275 s:taboption("advanced", Flag, "diversity", translate("Diversity")).rmempty = false
277 s:taboption("advanced", Value, "txantenna", translate("Transmitter Antenna"))
278 s:taboption("advanced", Value, "rxantenna", translate("Receiver Antenna"))
282 ----------------------- Interface -----------------------
284 local wnet = ww:get_network(arg[2])
287 s = m:section(NamedSection, wnet.sid, "wifi-iface", translate("Interface Configuration"))
291 s.defaults.device = arg[1]
293 s:tab("general", translate("General Setup"))
294 s:tab("encryption", translate("Wireless Security"))
295 s:tab("macfilter", translate("MAC-Filter"))
296 s:tab("advanced", translate("Advanced Settings"))
298 s:taboption("general", Value, "ssid", translate("<abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
300 mode = s:taboption("general", ListValue, "mode", translate("Mode"))
301 mode.override_values = true
302 mode:value("ap", translate("Access Point"))
303 mode:value("sta", translate("Client"))
304 mode:value("adhoc", translate("Ad-Hoc"))
306 bssid = s:taboption("general", Value, "bssid", translate("<abbr title=\"Basic Service Set Identifier\">BSSID</abbr>"))
308 network = s:taboption("general", Value, "network", translate("Network"),
309 translate("Choose the network you want to attach to this wireless interface. " ..
310 "Select <em>unspecified</em> to not attach any network or fill out the " ..
311 "<em>create</em> field to define a new network."))
313 network.rmempty = true
314 network.template = "cbi/network_netlist"
315 network.widget = "radio"
317 function network.write(self, section, value)
318 local i = nw:get_interface(section)
321 value = m:formvalue(self:cbid(section) .. ".newnet")
322 if value and #value > 0 then
323 local n = nw:add_network(value, {type="bridge", proto="none"})
324 if n then n:add_interface(i) end
326 local n = i:get_network()
327 if n then n:del_interface(i) end
330 local n = nw:get_network(value)
339 -------------------- MAC80211 Interface ----------------------
341 if hwtype == "mac80211" then
342 if fs.access("/usr/sbin/iw") then
343 mode:value("mesh", "802.11s")
346 mode:value("ahdemo", translate("Pseudo Ad-Hoc (ahdemo)"))
347 mode:value("monitor", translate("Monitor"))
348 bssid:depends({mode="adhoc"})
350 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
351 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
353 mode:value("ap-wds", "%s (%s)" % {translate("Access Point"), translate("WDS")})
354 mode:value("sta-wds", "%s (%s)" % {translate("Client"), translate("WDS")})
356 function mode.write(self, section, value)
357 if value == "ap-wds" then
358 ListValue.write(self, section, "ap")
359 m.uci:set("wireless", section, "wds", 1)
360 elseif value == "sta-wds" then
361 ListValue.write(self, section, "sta")
362 m.uci:set("wireless", section, "wds", 1)
364 ListValue.write(self, section, value)
365 m.uci:delete("wireless", section, "wds")
369 function mode.cfgvalue(self, section)
370 local mode = ListValue.cfgvalue(self, section)
371 local wds = m.uci:get("wireless", section, "wds") == "1"
373 if mode == "ap" and wds then
375 elseif mode == "sta" and wds then
382 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
383 hidden:depends({mode="ap"})
384 hidden:depends({mode="ap-wds"})
389 -------------------- Madwifi Interface ----------------------
391 if hwtype == "atheros" then
392 mode:value("ahdemo", translate("Pseudo Ad-Hoc (ahdemo)"))
393 mode:value("monitor", translate("Monitor"))
394 mode:value("ap-wds", "%s (%s)" % {translate("Access Point"), translate("WDS")})
395 mode:value("sta-wds", "%s (%s)" % {translate("Client"), translate("WDS")})
396 mode:value("wds", translate("Static WDS"))
398 function mode.write(self, section, value)
399 if value == "ap-wds" then
400 ListValue.write(self, section, "ap")
401 m.uci:set("wireless", section, "wds", 1)
402 elseif value == "sta-wds" then
403 ListValue.write(self, section, "sta")
404 m.uci:set("wireless", section, "wds", 1)
406 ListValue.write(self, section, value)
407 m.uci:delete("wireless", section, "wds")
411 function mode.cfgvalue(self, section)
412 local mode = ListValue.cfgvalue(self, section)
413 local wds = m.uci:get("wireless", section, "wds") == "1"
415 if mode == "ap" and wds then
417 elseif mode == "sta" and wds then
424 bssid:depends({mode="adhoc"})
425 bssid:depends({mode="ahdemo"})
426 bssid:depends({mode="wds"})
428 wdssep = s:taboption("advanced", Flag, "wdssep", translate("Separate WDS"))
429 wdssep:depends({mode="ap-wds"})
431 s:taboption("advanced", Flag, "doth", "802.11h")
432 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
433 hidden:depends({mode="ap"})
434 hidden:depends({mode="adhoc"})
435 hidden:depends({mode="ap-wds"})
436 hidden:depends({mode="sta-wds"})
437 isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
438 translate("Prevents client-to-client communication"))
439 isolate:depends({mode="ap"})
440 s:taboption("advanced", Flag, "bgscan", translate("Background Scan"))
442 mp = s:taboption("macfilter", ListValue, "macpolicy", translate("MAC-Address Filter"))
443 mp:value("", translate("disable"))
444 mp:value("deny", translate("Allow listed only"))
445 mp:value("allow", translate("Allow all except listed"))
446 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
447 ml:depends({macpolicy="allow"})
448 ml:depends({macpolicy="deny"})
450 s:taboption("advanced", Value, "rate", translate("Transmission Rate"))
451 s:taboption("advanced", Value, "mcast_rate", translate("Multicast Rate"))
452 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
453 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
454 s:taboption("advanced", Value, "minrate", translate("Minimum Rate"))
455 s:taboption("advanced", Value, "maxrate", translate("Maximum Rate"))
456 s:taboption("advanced", Flag, "compression", translate("Compression"))
458 s:taboption("advanced", Flag, "bursting", translate("Frame Bursting"))
459 s:taboption("advanced", Flag, "turbo", translate("Turbo Mode"))
460 s:taboption("advanced", Flag, "ff", translate("Fast Frames"))
462 s:taboption("advanced", Flag, "wmm", translate("WMM Mode"))
463 s:taboption("advanced", Flag, "xr", translate("XR Support"))
464 s:taboption("advanced", Flag, "ar", translate("AR Support"))
466 local swm = s:taboption("advanced", Flag, "sw_merge", translate("Disable HW-Beacon timer"))
467 swm:depends({mode="adhoc"})
469 local nos = s:taboption("advanced", Flag, "nosbeacon", translate("Disable HW-Beacon timer"))
470 nos:depends({mode="sta"})
471 nos:depends({mode="sta-wds"})
473 local probereq = s:taboption("advanced", Flag, "probereq", translate("Do not send probe responses"))
474 probereq.enabled = "0"
475 probereq.disabled = "1"
479 -------------------- Broadcom Interface ----------------------
481 if hwtype == "broadcom" then
482 mode:value("wds", translate("WDS"))
483 mode:value("monitor", translate("Monitor"))
485 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
486 hidden:depends({mode="ap"})
487 hidden:depends({mode="adhoc"})
488 hidden:depends({mode="wds"})
490 isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
491 translate("Prevents client-to-client communication"))
492 isolate:depends({mode="ap"})
494 s:taboption("advanced", Flag, "doth", "802.11h")
495 s:taboption("advanced", Flag, "wmm", translate("WMM Mode"))
497 bssid:depends({mode="wds"})
498 bssid:depends({mode="adhoc"})
502 ----------------------- HostAP Interface ---------------------
504 if hwtype == "prism2" then
505 mode:value("wds", translate("WDS"))
506 mode:value("monitor", translate("Monitor"))
508 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
509 hidden:depends({mode="ap"})
510 hidden:depends({mode="adhoc"})
511 hidden:depends({mode="wds"})
513 bssid:depends({mode="sta"})
515 mp = s:taboption("macfilter", ListValue, "macpolicy", translate("MAC-Address Filter"))
516 mp:value("", translate("disable"))
517 mp:value("deny", translate("Allow listed only"))
518 mp:value("allow", translate("Allow all except listed"))
519 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
520 ml:depends({macpolicy="allow"})
521 ml:depends({macpolicy="deny"})
523 s:taboption("advanced", Value, "rate", translate("Transmission Rate"))
524 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
525 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
529 ------------------- WiFI-Encryption -------------------
531 encr = s:taboption("encryption", ListValue, "encryption", translate("Encryption"))
532 encr.override_values = true
533 encr.override_depends = true
534 encr:depends({mode="ap"})
535 encr:depends({mode="sta"})
536 encr:depends({mode="adhoc"})
537 encr:depends({mode="ahdemo"})
538 encr:depends({mode="ap-wds"})
539 encr:depends({mode="sta-wds"})
540 encr:depends({mode="mesh"})
542 encr:value("none", "No Encryption")
543 encr:value("wep", "WEP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
545 if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
546 local supplicant = fs.access("/usr/sbin/wpa_supplicant")
547 local hostapd = fs.access("/usr/sbin/hostapd")
549 if hostapd and supplicant then
550 encr:value("psk", "WPA-PSK")
551 encr:value("psk2", "WPA2-PSK")
552 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode")
553 encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
554 encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="sta"})
555 elseif hostapd and not supplicant then
556 encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
557 encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
558 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
559 encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="ap-wds"})
560 encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="ap-wds"})
561 encr.description = translate(
562 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
563 "and ad-hoc mode) to be installed."
565 elseif not hostapd and supplicant then
566 encr:value("psk", "WPA-PSK", {mode="sta"}, {mode="sta-wds"})
567 encr:value("psk2", "WPA2-PSK", {mode="sta"}, {mode="sta-wds"})
568 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"}, {mode="sta-wds"})
569 encr:value("wpa", "WPA-EAP", {mode="sta"}, {mode="sta-wds"})
570 encr:value("wpa2", "WPA2-EAP", {mode="sta"}, {mode="sta-wds"})
571 encr.description = translate(
572 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
573 "and ad-hoc mode) to be installed."
576 encr.description = translate(
577 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
578 "and ad-hoc mode) to be installed."
581 elseif hwtype == "broadcom" then
582 encr:value("psk", "WPA-PSK")
583 encr:value("psk2", "WPA2-PSK")
584 encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
587 encr:depends("mode", "ap")
588 encr:depends("mode", "sta")
589 encr:depends("mode", "ap-wds")
590 encr:depends("mode", "sta-wds")
591 encr:depends("mode", "wds")
593 server = s:taboption("encryption", Value, "server", translate("Radius-Server"))
594 server:depends({mode="ap", encryption="wpa"})
595 server:depends({mode="ap", encryption="wpa2"})
596 server:depends({mode="ap-wds", encryption="wpa"})
597 server:depends({mode="ap-wds", encryption="wpa2"})
598 server.rmempty = true
600 port = s:taboption("encryption", Value, "port", translate("Radius-Port"))
601 port:depends({mode="ap", encryption="wpa"})
602 port:depends({mode="ap", encryption="wpa2"})
603 port:depends({mode="ap-wds", encryption="wpa"})
604 port:depends({mode="ap-wds", encryption="wpa2"})
607 key = s:taboption("encryption", Value, "key", translate("Key"))
608 key:depends("encryption", "wep")
609 key:depends("encryption", "psk")
610 key:depends("encryption", "psk2")
611 key:depends("encryption", "psk+psk2")
612 key:depends("encryption", "psk-mixed")
613 key:depends({mode="ap", encryption="wpa"})
614 key:depends({mode="ap", encryption="wpa2"})
615 key:depends({mode="ap-wds", encryption="wpa"})
616 key:depends({mode="ap-wds", encryption="wpa2"})
620 if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
621 nasid = s:taboption("encryption", Value, "nasid", translate("NAS ID"))
622 nasid:depends({mode="ap", encryption="wpa"})
623 nasid:depends({mode="ap", encryption="wpa2"})
624 nasid:depends({mode="ap-wds", encryption="wpa"})
625 nasid:depends({mode="ap-wds", encryption="wpa2"})
628 eaptype = s:taboption("encryption", ListValue, "eap_type", translate("EAP-Method"))
630 eaptype:value("TTLS")
631 eaptype:value("PEAP")
632 eaptype:depends({mode="sta", encryption="wpa"})
633 eaptype:depends({mode="sta", encryption="wpa2"})
635 cacert = s:taboption("encryption", FileUpload, "ca_cert", translate("Path to CA-Certificate"))
636 cacert:depends({mode="sta", encryption="wpa"})
637 cacert:depends({mode="sta", encryption="wpa2"})
639 privkey = s:taboption("encryption", FileUpload, "priv_key", translate("Path to Private Key"))
640 privkey:depends({mode="sta", eap_type="TLS", encryption="wpa2"})
641 privkey:depends({mode="sta", eap_type="TLS", encryption="wpa"})
643 privkeypwd = s:taboption("encryption", Value, "priv_key_pwd", translate("Password of Private Key"))
644 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="wpa2"})
645 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="wpa"})
648 auth = s:taboption("encryption", Value, "auth", translate("Authentication"))
652 auth:value("MSCHAPV2")
653 auth:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
654 auth:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
655 auth:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
656 auth:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
659 identity = s:taboption("encryption", Value, "identity", translate("Identity"))
660 identity:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
661 identity:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
662 identity:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
663 identity:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
665 password = s:taboption("encryption", Value, "password", translate("Password"))
666 password:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
667 password:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
668 password:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
669 password:depends({mode="sta", eap_type="TTLS", encryption="wpa"})