proto_aiccu.lua 4.3 KB

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