Branch Coverage

blib/lib/Netstack/Utils/Ip.pm
Criterion Covered Total %
branch 35 88 39.7


line true false branch
88 0 4 unless ($ip =~ /^[\d\.]+$/u)
92 0 4 if ($ip =~ /^\./u)
96 0 4 if ($ip =~ /\.$/u)
101 0 4 if ($ip =~ /^(\d+)$/u and $1 < 256)
107 0 4 unless ($n >= 0 and $n < 4)
112 0 4 if ($ip =~ /\.\./u)
118 0 16 unless ($_ >= 0 and $_ < 256)
131 0 2 unless defined $ipMin and defined $ipMax
133 0 2 unless isIpv4($ipMin) and isIpv4($ipMax)
141 1 1 wantarray ? :
152 0 2 if ($ip =~ /^(?:(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\.){3}
0 2 elsif ($ip =~ /^(?:(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\.){3}
173 0 0 if $suffix < 0 or $suffix > 255
186 1 1 wantarray ? :
198 0 1 if $mask == 32
212 0 3 unless $num >= 0 and $num <= 4294967295
228 0 10 unless defined $addr
230 0 10 unless ($addr =~ /^(?:(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\.){3}
235 0 0 if ($addr =~ /any|all/iu) { }
243 0 40 !(defined $_ || /^\s*$/u) ? :
244 0 10 if scalar @addr != 4
257 0 5 unless defined $mask
260 2 3 if ($mask =~ /^(?:(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\.){3}
0 3 elsif (not $mask =~ /^\d+$/ou) { }
266 0 2 if ($IpStr =~ /01/u) { }
2 0 elsif ($IpStr =~ /^(1+)/u) { }
280 0 5 if ($mask < 0 or $mask > 32)
292 1 0 if ($wildcard =~ /(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.
315 1 1 if ($mask =~ /^(?:(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\.){3}
1 0 elsif ($mask >= 0 and $mask <= 32) { }
341 0 1 unless defined $min or not defined $max
344 0 1 unless $min >= 0 and $min <= 4294967295 and $max >= 0 || $max <= 4294967295
354 1 0 if ($min == ($min & 4294967296 - (1 << 32 - $mask)) and $max == $min + (1 << 32 - $mask) - 1) { }
370 0 0 unless defined $service
377 0 0 if ($proto eq '0' or $proto =~ /any|all/iu) { }
0 0 elsif ($proto =~ /tcp|udp|icmp|\d+/iu) { }
379 0 0 wantarray ? :
383 0 0 if ($proto =~ /tcp/iu) { }
0 0 elsif ($proto =~ /udp/iu) { }
0 0 elsif ($proto =~ /icmp/iu) { }
0 0 elsif ($proto =~ /\d+/iu) { }
400 0 0 if (defined $port) { }
403 0 0 unless $min >= 0 and $min <= 65535 and ($max >= 0 and $max <= 65535)
412 0 0 wantarray ? :