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.
5 local uci = require "luci.model.uci".cursor()
6 local ipv = uci:get_first("olsrd", "olsrd", "IpVersion", "4")
8 mh = Map("olsrd", translate("OLSR - HNA-Announcements"), translate("Hosts in a OLSR routed network can announce connecitivity " ..
9 "to external networks using HNA messages."))
11 if ipv == "6and4" or ipv == "4" then
12 hna4 = mh:section(TypedSection, "Hna4", translate("Hna4"), translate("Both values must use the dotted decimal notation."))
15 hna4.template = "cbi/tblsection"
17 net4 = hna4:option(Value, "netaddr", translate("Network address"))
18 net4.datatype = "ip4addr"
19 net4.placeholder = "10.11.12.13"
20 net4.default = "10.11.12.13"
21 msk4 = hna4:option(Value, "netmask", translate("Netmask"))
22 msk4.datatype = "ip4addr"
23 msk4.placeholder = "255.255.255.255"
24 msk4.default = "255.255.255.255"
27 if ipv == "6and4" or ipv == "6" then
28 hna6 = mh:section(TypedSection, "Hna6", translate("Hna6"), translate("IPv6 network must be given in full notation, " ..
29 "prefix must be in CIDR notation."))
32 hna6.template = "cbi/tblsection"
34 net6 = hna6:option(Value, "netaddr", translate("Network address"))
35 net6.datatype = "ip6addr"
36 net6.placeholder = "fec0:2200:106:0:0:0:0:0"
37 net6.default = "fec0:2200:106:0:0:0:0:0"
38 msk6 = hna6:option(Value, "prefix", translate("Prefix"))
39 msk6.datatype = "range(0,128)"
40 msk6.placeholder = "128"