diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-01-29 03:27:37 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-01-29 03:27:37 +0000 |
commit | a707d2cb84459d8f92eebadec86eeefb16c0548e (patch) | |
tree | 2890b55c1c7c2420211d232bec113a472ac4e57c /applications/luci-radvd/luasrc/model/cbi/radvd | |
parent | c2b107ed46571a1494d74d4c1af3bb22b8b2f821 (diff) |
applications/luci-radvd: sync with OpenWrt trunk changes
Diffstat (limited to 'applications/luci-radvd/luasrc/model/cbi/radvd')
4 files changed, 59 insertions, 16 deletions
diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/interface.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/interface.lua index ae8e062cba..519664cdc2 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/interface.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/interface.lua @@ -13,6 +13,7 @@ $Id$ ]]-- local sid = arg[1] +local utl = require "luci.util" m = Map("radvd", translatef("Radvd - Interface %q", "?"), translate("Radvd is a router advertisement daemon for IPv6. " .. @@ -84,6 +85,22 @@ function o.write(self, section, value) end +o = s:taboption("general", DynamicList, "client", translate("Clients"), + translate("Restrict communication to specified clients, leave empty to use multicast")) + +o.rmempty = true +o.datatype = "ip6addr" +o.placeholder = "any" +function o.cfgvalue(...) + local v = Value.cfgvalue(...) + local l = { } + for v in utl.imatch(v) do + l[#l+1] = v + end + return l +end + + o = s:taboption("general", Flag, "AdvSendAdvert", translate("Enable advertisements"), translate("Enables router advertisements and solicitations")) diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua index d3567cb0e8..6151910649 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua @@ -13,6 +13,7 @@ $Id$ ]]-- local sid = arg[1] +local utl = require "luci.util" m = Map("radvd", translatef("Radvd - Prefix"), translate("Radvd is a router advertisement daemon for IPv6. " .. @@ -75,11 +76,20 @@ function o.write(self, section, value) end -o = s:taboption("general", Value, "prefix", translate("Prefix"), - translate("Advertised IPv6 prefix. If empty, the current interface prefix is used")) +o = s:taboption("general", DynamicList, "prefix", translate("Prefixes"), + translate("Advertised IPv6 prefixes. If empty, the current interface prefix is used")) -o.optional = true -o.datatype = "ip6addr" +o.optional = true +o.datatype = "ip6addr" +o.placeholder = translate("default") +function o.cfgvalue(self, section) + local l = { } + local v = m.uci:get_list("radvd", section, "prefix") + for v in utl.imatch(v) do + l[#l+1] = v + end + return l +end o = s:taboption("general", Flag, "AdvOnLink", translate("On-link determination"), diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua index 91cf25c665..5313bbe3fa 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/rdnss.lua @@ -13,6 +13,7 @@ $Id$ ]]-- local sid = arg[1] +local utl = require "luci.util" m = Map("radvd", translatef("Radvd - RDNSS"), translate("Radvd is a router advertisement daemon for IPv6. " .. @@ -72,16 +73,21 @@ function o.write(self, section, value) end -o = s:option(Value, "addr", translate("Address"), +o = s:option(DynamicList, "addr", translate("Addresses"), translate("Advertised IPv6 RDNSS. If empty, the current IPv6 address of the interface is used")) -o.optional = false -o.rmempty = true -o.datatype = "ip6addr" - - -o = s:option(Flag, "AdvRDNSSOpen", translate("Open"), - translate("Indicates whether that RDNSS continues to be available to hosts even if they moved to a different subnet ")) +o.optional = false +o.rmempty = true +o.datatype = "ip6addr" +o.placeholder = translate("default") +function o.cfgvalue(self, section) + local l = { } + local v = m.uci:get_list("radvd", section, "prefix") + for v in utl.imatch(v) do + l[#l+1] = v + end + return l +end o = s:option(Value, "AdvRDNSSLifetime", translate("Lifetime"), diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua index 6e84d0fb25..37fac576b4 100644 --- a/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua +++ b/applications/luci-radvd/luasrc/model/cbi/radvd/route.lua @@ -13,6 +13,7 @@ $Id$ ]]-- local sid = arg[1] +local utl = require "luci.util" m = Map("radvd", translatef("Radvd - Route"), translate("Radvd is a router advertisement daemon for IPv6. " .. @@ -72,11 +73,20 @@ function o.write(self, section, value) end -o = s:option(Value, "prefix", translate("Prefix"), - translate("Advertised IPv6 prefix")) +o = s:option(DynamicList, "prefix", translate("Prefixes"), + translate("Advertised IPv6 prefixes")) -o.rmempty = false -o.datatype = "ip6addr" +o.rmempty = false +o.datatype = "ip6addr" +o.placeholder = translate("default") +function o.cfgvalue(self, section) + local l = { } + local v = m.uci:get_list("radvd", section, "prefix") + for v in utl.imatch(v) do + l[#l+1] = v + end + return l +end o = s:option(Value, "AdvRouteLifetime", translate("Lifetime"), |