| line |
true |
false |
branch |
|
72
|
6 |
12 |
if defined $$self{$key} |
|
87
|
3 |
0 |
if ($arg) |
|
88
|
1 |
2 |
unless ($arg =~ m[\A/.+\z]) |
|
102
|
14 |
0 |
if ($arg) |
|
103
|
2 |
12 |
unless ($arg =~ /\A-[ADIRLSFZNXPE]\z/) |
|
117
|
12 |
0 |
if ($arg) |
|
119
|
4 |
8 |
unless ($arg =~ /\A[46]\z/) |
|
134
|
8 |
0 |
if ($arg) |
|
136
|
0 |
8 |
if $$self{'ipver'} eq '4' and not $arg =~ /\A(filter|nat|mangle|raw)\z/i |
|
137
|
0 |
8 |
if $$self{'ipver'} eq '6' and not $arg =~ /\A(filter|mangle|raw)\z/i |
|
138
|
0 |
8 |
if ($need_to_barf) |
|
153
|
8 |
0 |
if ($arg) |
|
164
|
10 |
0 |
if ($arg) |
|
176
|
11 |
0 |
if ($arg) |
|
177
|
0 |
11 |
unless ($arg =~ /\A[a-z0-9]+\z/) |
|
181
|
1 |
10 |
if ($$self{'ipver'} eq '6' and $arg eq 'icmp') |
|
185
|
1 |
9 |
if ($$self{'ipver'} eq '4' and $arg eq 'icmpv6') |
|
200
|
9 |
0 |
if ($arg) |
|
211
|
8 |
0 |
if ($arg) |
|
223
|
17 |
0 |
if ($arg) |
|
224
|
7 |
4 |
unless (__is_valid_inet_host($arg) or __is_valid_inet_cidr($arg) or __is_valid_inet_range($arg)) |
|
245
|
16 |
0 |
if ($arg) |
|
246
|
7 |
3 |
unless (__is_valid_inet_host($arg) or __is_valid_inet_cidr($arg) or __is_valid_inet_range($arg)) |
|
267
|
14 |
0 |
if ($arg) |
|
268
|
5 |
9 |
unless (__is_valid_inet_port($arg)) |
|
284
|
11 |
0 |
if ($arg) |
|
285
|
5 |
6 |
unless (__is_valid_inet_port($arg)) |
|
300
|
4 |
0 |
if ($arg) |
|
301
|
3 |
1 |
unless (__is_valid_mac_address($arg)) |
|
316
|
7 |
0 |
if ($arg) |
|
317
|
1 |
6 |
unless ($arg =~ /\A(NEW|ESTABLISHED|RELATED|INVALID|UNTRACKED)\z/i) |
|
332
|
17 |
0 |
if ($arg) |
|
334
|
6 |
11 |
unless ($arg =~ m[\A\d+/(s(ec(ond)?)?|m(in(ute)?)?|h(our)?|d(ay)?)\z]i) |
|
348
|
10 |
0 |
if ($arg) |
|
349
|
2 |
8 |
unless ($arg =~ m[\A[a-z0-9\-]+(/[a-z0-9\-]+)?\z]i) |
|
366
|
6 |
0 |
if ($arg) |
|
367
|
3 |
3 |
if (length $arg > $max_length) |
|
371
|
0 |
3 |
if ($arg =~ /[\"\']/) |
|
388
|
7 |
0 |
if ($arg) |
|
389
|
1 |
6 |
if (length $arg > $max_length) |
|
393
|
1 |
5 |
if ($arg =~ /[\"\']/) |
|
409
|
0 |
6 |
unless ($$self{'chain'}) |
|
414
|
0 |
6 |
if (defined $$self{'spt'} and not $$self{'proto'} =~ /\A(tcp|udp)\z/i) |
|
418
|
0 |
6 |
if (defined $$self{'dpt'} and not $$self{'proto'} =~ /\A(tcp|udp)\z/i) |
|
423
|
0 |
6 |
if (defined $$self{'logprefix'} and not $$self{'target'} =~ /\Alog\z/i) |
|
428
|
5 |
1 |
if ($$self{'ipver'} eq '4') { } |
|
|
1 |
0 |
elsif ($$self{'ipver'} eq '6') { } |
|
429
|
1 |
4 |
if ($$self{'src'}) |
|
431
|
1 |
0 |
unless (__is_valid_inet4($$self{'src'})) |
|
436
|
0 |
4 |
if ($$self{'dst'}) |
|
438
|
0 |
0 |
unless (__is_valid_inet4($$self{'dst'})) |
|
444
|
1 |
0 |
if ($$self{'src'}) |
|
446
|
1 |
0 |
unless (__is_valid_inet6($$self{'src'})) |
|
451
|
0 |
0 |
if ($$self{'dst'}) |
|
453
|
0 |
0 |
unless (__is_valid_inet6($$self{'dst'})) |
|
464
|
0 |
4 |
if (defined $$self{'icmp_type'} and not $$self{'proto'} =~ /\Aicmp(v6)?\z/i) |
|
473
|
2 |
2 |
if defined $$self{'table'} |
|
478
|
0 |
4 |
if (defined $$self{'src'}) |
|
479
|
0 |
0 |
if (__is_valid_inet_host($$self{'src'}) or &is_valid_inet_cidr($$self{'src'})) |
|
482
|
0 |
0 |
if (__is_valid_inet_range($$self{'src'})) |
|
486
|
0 |
4 |
if (defined $$self{'dst'}) |
|
487
|
0 |
0 |
if (__is_valid_inet_host($$self{'dst'}) or &is_valid_inet_cidr($$self{'dst'})) |
|
490
|
0 |
0 |
if (__is_valid_inet_range($$self{'dst'})) |
|
496
|
0 |
4 |
if (defined $$self{'spt'}) |
|
497
|
0 |
0 |
if ($$self{'spt'} =~ /\A\w+\z/) |
|
501
|
0 |
0 |
if ($$self{'spt'} =~ /\A\w+(:\w+)+\z/) |
|
505
|
0 |
0 |
if ($$self{'spt'} =~ /\A\w+(:\w+)+\z/) |
|
510
|
1 |
3 |
if (defined $$self{'dpt'}) |
|
511
|
1 |
0 |
if ($$self{'dpt'} =~ /\A\w+\z/) |
|
515
|
0 |
1 |
if ($$self{'dpt'} =~ /\A\w+(:\w+)+\z/) |
|
519
|
0 |
1 |
if ($$self{'dpt'} =~ /\A\w+(:\w+)+\z/) |
|
525
|
3 |
1 |
if defined $$self{'in'} |
|
526
|
1 |
3 |
if defined $$self{'out'} |
|
527
|
1 |
3 |
if defined $$self{'proto'} |
|
528
|
0 |
4 |
if defined $$self{'mac'} |
|
529
|
1 |
3 |
if defined $$self{'state'} |
|
530
|
0 |
4 |
if defined $$self{'icmp_type'} |
|
531
|
3 |
1 |
if defined $$self{'comment'} |
|
532
|
0 |
4 |
if defined $$self{'limit'} |
|
533
|
4 |
0 |
if defined $$self{'target'} |
|
534
|
0 |
4 |
if defined $$self{'logprefix'} |
|
554
|
0 |
4 |
unless $arg |
|
556
|
1 |
3 |
if ($arg =~ /\A$qr_mac_addr\z/) |
|
568
|
0 |
1 |
unless $arg |
|
571
|
0 |
1 |
if __is_inet4_host($arg) |
|
574
|
0 |
1 |
if __is_inet4_cidr($arg) |
|
577
|
0 |
1 |
if __is_inet4_range($arg) |
|
580
|
0 |
1 |
if $arg =~ /\A$qr_fqdn\z/ |
|
590
|
0 |
1 |
unless $arg |
|
593
|
0 |
1 |
if __is_inet6_host($arg) |
|
596
|
0 |
1 |
if __is_inet6_cidr($arg) |
|
599
|
0 |
1 |
if __is_inet6_range($arg) |
|
602
|
0 |
1 |
if $arg =~ /\A$qr_fqdn\z/ |
|
612
|
0 |
33 |
unless $arg |
|
615
|
3 |
30 |
if __is_inet4_host($arg) |
|
618
|
4 |
26 |
if __is_inet6_host($arg) |
|
621
|
5 |
21 |
if $arg =~ /\A$qr_fqdn\z/ |
|
631
|
0 |
34 |
unless $arg |
|
634
|
3 |
31 |
if $arg =~ /\A$qr_ip4_addr\z/ |
|
644
|
0 |
31 |
unless $arg |
|
647
|
4 |
27 |
if $arg =~ /\A$qr_ip6_addr\z/ |
|
657
|
0 |
21 |
unless $arg |
|
660
|
2 |
19 |
if __is_inet4_cidr($arg) |
|
663
|
5 |
14 |
if __is_inet6_cidr($arg) |
|
673
|
0 |
22 |
unless $arg |
|
676
|
4 |
18 |
if ($arg =~ /\A$qr_ip4_cidr\z/) |
|
679
|
0 |
4 |
if $cidr < 0 |
|
680
|
2 |
2 |
if $cidr > 32 |
|
693
|
0 |
20 |
unless $arg |
|
696
|
9 |
11 |
if ($arg =~ /\A$qr_ip6_cidr\z/) |
|
699
|
0 |
9 |
if $cidr < 0 |
|
700
|
4 |
5 |
if $cidr > 128 |
|
713
|
0 |
14 |
unless $arg |
|
716
|
0 |
14 |
if __is_inet4_range($arg) |
|
719
|
0 |
14 |
if __is_inet6_range($arg) |
|
729
|
0 |
15 |
unless $arg |
|
732
|
0 |
15 |
if $arg =~ /\A$qr_ip4_addr\-$qr_ip4_addr\z/ |
|
744
|
0 |
15 |
unless $arg |
|
747
|
0 |
15 |
if $arg =~ /\A$qr_ip6_addr\-$qr_ip6_addr\z/ |
|
759
|
0 |
41 |
unless $arg |
|
762
|
21 |
20 |
if (__is_a_number($arg)) |
|
763
|
0 |
21 |
if $arg < 0 |
|
764
|
2 |
19 |
if $arg > 65535 |
|
770
|
6 |
14 |
if ($arg =~ /\A[a-z]+\z/i) |
|
775
|
4 |
10 |
if ($arg =~ /\A\d+:\d+\z/) |
|
779
|
0 |
4 |
unless __is_valid_inet_port($lower) |
|
780
|
0 |
4 |
unless __is_valid_inet_port($upper) |
|
783
|
2 |
2 |
if $upper < $lower |
|
789
|
0 |
10 |
if ($arg =~ /\A[a-z]+:[a-z]+\z/i) |
|
793
|
0 |
0 |
unless __is_valid_inet_port($lower) |
|
794
|
0 |
0 |
unless __is_valid_inet_port($upper) |
|
800
|
2 |
8 |
if ($arg =~ /\A\d+(,\d+)+\z/) |
|
805
|
0 |
4 |
unless __is_valid_inet_port($port) |
|
812
|
2 |
6 |
if ($arg =~ /\A[a-z]+(,[a-z]+)+\z/i) |
|
817
|
0 |
4 |
unless __is_valid_inet_port($port) |
|
829
|
21 |
20 |
if $arg =~ /\A-?\d+\z/ |