diff options
-rw-r--r-- | awall/init.lua | 6 | ||||
-rw-r--r-- | awall/model.lua | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/awall/init.lua b/awall/init.lua index 6e8697b..fa109ae 100644 --- a/awall/init.lua +++ b/awall/init.lua @@ -45,7 +45,7 @@ function Config:init(confdirs, importdirs) local required = {} local imported = {} - function import(name, fname) + local function import(name, fname) local file if fname then file = io.open(fname) @@ -97,7 +97,7 @@ function Config:init(confdirs, importdirs) end - function expandvars(obj) + local function expandvars(obj) for k, v in pairs(obj) do if type(v) == 'table' then expandvars(v) @@ -135,7 +135,7 @@ function Config:init(confdirs, importdirs) expandvars(self.input) - function insertrule(trule) + local function insertrule(trule) local t = self.iptables.config[trule.family][trule.table][trule.chain] if trule.position == 'prepend' then table.insert(t, 1, trule.opts) diff --git a/awall/model.lua b/awall/model.lua index bc9bd28..0581843 100644 --- a/awall/model.lua +++ b/awall/model.lua @@ -96,10 +96,10 @@ function Rule:checkzoneoptfrag(ofrag) end function Rule:zoneoptfrags() - function zonepair(zin, zout) + local function zonepair(zin, zout) assert(zin ~= zout or not zin) - function zofs(zone, dir) + local function zofs(zone, dir) if not zone then return zone end local ofrags = zone:optfrags(dir) util.map(ofrags, function(x) self:checkzoneoptfrag(x) end) @@ -147,7 +147,7 @@ function Rule:servoptfrags() if not self.service then return end - function containskey(tbl, key) + local function containskey(tbl, key) for k, v in pairs(tbl) do if k == key then return true end end return false end @@ -226,7 +226,7 @@ end function Rule:trules() - function tag(ofrags, tag, value) + local function tag(ofrags, tag, value) for i, ofrag in ipairs(ofrags) do assert(not ofrag[tag]) ofrag[tag] = value @@ -235,7 +235,7 @@ function Rule:trules() local families - function setfamilies(ofrags) + local function setfamilies(ofrags) if ofrags then families = {} for i, ofrag in ipairs(ofrags) do @@ -248,7 +248,7 @@ function Rule:trules() else families = nil end end - function ffilter(ofrags) + local function ffilter(ofrags) if not ofrags or not ofrags[1] or not families then return ofrags end local res = {} for i, ofrag in util.listpairs(ofrags) do @@ -259,7 +259,7 @@ function Rule:trules() return res end - function appendtarget(ofrag, target) + local function appendtarget(ofrag, target) ofrag.opts = (ofrag.opts and ofrag.opts..' ' or '')..'-j '..target end |