summaryrefslogtreecommitdiffstats
path: root/snort-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-21 00:34:22 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-21 00:34:22 +0000
commit9c7c3db17d1f67f0ffcacc58e4e4dd57a61594cf (patch)
tree0af85240681cfff24441e48d02d047041ccff430 /snort-model.lua
parentbb316d50d3ed0eeec998b7ea535dc587ef2fff21 (diff)
downloadacf-snort-9c7c3db17d1f67f0ffcacc58e4e4dd57a61594cf.tar.bz2
acf-snort-9c7c3db17d1f67f0ffcacc58e4e4dd57a61594cf.tar.xz
Remove all calls to 'module' in preparation for move to Lua 5.2
Use mymodule parameter for module definition. This was also helpful in revealing places where the code relied on the global environment.
Diffstat (limited to 'snort-model.lua')
-rw-r--r--snort-model.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/snort-model.lua b/snort-model.lua
index c8c7d83..6c633a3 100644
--- a/snort-model.lua
+++ b/snort-model.lua
@@ -1,5 +1,5 @@
-- acf model for displaying logfiles recusivly
-module (..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -17,19 +17,19 @@ local alertfile = "/var/log/snort/alert"
-- ################################################################################
-- PUBLIC FUNCTIONS
-function getstatus()
+function mymodule.getstatus()
return modelfunctions.getstatus(processname, packagename, "Snort Status")
end
-function get_startstop(self, clientdata)
+function mymodule.get_startstop(self, clientdata)
return modelfunctions.get_startstop(processname)
end
-function startstop_service(self, startstop, action)
+function mymodule.startstop_service(self, startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
-function read_alert()
+function mymodule.read_alert()
local alertpriority = {}
local liboutput = fs.read_file_as_array(alertfile)
if (liboutput) then
@@ -77,10 +77,12 @@ function read_alert()
return cfe({ type="structure", value=sorted_table, label="Snort Alerts" })
end
-function get_filedetails()
+function mymodule.get_filedetails()
return modelfunctions.getfiledetails(configfile)
end
-function update_filedetails(self, filedetails)
+function mymodule.update_filedetails(self, filedetails)
return modelfunctions.setfiledetails(self, filedetails, {configfile})
end
+
+return mymodule