proto_6rd.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. -- Copyright 2011-2012 Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local map, section, net = ...
  4. local ipaddr, peeraddr, ip6addr, tunnelid, username, password
  5. local defaultroute, metric, ttl, mtu
  6. ipaddr = s:taboption("general", Value, "ipaddr",
  7. translate("Local IPv4 address"),
  8. translate("Leave empty to use the current WAN address"))
  9. ipaddr.datatype = "ip4addr"
  10. peeraddr = s:taboption("general", Value, "peeraddr",
  11. translate("Remote IPv4 address"),
  12. translate("This IPv4 address of the relay"))
  13. peeraddr.rmempty = false
  14. peeraddr.datatype = "ip4addr"
  15. ip6addr = s:taboption("general", Value, "ip6prefix",
  16. translate("IPv6 prefix"),
  17. translate("The IPv6 prefix assigned to the provider, usually ends with <code>::</code>"))
  18. ip6addr.rmempty = false
  19. ip6addr.datatype = "ip6addr"
  20. ip6prefixlen = s:taboption("general", Value, "ip6prefixlen",
  21. translate("IPv6 prefix length"),
  22. translate("The length of the IPv6 prefix in bits"))
  23. ip6prefixlen.placeholder = "16"
  24. ip6prefixlen.datatype = "range(0,128)"
  25. ip6prefixlen = s:taboption("general", Value, "ip4prefixlen",
  26. translate("IPv4 prefix length"),
  27. translate("The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses."))
  28. ip6prefixlen.placeholder = "0"
  29. ip6prefixlen.datatype = "range(0,32)"
  30. defaultroute = section:taboption("advanced", Flag, "defaultroute",
  31. translate("Default gateway"),
  32. translate("If unchecked, no default route is configured"))
  33. defaultroute.default = defaultroute.enabled
  34. metric = section:taboption("advanced", Value, "metric",
  35. translate("Use gateway metric"))
  36. metric.placeholder = "0"
  37. metric.datatype = "uinteger"
  38. metric:depends("defaultroute", defaultroute.enabled)
  39. ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
  40. ttl.placeholder = "64"
  41. ttl.datatype = "range(1,255)"
  42. mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
  43. mtu.placeholder = "1280"
  44. mtu.datatype = "max(9200)"