Mercurial > prosody-modules
diff mod_firewall/actions.lib.lua @ 2107:f445f43b9ba1
mod_firewall: Add support for session marking (MARK_ORIGIN, UNMARK_ORIGIN, ORIGIN_MARKED)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 17 Mar 2016 11:27:10 +0000 |
parents | f2ee508315e1 |
children | edf5cf3c474b |
line wrap: on
line diff
--- a/mod_firewall/actions.lib.lua Thu Mar 17 11:26:20 2016 +0000 +++ b/mod_firewall/actions.lib.lua Thu Mar 17 11:27:10 2016 +0000 @@ -183,4 +183,12 @@ return ("if fire_event(%q, event) then return true; end"):format("firewall/chains/"..name); end +function action_handlers.MARK_ORIGIN(name) + return [[session.firewall_marked_]]..idsafe(name)..[[ = current_timestamp;]], { "timestamp" }; +end + +function action_handlers.UNMARK_ORIGIN(name) + return [[session.firewall_marked_]]..idsafe(name)..[[ = nil;]] +end + return action_handlers;