* luci/libs: set svn property on uvl executable
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_wifi / networks.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
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
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 require("luci.tools.webadmin")
15 m = Map("wireless", translate("networks"), translate("a_w_networks1"))
16
17 s = m:section(TypedSection, "wifi-iface", "")
18 s.addremove = true
19 s.anonymous = true
20
21 s:option(Value, "ssid", translate("a_w_netid")).maxlength = 32
22
23 device = s:option(ListValue, "device", translate("device"))
24 luci.model.uci.foreach("wireless", "wifi-device",
25         function (section)
26                 device:value(section[".name"])
27         end)
28
29 network = s:option(ListValue, "network", translate("network"), translate("a_w_network1"))
30 network:value("")
31 luci.tools.webadmin.cbi_add_networks(network)
32
33 mode = s:option(ListValue, "mode", translate("mode"))
34 mode:value("ap", translate("a_w_ap"))
35 mode:value("adhoc", translate("a_w_adhoc"))
36 mode:value("ahdemo", translate("a_w_ahdemo"))
37 mode:value("sta", translate("a_w_client"))
38 mode:value("wds", translate("a_w_wds"))
39 mode:value("monitor", translate("a_w_monitor"))
40
41 s:option(Value, "bssid", "BSSID").optional = true
42
43 s:option(Value, "txpower", translate("a_w_txpwr"), "dbm").rmempty = true
44
45 s:option(Flag, "frameburst", translate("a_w_brcmburst")).optional = true
46 s:option(Flag, "bursting", translate("a_w_athburst")).optional = true
47
48
49 encr = s:option(ListValue, "encryption", translate("encryption"))
50 encr:value("none", "keine")
51 encr:value("wep", "WEP")
52 encr:value("PSK", "WPA-PSK")
53 encr:value("WPA", "WPA-EAP", {mode="ap"}, {mode="sta"})
54 encr:value("PSK2", "WPA2-PSK")
55 encr:value("WPA2", "WPA2-EAP", {mode="ap"}, {mode="sta"})
56 encr:depends("mode", "ap")
57 encr:depends("mode", "sta")
58 encr:depends("mode", "wds")
59
60 server = s:option(Value, "server", translate("a_w_radiussrv"))
61 server:depends({mode="ap", encryption="WPA"})
62 server:depends({mode="ap", encryption="WPA2"})
63 server.rmempty = true
64
65 port = s:option(Value, "port", translate("a_w_radiusport"))
66 port:depends({mode="ap", encryption="WPA"})
67 port:depends({mode="ap", encryption="WPA2"})
68 port.rmempty = true
69
70 key = s:option(Value, "key", translate("key"))
71 key:depends("encryption", "wep")
72 key:depends("encryption", "PSK")
73 key:depends({mode="ap", encryption="WPA"})
74 key:depends("encryption", "PSK2")
75 key:depends({mode="ap", encryption="WPA2"})
76 key.rmempty = true
77
78 nasid = s:option(Value, "nasid", translate("a_w_nasid"))
79 nasid:depends({mode="ap", encryption="WPA"})
80 nasid:depends({mode="ap", encryption="WPA2"})
81 nasid.rmempty = true
82
83 eaptype = s:option(ListValue, "eap_type", translate("a_w_eaptype"))
84 eaptype:value("TLS")
85 eaptype:value("PEAP")
86 eaptype:depends({mode="sta", encryption="WPA"})
87 eaptype:depends({mode="sta", encryption="WPA2"})
88
89 cacert = s:option(Value, "ca_cert", translate("a_w_cacert"))
90 cacert:depends({mode="sta", encryption="WPA"})
91 cacert:depends({mode="sta", encryption="WPA2"})
92
93 privkey = s:option(Value, "priv_key", translate("a_w_tlsprivkey"))
94 privkey:depends({mode="sta", eap_type="TLS", encryption="WPA2"})
95 privkey:depends({mode="sta", eap_type="TLS", encryption="WPA"})
96
97 privkeypwd = s:option(Value, "priv_key_pwd", translate("a_w_tlsprivkeypwd"))
98 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="WPA2"})
99 privkeypwd:depends({mode="sta", eap_type="TLS", encryption="WPA"})
100
101
102 auth = s:option(Value, "auth", translate("a_w_peapauth"))
103 auth:depends({mode="sta", eap_type="PEAP", encryption="WPA2"})
104 auth:depends({mode="sta", eap_type="PEAP", encryption="WPA"})
105
106 identity = s:option(Value, "identity", translate("a_w_peapidentity"))
107 identity:depends({mode="sta", eap_type="PEAP", encryption="WPA2"})
108 identity:depends({mode="sta", eap_type="PEAP", encryption="WPA"})
109
110 password = s:option(Value, "password", translate("a_w_peappassword"))
111 password:depends({mode="sta", eap_type="PEAP", encryption="WPA2"})
112 password:depends({mode="sta", eap_type="PEAP", encryption="WPA"})
113
114
115
116
117 s:option(Flag, "isolate", translate("a_w_apisolation"), translate("a_w_apisolation1")).optional = true
118
119 s:option(Flag, "hidden", translate("a_w_hideessid")).optional = true
120
121
122
123 return m