1 -- Copyright 2015 Paul Oranje <por@xs4all.nl>
2 -- Licensed to the public under the Apache License 2.0.
4 local map, section, net = ...
6 -- config read by /lib/netifd/proto/aiccu.sh
7 local username, password, protocol, server, tunnelid, ip6prefix, requiretls, nat, heartbeat,
8 verbose, ntpsynctimeout, ip6addr, sourcerouting, defaultroute
11 local metric, ttl, mtu
14 username = section:taboption("general", Value, "username",
15 translate("Server username"),
16 translate("SIXXS-handle[/Tunnel-ID]"))
17 username.datatype = "string"
19 password = section:taboption("general", Value, "password",
20 translate("Server password"),
21 translate("Server password, enter the specific password of the tunnel when the username contains the tunnel ID"))
22 password.datatype = "string"
23 password.password = true
26 --[[ SIXXS supports only TIC as tunnel broker protocol, no use setting it.
27 protocol = section:taboption("general", ListValue, "protocol",
28 translate("Tunnel broker protocol"),
29 translate("SIXXS supports TIC only, for static tunnels using IP protocol 41 (RFC4213) use 6in4 instead"))
31 protocol:value("tic", "TIC")
32 protocol:value("tsp", "TSP")
33 protocol:value("l2tp", "L2TP")
34 protocol.default = "tic"
35 protocol.optional = true
39 server = section:taboption("general", Value, "server",
40 translate("Tunnel setup server"),
41 translate("Optional, specify to override default server (tic.sixxs.net)"))
42 server.datatype = "host"
43 server.optional = true
46 tunnelid = section:taboption("general", Value, "tunnelid",
47 translate("Tunnel ID"),
48 translate("Optional, use when the SIXXS account has more than one tunnel"))
49 tunnelid.datatype = "string"
50 tunnelid.optional = true
53 local ip6prefix = section:taboption("general", Value, "ip6prefix",
54 translate("IPv6 prefix"),
55 translate("Routed IPv6 prefix for downstream interfaces"))
56 ip6prefix.datatype = "ip6prefix"
57 ip6prefix.optional = true
60 heartbeat = s:taboption("general", ListValue, "heartbeat",
61 translate("Tunnel type"),
62 translate("Also see <a href=\"https://www.sixxs.net/faq/connectivity/?faq=comparison\">Tunneling Comparison</a> on SIXXS"))
63 heartbeat:value("0", translate("AYIYA"))
64 heartbeat:value("1", translate("Heartbeat"))
65 heartbeat.default = "0"
68 nat = section:taboption("general", Flag, "nat",
69 translate("Behind NAT"),
70 translate("The tunnel end-point is behind NAT, defaults to disabled and only applies to AYIYA"))
72 nat.default = disabled
75 requiretls = section:taboption("general", Flag, "requiretls",
76 translate("Require TLS"),
77 translate("Connection to server fails when TLS cannot be used"))
78 requiretls.optional = true
79 requiretls.default = requiretls.enabled
82 verbose = section:taboption("advanced", Flag, "verbose",
84 translate("Verbose logging by aiccu daemon"))
85 verbose.optional = true
86 verbose.default = disabled
89 ntpsynctimeout = section:taboption("advanced", Value, "ntpsynctimeout",
90 translate("NTP sync time-out"),
91 translate("Wait for NTP sync that many seconds, seting to 0 disables waiting (optional)"))
92 ntpsynctimeout.datatype = "uinteger"
93 ntpsynctimeout.placeholder = "90"
94 ntpsynctimeout.optional = true
97 ip6addr = section:taboption("advanced", Value, "ip6addr",
98 translate("Local IPv6 address"),
99 translate("IPv6 address delegated to the local tunnel endpoint (optional)"))
100 ip6addr.datatype = "ip6addr"
101 ip6addr.optional = true
104 defaultroute = section:taboption("advanced", Flag, "defaultroute",
105 translate("Default route"),
106 translate("Whether to create an IPv6 default route over the tunnel"))
107 defaultroute.default = defaultroute.enabled
108 defaultroute.optional = true
111 sourcerouting = section:taboption("advanced", Flag, "sourcerouting",
112 translate("Source routing"),
113 translate("Whether to route only packets from delegated prefixes"))
114 sourcerouting.default = sourcerouting.enabled
115 sourcerouting.optional = true
118 metric = section:taboption("advanced", Value, "metric",
119 translate("Use gateway metric"))
120 metric.datatype = "uinteger"
121 metric.placeholder = "0"
122 metric:depends("defaultroute", defaultroute.enabled)
125 ttl = section:taboption("advanced", Value, "ttl",
126 translate("Use TTL on tunnel interface"))
127 ttl.datatype = "range(1,255)"
128 ttl.placeholder = "64"
131 mtu = section:taboption("advanced", Value, "mtu",
132 translate("Use MTU on tunnel interface"),
133 translate("minimum 1280, maximum 1480"))
134 mtu.datatype = "range(1280,1480)"
135 mtu.placeholder = "1280"