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")
98 local nsantenna = m:get(arg[1], "antenna")
100 ch = s:taboption("general", Value, "channel", translate("Channel"))
101 ch:value("auto", translate("auto"))
102 for _, f in ipairs(luci.sys.wifi.channels()) do
103 ch:value(f.channel, "%i (%.3f GHz)" %{ f.channel, f.mhz / 1000 })
107 ------------------- MAC80211 Device ------------------
109 if hwtype == "mac80211" then
110 tp = s:taboption("general",
111 (tx_powers and #tx_powers > 0) and ListValue or Value,
112 "txpower", translate("Transmit Power"), "dBm")
115 for _, p in ipairs(iw and iw.txpwrlist or {}) do
116 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
119 mode = s:taboption("advanced", ListValue, "hwmode", translate("Mode"))
120 mode:value("", translate("auto"))
121 mode:value("11b", "802.11b")
122 mode:value("11g", "802.11g")
123 mode:value("11a", "802.11a")
124 mode:value("11ng", "802.11g+n")
125 mode:value("11na", "802.11a+n")
127 htmode = s:taboption("advanced", ListValue, "htmode", translate("HT mode"))
128 htmode:depends("hwmode", "11na")
129 htmode:depends("hwmode", "11ng")
130 htmode:value("HT20", "20MHz")
131 htmode:value("HT40-", translate("40MHz 2nd channel below"))
132 htmode:value("HT40+", translate("40MHz 2nd channel above"))
134 htcapab = s:taboption("advanced", DynamicList, "ht_capab", translate("HT capabilities"))
135 htcapab:depends("hwmode", "11na")
136 htcapab:depends("hwmode", "11ng")
138 s:taboption("advanced", Value, "country", translate("Country Code"), translate("Use ISO/IEC 3166 alpha2 country codes."))
139 s:taboption("advanced", Value, "distance", translate("Distance Optimization"),
140 translate("Distance to farthest network member in meters."))
144 ------------------- Madwifi Device ------------------
146 if hwtype == "atheros" then
147 tp = s:taboption("general",
148 (#tx_powers > 0) and ListValue or Value,
149 "txpower", translate("Transmit Power"), "dBm")
152 for _, p in ipairs(iw.txpwrlist) do
153 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
156 mode = s:taboption("advanced", ListValue, "hwmode", translate("Mode"))
157 mode:value("", translate("auto"))
158 mode:value("11b", "802.11b")
159 mode:value("11g", "802.11g")
160 mode:value("11a", "802.11a")
161 mode:value("11bg", "802.11b+g")
162 mode:value("11gst", "802.11g + Turbo")
163 mode:value("11ast", "802.11a + Turbo")
164 mode:value("fh", translate("Frequency Hopping"))
166 s:taboption("advanced", Flag, "diversity", translate("Diversity")).rmempty = false
168 if not nsantenna then
169 ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
170 ant1.widget = "radio"
171 ant1.orientation = "horizontal"
172 ant1:depends("diversity", "")
173 ant1:value("0", translate("auto"))
174 ant1:value("1", translate("Antenna 1"))
175 ant1:value("2", translate("Antenna 2"))
177 ant2 = s:taboption("advanced", ListValue, "rxantenna", translate("Receiver Antenna"))
178 ant2.widget = "radio"
179 ant2.orientation = "horizontal"
180 ant2:depends("diversity", "")
181 ant2:value("0", translate("auto"))
182 ant2:value("1", translate("Antenna 1"))
183 ant2:value("2", translate("Antenna 2"))
186 local ant = s:taboption("advanced", ListValue, "antenna", translate("Transmitter Antenna"))
188 ant:value("vertical")
189 ant:value("horizontal")
190 ant:value("external")
193 s:taboption("advanced", Value, "distance", translate("Distance Optimization"),
194 translate("Distance to farthest network member in meters."))
195 s:taboption("advanced", Value, "regdomain", translate("Regulatory Domain"))
196 s:taboption("advanced", Value, "country", translate("Country Code"))
197 s:taboption("advanced", Flag, "outdoor", translate("Outdoor Channels"))
199 --s:option(Flag, "nosbeacon", translate("Disable HW-Beacon timer"))
204 ------------------- Broadcom Device ------------------
206 if hwtype == "broadcom" then
207 tp = s:taboption("general",
208 (#tx_powers > 0) and ListValue or Value,
209 "txpower", translate("Transmit Power"), "dBm")
212 for _, p in ipairs(iw.txpwrlist) do
213 tp:value(p.dbm, "%i dBm (%i mW)" %{ p.dbm, p.mw })
216 mp = s:taboption("macfilter", ListValue, "macfilter", translate("MAC-Address Filter"))
217 mp:value("", translate("disable"))
218 mp:value("allow", translate("Allow listed only"))
219 mp:value("deny", translate("Allow all except listed"))
220 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
221 ml:depends({macfilter="allow"})
222 ml:depends({macfilter="deny"})
224 ant1 = s:taboption("advanced", ListValue, "txantenna", translate("Transmitter Antenna"))
225 ant1.widget = "radio"
226 ant1:depends("diversity", "")
227 ant1:value("3", translate("auto"))
228 ant1:value("0", translate("Antenna 1"))
229 ant1:value("1", translate("Antenna 2"))
231 ant2 = s:taboption("advanced", ListValue, "rxantenna", translate("Receiver Antenna"))
232 ant2.widget = "radio"
233 ant2:depends("diversity", "")
234 ant2:value("3", translate("auto"))
235 ant2:value("0", translate("Antenna 1"))
236 ant2:value("1", translate("Antenna 2"))
238 s:taboption("advanced", Flag, "frameburst", translate("Frame Bursting"))
240 s:taboption("advanced", Value, "distance", translate("Distance Optimization"))
241 --s:option(Value, "slottime", translate("Slot time"))
243 s:taboption("advanced", Value, "country", translate("Country Code"))
244 s:taboption("advanced", Value, "maxassoc", translate("Connection Limit"))
248 --------------------- HostAP Device ---------------------
250 if hwtype == "prism2" then
251 s:taboption("advanced", Value, "txpower", translate("Transmit Power"), "att units").rmempty = true
253 s:taboption("advanced", Flag, "diversity", translate("Diversity")).rmempty = false
255 s:taboption("advanced", Value, "txantenna", translate("Transmitter Antenna"))
256 s:taboption("advanced", Value, "rxantenna", translate("Receiver Antenna"))
260 ----------------------- Interface -----------------------
262 local wnet = ww:get_network(arg[2])
265 s = m:section(NamedSection, wnet.sid, "wifi-iface", translate("Interface Configuration"))
269 s.defaults.device = arg[1]
271 s:tab("general", translate("General Setup"))
272 s:tab("encryption", translate("Wireless Security"))
273 s:tab("macfilter", translate("MAC-Filter"))
274 s:tab("advanced", translate("Advanced Settings"))
276 s:taboption("general", Value, "ssid", translate("<abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
278 mode = s:taboption("general", ListValue, "mode", translate("Mode"))
279 mode.override_values = true
280 mode:value("ap", translate("Access Point"))
281 mode:value("sta", translate("Client"))
282 mode:value("adhoc", translate("Ad-Hoc"))
284 bssid = s:taboption("general", Value, "bssid", translate("<abbr title=\"Basic Service Set Identifier\">BSSID</abbr>"))
286 network = s:taboption("general", Value, "network", translate("Network"),
287 translate("Choose the network you want to attach to this wireless interface. " ..
288 "Select <em>unspecified</em> to not attach any network or fill out the " ..
289 "<em>create</em> field to define a new network."))
291 network.rmempty = true
292 network.template = "cbi/network_netlist"
293 network.widget = "radio"
295 function network.write(self, section, value)
296 local i = nw:get_interface(section)
299 value = m:formvalue(self:cbid(section) .. ".newnet")
300 if value and #value > 0 then
301 local n = nw:add_network(value, {type="bridge", proto="none"})
302 if n then n:add_interface(i) end
304 local n = i:get_network()
305 if n then n:del_interface(i) end
308 local n = nw:get_network(value)
317 -------------------- MAC80211 Interface ----------------------
319 if hwtype == "mac80211" then
320 if fs.access("/usr/sbin/iw") then
321 mode:value("mesh", "802.11s")
324 mode:value("ahdemo", translate("Pseudo Ad-Hoc (ahdemo)"))
325 mode:value("monitor", translate("Monitor"))
326 bssid:depends({mode="adhoc"})
328 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
329 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
331 mode:value("ap-wds", "%s (%s)" % {translate("Access Point"), translate("WDS")})
332 mode:value("sta-wds", "%s (%s)" % {translate("Client"), translate("WDS")})
334 function mode.write(self, section, value)
335 if value == "ap-wds" then
336 ListValue.write(self, section, "ap")
337 m.uci:set("wireless", section, "wds", 1)
338 elseif value == "sta-wds" then
339 ListValue.write(self, section, "sta")
340 m.uci:set("wireless", section, "wds", 1)
342 ListValue.write(self, section, value)
343 m.uci:delete("wireless", section, "wds")
347 function mode.cfgvalue(self, section)
348 local mode = ListValue.cfgvalue(self, section)
349 local wds = m.uci:get("wireless", section, "wds") == "1"
351 if mode == "ap" and wds then
353 elseif mode == "sta" and wds then
360 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
361 hidden:depends({mode="ap"})
362 hidden:depends({mode="ap-wds"})
367 -------------------- Madwifi Interface ----------------------
369 if hwtype == "atheros" then
370 mode:value("ahdemo", translate("Pseudo Ad-Hoc (ahdemo)"))
371 mode:value("monitor", translate("Monitor"))
372 mode:value("ap-wds", "%s (%s)" % {translate("Access Point"), translate("WDS")})
373 mode:value("sta-wds", "%s (%s)" % {translate("Client"), translate("WDS")})
374 mode:value("wds", translate("Static WDS"))
376 function mode.write(self, section, value)
377 if value == "ap-wds" then
378 ListValue.write(self, section, "ap")
379 m.uci:set("wireless", section, "wds", 1)
380 elseif value == "sta-wds" then
381 ListValue.write(self, section, "sta")
382 m.uci:set("wireless", section, "wds", 1)
384 ListValue.write(self, section, value)
385 m.uci:delete("wireless", section, "wds")
389 function mode.cfgvalue(self, section)
390 local mode = ListValue.cfgvalue(self, section)
391 local wds = m.uci:get("wireless", section, "wds") == "1"
393 if mode == "ap" and wds then
395 elseif mode == "sta" and wds then
402 bssid:depends({mode="adhoc"})
403 bssid:depends({mode="ahdemo"})
404 bssid:depends({mode="wds"})
406 wdssep = s:taboption("advanced", Flag, "wdssep", translate("Separate WDS"))
407 wdssep:depends({mode="ap-wds"})
409 s:taboption("advanced", Flag, "doth", "802.11h")
410 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
411 hidden:depends({mode="ap"})
412 hidden:depends({mode="adhoc"})
413 hidden:depends({mode="ap-wds"})
414 hidden:depends({mode="sta-wds"})
415 isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
416 translate("Prevents client-to-client communication"))
417 isolate:depends({mode="ap"})
418 s:taboption("advanced", Flag, "bgscan", translate("Background Scan"))
420 mp = s:taboption("macfilter", ListValue, "macpolicy", translate("MAC-Address Filter"))
421 mp:value("", translate("disable"))
422 mp:value("deny", translate("Allow listed only"))
423 mp:value("allow", translate("Allow all except listed"))
424 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
425 ml:depends({macpolicy="allow"})
426 ml:depends({macpolicy="deny"})
428 s:taboption("advanced", Value, "rate", translate("Transmission Rate"))
429 s:taboption("advanced", Value, "mcast_rate", translate("Multicast Rate"))
430 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
431 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
432 s:taboption("advanced", Value, "minrate", translate("Minimum Rate"))
433 s:taboption("advanced", Value, "maxrate", translate("Maximum Rate"))
434 s:taboption("advanced", Flag, "compression", translate("Compression"))
436 s:taboption("advanced", Flag, "bursting", translate("Frame Bursting"))
437 s:taboption("advanced", Flag, "turbo", translate("Turbo Mode"))
438 s:taboption("advanced", Flag, "ff", translate("Fast Frames"))
440 s:taboption("advanced", Flag, "wmm", translate("WMM Mode"))
441 s:taboption("advanced", Flag, "xr", translate("XR Support"))
442 s:taboption("advanced", Flag, "ar", translate("AR Support"))
444 local swm = s:taboption("advanced", Flag, "sw_merge", translate("Disable HW-Beacon timer"))
445 swm:depends({mode="adhoc"})
447 local nos = s:taboption("advanced", Flag, "nosbeacon", translate("Disable HW-Beacon timer"))
448 nos:depends({mode="sta"})
449 nos:depends({mode="sta-wds"})
451 local probereq = s:taboption("advanced", Flag, "probereq", translate("Do not send probe responses"))
452 probereq.enabled = "0"
453 probereq.disabled = "1"
457 -------------------- Broadcom Interface ----------------------
459 if hwtype == "broadcom" then
460 mode:value("wds", translate("WDS"))
461 mode:value("monitor", translate("Monitor"))
463 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
464 hidden:depends({mode="ap"})
465 hidden:depends({mode="adhoc"})
466 hidden:depends({mode="wds"})
468 isolate = s:taboption("advanced", Flag, "isolate", translate("Separate Clients"),
469 translate("Prevents client-to-client communication"))
470 isolate:depends({mode="ap"})
472 s:taboption("advanced", Flag, "doth", "802.11h")
473 s:taboption("advanced", Flag, "wmm", translate("WMM Mode"))
475 bssid:depends({mode="wds"})
476 bssid:depends({mode="adhoc"})
480 ----------------------- HostAP Interface ---------------------
482 if hwtype == "prism2" then
483 mode:value("wds", translate("WDS"))
484 mode:value("monitor", translate("Monitor"))
486 hidden = s:taboption("general", Flag, "hidden", translate("Hide <abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
487 hidden:depends({mode="ap"})
488 hidden:depends({mode="adhoc"})
489 hidden:depends({mode="wds"})
491 bssid:depends({mode="sta"})
493 mp = s:taboption("macfilter", ListValue, "macpolicy", translate("MAC-Address Filter"))
494 mp:value("", translate("disable"))
495 mp:value("deny", translate("Allow listed only"))
496 mp:value("allow", translate("Allow all except listed"))
497 ml = s:taboption("macfilter", DynamicList, "maclist", translate("MAC-List"))
498 ml:depends({macpolicy="allow"})
499 ml:depends({macpolicy="deny"})
501 s:taboption("advanced", Value, "rate", translate("Transmission Rate"))
502 s:taboption("advanced", Value, "frag", translate("Fragmentation Threshold"))
503 s:taboption("advanced", Value, "rts", translate("RTS/CTS Threshold"))
507 ------------------- WiFI-Encryption -------------------
509 encr = s:taboption("encryption", ListValue, "encryption", translate("Encryption"))
510 encr.override_values = true
511 encr.override_depends = true
512 encr:depends({mode="ap"})
513 encr:depends({mode="sta"})
514 encr:depends({mode="adhoc"})
515 encr:depends({mode="ahdemo"})
516 encr:depends({mode="ap-wds"})
517 encr:depends({mode="sta-wds"})
518 encr:depends({mode="mesh"})
520 encr:value("none", "No Encryption")
521 encr:value("wep", "WEP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
523 if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
524 local supplicant = fs.access("/usr/sbin/wpa_supplicant")
525 local hostapd = fs.access("/usr/sbin/hostapd")
527 if hostapd and supplicant then
528 encr:value("psk", "WPA-PSK")
529 encr:value("psk2", "WPA2-PSK")
530 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode")
531 encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
532 encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="sta"})
533 elseif hostapd and not supplicant then
534 encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
535 encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
536 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="ap-wds"}, {mode="adhoc"}, {mode="ahdemo"})
537 encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="ap-wds"})
538 encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="ap-wds"})
539 encr.description = translate(
540 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
541 "and ad-hoc mode) to be installed."
543 elseif not hostapd and supplicant then
544 encr:value("psk", "WPA-PSK", {mode="sta"}, {mode="sta-wds"})
545 encr:value("psk2", "WPA2-PSK", {mode="sta"}, {mode="sta-wds"})
546 encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"}, {mode="sta-wds"})
547 encr:value("wpa", "WPA-EAP", {mode="sta"}, {mode="sta-wds"})
548 encr:value("wpa2", "WPA2-EAP", {mode="sta"}, {mode="sta-wds"})
549 encr.description = translate(
550 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
551 "and ad-hoc mode) to be installed."
554 encr.description = translate(
555 "WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
556 "and ad-hoc mode) to be installed."
559 elseif hwtype == "broadcom" then
560 encr:value("psk", "WPA-PSK")
561 encr:value("psk2", "WPA2-PSK")
562 encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
565 encr:depends("mode", "ap")
566 encr:depends("mode", "sta")
567 encr:depends("mode", "ap-wds")
568 encr:depends("mode", "sta-wds")
569 encr:depends("mode", "wds")
571 server = s:taboption("encryption", Value, "server", translate("Radius-Server"))
572 server:depends({mode="ap", encryption="wpa"})
573 server:depends({mode="ap", encryption="wpa2"})
574 server:depends({mode="ap-wds", encryption="wpa"})
575 server:depends({mode="ap-wds", encryption="wpa2"})
576 server.rmempty = true
578 port = s:taboption("encryption", Value, "port", translate("Radius-Port"))
579 port:depends({mode="ap", encryption="wpa"})
580 port:depends({mode="ap", encryption="wpa2"})
581 port:depends({mode="ap-wds", encryption="wpa"})
582 port:depends({mode="ap-wds", encryption="wpa2"})
585 key = s:taboption("encryption", Value, "key", translate("Key"))
586 key:depends("encryption", "wep")
587 key:depends("encryption", "psk")
588 key:depends("encryption", "psk2")
589 key:depends("encryption", "psk+psk2")
590 key:depends("encryption", "psk-mixed")
591 key:depends({mode="ap", encryption="wpa"})
592 key:depends({mode="ap", encryption="wpa2"})
593 key:depends({mode="ap-wds", encryption="wpa"})
594 key:depends({mode="ap-wds", encryption="wpa2"})
598 if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
599 nasid = s:taboption("encryption", Value, "nasid", translate("NAS ID"))
600 nasid:depends({mode="ap", encryption="wpa"})
601 nasid:depends({mode="ap", encryption="wpa2"})
602 nasid:depends({mode="ap-wds", encryption="wpa"})
603 nasid:depends({mode="ap-wds", encryption="wpa2"})
606 eaptype = s:taboption("encryption", ListValue, "eap_type", translate("EAP-Method"))
608 eaptype:value("TTLS")
609 eaptype:value("PEAP")
610 eaptype:depends({mode="sta", encryption="wpa"})
611 eaptype:depends({mode="sta", encryption="wpa2"})
613 cacert = s:taboption("encryption", FileUpload, "ca_cert", translate("Path to CA-Certificate"))
614 cacert:depends({mode="sta", encryption="wpa"})
615 cacert:depends({mode="sta", encryption="wpa2"})
617 privkey = s:taboption("encryption", FileUpload, "priv_key", translate("Path to Private Key"))
618 privkey:depends({mode="sta", eap_type="TLS", encryption="wpa2"})
619 privkey:depends({mode="sta", eap_type="TLS", encryption="wpa"})
621 privkeypwd = s:taboption("encryption", Value, "priv_key_pwd", translate("Password of Private Key"))
622 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="wpa2"})
623 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="wpa"})
626 auth = s:taboption("encryption", Value, "auth", translate("Authentication"))
630 auth:value("MSCHAPV2")
631 auth:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
632 auth:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
633 auth:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
634 auth:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
637 identity = s:taboption("encryption", Value, "identity", translate("Identity"))
638 identity:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
639 identity:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
640 identity:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
641 identity:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
643 password = s:taboption("encryption", Value, "password", translate("Password"))
644 password:depends({mode="sta", eap_type="PEAP", encryption="wpa2"})
645 password:depends({mode="sta", eap_type="PEAP", encryption="wpa"})
646 password:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
647 password:depends({mode="sta", eap_type="TTLS", encryption="wpa"})