Commit 06c16f14 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

optfrag.FAMILIES: move to new module

parent 2285a3c1
--[[
Address family module for Alpine Wall
Copyright (C) 2012-2019 Kaarle Ritvanen
See LICENSE file for license details
]]--
return {ALL={'inet', 'inet6'}}
--[[ --[[
Base data model for Alpine Wall Base data model for Alpine Wall
Copyright (C) 2012-2018 Kaarle Ritvanen Copyright (C) 2012-2019 Kaarle Ritvanen
See LICENSE file for license details See LICENSE file for license details
]]-- ]]--
...@@ -10,11 +10,11 @@ local M = {} ...@@ -10,11 +10,11 @@ local M = {}
local loadclass = require('awall').loadclass local loadclass = require('awall').loadclass
M.class = require('awall.class') M.class = require('awall.class')
local FAMILIES = require('awall.family').ALL
local resolvelist = require('awall.host').resolvelist local resolvelist = require('awall.host').resolvelist
local builtin = require('awall.iptables').builtin local builtin = require('awall.iptables').builtin
local optfrag = require('awall.optfrag') local optfrag = require('awall.optfrag')
local FAMILIES = optfrag.FAMILIES
local combinations = optfrag.combinations local combinations = optfrag.combinations
local prune = optfrag.prune local prune = optfrag.prune
......
--[[ --[[
Filter module for Alpine Wall Filter module for Alpine Wall
Copyright (C) 2012-2017 Kaarle Ritvanen Copyright (C) 2012-2019 Kaarle Ritvanen
See LICENSE file for license details See LICENSE file for license details
]]-- ]]--
local loadclass = require('awall').loadclass local loadclass = require('awall').loadclass
local FAMILIES = require('awall.family').ALL
local resolve = require('awall.host').resolve local resolve = require('awall.host').resolve
local model = require('awall.model') local model = require('awall.model')
local class = model.class local class = model.class
local Rule = model.Rule local Rule = model.Rule
local optfrag = require('awall.optfrag') local combinations = require('awall.optfrag').combinations
local combinations = optfrag.combinations
local util = require('awall.util') local util = require('awall.util')
local contains = util.contains local contains = util.contains
...@@ -444,7 +444,7 @@ local fchains = {{chain='FORWARD'}, {chain='INPUT'}, {chain='OUTPUT'}} ...@@ -444,7 +444,7 @@ local fchains = {{chain='FORWARD'}, {chain='INPUT'}, {chain='OUTPUT'}}
local function stateful(config) local function stateful(config)
local res = {} local res = {}
for _, family in ipairs(optfrag.FAMILIES) do for _, family in ipairs(FAMILIES) do
local er = combinations( local er = combinations(
fchains, fchains,
......
--[[ --[[
Option fragment module for Alpine Wall Option fragment module for Alpine Wall
Copyright (C) 2012-2017 Kaarle Ritvanen Copyright (C) 2012-2019 Kaarle Ritvanen
See LICENSE file for license details See LICENSE file for license details
]]-- ]]--
local M = {} local M = {}
local FAMILIES = require('awall.family').ALL
local util = require('awall.util') local util = require('awall.util')
local map = util.map local map = util.map
...@@ -14,8 +16,7 @@ local function ffrags(families) ...@@ -14,8 +16,7 @@ local function ffrags(families)
return map(families, function(f) return {family=f} end) return map(families, function(f) return {family=f} end)
end end
M.FAMILIES = {'inet', 'inet6'} M.FAMILYFRAGS = ffrags(FAMILIES)
M.FAMILYFRAGS = ffrags(M.FAMILIES)
function M.combinations(of1, ...) function M.combinations(of1, ...)
local arg = {...} local arg = {...}
......
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