2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
16 local uci = require "luci.model.uci".cursor()
17 local ipv = uci:get_first("olsrd", "olsrd", "IpVersion", "4")
19 mh = Map("olsrd", translate("OLSR - HNA-Announcements"), translate("Hosts in a OLSR routed network can announce connecitivity " ..
20 "to external networks using HNA messages."))
22 if ipv == "6and4" or ipv == "4" then
23 hna4 = mh:section(TypedSection, "Hna4", translate("Hna4"), translate("Both values must use the dotted decimal notation."))
26 hna4.template = "cbi/tblsection"
28 net4 = hna4:option(Value, "netaddr", translate("Network address"))
29 net4.datatype = "ip4addr"
30 net4.placeholder = "10.11.12.13"
31 net4.default = "10.11.12.13"
32 msk4 = hna4:option(Value, "netmask", translate("Netmask"))
33 msk4.datatype = "ip4addr"
34 msk4.placeholder = "255.255.255.255"
35 msk4.default = "255.255.255.255"
38 if ipv == "6and4" or ipv == "6" then
39 hna6 = mh:section(TypedSection, "Hna6", translate("Hna6"), translate("IPv6 network must be given in full notation, " ..
40 "prefix must be in CIDR notation."))
43 hna6.template = "cbi/tblsection"
45 net6 = hna6:option(Value, "netaddr", translate("Network address"))
46 net6.datatype = "ip6addr"
47 net6.placeholder = "fec0:2200:106:0:0:0:0:0"
48 net6.default = "fec0:2200:106:0:0:0:0:0"
49 msk6 = hna6:option(Value, "prefix", translate("Prefix"))
50 msk6.datatype = "range(0,128)"
51 msk6.placeholder = "128"