Commit 14e6f61b authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

enforce common base class for all objects

parent 31a02a4d
......@@ -69,7 +69,7 @@ end
PolicySet = policy.PolicySet
Config = object.class(object.Object)
Config = object.class()
function Config:init(policyconfig)
......
......@@ -9,7 +9,7 @@ module(..., package.seeall)
require 'awall.object'
IPSet = awall.object.class(awall.object.Object)
IPSet = awall.object.class()
function IPSet:init(config) self.config = config or {} end
......
......@@ -31,7 +31,7 @@ builtin = {filter={'FORWARD', 'INPUT', 'OUTPUT'},
local backupdir = '/var/run/awall'
local BaseIPTables = class(awall.object.Object)
local BaseIPTables = class()
function BaseIPTables:print()
for family, tbls in pairs(families) do
......
......@@ -20,7 +20,7 @@ local combinations = awall.optfrag.combinations
class = awall.object.class
ConfigObject = class(awall.object.Object)
ConfigObject = class()
function ConfigObject:init(context, location)
if context then
......
......@@ -19,7 +19,7 @@ local combinations = awall.optfrag.combinations
local extend = awall.util.extend
Log = awall.object.class(awall.object.Object)
Log = awall.object.class()
function Log:matchopts()
return self.limit and '-m limit --limit '..self.limit..'/second'
......
......@@ -11,6 +11,7 @@ function class(base)
local cls = {}
local mt = {__index = cls}
if not base and Object then base = Object end
if base then setmetatable(cls, {__index = base}) end
function cls.new(...) return cls.morph({}, unpack(arg)) end
......
......@@ -17,7 +17,7 @@ local object = awall.object
local util = awall.util
local PolicyConfig = object.class(object.Object)
local PolicyConfig = awall.object.class()
function PolicyConfig:init(data, source, policies)
self.data = data
......@@ -109,7 +109,7 @@ local function list(dirs)
end
PolicySet = object.class(object.Object)
PolicySet = object.class()
function PolicySet:init(confdirs, importdirs)
self.autodirs = confdirs or {'/usr/share/awall/mandatory', '/etc/awall'}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment