Module ImportFrom alias Import alias alias alias alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Call NameLoad keyword Str keyword NameLoad keyword NameLoad keyword NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Str Call NameLoad keyword Str keyword NameLoad keyword NameLoad keyword NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str TupleLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str ListLoad Str NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str Assign NameStore Call NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str Assign NameStore Call NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str Assign NameStore Call NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str Assign NameStore ListLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str ListLoad Str ListLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str ListLoad Str ListLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str ListLoad Str ListLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str Str ListLoad Str ListLoad Str ListLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str Str ListLoad Str Str ListLoad Str ListLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str Str ListLoad Str Str ListLoad Str Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str Str Str ListLoad Str Str ListLoad Str ListLoad Str ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Dict Str Str Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str Assign NameStore Call NameLoad keyword Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str Assign NameStore Call NameLoad ListLoad Str NameLoad NameLoad NameLoad NameLoad Str Str Str Str Str Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str decorator_list decorator_list
N/A unittest TestCase N/A cmdparse timeutil iptables iputil iptables Rule CmdParseTest N/A TestCase N/A test_parse_command N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A cmdparse parse_command_path /drop/input/eth0/5.6.7.8 N/A drop N/A Rule chain INPUT num None pkts None bytes None target DROP prot all opt -- inp eth0 out * source 5.6.7.8 destination 0.0.0.0/0 extra N/A N/A N/A self assertEqual N/A N/A cmdparse parse_command_path /drop/input/eth /5.6.7.8/ N/A drop N/A Rule chain INPUT num None pkts None bytes None target DROP prot all opt -- inp eth+ out * source 5.6.7.8 destination 0.0.0.0/0 extra N/A N/A IpUtilTest N/A TestCase N/A test_ip2long N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A iputil ip2long 1.2.3.4 16909060 N/A N/A N/A self assertEqual N/A N/A iputil ip2long 1.2.3.250 16909306 N/A N/A N/A self assertEqual N/A N/A iputil ip2long 250.2.3.4 4194435844 N/A N/A N/A self assertEqual N/A N/A iputil ip2long 129.2.3.129 2164392833 N/A test_cidr2range N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A iputil cidr2range 1.2.3.4 N/A 16909060 16909060 N/A N/A N/A self assertEqual N/A N/A iputil cidr2range 1.2.3.4/32 N/A 16909060 16909060 N/A N/A N/A self assertEqual N/A N/A iputil cidr2range 1.2.3.4/31 N/A 16909060 16909061 N/A N/A N/A self assertEqual N/A N/A iputil cidr2range 1.2.3.4/30 N/A 16909060 16909063 N/A N/A N/A self assertEqual N/A N/A iputil cidr2range 1.2.3.4/0 N/A 0 4294967295 N/A N/A N/A self assertEqual N/A N/A iputil cidr2range 129.2.3.129/28 N/A 2164392832 2164392847 N/A test_ip_in_list N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A iputil ip_in_list 1.2.0.0/16 N/A 1.2.3.4 True N/A N/A TimeUtilTest N/A TestCase N/A test_parse_interval N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 350 350 N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 20000s 20000 N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 10m 600 N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 2h 7200 N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 10d 864000 N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 0 0 N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 0m 0 N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval -3 None N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval 10u None N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval abc None N/A N/A N/A self assertEqual N/A N/A timeutil parse_interval None N/A N/A IptablesTest N/A TestCase N/A load N/A N/A self rules N/A N/A N/A inst N/A N/A iptables Iptables rules N/A inst N/A test_find N/A N/A self N/A N/A N/A r1 N/A Rule chain INPUT num 9 pkts 0 bytes 0 target DROP prot all opt -- inp eth+ out * source 2.2.2.2 destination 0.0.0.0/0 extra N/A r2 N/A Rule chain INPUT num 10 pkts 0 bytes 0 target ACCEPT prot tcp opt -- inp * out * source 3.4.5.6 destination 0.0.0.0/0 extra tcp spt:12345 N/A r3 N/A Rule chain INPUT num 1 pkts 14 bytes 840 target DROP prot tcp opt -- inp * out * source 0.0.0.0/0 destination 0.0.0.0/0 extra tcp dpt:7393 N/A r4 N/A Rule chain OUTPUT num 1 pkts 0 bytes 0 target DROP prot all opt -- inp * out tun+ source 0.0.0.0/0 destination 7.7.7.6 extra N/A rules N/A r1 r2 r3 r4 N/A inst1 N/A N/A self load rules N/A N/A N/A self assertEqual N/A N/A inst1 find N/A rules N/A N/A N/A self assertEqual N/A N/A inst1 find N/A destination N/A 0.0.0.0/0 N/A r1 r2 r3 N/A N/A N/A self assertEqual N/A N/A inst1 find N/A target N/A ACCEPT N/A r2 N/A N/A N/A self assertEqual N/A N/A inst1 find N/A chain N/A OUTPUT N/A r4 N/A N/A N/A self assertEqual N/A N/A inst1 find N/A chain target N/A OUTPUT N/A ACCEPT N/A N/A N/A N/A self assertEqual N/A N/A inst1 find N/A chain target N/A OUTPUT INPUT N/A ACCEPT N/A r2 N/A N/A N/A self assertEqual N/A N/A inst1 find N/A chain target N/A OUTPUT INPUT N/A ACCEPT DROP rules N/A N/A N/A self assertEqual N/A N/A inst1 find N/A chain target extra N/A OUTPUT INPUT N/A DROP N/A N/A r1 r4 N/A test_create_rule N/A N/A self N/A N/A N/A Test creating Rule objects in various ways
         N/A r1 N/A Rule N/A chain source INPUT 1.2.3.4 N/A N/A N/A self assertEquals N/A str r1 Rule(chain='INPUT', num=None, pkts=None, bytes=None, target=None, prot='all', opt='--', inp='*', out='*', source='1.2.3.4', destination='0.0.0.0/0', extra='') N/A r2 N/A Rule chain INPUT num None pkts None bytes None target None prot all opt -- inp * out * source 1.2.3.4 destination 0.0.0.0/0 extra N/A N/A N/A self assertEquals N/A str r2 Rule(chain='INPUT', num=None, pkts=None, bytes=None, target=None, prot='all', opt='--', inp='*', out='*', source='1.2.3.4', destination='0.0.0.0/0', extra='') N/A r3 N/A Rule N/A INPUT None None None None all -- * * 1.2.3.4 0.0.0.0/0 N/A N/A N/A self assertEquals N/A str r3 Rule(chain='INPUT', num=None, pkts=None, bytes=None, target=None, prot='all', opt='--', inp='*', out='*', source='1.2.3.4', destination='0.0.0.0/0', extra='') N/A N/A