Add DS-Lite support
[project/luci.git] / protocols / ipv6 / luasrc / model / cbi / admin_network / proto_dslite.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
5 Copyright 2013 Steven Barth <steven@midlink.org>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12 ]]--
13
14 local map, section, net = ...
15
16 local peeraddr, ip6addr
17 local tunlink, defaultroute, metric, ttl, mtu
18
19
20
21
22 peeraddr = section:taboption("general", Value, "peeraddr",
23         translate("DS-Lite AFTR address"))
24
25 peeraddr.rmempty  = false
26 peeraddr.datatype = "ip6addr"
27
28 ip6addr = section:taboption("general", Value, "ip6addr",
29         translate("Local IPv6 address"),
30         translate("Leave empty to use the current WAN address"))
31
32 ip6addr.datatype = "ip6addr"
33
34
35 tunlink = section:taboption("advanced", DynamicList, "tunlink", translate("Tunnel Link"))
36 tunlink.template = "cbi/network_netlist"
37 tunlink.nocreate = true
38
39
40 defaultroute = section:taboption("advanced", Flag, "defaultroute",
41         translate("Default gateway"),
42         translate("If unchecked, no default route is configured"))
43
44 defaultroute.default = defaultroute.enabled
45
46
47 metric = section:taboption("advanced", Value, "metric",
48         translate("Use gateway metric"))
49
50 metric.placeholder = "0"
51 metric.datatype    = "uinteger"
52 metric:depends("defaultroute", defaultroute.enabled)
53
54
55 ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
56 ttl.placeholder = "64"
57 ttl.datatype    = "range(1,255)"
58
59
60 mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
61 mtu.placeholder = "1280"
62 mtu.datatype    = "max(9200)"