summaryrefslogtreecommitdiffstats
path: root/awall/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'awall/init.lua')
-rw-r--r--awall/init.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/awall/init.lua b/awall/init.lua
index a126872..80fdf7e 100644
--- a/awall/init.lua
+++ b/awall/init.lua
@@ -27,16 +27,10 @@ local achains
function loadmodules(path)
events = {}
- classmap = {}
achains = {}
local function readmetadata(mod)
- for name, target in pairs(mod.export or {}) do
- events[name] = target
- if string.sub(name, 1, 1) ~= '%' then
- classmap[name] = target.class
- end
- end
+ for name, target in pairs(mod.export or {}) do events[name] = target end
for name, opts in pairs(mod.achains or {}) do
assert(not achains[name])
achains[name] = opts
@@ -67,6 +61,11 @@ function loadmodules(path)
procorder = awall.dependency.order(events)
end
+function loadclass(path)
+ assert(string.sub(path, 1, 1) ~= '%')
+ return events[path] and events[path].class
+end
+
PolicySet = policy.PolicySet
@@ -103,7 +102,7 @@ function Config:init(policyconfig)
local objs = self.objects[path]
if objs then
for k, v in pairs(objs) do
- objs[k] = classmap[path].morph(
+ objs[k] = events[path].class.morph(
v,
self,
path..' '..k..' ('..policyconfig.source[path][k]..')'