summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-chillispot/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-09-23 23:17:45 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-09-23 23:17:45 +0000
commite3260d06bd3ace4becf0a4ac9d4ca3fd1b727a0d (patch)
tree120c7de99a18e1100d37546d07e4d5c1f0b8dda6 /applications/luci-chillispot/luasrc/model
parent0227e3cea1bbe3b9574d13b729129695aed017d3 (diff)
* luci/applications: add initial chillispot package (incomplete)
Diffstat (limited to 'applications/luci-chillispot/luasrc/model')
-rw-r--r--applications/luci-chillispot/luasrc/model/cbi/chillispot.lua36
-rw-r--r--applications/luci-chillispot/luasrc/model/cbi/chillispot_macauth.lua30
-rw-r--r--applications/luci-chillispot/luasrc/model/cbi/chillispot_network.lua65
-rw-r--r--applications/luci-chillispot/luasrc/model/cbi/chillispot_radius.lua64
4 files changed, 195 insertions, 0 deletions
diff --git a/applications/luci-chillispot/luasrc/model/cbi/chillispot.lua b/applications/luci-chillispot/luasrc/model/cbi/chillispot.lua
new file mode 100644
index 000000000..6c79d7456
--- /dev/null
+++ b/applications/luci-chillispot/luasrc/model/cbi/chillispot.lua
@@ -0,0 +1,36 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+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("chillispot")
+
+-- general
+s1 = m:section(TypedSection, "general")
+s1.anonymous = true
+
+s1:option( Flag, "debug" )
+s1:option( Value, "interval" )
+s1:option( Value, "pidfile" ).optional = true
+s1:option( Value, "statedir" ).optional = true
+
+-- remote config management
+s2 = m:section(TypedSection, "remoteconfig")
+s2.anonymous = true
+
+s2:option( Value, "confusername" )
+s2:option( Value, "confpassword" )
+
+
+return m
diff --git a/applications/luci-chillispot/luasrc/model/cbi/chillispot_macauth.lua b/applications/luci-chillispot/luasrc/model/cbi/chillispot_macauth.lua
new file mode 100644
index 000000000..710b2165c
--- /dev/null
+++ b/applications/luci-chillispot/luasrc/model/cbi/chillispot_macauth.lua
@@ -0,0 +1,30 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+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("chillispot")
+
+
+-- mac authentication
+s = m:section(TypedSection, "macauth")
+s.anonymous = true
+
+s:option( Flag, "macauth" )
+s:option( DynamicList, "macallowed" )
+s:option( Value, "macpasswd" ).optional = true
+s:option( Value, "macsuffix" ).optional = true
+
+
+return m
diff --git a/applications/luci-chillispot/luasrc/model/cbi/chillispot_network.lua b/applications/luci-chillispot/luasrc/model/cbi/chillispot_network.lua
new file mode 100644
index 000000000..b75fc5fb4
--- /dev/null
+++ b/applications/luci-chillispot/luasrc/model/cbi/chillispot_network.lua
@@ -0,0 +1,65 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+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$
+]]--
+
+require("luci.sys")
+require("luci.ip")
+
+m = Map("chillispot")
+
+-- tun
+s1 = m:section(TypedSection, "tun")
+s1.anonymous = true
+
+net = s1:option( Value, "net" )
+for _, route in ipairs(luci.sys.net.routes()) do
+ if route.Iface ~= "lo" and route.Mask ~= "FFFFFFFF" then
+ local netmask = luci.ip.IPv4(route.Mask)
+ if netmask then
+ local netaddr = luci.ip.IPv4(route.Destination, netmask)
+ if netaddr then
+ net:value( netaddr:string() )
+ end
+ end
+ end
+end
+
+s1:option( Value, "dynip" ).optional = true
+s1:option( Value, "statip" ).optional = true
+
+s1:option( Value, "dns1" ).optional = true
+s1:option( Value, "dns2" ).optional = true
+s1:option( Value, "domain" ).optional = true
+
+s1:option( Value, "ipup" ).optional = true
+s1:option( Value, "ipdown" ).optional = true
+
+s1:option( Value, "conup" ).optional = true
+s1:option( Value, "condown" ).optional = true
+
+
+-- dhcp config
+s2 = m:section(TypedSection, "dhcp")
+s2.anonymous = true
+
+dif = s2:option( Value, "dhcpif" )
+for _, nif in ipairs(luci.sys.net.devices()) do
+ if nif ~= "lo" then dif:value(nif) end
+end
+
+s2:option( Value, "dhcpmac" ).optional = true
+s2:option( Value, "lease" ).optional = true
+
+
+return m
diff --git a/applications/luci-chillispot/luasrc/model/cbi/chillispot_radius.lua b/applications/luci-chillispot/luasrc/model/cbi/chillispot_radius.lua
new file mode 100644
index 000000000..8b7ba59b4
--- /dev/null
+++ b/applications/luci-chillispot/luasrc/model/cbi/chillispot_radius.lua
@@ -0,0 +1,64 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+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("chillispot")
+
+
+-- uam config
+s1 = m:section(TypedSection, "uam")
+s1.anonymous = true
+
+s1:option( Value, "uamserver" )
+s1:option( Value, "uamsecret" ).password = true
+s1:option( Flag, "uamanydns" )
+s1:option( Value, "uamhomepage" ).optional = true
+s1:option( Value, "uamlisten" ).optional = true
+s1:option( Value, "uamport" ).optional = true
+s1:option( DynamicList, "uamallowed" ).optional = true
+
+
+-- radius server
+s2 = m:section(TypedSection, "radius")
+s2.anonymous = true
+
+s2:option( Value, "radiusserver1" )
+s2:option( Value, "radiusserver2" )
+s2:option( Value, "radiussecret" ).password = true
+
+s2:option( Value, "radiuslisten" ).optional = true
+s2:option( Value, "radiusauthport" ).optional = true
+s2:option( Value, "radiusacctport" ).optional = true
+
+s2:option( Value, "radiusnasid" ).optional = true
+s2:option( Value, "radiusnasip" ).optional = true
+
+s2:option( Value, "radiuscalled" ).optional = true
+s2:option( Value, "radiuslocationid" ).optional = true
+s2:option( Value, "radiuslocationname" ).optional = true
+
+
+-- radius proxy
+s3 = m:section(TypedSection, "proxy")
+s3.anonymous = true
+
+s3:option( Value, "proxylisten" ).optional = true
+s3:option( Value, "proxyport" ).optional = true
+s3:option( Value, "proxyclient" ).optional = true
+ps = s3:option( Value, "proxysecret" )
+ps.optional = true
+ps.password = true
+
+return m