Globally reduce copyright headers
[project/luci.git] / protocols / luci-proto-ppp / luasrc / model / cbi / admin_network / proto_l2tp.lua
1 -- Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
2 -- Licensed to the public under the Apache License 2.0.
3
4 local map, section, net = ...
5
6 local server, username, password
7 local ipv6, defaultroute, metric, peerdns, dns, mtu
8
9
10 server = section:taboption("general", Value, "server", translate("L2TP Server"))
11 server.datatype = "host"
12
13
14 username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
15
16
17 password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
18 password.password = true
19
20 if luci.model.network:has_ipv6() then
21
22         ipv6 = section:taboption("advanced", Flag, "ipv6",
23                 translate("Enable IPv6 negotiation on the PPP link"))
24
25         ipv6.default = ipv6.disabled
26
27 end
28
29 defaultroute = section:taboption("advanced", Flag, "defaultroute",
30         translate("Use default gateway"),
31         translate("If unchecked, no default route is configured"))
32
33 defaultroute.default = defaultroute.enabled
34
35
36 metric = section:taboption("advanced", Value, "metric",
37         translate("Use gateway metric"))
38
39 metric.placeholder = "0"
40 metric.datatype    = "uinteger"
41 metric:depends("defaultroute", defaultroute.enabled)
42
43
44 peerdns = section:taboption("advanced", Flag, "peerdns",
45         translate("Use DNS servers advertised by peer"),
46         translate("If unchecked, the advertised DNS server addresses are ignored"))
47
48 peerdns.default = peerdns.enabled
49
50
51 dns = section:taboption("advanced", DynamicList, "dns",
52         translate("Use custom DNS servers"))
53
54 dns:depends("peerdns", "")
55 dns.datatype = "ipaddr"
56 dns.cast     = "string"
57
58 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
59 mtu.placeholder = "1500"
60 mtu.datatype    = "max(9200)"