Branch Coverage

blib/lib/Metabrik/Network/Linux/Iptables.pm
Criterion Covered Total %
branch 0 284 0.0


line true false branch
127 0 0 unless $self->brik_help_run_undef_arg('command', $command)
133 0 0 if ($self->test_only)
139 0 0 unless my $r = $self->sudo_execute($cmd)
140 0 0 if ($r == 256)
168 0 0 unless $self->brik_help_run_undef_arg('save', $output)
172 0 0 unless ($output =~ m[^/])
177 0 0 if (defined $table)
183 0 0 if ($self->test_only)
192 0 0 unless (defined $r)
200 0 0 unless my $ft = 'Metabrik::File::Text'->new_from_brik_init($self)
203 0 0 unless $ft->write($r, $output)
213 0 0 unless $self->brik_help_run_undef_arg('save_nat', $output)
223 0 0 unless $self->brik_help_run_undef_arg('save_filter', $output)
233 0 0 unless $self->brik_help_run_undef_arg('restore', $input)
236 0 0 unless ($input =~ m[^/])
239 0 0 unless $self->brik_help_run_file_not_found('restore', $input)
242 0 0 if (defined $table)
248 0 0 if ($self->test_only)
257 0 0 unless (defined $r)
273 0 0 unless $self->brik_help_run_undef_arg('restore_nat', $input)
276 0 0 unless ($input =~ m[^/])
279 0 0 unless $self->brik_help_run_file_not_found('restore_nat', $input)
289 0 0 unless $self->brik_help_run_undef_arg('restore_filter', $input)
292 0 0 unless ($input =~ m[^/])
295 0 0 unless $self->brik_help_run_file_not_found('restore_filter', $input)
304 0 0 unless (defined $table)
307 0 0 unless my $ref = $self->brik_help_run_invalid_arg('flush', $table, 'ARRAY', 'SCALAR')
312 0 0 if ($ref eq 'ARRAY') { }
319 0 0 if (defined $chain)
387 0 0 unless $self->brik_help_run_undef_arg('set_policy', $table)
388 0 0 unless $self->brik_help_run_undef_arg('set_policy', $target)
399 0 0 unless $self->brik_help_run_undef_arg('set_policy_input', $target)
408 0 0 unless $self->brik_help_run_undef_arg('set_policy_output', $target)
417 0 0 unless $self->brik_help_run_undef_arg('set_policy_forward', $target)
438 0 0 if (length $source)
441 0 0 if (length $destination)
444 0 0 if (length $protocol)
447 0 0 if (length $dport)
450 0 0 if (length $sport)
453 0 0 if (length $to_ports)
456 0 0 if (length $state)
459 0 0 if (length $uid)
462 0 0 if (length $to_destination)
465 0 0 if (length $custom)
479 0 0 unless $self->brik_help_run_undef_arg('add', $table)
480 0 0 unless $self->brik_help_run_undef_arg('add', $chain)
481 0 0 unless $self->brik_help_run_undef_arg('add', $target)
482 0 0 unless $self->brik_help_run_undef_arg('add', $rule)
483 0 0 unless $self->brik_help_run_invalid_arg('add', $rule, 'HASH')
496 0 0 unless $self->brik_help_run_undef_arg('add_nat', $chain)
497 0 0 unless $self->brik_help_run_undef_arg('add_nat', $target)
498 0 0 unless $self->brik_help_run_undef_arg('add_nat', $rule)
499 0 0 unless $self->brik_help_run_invalid_arg('add_nat', $rule, 'HASH')
509 0 0 unless $self->brik_help_run_undef_arg('add_nat_output', $target)
510 0 0 unless $self->brik_help_run_undef_arg('add_nat_output', $rule)
511 0 0 unless $self->brik_help_run_invalid_arg('add_nat_output', $rule, 'HASH')
520 0 0 unless $self->brik_help_run_undef_arg('add_nat_output_return', $rule)
521 0 0 unless $self->brik_help_run_invalid_arg('add_nat_output_return', $rule, 'HASH')
530 0 0 unless $self->brik_help_run_undef_arg('add_nat_output_redirect', $rule)
531 0 0 unless $self->brik_help_run_invalid_arg('add_nat_output_redirect', $rule, 'HASH')
540 0 0 unless $self->brik_help_run_undef_arg('add_nat_output_dnat', $rule)
541 0 0 unless $self->brik_help_run_invalid_arg('add_nat_output_dnat', $rule, 'HASH')
551 0 0 unless $self->brik_help_run_undef_arg('add_nat_postrouting', $target)
552 0 0 unless $self->brik_help_run_undef_arg('add_nat_postrouting', $rule)
553 0 0 unless $self->brik_help_run_invalid_arg('add_nat_postrouting', $rule, 'HASH')
563 0 0 unless $self->brik_help_run_undef_arg('add_nat_postrouting_masquerade', $rule)
564 0 0 unless $self->brik_help_run_invalid_arg('add_nat_postrouting_masquerade', $rule, 'HASH')
573 0 0 unless $self->brik_help_run_undef_arg('add_nat_postrouting_dnat', $rule)
574 0 0 unless $self->brik_help_run_invalid_arg('add_nat_postrouting_dnat', $rule, 'HASH')
585 0 0 unless $self->brik_help_run_undef_arg('add_filter', $chain)
586 0 0 unless $self->brik_help_run_undef_arg('add_filter', $target)
587 0 0 unless $self->brik_help_run_undef_arg('add_filter', $rule)
588 0 0 unless $self->brik_help_run_invalid_arg('add_filter', $rule, 'HASH')
598 0 0 unless $self->brik_help_run_undef_arg('add_filter_output', $target)
599 0 0 unless $self->brik_help_run_undef_arg('add_filter_output', $rule)
600 0 0 unless $self->brik_help_run_invalid_arg('add_filter_output', $rule, 'HASH')
609 0 0 unless $self->brik_help_run_undef_arg('add_filter_output_accept', $rule)
610 0 0 unless $self->brik_help_run_invalid_arg('add_filter_output_accept', $rule, 'HASH')
619 0 0 unless $self->brik_help_run_undef_arg('add_filter_output_reject', $rule)
620 0 0 unless $self->brik_help_run_invalid_arg('add_filter_output_reject', $rule, 'HASH')
632 0 0 unless $self->brik_help_run_undef_arg('del', $table)
633 0 0 unless $self->brik_help_run_undef_arg('del', $chain)
634 0 0 unless $self->brik_help_run_undef_arg('del', $target)
635 0 0 unless $self->brik_help_run_undef_arg('del', $rule)
636 0 0 unless $self->brik_help_run_invalid_arg('del', $rule, 'HASH')
649 0 0 unless $self->brik_help_run_undef_arg('del_nat', $chain)
650 0 0 unless $self->brik_help_run_undef_arg('del_nat', $target)
651 0 0 unless $self->brik_help_run_undef_arg('del_nat', $rule)
652 0 0 unless $self->brik_help_run_invalid_arg('del_nat', $rule, 'HASH')
662 0 0 unless $self->brik_help_run_undef_arg('del_nat_output', $target)
663 0 0 unless $self->brik_help_run_undef_arg('del_nat_output', $rule)
664 0 0 unless $self->brik_help_run_invalid_arg('del_nat_output', $rule, 'HASH')
673 0 0 unless $self->brik_help_run_undef_arg('del_nat_output_return', $rule)
674 0 0 unless $self->brik_help_run_invalid_arg('del_nat_output_return', $rule, 'HASH')
683 0 0 unless $self->brik_help_run_undef_arg('del_nat_output_return', $rule)
684 0 0 unless $self->brik_help_run_invalid_arg('del_nat_output_return', $rule, 'HASH')
693 0 0 unless $self->brik_help_run_undef_arg('del_nat_output_return', $rule)
694 0 0 unless $self->brik_help_run_invalid_arg('del_nat_output_return', $rule, 'HASH')
706 0 0 unless $self->brik_help_run_undef_arg('check', $table)
707 0 0 unless $self->brik_help_run_undef_arg('check', $chain)
708 0 0 unless $self->brik_help_run_undef_arg('check', $target)
709 0 0 unless $self->brik_help_run_undef_arg('check', $rule)
710 0 0 unless $self->brik_help_run_invalid_arg('check', $rule, 'HASH')
723 0 0 unless $self->brik_help_run_undef_arg('check_nat', $chain)
724 0 0 unless $self->brik_help_run_undef_arg('check_nat', $target)
725 0 0 unless $self->brik_help_run_undef_arg('check_nat', $rule)
726 0 0 unless $self->brik_help_run_invalid_arg('check_nat', $rule, 'HASH')
736 0 0 unless $self->brik_help_run_undef_arg('check_nat_output', $target)
737 0 0 unless $self->brik_help_run_undef_arg('check_nat_output', $rule)
738 0 0 unless $self->brik_help_run_invalid_arg('check_nat_output', $rule, 'HASH')
747 0 0 unless $self->brik_help_run_undef_arg('check_nat_output_return', $rule)
748 0 0 unless $self->brik_help_run_invalid_arg('check_nat_output_return', $rule, 'HASH')
757 0 0 unless $self->brik_help_run_undef_arg('check_nat_output_return', $rule)
758 0 0 unless $self->brik_help_run_invalid_arg('check_nat_output_return', $rule, 'HASH')
767 0 0 unless $self->brik_help_run_undef_arg('check_nat_output_return', $rule)
768 0 0 unless $self->brik_help_run_invalid_arg('check_nat_output_return', $rule, 'HASH')
777 0 0 if ($target_host_port =~ /^\d+$/)
780 0 0 if ($dest_host_port =~ /^\d+$/)
794 0 0 if ($action eq 'start') { }
804 0 0 if ($action eq 'start' and not $self->check_nat_output_return({'state', 'ESTABLISHED'}))
805 0 0 unless $self->$method_return({'state', 'ESTABLISHED'})
809 0 0 if ($protocol) { }
816 0 0 if ($action eq 'start' and not $self->check_nat_output_dnat($rule)) { }
0 0 elsif ($action eq 'stop') { }
817 0 0 unless $self->$method_dnat($rule)
820 0 0 unless $self->$method_dnat($rule)
837 0 0 if ($action eq 'start' and not $self->check_nat_output_dnat($rule_tcp)) { }
0 0 elsif ($action eq 'stop') { }
838 0 0 unless $self->$method_dnat($rule_tcp)
841 0 0 unless $self->$method_dnat($rule_tcp)
843 0 0 if ($action eq 'start' and not $self->check_nat_output_dnat($rule_udp)) { }
0 0 elsif ($action eq 'stop') { }
844 0 0 unless $self->$method_dnat($rule_udp)
847 0 0 unless $self->$method_dnat($rule_udp)
858 0 0 unless $self->brik_help_run_undef_arg('start_redirect_target_to', $target_host_port)
859 0 0 unless $self->brik_help_run_undef_arg('start_redirect_target_to', $dest_host_port)
868 0 0 unless $self->brik_help_run_undef_arg('start_redirect_target_tcp_to', $target_host_port)
869 0 0 unless $self->brik_help_run_undef_arg('start_redirect_target_tcp_to', $dest_host_port)
878 0 0 unless $self->brik_help_run_undef_arg('start_redirect_target_udp_to', $target_host_port)
879 0 0 unless $self->brik_help_run_undef_arg('start_redirect_target_udp_to', $dest_host_port)
888 0 0 unless $self->brik_help_run_undef_arg('stop_redirect_target_to', $target_host_port)
889 0 0 unless $self->brik_help_run_undef_arg('stop_redirect_target_to', $dest_host_port)