a4b50efa2721703834153e3d2cb4b12e28572d97
[project/luci.git] / protocols / ipv6 / luasrc / model / cbi / admin_network / proto_6rd.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.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
13 local map, section, net = ...
14
15 local ipaddr, peeraddr, ip6addr, tunnelid, username, password
16 local defaultroute, metric, ttl, mtu
17
18
19 ipaddr = s:taboption("general", Value, "ipaddr",
20         translate("Local IPv4 address"),
21         translate("Leave empty to use the current WAN address"))
22
23 ipaddr.datatype = "ip4addr"
24
25
26 peeraddr = s:taboption("general", Value, "peeraddr",
27         translate("Remote IPv4 address"),
28         translate("This IPv4 address of the relay"))
29
30 peeraddr.rmempty  = false
31 peeraddr.datatype = "ip4addr"
32
33
34 ip6addr = s:taboption("general", Value, "ip6prefix",
35         translate("IPv6 prefix"),
36         translate("The IPv6 prefix assigned to the provider, usually ends with <code>::</code>"))
37
38 ip6addr.rmempty  = false
39 ip6addr.datatype = "ip6addr"
40
41
42 ip6prefixlen = s:taboption("general", Value, "ip6prefixlen",
43         translate("IPv6 prefix length"),
44         translate("The length of the IPv6 prefix in bits"))
45
46 ip6prefixlen.placeholder = "16"
47 ip6prefixlen.datatype    = "range(0,128)"
48
49
50 ip6prefixlen = s:taboption("general", Value, "ip4prefixlen",
51         translate("IPv4 prefix length"),
52         translate("The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses."))
53
54 ip6prefixlen.placeholder = "0"
55 ip6prefixlen.datatype    = "range(0,32)"
56
57
58
59 defaultroute = section:taboption("advanced", Flag, "defaultroute",
60         translate("Default gateway"),
61         translate("If unchecked, no default route is configured"))
62
63 defaultroute.default = defaultroute.enabled
64
65
66 metric = section:taboption("advanced", Value, "metric",
67         translate("Use gateway metric"))
68
69 metric.placeholder = "0"
70 metric.datatype    = "uinteger"
71 metric:depends("defaultroute", defaultroute.enabled)
72
73
74 ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
75 ttl.placeholder = "64"
76 ttl.datatype    = "range(1,255)"
77
78
79 mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
80 mtu.placeholder = "1280"
81 mtu.datatype    = "max(1500)"