diff --git a/awall/family.lua b/awall/family.lua new file mode 100644 index 0000000000000000000000000000000000000000..ceb627ead1f32ad9018a9f9026017239b551fa40 --- /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 da2009c53bb4f8770d3d7bb8f5da09967457a8d8..8daffa9f52f78de2e77b3f762688e17e65cbd929 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 701794ef09a8fb0fa4a0a2dac7e10d3846ee9a48..33a2eedb73d6d7176e54140452b074f3344d05a5 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 7fd369505526915d2e80b99e7419aa430ebc7aab..1ca4796757c34e44c0de5c4a35f9d80405fb8d4d 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 = {...}