comparison mod_firewall/mod_firewall.lua @ 960:d773a51af9b1

mod_firewall: Add actions EVENT (fire an event), JUMP EVENT (transfer control to the handlers of an event), JUMP CHAIN (transfer control to another mod_firewall chain)
author Matthew Wild <mwild1@gmail.com>
date Fri, 05 Apr 2013 18:08:16 +0100
parents 33d6642f4db7
children d4e24fb289c0
comparison
equal deleted inserted replaced
959:6ef334596276 960:d773a51af9b1
239 ..table.concat(rule.actions, "\n\t") 239 ..table.concat(rule.actions, "\n\t")
240 .."\n end\n"; 240 .."\n end\n";
241 table.insert(code, rule_code); 241 table.insert(code, rule_code);
242 end 242 end
243 243
244 assert(chains[chain_name].type == "event", "Only event chains supported at the moment") 244 local code_string = [[return function (zones, fire_event, log)
245
246 local code_string = [[return function (zones, log)
247 ]]..table.concat(code.global_header, "\n")..[[ 245 ]]..table.concat(code.global_header, "\n")..[[
248 local db = require 'util.debug' 246 local db = require 'util.debug'
249 return function (event) 247 return function (event)
250 local stanza, session = event.stanza, event.origin; 248 local stanza, session = event.stanza, event.origin;
251 249