Branch Coverage

blib/lib/Net/BGP/Transport.pm
Criterion Covered Total %
branch 111 210 52.8


line true false branch
239 0 0 if ($length >= 16) { }
295 5 10 if ($arg =~ /start/i) { }
6 4 elsif ($arg =~ /parent/i) { }
0 4 elsif ($arg =~ /holdtime/i) { }
0 4 elsif ($arg =~ /connectretrytime/i) { }
4 0 elsif ($arg =~ /keepalivetime/i) { }
339 0 0 +(shift())->{'_fsm_state'} == BGP_STATE_ESTABLISHED() ? :
362 4 0 if ($this->{'_fsm_state'} == BGP_STATE_ESTABLISHED())
379 2 0 unless ref $refresh eq 'Net::BGP::Refresh'
382 2 0 if ($this->{'_fsm_state'} == BGP_STATE_ESTABLISHED() and $this->{'_peer_refresh'})
399 238 0 unless defined $this->{'_sibling'}
400 0 0 unless $this->parent->transport eq $this
410 0 0 if defined $this->{'_sibling'}
439 0 0 if ($this->{'_fsm_state'} != BGP_STATE_IDLE())
515 32 0 if defined $action
517 0 32 if (my $oops = $@)
519 0 0 if (UNIVERSAL::isa($oops, 'Net::BGP::Notification')) { }
531 32 0 if defined $next_state
534 18 14 if ($next_state != $state)
536 2 16 if ($state == BGP_STATE_ESTABLISHED()) { }
4 12 elsif ($next_state == BGP_STATE_ESTABLISHED()) { }
567 4 14 if ($pre_state == BGP_STATE_OPEN_CONFIRM() and $pos_state == BGP_STATE_ESTABLISHED())
578 0 76 if (length $this->{'_out_msg_buffer'})
598 0 76 if (length $this->{'_out_msg_buffer'})
604 118 110 if (defined $this->{$timer})
607 4 114 if ($this->{$timer} <= 0)
612 90 28 if ($this->{$timer} < $min_time)
619 0 76 if (defined $this->sibling)
622 0 0 if $sibmin < $min_time
633 0 20 unless (defined $this->{'_peer_socket'})
634 0 0 if $oktofail
643 0 20 unless (defined $sent)
644 0 0 if $oktofail
645 0 0 if ($!{'EAGAIN'} == 0)
661 0 32 unless (defined $socket)
671 20 12 if ($this->{'_in_msg_buf_state'} == AWAITING_HEADER_START()) { }
0 12 elsif ($this->{'_in_msg_buf_state'} == AWAITING_HEADER_FRAGMENT()) { }
12 0 elsif ($this->{'_in_msg_buf_state'} == AWAITING_MESSAGE_FRAGMENT()) { }
674 0 20 if ($!)
680 0 20 if ($num_read == 0) { }
0 20 elsif ($num_read != BGP_MESSAGE_HEADER_LENGTH()) { }
695 0 0 if ($num_read == 0) { }
0 0 elsif ($num_read == $this->{'_in_msg_buf_bytes_exp'}) { }
709 0 12 if ($num_read == 0 and $this->{'_in_msg_buf_bytes_exp'} != 0) { }
12 0 elsif ($num_read == $this->{'_in_msg_buf_bytes_exp'}) { }
727 0 32 if ($conn_closed)
735 0 4 unless defined $this->{'_peer_socket'}
751 4 4 if (defined $socket)
773 2 4 if (defined $this->{'_peer_socket'})
799 8 0 if ($this->{'_hold_time'} != 0)
815 4 0 if ($this->{'_hold_time'} != 0)
837 2 0 if ($this->{'_hold_time'} != 0)
844 0 2 unless ($this->parent->this_can_refresh)
927 0 4 unless ($this->_decode_bgp_open_message($this->_dequeue_message))
933 0 4 if (defined $this->{'_sibling'})
934 0 0 if ($this->{'_sibling'}{'_fsm_state'} == BGP_STATE_OPEN_SENT() or $this->{'_sibling'}{'_fsm_state'} == BGP_STATE_OPEN_CONFIRM()) { }
0 0 elsif ($this->{'_sibling'}{'_fsm_state'} == BGP_STATE_ESTABLISHED()) { }
940 0 0 if ($this_id < $peer_id) { }
965 4 0 if ($this->{'_hold_time'} != 0)
1001 2 2 unless ($this->parent->is_passive)
1006 2 2 unless ($this->parent->is_passive)
1009 0 2 unless (defined $socket)
1015 0 2 unless (defined $rv)
1021 0 2 unless ($rv)
1026 0 2 unless (defined $rv)
1032 0 2 unless (defined $rv)
1033 0 0 unless $! == 115
1043 0 2 if ($@)
1044 0 0 unless $@ =~ /^OK/
1045 0 0 if (defined $socket)
1062 0 5 $a < $b ? :
1069 6 0 if ($this->{'_fsm_state'} == BGP_STATE_ESTABLISHED())
1088 14 8 if (defined $payload)
1100 0 22 if (defined $this->{'_auth_data'}) { }
1116 0 20 if (length $header != BGP_MESSAGE_HEADER_LENGTH())
1126 0 20 if ($marker ne "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377")
1133 0 20 if ($length < BGP_MESSAGE_HEADER_LENGTH() or $length > BGP_MAX_MESSAGE_LENGTH())
1143 0 20 if ($type < BGP_MESSAGE_OPEN() or $type > BGP_MESSAGE_REFRESH())
1151 8 12 if ($type == BGP_MESSAGE_KEEPALIVE()) { }
1176 6 0 if ($this->parent->support_capabilities)
1178 2 4 if (defined $this->{'_peer_announced_id'}) { }
1181 2 0 if ($this->{'_peer_mbgp'})
1185 1 1 if ($this->{'_peer_as4'})
1192 4 0 if ($this->parent->support_mbgp)
1195 2 2 if ($this->parent->this_can_as4)
1202 6 0 if ($this->parent->this_can_refresh)
1217 3 3 if ($this->parent->this_as > 65535) { }
1280 0 5 if ($version != BGP_VERSION_4())
1290 3 2 if ($as != $this->parent->peer_as)
1291 0 3 if ($this->parent->peer_as < 65536) { }
0 3 elsif ($as != 23456) { }
1302 0 5 if ($hold_time < 3 and $hold_time != 0)
1319 15 0 if ($type eq BGP_OPTION_CAPABILITIES()) { }
1346 0 17 if (length $value < 2)
1365 0 17 if (length $data != $len)
1370 5 12 if ($type == BGP_CAPABILITY_MBGP())
1374 5 12 if ($type == BGP_CAPABILITY_REFRESH())
1377 0 17 if ($type == BGP_CAPABILITY_REFRESH_OLD())
1381 3 14 if ($type == BGP_CAPABILITY_AS4())
1383 0 3 if ($len != 4)
1389 0 3 if ($as != $this->parent->peer_as)
1395 3 0 if ($this->parent->this_can_as4)
1409 0 2 if ($error_code < 1 or $error_code > 6)
1415 0 2 if ($error_subcode < 0 or $error_subcode > 11)
1452 0 2 $data ? :