2 LuCI - Lua Configuration Interface
4 Copyright 2011 Jo-Philipp Wich <xm@subsignal.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
13 local map, section, net = ...
15 local server, username, password
16 local buffering, defaultroute, metric, peerdns, dns
19 server = section:taboption("general", Value, "server", translate("VPN Server"))
20 server.datatype = "host"
23 username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
26 password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
27 password.password = true
30 buffering = section:taboption("advanced", Flag, "buffering", translate("Enable buffering"))
31 buffering.default = buffering.enabled
34 defaultroute = section:taboption("advanced", Flag, "defaultroute",
35 translate("Use default gateway"),
36 translate("If unchecked, no default route is configured"))
38 defaultroute.default = defaultroute.enabled
41 metric = section:taboption("advanced", Value, "metric",
42 translate("Use gateway metric"))
44 metric.placeholder = "0"
45 metric.datatype = "uinteger"
46 metric:depends("defaultroute", defaultroute.enabled)
49 peerdns = section:taboption("advanced", Flag, "peerdns",
50 translate("Use DNS servers advertised by peer"),
51 translate("If unchecked, the advertised DNS server addresses are ignored"))
53 peerdns.default = peerdns.enabled
56 dns = section:taboption("advanced", DynamicList, "dns",
57 translate("Use custom DNS servers"))
59 dns:depends("peerdns", "")
60 dns.datatype = "ipaddr"