| 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
|
11 |
0 |
if ($arg) |
|
319
|
3 |
11 |
unless ($_ =~ /\A(NEW|ESTABLISHED|RELATED|INVALID|UNTRACKED)\z/i) |
|
335
|
17 |
0 |
if ($arg) |
|
337
|
6 |
11 |
unless ($arg =~ m[\A\d+/(s(ec(ond)?)?|m(in(ute)?)?|h(our)?|d(ay)?)\z]i) |
|
351
|
10 |
0 |
if ($arg) |
|
352
|
2 |
8 |
unless ($arg =~ m[\A[a-z0-9\-]+(/[a-z0-9\-]+)?\z]i) |
|
369
|
6 |
0 |
if ($arg) |
|
370
|
3 |
3 |
if (length $arg > $max_length) |
|
374
|
0 |
3 |
if ($arg =~ /[\"\']/) |
|
391
|
7 |
0 |
if ($arg) |
|
392
|
1 |
6 |
if (length $arg > $max_length) |
|
396
|
1 |
5 |
if ($arg =~ /[\"\']/) |
|
412
|
0 |
6 |
unless ($self->{'chain'}) |
|
417
|
0 |
6 |
if (defined $self->{'spt'} and not $self->{'proto'} =~ /\A(tcp|udp)\z/i) |
|
421
|
0 |
6 |
if (defined $self->{'dpt'} and not $self->{'proto'} =~ /\A(tcp|udp)\z/i) |
|
426
|
0 |
6 |
if (defined $self->{'logprefix'} and not $self->{'target'} =~ /\Alog\z/i) |
|
431
|
5 |
1 |
if ($self->{'ipver'} eq '4') { } |
|
|
1 |
0 |
elsif ($self->{'ipver'} eq '6') { } |
|
432
|
1 |
4 |
if ($self->{'src'}) |
|
434
|
1 |
0 |
unless (__is_valid_inet4($self->{'src'})) |
|
439
|
0 |
4 |
if ($self->{'dst'}) |
|
441
|
0 |
0 |
unless (__is_valid_inet4($self->{'dst'})) |
|
447
|
1 |
0 |
if ($self->{'src'}) |
|
449
|
1 |
0 |
unless (__is_valid_inet6($self->{'src'})) |
|
454
|
0 |
0 |
if ($self->{'dst'}) |
|
456
|
0 |
0 |
unless (__is_valid_inet6($self->{'dst'})) |
|
467
|
0 |
4 |
if (defined $self->{'icmp_type'} and not $self->{'proto'} =~ /\Aicmp(v6)?\z/i) |
|
476
|
2 |
2 |
if defined $self->{'table'} |
|
481
|
0 |
4 |
if (defined $self->{'src'}) |
|
482
|
0 |
0 |
if (__is_valid_inet_host($self->{'src'}) or __is_valid_inet_cidr($self->{'src'})) |
|
485
|
0 |
0 |
if (__is_valid_inet_range($self->{'src'})) |
|
489
|
0 |
4 |
if (defined $self->{'dst'}) |
|
490
|
0 |
0 |
if (__is_valid_inet_host($self->{'dst'}) or __is_valid_inet_cidr($self->{'dst'})) |
|
493
|
0 |
0 |
if (__is_valid_inet_range($self->{'dst'})) |
|
499
|
0 |
4 |
if (defined $self->{'spt'}) |
|
500
|
0 |
0 |
if ($self->{'spt'} =~ /\A\w+\z/) |
|
504
|
0 |
0 |
if ($self->{'spt'} =~ /\A\w+(:\w+)+\z/) |
|
508
|
0 |
0 |
if ($self->{'spt'} =~ /\A\w+(:\w+)+\z/) |
|
513
|
1 |
3 |
if (defined $self->{'dpt'}) |
|
514
|
1 |
0 |
if ($self->{'dpt'} =~ /\A\w+\z/) |
|
518
|
0 |
1 |
if ($self->{'dpt'} =~ /\A\w+(:\w+)+\z/) |
|
522
|
0 |
1 |
if ($self->{'dpt'} =~ /\A\w+(:\w+)+\z/) |
|
528
|
3 |
1 |
if defined $self->{'in'} |
|
529
|
1 |
3 |
if defined $self->{'out'} |
|
530
|
1 |
3 |
if defined $self->{'proto'} |
|
531
|
0 |
4 |
if defined $self->{'mac'} |
|
532
|
1 |
3 |
if defined $self->{'state'} |
|
533
|
0 |
4 |
if defined $self->{'icmp_type'} |
|
534
|
3 |
1 |
if defined $self->{'comment'} |
|
535
|
0 |
4 |
if defined $self->{'limit'} |
|
536
|
4 |
0 |
if defined $self->{'target'} |
|
537
|
0 |
4 |
if defined $self->{'logprefix'} |
|
557
|
0 |
4 |
unless $arg |
|
559
|
1 |
3 |
if ($arg =~ /\A$qr_mac_addr\z/) |
|
571
|
0 |
1 |
unless $arg |
|
574
|
0 |
1 |
if __is_inet4_host($arg) |
|
577
|
0 |
1 |
if __is_inet4_cidr($arg) |
|
580
|
0 |
1 |
if __is_inet4_range($arg) |
|
583
|
0 |
1 |
if $arg =~ /\A$qr_fqdn\z/ |
|
593
|
0 |
1 |
unless $arg |
|
596
|
0 |
1 |
if __is_inet6_host($arg) |
|
599
|
0 |
1 |
if __is_inet6_cidr($arg) |
|
602
|
0 |
1 |
if __is_inet6_range($arg) |
|
605
|
0 |
1 |
if $arg =~ /\A$qr_fqdn\z/ |
|
615
|
0 |
33 |
unless $arg |
|
618
|
3 |
30 |
if __is_inet4_host($arg) |
|
621
|
4 |
26 |
if __is_inet6_host($arg) |
|
624
|
5 |
21 |
if $arg =~ /\A$qr_fqdn\z/ |
|
634
|
0 |
34 |
unless $arg |
|
637
|
3 |
31 |
if $arg =~ /\A$qr_ip4_addr\z/ |
|
647
|
0 |
31 |
unless $arg |
|
650
|
4 |
27 |
if $arg =~ /\A$qr_ip6_addr\z/ |
|
660
|
0 |
21 |
unless $arg |
|
663
|
2 |
19 |
if __is_inet4_cidr($arg) |
|
666
|
5 |
14 |
if __is_inet6_cidr($arg) |
|
676
|
0 |
22 |
unless $arg |
|
679
|
4 |
18 |
if ($arg =~ /\A$qr_ip4_cidr\z/) |
|
682
|
0 |
4 |
if $cidr < 0 |
|
683
|
2 |
2 |
if $cidr > 32 |
|
696
|
0 |
20 |
unless $arg |
|
699
|
9 |
11 |
if ($arg =~ /\A$qr_ip6_cidr\z/) |
|
702
|
0 |
9 |
if $cidr < 0 |
|
703
|
4 |
5 |
if $cidr > 128 |
|
716
|
0 |
14 |
unless $arg |
|
719
|
0 |
14 |
if __is_inet4_range($arg) |
|
722
|
0 |
14 |
if __is_inet6_range($arg) |
|
732
|
0 |
15 |
unless $arg |
|
735
|
0 |
15 |
if $arg =~ /\A$qr_ip4_addr\-$qr_ip4_addr\z/ |
|
747
|
0 |
15 |
unless $arg |
|
750
|
0 |
15 |
if $arg =~ /\A$qr_ip6_addr\-$qr_ip6_addr\z/ |
|
762
|
0 |
41 |
unless $arg |
|
765
|
21 |
20 |
if (__is_a_number($arg)) |
|
766
|
0 |
21 |
if $arg < 0 |
|
767
|
2 |
19 |
if $arg > 65535 |
|
773
|
6 |
14 |
if ($arg =~ /\A[a-z]+\z/i) |
|
778
|
4 |
10 |
if ($arg =~ /\A\d+:\d+\z/) |
|
782
|
0 |
4 |
unless __is_valid_inet_port($lower) |
|
783
|
0 |
4 |
unless __is_valid_inet_port($upper) |
|
786
|
2 |
2 |
if $upper < $lower |
|
792
|
0 |
10 |
if ($arg =~ /\A[a-z]+:[a-z]+\z/i) |
|
796
|
0 |
0 |
unless __is_valid_inet_port($lower) |
|
797
|
0 |
0 |
unless __is_valid_inet_port($upper) |
|
803
|
2 |
8 |
if ($arg =~ /\A\d+(,\d+)+\z/) |
|
808
|
0 |
4 |
unless __is_valid_inet_port($port) |
|
815
|
2 |
6 |
if ($arg =~ /\A[a-z]+(,[a-z]+)+\z/i) |
|
820
|
0 |
4 |
unless __is_valid_inet_port($port) |
|
832
|
21 |
20 |
if $arg =~ /\A-?\d+\z/ |