Branch Coverage

blib/lib/NET/MitM.pm
Criterion Covered Total %
branch 110 170 64.7


line true false branch
134 0 7 unless $$this{'remote_ip_address'} = shift()
135 0 7 unless $$this{'remote_port_num'} = shift()
173 0 125 unless my $key = shift()
175 112 13 if (defined $value)
351 1 7 if (defined $interval and $interval == 0)
384 2 0 if ($parallel)
417 0 0 defined $level ? :
418 0 0 $parallel ? :
446 1 0 if (defined $new_log_file)
447 0 1 if (not $new_log_file) { }
448 0 0 if ($$this{'LOGFILE'})
451 0 0 if $$this{'verbose'}
455 1 0 if (open $LOGFILE, ">>$new_log_file") { }
462 0 0 if $$this{'verbose'}
464 1 0 if $$this{'verbose'} and $$this{'log_file'}
549 0 8 unless $$this{'local_port_num'} = shift()
550 0 8 unless $$this{'server_callback'} = shift()
590 0 74 unless $$this{'remote_ip_address'} = shift()
591 0 74 unless $$this{'remote_port_num'} = shift()
620 81 378 if $$this{'LOGFILE'}
648 0 256 unless $$this{'verbose'}
649 0 256 unless $$this{'name'}
650 109 147 if ($_[0] =~ /^[<>]{3}$/) { }
686 11 98 if ($callback)
688 10 1 if defined $new_msg
698 0 109 if ($$this{'verbose'} > 1) { }
712 0 85 if $$this{'client_to_server_callback'} and $$this{'verbose'} > 1
715 0 85 unless $$this{'SERVER'}
743 0 24 if $$this{'server_to_client_callback'} and $$this{'verbose'} > 1
774 0 85 if (length $msg == 0)
832 11 80 if $$this{'SERVER'}
833 0 80 unless socket $$this{'SERVER'}, 2, 1, $protocol
834 0 80 unless $$this{'remote_ip_address'}
835 0 80 unless my $remote_ip_aton = inet_aton($$this{'remote_ip_address'})
836 0 80 unless my $remote_port_address = sockaddr_in($$this{'remote_port_num'}, $remote_ip_aton)
838 0 80 unless connect $$this{'SERVER'}, $remote_port_address
880 0 44 if $$this{'defrag_delay'}
885 20 24 if (length $msg == 0)
891 7 17 if ($$this{'SERVER'}) { }
17 0 elsif ($$this{'server_callback'}) { }
904 0 7 if $$this{'defrag_delay'}
907 0 7 unless (defined $msg)
918 0 19 unless my $this = shift()
919 0 19 unless my $child = shift()
921 19 0 if ($child == $$this{'children'}[$i])
922 0 19 if $$this{'verbose'} > 1
937 4 7 if ($$this{'timer_interval'} and $$this{'timer_callback'})
946 89 5 if ($$this{'LISTEN'})
947 0 89 unless fileno $$this{'LISTEN'}
951 188 89 if $$each{'CLIENT'}
952 21 256 if $$each{'SERVER'}
957 21 73 if ($$this{'timer_interval'}) { }
958 13 8 if (time > $target_time)
959 4 9 unless $$this{'timer_callback'}()
964 0 17 if $delay < 0
965 10 7 if $$this{'verbose'} > 1
970 21 64 if ($$this{'LISTEN'} and vec $rout, fileno $$this{'LISTEN'}, 1)
972 19 1 if $child
976 0 156 if not $$each{'CLIENT'} and $each != $this
977 44 112 if ($$each{'CLIENT'} and vec $rout, fileno $$each{'CLIENT'}, 1)
979 20 24 unless ($$each{'CLIENT'})
981 1 19 if ($each == $this) { }
991 7 129 if ($$each{'SERVER'} and vec $rout, fileno $$each{'SERVER'}, 1)
993 0 7 unless ($$each{'SERVER'})
995 0 0 if ($each == $this) { }
1068 0 0 if (defined $mydate)
1097 3 8 if $$this{'LISTEN'}
1098 2 6 $$this{'parallel'} ? :
1100 0 8 unless socket $$this{'LISTEN'}, 2, 1, $protocol
1101 0 8 unless bind $$this{'LISTEN'}, sockaddr_in($$this{'local_port_num'}, "\000\000\000\000")
1102 0 8 unless CORE::listen $$this{'LISTEN'}, 1
1117 6 15 if $$this{'remote_ip_address'}
1126 80 157 if ($key =~ /^(LISTEN|children|connections|name|timer_interval|timer_callback)$/) { }
141 16 elsif ($key =~ /^(parallel|log_file|verbose|mydate|.*callback|(local|remote)_(port_num|ip_address))$/) { }
16 0 elsif ($key eq 'LOGFILE') { }
1138 0 22 unless $all_good
1146 0 21 unless $$child{'CLIENT'}
1149 19 2 unless ($$this{'parallel'})
1153 0 2 if (not defined $pid) { }
1 1 elsif (not $pid) { }
1159 0 1 if $$child{'verbose'} > 1
1160 0 1 unless $$child{'CLIENT'}
1165 0 1 if $$child{'verbose'} > 1
1185 21 75 if $$this{'CLIENT'}
1186 80 16 if $$this{'SERVER'}