diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2018-12-13 21:25:51 +0200 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2019-02-02 19:55:31 +0200 |
commit | 06c16f1444e264007a22f48ef1c9cfedab1383e5 (patch) | |
tree | 23d8f7f5c14cd2d7238e1a3607b73c2a7719fc01 | |
parent | 2285a3c183a628cd6f8e8c76000742b815be667c (diff) | |
download | awall-06c16f1444e264007a22f48ef1c9cfedab1383e5.tar.bz2 awall-06c16f1444e264007a22f48ef1c9cfedab1383e5.tar.xz |
optfrag.FAMILIES: move to new module
-rw-r--r-- | awall/family.lua | 7 | ||||
-rw-r--r-- | awall/model.lua | 4 | ||||
-rw-r--r-- | awall/modules/filter.lua | 8 | ||||
-rw-r--r-- | awall/optfrag.lua | 7 |
4 files changed, 17 insertions, 9 deletions
diff --git a/awall/family.lua b/awall/family.lua new file mode 100644 index 0000000..ceb627e --- /dev/null +++ b/awall/family.lua @@ -0,0 +1,7 @@ +--[[ +Address family module for Alpine Wall +Copyright (C) 2012-2019 Kaarle Ritvanen +See LICENSE file for license details +]]-- + +return {ALL={'inet', 'inet6'}} diff --git a/awall/model.lua b/awall/model.lua index da2009c..8daffa9 100644 --- a/awall/model.lua +++ b/awall/model.lua @@ -1,6 +1,6 @@ --[[ Base data model for Alpine Wall -Copyright (C) 2012-2018 Kaarle Ritvanen +Copyright (C) 2012-2019 Kaarle Ritvanen See LICENSE file for license details ]]-- @@ -10,11 +10,11 @@ local M = {} local loadclass = require('awall').loadclass M.class = require('awall.class') +local FAMILIES = require('awall.family').ALL local resolvelist = require('awall.host').resolvelist local builtin = require('awall.iptables').builtin local optfrag = require('awall.optfrag') -local FAMILIES = optfrag.FAMILIES local combinations = optfrag.combinations local prune = optfrag.prune diff --git a/awall/modules/filter.lua b/awall/modules/filter.lua index 701794e..33a2eed 100644 --- a/awall/modules/filter.lua +++ b/awall/modules/filter.lua @@ -1,19 +1,19 @@ --[[ Filter module for Alpine Wall -Copyright (C) 2012-2017 Kaarle Ritvanen +Copyright (C) 2012-2019 Kaarle Ritvanen See LICENSE file for license details ]]-- local loadclass = require('awall').loadclass +local FAMILIES = require('awall.family').ALL local resolve = require('awall.host').resolve local model = require('awall.model') local class = model.class local Rule = model.Rule -local optfrag = require('awall.optfrag') -local combinations = optfrag.combinations +local combinations = require('awall.optfrag').combinations local util = require('awall.util') local contains = util.contains @@ -444,7 +444,7 @@ local fchains = {{chain='FORWARD'}, {chain='INPUT'}, {chain='OUTPUT'}} local function stateful(config) local res = {} - for _, family in ipairs(optfrag.FAMILIES) do + for _, family in ipairs(FAMILIES) do local er = combinations( fchains, diff --git a/awall/optfrag.lua b/awall/optfrag.lua index 7fd3695..1ca4796 100644 --- a/awall/optfrag.lua +++ b/awall/optfrag.lua @@ -1,12 +1,14 @@ --[[ Option fragment module for Alpine Wall -Copyright (C) 2012-2017 Kaarle Ritvanen +Copyright (C) 2012-2019 Kaarle Ritvanen See LICENSE file for license details ]]-- local M = {} +local FAMILIES = require('awall.family').ALL + local util = require('awall.util') local map = util.map @@ -14,8 +16,7 @@ local function ffrags(families) return map(families, function(f) return {family=f} end) end -M.FAMILIES = {'inet', 'inet6'} -M.FAMILYFRAGS = ffrags(M.FAMILIES) +M.FAMILYFRAGS = ffrags(FAMILIES) function M.combinations(of1, ...) local arg = {...} |