luci-mod-admin-full: routes: add support for route types
authorAndrew Shadura <andrew.shadura@collabora.co.uk>
Sat, 8 Oct 2016 16:29:08 +0000 (18:29 +0200)
committerAndrew Shadura <andrew.shadura@collabora.co.uk>
Sat, 8 Oct 2016 16:41:31 +0000 (18:41 +0200)
Allow specifying route types.

Signed-off-by: Andrew Shadura <andrew.shadura@collabora.co.uk>
modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/routes.lua

index ac02b156e9da25d598b0c2683fdfe3cb1be8a26d..e5f308e6da16c410dd0e01a15dc9cc59b3d7b11e 100644 (file)
@@ -41,6 +41,18 @@ mtu.placeholder = 1500
 mtu.datatype = "range(64,9000)"
 mtu.rmempty = true
 
+routetype = s:option(Value, "type", translate("Route type"))
+routetype:value("", "unicast")
+routetype:value("local", "local")
+routetype:value("broadcast", "broadcast")
+routetype:value("multicast", "multicast")
+routetype:value("unreachable", "unreachable")
+routetype:value("prohibit", "prohibit")
+routetype:value("blackhole", "blackhole")
+routetype:value("anycast", "anycast")
+routetype.default = ""
+routetype.rmempty = true
+
 if fs.access("/proc/net/ipv6_route") then
        s = m:section(TypedSection, "route6", translate("Static IPv6 Routes"))
        s.addremove = true
@@ -68,6 +80,18 @@ if fs.access("/proc/net/ipv6_route") then
        mtu.placeholder = 1500
        mtu.datatype = "range(64,9000)"
        mtu.rmempty = true
+
+       routetype = s:option(Value, "type", translate("Route type"))
+       routetype:value("", "unicast")
+       routetype:value("local", "local")
+       routetype:value("broadcast", "broadcast")
+       routetype:value("multicast", "multicast")
+       routetype:value("unreachable", "unreachable")
+       routetype:value("prohibit", "prohibit")
+       routetype:value("blackhole", "blackhole")
+       routetype:value("anycast", "anycast")
+       routetype.default = ""
+       routetype.rmempty = true
 end