Diff

mod_firewall/mod_firewall.lua @ 2520:c6fd8975704b

mod_firewall: Initial support for lists, in-memory and HTTP
author Matthew Wild <mwild1@gmail.com>
date Sun, 19 Feb 2017 21:10:26 +0000
parent 2518:0e1054c19f9d
child 2524:0404476ecfe3
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua	Sun Feb 19 21:08:30 2017 +0000
+++ b/mod_firewall/mod_firewall.lua	Sun Feb 19 21:10:26 2017 +0000
@@ -191,6 +191,12 @@
 		local_code = [[local roster_entry = (to_node and rostermanager.load_roster(to_node, to_host) or {})[bare_from];]];
 		depends = { "rostermanager", "split_to", "bare_from" };
 	};
+	list = { global_code = function (list)
+			assert(idsafe(list), "Invalid list name: "..list);
+			assert(active_definitions.LIST[list], "Unknown list: "..list);
+			return ("local list_%s = lists[%q];"):format(list, list);
+		end
+	};
 };
 
 local function include_dep(dependency, code)