Commit 044a5efc authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

Config.input renamed to Config.objects

parent da7f4cb2
...@@ -61,11 +61,11 @@ Config = object.class(object.Object) ...@@ -61,11 +61,11 @@ Config = object.class(object.Object)
function Config:init(policyconfig) function Config:init(policyconfig)
self.input = policyconfig:expand() self.objects = policyconfig:expand()
self.iptables = iptables.IPTables.new() self.iptables = iptables.IPTables.new()
local function morph(path, cls) local function morph(path, cls)
local objs = self.input[path] local objs = self.objects[path]
if objs then if objs then
for k, v in pairs(objs) do for k, v in pairs(objs) do
objs[k] = cls.morph(v, objs[k] = cls.morph(v,
...@@ -89,7 +89,7 @@ function Config:init(policyconfig) ...@@ -89,7 +89,7 @@ function Config:init(policyconfig)
local function insertdefrules(phase) local function insertdefrules(phase)
for i, rulegroup in ipairs(defrules[phase] or {}) do for i, rulegroup in ipairs(defrules[phase] or {}) do
if type(rulegroup) == 'function' then if type(rulegroup) == 'function' then
insertrules(rulegroup(self.input)) insertrules(rulegroup(self.objects))
else insertrules(rulegroup) end else insertrules(rulegroup) end
end end
end end
...@@ -99,8 +99,8 @@ function Config:init(policyconfig) ...@@ -99,8 +99,8 @@ function Config:init(policyconfig)
insertdefrules('pre') insertdefrules('pre')
for i, path in ipairs(procorder) do for i, path in ipairs(procorder) do
if self.input[path] then if self.objects[path] then
for i, rule in ipairs(self.input[path]) do for i, rule in ipairs(self.objects[path]) do
insertrules(rule:trules()) insertrules(rule:trules())
end end
end end
...@@ -108,7 +108,7 @@ function Config:init(policyconfig) ...@@ -108,7 +108,7 @@ function Config:init(policyconfig)
end end
morph('ipset', awall.model.ConfigObject) morph('ipset', awall.model.ConfigObject)
self.ipset = ipset.IPSet.new(self.input.ipset) self.ipset = ipset.IPSet.new(self.objects.ipset)
end end
function Config:print() function Config:print()
......
...@@ -24,7 +24,7 @@ ConfigObject = class(awall.object.Object) ...@@ -24,7 +24,7 @@ ConfigObject = class(awall.object.Object)
function ConfigObject:init(context, location) function ConfigObject:init(context, location)
if context then if context then
self.context = context self.context = context
self.root = context.input self.root = context.objects
end end
self.location = location self.location = location
end end
......
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