-mh = Map("olsrd", translate("olsrd_hna", "OLSR - HNA-Ankündigungen"))
-
-for i, sect in ipairs({ "Hna4", "Hna6" }) do
- hna = mh:section(TypedSection, sect)
- hna.addremove = true
- hna.anonymous = true
- hna.template = "cbi/tblsection"
+local uci = require "luci.model.uci".cursor()
+local ipv = uci:get_first("olsrd", "olsrd", "IpVersion", "4")
+
+mh = Map("olsrd", translate("OLSR - HNA-Announcements"), translate("Hosts in a OLSR routed network can announce connecitivity " ..
+ "to external networks using HNA messages."))
+
+if ipv == "6and4" or ipv == "4" then
+ hna4 = mh:section(TypedSection, "Hna4", translate("Hna4"), translate("Both values must use the dotted decimal notation."))
+ hna4.addremove = true
+ hna4.anonymous = true
+ hna4.template = "cbi/tblsection"
+
+ net4 = hna4:option(Value, "netaddr", translate("Network address"))
+ net4.datatype = "ip4addr"
+ net4.placeholder = "10.11.12.13"
+ net4.default = "10.11.12.13"
+ msk4 = hna4:option(Value, "netmask", translate("Netmask"))
+ msk4.datatype = "ip4addr"
+ msk4.placeholder = "255.255.255.255"
+ msk4.default = "255.255.255.255"
+end