summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2014-10-28 18:03:18 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2014-10-28 18:03:18 +0100
commit267a2e85486a498d85d01ba6594d9eb7b250ac5b (patch)
treea69decf973421c7e988f6227baa3045ef78e2ecf
parent2826426c6a518867d695f05e514e41703deac3a1 (diff)
applications/luci-udpxy: add new package.
This adds support for configuring udpxy. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
-rw-r--r--applications/luci-udpxy/Makefile4
-rw-r--r--applications/luci-udpxy/luasrc/controller/udpxy.lua25
-rw-r--r--applications/luci-udpxy/luasrc/model/cbi/udpxy.lua73
-rw-r--r--applications/luci-udpxy/root/etc/uci-defaults/luci-udpxy12
-rw-r--r--contrib/package/luci-addons/Makefile1
5 files changed, 115 insertions, 0 deletions
diff --git a/applications/luci-udpxy/Makefile b/applications/luci-udpxy/Makefile
new file mode 100644
index 000000000..05228b169
--- /dev/null
+++ b/applications/luci-udpxy/Makefile
@@ -0,0 +1,4 @@
+PO = udpxy
+
+include ../../build/config.mk
+include ../../build/module.mk
diff --git a/applications/luci-udpxy/luasrc/controller/udpxy.lua b/applications/luci-udpxy/luasrc/controller/udpxy.lua
new file mode 100644
index 000000000..bc85b0bb0
--- /dev/null
+++ b/applications/luci-udpxy/luasrc/controller/udpxy.lua
@@ -0,0 +1,25 @@
+--[[
+LuCI - Lua Configuration Interface - udpxy support
+
+Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+module("luci.controller.udpxy", package.seeall)
+
+function index()
+ if not nixio.fs.access("/etc/config/udpxy") then
+ return
+ end
+
+ local page = entry({"admin", "services", "udpxy"}, cbi("udpxy"), _("udpxy"))
+ page.dependent = true
+
+end
diff --git a/applications/luci-udpxy/luasrc/model/cbi/udpxy.lua b/applications/luci-udpxy/luasrc/model/cbi/udpxy.lua
new file mode 100644
index 000000000..fb3080afc
--- /dev/null
+++ b/applications/luci-udpxy/luasrc/model/cbi/udpxy.lua
@@ -0,0 +1,73 @@
+--[[
+LuCI - Lua Configuration Interface - udpxy support
+
+Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+m = Map("udpxy", "udpxy", translate("udpxy is a UDP-to-HTTP multicast traffic relay daemon, here you can configure the settings."))
+
+s = m:section(TypedSection, "udpxy", "")
+s.addremove = true
+s.anonymous = false
+
+enable=s:option(Flag, "disabled", translate("Enabled"))
+enable.enabled="0"
+enable.disabled="1"
+enable.default = "1"
+respawn=s:option(Flag, "respawn", translate("Respawn"))
+respawn.default = false
+
+verbose=s:option(Flag, "verbose", translate("Verbose"))
+verbose.default = false
+
+status=s:option(Flag, "status", translate("Status"))
+
+bind=s:option(Value, "bind", translate("Bind IP/Interface"))
+bind.rmempty = true
+bind.datatype = "or(ipaddr, network)"
+
+port=s:option(Value, "port", translate("Port"))
+port.rmempty = true
+port.datatype = "port"
+
+source=s:option(Value, "source", translate("Source IP/Interface"))
+source.rmempty = true
+source.datatype = "or(ipaddr, network)"
+
+max_clients=s:option(Value, "max_clients", translate("Max clients"))
+max_clients.rmempty = true
+max_clients.datatype = "range(1, 5000)"
+
+log_file=s:option(Value, "log_file", translate("Log file"))
+log_file.rmempty = true
+--log_file.datatype = "file"
+
+buffer_size=s:option(Value, "buffer_size", translate("Buffer size"))
+buffer_size.rmempty = true
+buffer_size.datatype = "range(4096,2097152)"
+
+buffer_messages=s:option(Value, "buffer_messages", translate("Buffer messages"))
+buffer_messages.rmempty = true
+buffer_messages.datatype = "or(-1, and(min(1), uinteger))"
+
+buffer_time=s:option(Value, "buffer_time", translate("Buffer time"))
+buffer_time.rmempty = true
+buffer_time.datatype = "or(-1, and(min(1), uinteger))"
+
+nice_increment=s:option(Value, "nice_increment", translate("Nice increment"))
+nice_increment.rmempty = true
+nice_increment.datatype = "or(and(max(-1), integer),and(min(1), integer))"
+
+mcsub_renew=s:option(Value, "mcsub_renew", translate("Multicast subscription renew"))
+mcsub_renew.rmempty = true
+mcsub_renew.datatype = "or(0, range(30, 64000))"
+
+return m
diff --git a/applications/luci-udpxy/root/etc/uci-defaults/luci-udpxy b/applications/luci-udpxy/root/etc/uci-defaults/luci-udpxy
new file mode 100644
index 000000000..e93c07880
--- /dev/null
+++ b/applications/luci-udpxy/root/etc/uci-defaults/luci-udpxy
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# needed for "Save and Apply" to restart udpxy
+uci -q batch <<-EOF >/dev/null
+ delete ucitrack.@udpxy[-1]
+ add ucitrack udpxy
+ set ucitrack.@udpxy[-1].init="udpxy"
+ commit ucitrack
+EOF
+
+rm -f /tmp/luci-indexcache
+exit 0
diff --git a/contrib/package/luci-addons/Makefile b/contrib/package/luci-addons/Makefile
index ac31b639e..9742d0c04 100644
--- a/contrib/package/luci-addons/Makefile
+++ b/contrib/package/luci-addons/Makefile
@@ -171,6 +171,7 @@ $(eval $(call application,diag-devinfo,LuCI Diagnostics Tools (Device Info),\
$(eval $(call application,voice-core,LuCI Voice Software (Core)))
$(eval $(call application,voice-diag,LuCI Voice Software (Diagnostics),luci-app-diag-devinfo))
+$(eval $(call application,udpxy,LuCI Support for udpxy,udpxy))
$(eval $(call application,upnp,Universal Plug & Play configuration module,miniupnpd))
$(eval $(call application,ntpc,NTP time synchronisation configuration module,ntpclient))
$(eval $(call application,ddns,Dynamic DNS configuration module,ddns-scripts))