olsrdhna.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. -- Copyright 2008 Steven Barth <steven@midlink.org>
  2. -- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
  3. -- Licensed to the public under the Apache License 2.0.
  4. local uci = require "luci.model.uci".cursor()
  5. local ipv = uci:get_first("olsrd", "olsrd", "IpVersion", "4")
  6. mh = Map("olsrd", translate("OLSR - HNA-Announcements"), translate("Hosts in a OLSR routed network can announce connecitivity " ..
  7. "to external networks using HNA messages."))
  8. if ipv == "6and4" or ipv == "4" then
  9. hna4 = mh:section(TypedSection, "Hna4", translate("Hna4"), translate("Both values must use the dotted decimal notation."))
  10. hna4.addremove = true
  11. hna4.anonymous = true
  12. hna4.template = "cbi/tblsection"
  13. net4 = hna4:option(Value, "netaddr", translate("Network address"))
  14. net4.datatype = "ip4addr"
  15. net4.placeholder = "10.11.12.13"
  16. net4.default = "10.11.12.13"
  17. msk4 = hna4:option(Value, "netmask", translate("Netmask"))
  18. msk4.datatype = "ip4addr"
  19. msk4.placeholder = "255.255.255.255"
  20. msk4.default = "255.255.255.255"
  21. end
  22. if ipv == "6and4" or ipv == "6" then
  23. hna6 = mh:section(TypedSection, "Hna6", translate("Hna6"), translate("IPv6 network must be given in full notation, " ..
  24. "prefix must be in CIDR notation."))
  25. hna6.addremove = true
  26. hna6.anonymous = true
  27. hna6.template = "cbi/tblsection"
  28. net6 = hna6:option(Value, "netaddr", translate("Network address"))
  29. net6.datatype = "ip6addr"
  30. net6.placeholder = "fec0:2200:106:0:0:0:0:0"
  31. net6.default = "fec0:2200:106:0:0:0:0:0"
  32. msk6 = hna6:option(Value, "prefix", translate("Prefix"))
  33. msk6.datatype = "range(0,128)"
  34. msk6.placeholder = "128"
  35. msk6.default = "128"
  36. end
  37. return mh