Merge pull request #250 from openwrt-es/luci-next2
[project/luci.git] / applications / luci-udpxy / luasrc / model / cbi / udpxy.lua
1 --[[
2 LuCI - Lua Configuration Interface - udpxy support
3
4 Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14
15 m = Map("udpxy", "udpxy", translate("udpxy is a UDP-to-HTTP multicast traffic relay daemon, here you can configure the settings."))
16
17 s = m:section(TypedSection, "udpxy", "")
18 s.addremove = true
19 s.anonymous = false
20
21 enable=s:option(Flag, "disabled", translate("Enabled"))
22 enable.enabled="0"
23 enable.disabled="1"
24 enable.default = "1"
25 enable.rmempty = false
26 respawn=s:option(Flag, "respawn", translate("Respawn"))
27 respawn.default = false
28
29 verbose=s:option(Flag, "verbose", translate("Verbose"))
30 verbose.default = false
31
32 status=s:option(Flag, "status", translate("Status"))
33
34 bind=s:option(Value, "bind", translate("Bind IP/Interface"))
35 bind.rmempty = true
36 bind.datatype = "or(ipaddr, network)"
37
38 port=s:option(Value, "port", translate("Port"))
39 port.rmempty = true
40 port.datatype = "port"
41
42 source=s:option(Value, "source", translate("Source IP/Interface"))
43 source.rmempty = true
44 source.datatype = "or(ipaddr, network)"
45
46 max_clients=s:option(Value, "max_clients", translate("Max clients"))
47 max_clients.rmempty = true
48 max_clients.datatype = "range(1, 5000)"
49
50 log_file=s:option(Value, "log_file", translate("Log file"))
51 log_file.rmempty = true
52 --log_file.datatype = "file"
53
54 buffer_size=s:option(Value, "buffer_size", translate("Buffer size"))
55 buffer_size.rmempty = true
56 buffer_size.datatype = "range(4096,2097152)"
57
58 buffer_messages=s:option(Value, "buffer_messages", translate("Buffer messages"))
59 buffer_messages.rmempty = true
60 buffer_messages.datatype = "or(-1, and(min(1), uinteger))"
61
62 buffer_time=s:option(Value, "buffer_time", translate("Buffer time"))
63 buffer_time.rmempty = true
64 buffer_time.datatype = "or(-1, and(min(1), uinteger))"
65
66 nice_increment=s:option(Value, "nice_increment", translate("Nice increment"))
67 nice_increment.rmempty = true
68 nice_increment.datatype = "or(and(max(-1), integer),and(min(1), integer))"
69
70 mcsub_renew=s:option(Value, "mcsub_renew", translate("Multicast subscription renew"))
71 mcsub_renew.rmempty = true
72 mcsub_renew.datatype = "or(0, range(30, 64000))"
73
74 return m