mod_firewall/actions.lib.lua
changeset 2535 9d2bfff515b8
parent 2523 d4bc434a60a4
child 2545 76f03d514b13
--- a/mod_firewall/actions.lib.lua	Mon Feb 20 09:47:40 2017 +0000
+++ b/mod_firewall/actions.lib.lua	Mon Feb 20 09:47:58 2017 +0000
@@ -187,4 +187,11 @@
 	return [[session.firewall_marked_]]..idsafe(name)..[[ = nil;]]
 end
 
+function action_handlers.ADD_TO(spec)
+	local list_name, value = spec:match("(%S+) (.+)");
+	local meta_deps = {};
+	value = meta(("%q"):format(value), meta_deps);
+	return ("list_%s:add(%s);"):format(list_name, value), { "list:"..list_name, unpack(meta_deps) };
+end
+
 return action_handlers;