Software /
code /
prosody-modules
Diff
mod_firewall/actions.lib.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 |
parent | 959:6ef334596276 |
child | 961:f0108ec2b016 |
line wrap: on
line diff
--- a/mod_firewall/actions.lib.lua Fri Apr 05 18:06:32 2013 +0100 +++ b/mod_firewall/actions.lib.lua Fri Apr 05 18:08:16 2013 +0100 @@ -162,4 +162,16 @@ return "", { dep }; end +function action_handlers.EVENT(name) + return ("fire_event(%q, event)"):format(name); +end + +function action_handlers.JUMP_EVENT(name) + return ("do return fire_event(%q, event); end"):format(name); +end + +function action_handlers.JUMP_CHAIN(name) + return ("do return fire_event(%q, event); end"):format("firewall/chains/"..name); +end + return action_handlers;