summaryrefslogtreecommitdiffstats
path: root/dhcp-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp-model.lua')
-rw-r--r--dhcp-model.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/dhcp-model.lua b/dhcp-model.lua
index 2a952f7..4fca1a9 100644
--- a/dhcp-model.lua
+++ b/dhcp-model.lua
@@ -2,6 +2,8 @@
-- Copyright(c) 2007 A. Brodmann - Licensed under terms of GPL2
module (..., package.seeall)
+require("lfs")
+
local subnet = { }
local cfgdir = "/etc/dhcp/"
@@ -18,7 +20,7 @@ subnet_read = function( name )
netmask = cfe({ label="Netmask" }),
leaserangestart = cfe({ label="Lease Range Start" }),
leaserangeend = cfe({ label="Lease Range End" }),
- wpad = cfe({ label="Web Proxy Auto Discovery" })
+ wpad = cfe({ label="Web Proxy Auto Discovery", type="select", option = { "yes", "no" } })
}
for line in io.lines(filename) do
@@ -139,4 +141,17 @@ function nonil( value )
return retval
end
+
+get_subnets = function ()
+
+ local retval = retval or {}
+
+ for sn in lfs.dir( cfgdir ) do
+ if string.sub(sn, -7) == ".subnet" then
+ table.insert(retval, string.sub(sn, 1, -8))
+ end
+ end
+
+ return retval
+end