applications/luci-olsr: use correct config file for IPv6 plugin config
[project/luci.git] / applications / luci-olsr / luasrc / model / cbi / olsr / olsrdplugins.lua
index a387c4c..bd72c56 100644 (file)
@@ -19,11 +19,11 @@ local fs = require "nixio.fs"
 if arg[1] then
        mp = Map("olsrd", translate("OLSR - Plugins"))
 
-       p = mp:section(TypedSection, "LoadPlugin")
+       p = mp:section(TypedSection, "LoadPlugin", translate("Plugin configuration"))
        p:depends("library", arg[1])
        p.anonymous = true
 
-       ign = p:option(Flag, "ignore", "Enable")
+       ign = p:option(Flag, "ignore", translate("Enable"))
        ign.enabled  = "0"
        ign.disabled = "1"
        ign.rmempty  = false
@@ -74,45 +74,50 @@ if arg[1] then
 
        local knownPlParams = {
                ["olsrd_bmf.so.1.5.3"] = {
-                       { Value,                "BmfInterface",                 "bmf0" },
-                       { Value,                "BmfInterfaceIp",               "10.10.10.234/24" },
-                       { Flag,                 "DoLocalBroadcast",             "no" },
-                       { Flag,                 "CapturePacketsOnOlsrInterfaces", "yes" },
+                       { Value,        "BmfInterface",                 "bmf0" },
+                       { Value,        "BmfInterfaceIp",               "10.10.10.234/24" },
+                       { Flag,         "DoLocalBroadcast",             "no" },
+                       { Flag,         "CapturePacketsOnOlsrInterfaces", "yes" },
                        { ListValue,    "BmfMechanism",                 { "UnicastPromiscuous", "Broadcast" } },
-                       { Value,                "BroadcastRetransmitCount",     "2" },
-                       { Value,                "FanOutLimit",                  "4" },
+                       { Value,        "BroadcastRetransmitCount",     "2" },
+                       { Value,        "FanOutLimit",                  "4" },
                        { DynamicList,  "NonOlsrIf",                    "br-lan" }
                },
 
                ["olsrd_dyn_gw.so.0.4"] = {
-                       { Value,                "Interval",                             "40" },
-                       { DynamicList,  "Ping",                                 "141.1.1.1" },
-                       { DynamicList,  "HNA",                                  "192.168.80.0/24", IpMask2Cidr, Cidr2IpMask }
+                       { Value,        "Interval",                     "40" },
+                       { DynamicList,  "Ping",                         "141.1.1.1" },
+                       { DynamicList,  "HNA",                          "192.168.80.0/24", IpMask2Cidr, Cidr2IpMask }
                },
 
                ["olsrd_httpinfo.so.0.1"] = {
-                       { Value,                "port",                                 "80" },
-                       { DynamicList,  "Host",                                 "163.24.87.3" },
-                       { DynamicList,  "Net",                                  "0.0.0.0/0", IpMask2Cidr, Cidr2IpMask }
+                       { Value,        "port",                         "80" },
+                       { DynamicList,  "Host",                         "163.24.87.3" },
+                       { DynamicList,  "Net",                          "0.0.0.0/0", Cidr2IpMask }
                },
 
                ["olsrd_nameservice.so.0.3"] = {
-                       { DynamicList,  "name",                                 "my-name.mesh" },
-                       { DynamicList,  "hosts",                                "1.2.3.4 name-for-other-interface.mesh" },
-                       { Value,                "suffix",                               ".olsr" },
-                       { Value,                "hosts_file",                   "/path/to/hosts_file" },
-                       { Value,                "add_hosts",                    "/path/to/file" },
-                       { Value,                "dns_server",                   "141.1.1.1" },
-                       { Value,                "resolv_file",                  "/path/to/resolv.conf" },
-                       { Value,                "interval",                             "120" },
-                       { Value,                "timeout",                              "240" },
-                       { Value,                "lat",                                  "12.123" },
-                       { Value,                "lon",                                  "12.123" },
-                       { Value,                "latlon_file",                  "/var/run/latlon.js" },
-                       { Value,                "latlon_infile",                "/var/run/gps.txt" },
-                       { Value,                "sighup_pid_file",              "/var/run/dnsmasq.pid" },
-                       { Value,                "name_change_script",   "/usr/local/bin/announce_new_hosts.sh" },
-                       { Value,                "services_change_script",       "/usr/local/bin/announce_new_services.sh" }
+                       { DynamicList,  "name",                         "my-name.mesh" },
+                       { DynamicList,  "hosts",                        "1.2.3.4 name-for-other-interface.mesh" },
+                       { Value,        "suffix",                       ".olsr" },
+                       { Value,        "hosts_file",                   "/path/to/hosts_file" },
+                       { Value,        "add_hosts",                    "/path/to/file" },
+                       { Value,        "dns_server",                   "141.1.1.1" },
+                       { Value,        "resolv_file",                  "/path/to/resolv.conf" },
+                       { Value,        "interval",                     "120" },
+                       { Value,        "timeout",                      "240" },
+                       { Value,        "lat",                          "12.123" },
+                       { Value,        "lon",                          "12.123" },
+                       { Value,        "latlon_file",                  "/var/run/latlon.js" },
+                       { Value,        "latlon_infile",                "/var/run/gps.txt" },
+                       { Value,        "sighup_pid_file",              "/var/run/dnsmasq.pid" },
+                       { Value,        "name_change_script",           "/usr/local/bin/announce_new_hosts.sh" },
+                       { DynamicList,  "service",                      "http://me.olsr:80|tcp|my little homepage" },
+                       { Value,        "services_file",                "/var/run/services_olsr" },
+                       { Value,        "services_change_script",       "/usr/local/bin/announce_new_services.sh" },
+                        { DynamicList, "mac",                          "xx:xx:xx:xx:xx:xx[,0-255]" },
+                       { Value,        "macs_file",                    "/path/to/macs_file" },
+                       { Value,        "macs_change_script",           "/path/to/script" }
                },
 
                ["olsrd_quagga.so.0.2.2"] = {
@@ -121,25 +126,37 @@ if arg[1] then
                                "ospf6", "isis", "bgp", "hsls"
                        } },
                        { ListValue,    "ExportRoutes",                 { "only", "both" } },
-                       { Flag,                 "LocalPref",                    "true" },
-                       { Value,                "Distance",                             Range(0,255) }
+                       { Flag,         "LocalPref",                    "true" },
+                       { Value,        "Distance",                     Range(0,255) }
                },
 
                ["olsrd_secure.so.0.5"] = {
-                       { Value,                "Keyfile",                              "/etc/private-olsr.key" }
+                       { Value,        "Keyfile",                      "/etc/private-olsr.key" }
                },
 
                ["olsrd_txtinfo.so.0.1"] = {
-                       { Value,                "accept",                               "10.247.200.4" }
+                       { Value,        "accept",                       "127.0.0.1" }
+               },
+
+               ["olsrd_jsoninfo.so.0.0"] = {
+                       { Value,        "accept",                       "127.0.0.1" },
+                       { Value,        "port",                         "9090" },
+                       { Value,        "UUIDFile",                     "/etc/olsrd/olsrd.uuid" },
+
                },
 
                ["olsrd_watchdog.so.0.1"] = {
-                       { Value,                "file",                                 "/var/run/olsrd.watchdog" },
-                       { Value,                "interval",                             "30" }
+                       { Value,        "file",                         "/var/run/olsrd.watchdog" },
+                       { Value,        "interval",                     "30" }
                },
 
                ["olsrd_mdns.so.1.0.0"] = {
-                       { DynamicList,  "NonOlsrIf",                    "br-lan" }
+                       { DynamicList,  "NonOlsrIf",                    "lan" }
+               },
+
+               ["olsrd_p2pd.so.0.1.0"] = {
+                       { DynamicList,  "NonOlsrIf",                    "lan" },
+                       { Value,        "P2pdTtl",                      "10" }
                },
 
                ["olsrd_arprefresh.so.0.1"]             = {},
@@ -162,7 +179,7 @@ if arg[1] then
                        end
 
                        if otype == Flag then
-                               local bool = p:option( Flag, name )
+                               local bool = p:option( Flag, name, name )
                                if default == "yes" or default == "no" then
                                        bool.enabled  = "yes"
                                        bool.disabled = "no"
@@ -180,7 +197,7 @@ if arg[1] then
                                bool.default = default
                                bool:depends({ library = plugin })
                        else
-                               local field = p:option( otype, name )
+                               local field = p:option( otype, name, name )
                                if values then
                                        for _, value in ipairs(values) do
                                                field:value( value )
@@ -207,7 +224,7 @@ if arg[1] then
 
 else
 
-       mpi = Map("olsrd", "OLSR - Plugins")
+       mpi = Map("olsrd", translate("OLSR - Plugins"))
 
        local plugins = {}
        mpi.uci:foreach("olsrd", "LoadPlugin",
@@ -230,7 +247,7 @@ else
                end
        end
 
-       t = mpi:section( TypedSection, "LoadPlugin", "Plugins" )
+       t = mpi:section( TypedSection, "LoadPlugin", translate("Plugins") )
        t.anonymous = true
        t.template  = "cbi/tblsection"
        t.override_scheme = true
@@ -239,7 +256,7 @@ else
                return luci.dispatcher.build_url("admin", "services", "olsrd", "plugins") .. "/" .. lib
        end
 
-       ign = t:option( Flag, "ignore", "Enabled" )
+       ign = t:option( Flag, "ignore", translate("Enabled") )
        ign.enabled  = "0"
        ign.disabled = "1"
        ign.rmempty  = false
@@ -247,7 +264,7 @@ else
                return Flag.cfgvalue(self, section) or "0"
        end
 
-       t:option( DummyValue, "library", "Library" )
+       t:option( DummyValue, "library", translate("Library") )
 
        return mpi
 end