Commit c9aec673 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

make module attributes optional

parent 2fbe1770
......@@ -26,12 +26,12 @@ function loadmodules(path)
defrules = {}
local function readmetadata(mod)
for i, clsdef in ipairs(mod.classes) do
for i, clsdef in ipairs(mod.classes or {}) do
local path, cls = unpack(clsdef)
classmap[path] = cls
table.insert(procorder, path)
end
for phase, rules in pairs(mod.defrules) do
for phase, rules in pairs(mod.defrules or {}) do
if not defrules[phase] then defrules[phase] = {} end
table.insert(defrules[phase], rules)
end
......
......@@ -422,4 +422,4 @@ function ForwardOnlyRule:chain() return 'PREROUTING' end
classes = {{'zone', Zone}}
defrules = {}
......@@ -28,5 +28,3 @@ end
classes = {{'clamp-mss', ClampMSSRule}}
defrules = {}
......@@ -7,8 +7,6 @@ Licensed under the terms of GPL2
module(..., package.seeall)
classes = {}
-- TODO configuration of the ipset via JSON config
defrules = {['post-snat']={{family='inet', table='nat',
chain='POSTROUTING',
......
......@@ -59,5 +59,3 @@ end
classes = {{'dnat', DNATRule},
{'snat', SNATRule}}
defrules = {}
......@@ -23,5 +23,3 @@ end
classes = {{'no-track', NoTrackRule}}
defrules = {}
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