comparison mod_firewall/mod_firewall.lua @ 2585:02c6ae745c4f

mod_firewall: Add 'test' subcommand to read stanzas from stdin and test them against rules
author Matthew Wild <mwild1@gmail.com>
date Sun, 26 Feb 2017 09:58:07 +0000
parents d64fc9c3cffd
children 22e11645a895
comparison
equal deleted inserted replaced
2584:d64fc9c3cffd 2585:02c6ae745c4f
670 return 1; 670 return 1;
671 end 671 end
672 local verbose = arg[1] == "-v"; 672 local verbose = arg[1] == "-v";
673 if verbose then table.remove(arg, 1); end 673 if verbose then table.remove(arg, 1); end
674 674
675 if arg[1] == "test" then
676 table.remove(arg, 1);
677 return module:require("test")(arg);
678 end
679
675 local serialize = require "util.serialization".serialize; 680 local serialize = require "util.serialization".serialize;
676 if verbose then 681 if verbose then
677 print("local logger = require \"util.logger\".init;"); 682 print("local logger = require \"util.logger\".init;");
678 print(); 683 print();
679 print("local function fire_event(name, data)\n\tmodule:fire_event(name, data)\nend"); 684 print("local function fire_event(name, data)\n\tmodule:fire_event(name, data)\nend");