Branch Coverage

blib/lib/Control/CLI.pm
Criterion Covered Total %
branch 43 1244 3.4


line true false branch
154 0 0 unless open my $key, "<", $privateKey
156 0 0 if (/ENCRYPTED/)
168 0 1 unless @$argsRef
170 2 2 ++$even_lc % 2 && defined $_ ? :
173 0 2 unless defined $argsIn[$i]
174 2 0 if ($validArgs{$argsIn[$i]})
178 0 0 unless $noCarp
186 0 0 unless @$argsRef
188 0 0 ++$even_lc % 2 ? :
191 0 0 if $suppressArgs{$argsIn[$i]}
201 0 2 if (not defined $mode) { }
0 2 elsif ($mode =~ /^\s*die\s*$/i) { }
0 2 elsif ($mode =~ /^\s*croak\s*$/i) { }
2 0 elsif ($mode =~ /^\s*return\s*$/i) { }
0 0 elsif (ref $mode) { }
209 0 0 unless (validCodeRef($mode))
225 0 0 defined $1 ? :
231 0 0 if ref $codeRef eq "CODE"
232 0 0 if ref $codeRef eq "ARRAY" and ref $codeRef->[0] eq "CODE"
239 0 0 if ref $callRef eq "CODE"
249 0 0 if validCodeRef($mode)
250 0 0 if lc $privacy eq "clear"
251 0 0 if lc $privacy eq "hide"
263 0 1 if (@_ == 1) { }
270 0 1 defined $args{'debug'} ? :
271 1 0 defined $args{'errmode'} ? :
272 0 1 defined $args{'errmsg_format'} ? :
273 0 1 unless defined $connectionType
275 1 0 if ($connectionType =~ /^TELNET$/i) { }
0 0 elsif ($connectionType =~ /^SSH$/i) { }
276 0 1 unless $UseTelnet
285 0 0 unless $UseSSH
291 0 0 if ($^O eq 'MSWin32') { }
292 0 0 unless $UseSerial
295 0 0 $debug & 2 ? :
296 0 0 unless $parent = "Win32::SerialPort"->new($connectionType, !($debug & 1))
300 0 0 unless $UseSerial
303 0 0 $debug & 2 ? :
304 0 0 unless $parent = "Device::SerialPort"->new($connectionType, !($debug & 1))
363 0 1 $connectionType eq 'SSH' ? :
364 0 1 if ($connectionType eq "SERIAL")
366 0 0 $^O eq 'MSWin32' ? :
369 1 0 if ($connectionType eq "TELNET")
376 1 1 if ($arg eq 'errmode') { }
0 1 elsif ($arg eq 'errmsg_format') { }
0 1 elsif ($arg eq 'timeout') { }
0 1 elsif ($arg eq 'connection_timeout') { }
0 1 elsif ($arg eq 'read_block_size') { }
0 1 elsif ($arg eq 'blocking') { }
0 1 elsif ($arg eq 'read_attempts') { }
0 1 elsif ($arg eq 'readwait_timer') { }
0 1 elsif ($arg eq 'data_with_error') { }
0 1 elsif ($arg eq 'return_reference') { }
0 1 elsif ($arg eq 'output_record_separator') { }
0 1 elsif ($arg eq 'prompt_credentials') { }
0 1 elsif ($arg eq 'prompt') { }
0 1 elsif ($arg eq 'username_prompt') { }
0 1 elsif ($arg eq 'password_prompt') { }
0 1 elsif ($arg eq 'terminal_type') { }
0 1 elsif ($arg eq 'window_size') { }
0 1 elsif ($arg eq 'report_query_status') { }
0 1 elsif ($arg eq 'input_log') { }
0 1 elsif ($arg eq 'output_log') { }
0 1 elsif ($arg eq 'dump_log') { }
0 1 elsif ($arg eq 'debug') { }
414 0 0 if (@_ == 1) { }
416 0 0 if ($args{'host'} =~ /^(.+?)\s+(\d+)$/ or $args{'host'} =~ /^([^:\s]+?):(\d+)$/)
434 0 0 defined $args{'blocking'} ? :
0 0 defined $args{'connection_timeout'} ? :
0 0 defined $args{'errmode'} ? :
461 0 0 defined $args{'prompt_credentials'} ? :
465 0 0 if ($self->{'TYPE'} ne "SERIAL" and not $UseSocketIP and defined $args{'blocking'} and not $args{'blocking'})
469 0 0 if defined $self->{'POLL'}{'errmode'}
477 0 0 if @_
479 0 0 unless (defined $self->{'POLL'} and $self->{'POLL'}{'coderef'} == "Control::CLI"->can("connect_poll"))
483 0 0 if defined $self->{'POLL'}{'errmode'}
486 0 0 unless defined $self->{'POLL'}{'complete'} and $self->{'POLL'}{'complete'} == 0
498 0 0 defined $args{'timeout'} ? :
499 0 0 defined $args{'blocking'} ? :
500 0 0 defined $args{'return_reference'} ? :
501 0 0 defined $args{'errmode'} ? :
502 0 0 if defined $errmode
504 0 0 if $blocking and not length $self->{'BUFFER'}
516 0 0 defined $args{'read_attempts'} ? :
517 0 0 defined $args{'readwait_timer'} ? :
518 0 0 defined $args{'data_with_error'} ? :
519 0 0 defined $args{'timeout'} ? :
520 0 0 defined $args{'blocking'} ? :
521 0 0 defined $args{'return_reference'} ? :
522 0 0 defined $args{'errmode'} ? :
523 0 0 if defined $errmode
527 0 0 if (not length $$bufref and $blocking)
529 0 0 unless defined $bufref
535 0 0 unless (defined $outref)
536 0 0 if $dataWithError and length $$bufref
539 0 0 if (length $$outref)
545 0 0 $returnRef ? :
557 0 0 if (@_ == 1) { }
564 0 0 if $args[$i] eq "match"
565 0 0 if $args[$i] eq "match_list" and ref $args[$i + 1] eq "ARRAY"
566 0 0 if $args[$i] eq "timeout"
567 0 0 if $args[$i] eq "blocking"
568 0 0 if $args[$i] eq "return_reference"
569 0 0 if $args[$i] eq "errmode"
570 0 0 if $args[$i] eq "poll_syntax"
596 0 0 if defined $self->{'POLL'}{'errmode'}
600 0 0 if ($pollSyntax) { }
601 0 0 wantarray ? :
604 0 0 wantarray ? :
612 0 0 if @_
614 0 0 unless (defined $self->{'POLL'} and $self->{'POLL'}{'coderef'} == "Control::CLI"->can("waitfor_poll"))
619 0 0 if defined $self->{'POLL'}{'errmode'}
622 0 0 unless defined $self->{'POLL'}{'complete'} and $self->{'POLL'}{'complete'} == 0
633 0 0 if (@_ == 1) { }
640 0 0 unless defined $args{'string'}
641 0 0 defined $args{'errmode'} ? :
642 0 0 if defined $errmode
652 0 0 if (@_ == 1) { }
659 0 0 defined $args{'errmode'} ? :
660 0 0 if defined $errmode
694 0 0 defined $args{'blocking'} ? :
0 0 defined $args{'timeout'} ? :
0 0 defined $args{'errmode'} ? :
0 0 defined $args{'return_reference'} ? :
704 0 0 defined $args{'prompt_credentials'} ? :
0 0 defined $args{'prompt'} ? :
0 0 defined $args{'username_prompt'} ? :
0 0 defined $args{'password_prompt'} ? :
708 0 0 if defined $self->{'POLL'}{'errmode'}
716 0 0 if @_
718 0 0 unless (defined $self->{'POLL'} and $self->{'POLL'}{'coderef'} == "Control::CLI"->can("login_poll"))
723 0 0 if defined $self->{'POLL'}{'errmode'}
726 0 0 unless defined $self->{'POLL'}{'complete'} and $self->{'POLL'}{'complete'} == 0
737 0 0 if (@_ == 1) { }
744 0 0 unless defined $args{'command'}
757 0 0 defined $args{'blocking'} ? :
0 0 defined $args{'timeout'} ? :
0 0 defined $args{'errmode'} ? :
0 0 defined $args{'return_reference'} ? :
763 0 0 defined $args{'prompt'} ? :
768 0 0 if defined $self->{'POLL'}{'errmode'}
772 0 0 if ($args{'poll_syntax'}) { }
773 0 0 wantarray ? :
776 0 0 wantarray ? :
784 0 0 if @_
786 0 0 unless (defined $self->{'POLL'} and $self->{'POLL'}{'coderef'} == "Control::CLI"->can("cmd_poll"))
791 0 0 if defined $self->{'POLL'}{'errmode'}
794 0 0 unless defined $self->{'POLL'}{'complete'} and $self->{'POLL'}{'complete'} == 0
805 0 0 if (@_ == 1) { }
819 0 0 defined $args{'blocking'} ? :
0 0 defined $args{'errmode'} ? :
834 0 0 defined $args{'baudrate'} ? :
0 0 defined $args{'parity'} ? :
0 0 defined $args{'databits'} ? :
0 0 defined $args{'stopbits'} ? :
0 0 defined $args{'handshake'} ? :
837 0 0 if defined $self->{'POLL'}{'errmode'}
845 0 0 if @_
847 0 0 unless (defined $self->{'POLL'} and $self->{'POLL'}{'coderef'} == "Control::CLI"->can("change_baudrate_poll"))
851 0 0 if defined $self->{'POLL'}{'errmode'}
854 0 0 unless defined $self->{'POLL'}{'complete'} and $self->{'POLL'}{'complete'} == 0
865 0 0 unless (defined $fh)
868 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
870 0 0 if (defined $fh and $self->{'PARENT'}->errmsg =~ /problem creating $fh: (.*)/)
875 0 0 unless (ref $fh or length $fh)
879 0 0 unless (ref $fh or defined fileno $fh)
882 0 0 unless open $fh, ">", "$logfile"
895 0 0 unless (defined $fh)
898 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
900 0 0 if (defined $fh and $self->{'PARENT'}->errmsg =~ /problem creating $fh: (.*)/)
905 0 0 unless (ref $fh or length $fh)
909 0 0 unless (ref $fh or defined fileno $fh)
912 0 0 unless open $fh, ">", "$logfile"
925 0 0 unless (defined $fh)
928 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
930 0 0 if (defined $fh and $self->{'PARENT'}->errmsg =~ /problem creating $fh: (.*)/)
935 0 0 unless (ref $fh or length $fh)
939 0 0 unless (ref $fh or defined fileno $fh)
942 0 0 unless open $fh, ">", "$logfile"
955 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
0 0 elsif ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
957 0 0 $self->{'PARENT'}->eof ? :
961 0 0 if defined $self->{'PARENT'} and not defined $self->{'SSHCHANNEL'}
963 0 0 if $self->{'SSHCHANNEL'}->eof
966 0 0 if $sshError == -1
967 0 0 if $sshError == -43
985 0 0 if $self->eof
987 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
0 0 elsif ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
990 0 0 unless $self->{'PARENT'}->break
994 0 0 unless $self->put("string", "~B", "errmode", "return")
1011 0 0 if (@_ == 1) { }
1019 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
0 0 elsif ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
1020 0 0 if defined $self->{'PARENT'}
1022 0 0 if defined $self->{'SOCKET'}
1026 0 0 if defined $self->{'SSHCHANNEL'}
1028 0 0 if defined $self->{'PARENT'}
1030 0 0 if defined $self->{'SOCKET'}
1034 0 0 if (defined $self->{'PARENT'} and not $self->{'SERIALEOF'})
1036 0 0 if defined $self->{'BAUDRATE'}
1049 0 0 if ($args{'close_logs'})
1050 0 0 if (defined $self->input_log)
1054 0 0 if (defined $self->output_log)
1058 0 0 if (defined $self->dump_log)
1062 0 0 if ($self->{'TYPE'} eq "TELNET" and defined $self->parent->option_log)
1097 0 0 if ($_[0]->isa($Package)) { }
0 0 elsif (ref $_[0]) { }
1109 0 0 if (defined $args{'object_complete'})
1110 0 0 if ($args{'object_complete'} =~ /^all|next$/i) { }
1117 0 0 if (defined $args{'object_error'})
1118 0 0 if ($args{'object_error'} =~ /^return|ignore$/i) { }
1125 0 0 if (defined $args{'poll_timer'})
1126 0 0 if ($args{'poll_timer'} =~ /\d+/) { }
1133 0 0 if (defined $args{'poll_code'})
1134 0 0 unless (validCodeRef($args{'poll_code'}))
1139 0 0 defined $self ? :
0 0 defined $args{'errmode'} ? :
1140 0 0 defined $self ? :
0 0 defined $args{'errmsg_format'} ? :
1141 0 0 unless defined $self or defined $args{'object_list'}
1148 0 0 if (defined $self) { }
0 0 elsif (ref $args{'object_list'} eq 'ARRAY') { }
0 0 elsif (ref $args{'object_list'} eq 'HASH') { }
1149 0 0 unless (defined $self->{'POLL'})
1150 0 0 if defined $args{'errmode'}
1153 0 0 defined $args{'errmode'} ? :
1155 0 0 if $ok or not defined $ok
1161 0 0 unless $obj->isa($Package)
1162 0 0 unless (defined $obj->{'POLL'})
1163 0 0 if defined $args{'errmode'}
1167 0 0 defined $objLastPollTime->[$i] ? :
1168 0 0 defined $args{'errmode'} ? :
1169 0 0 if ($ok) { }
0 0 elsif (not defined $ok) { }
1171 0 0 unless ($obj->{'POLLREPORTED'})
1178 0 0 unless ($obj->{'POLLREPORTED'})
1185 0 0 if ($objLastPollTime->[$i] - $objStartTime > $pollTimer and $args{'poll_code'}) { }
1197 0 0 unless $obj->isa($Package)
1198 0 0 unless (defined $obj->{'POLL'})
1199 0 0 if defined $args{'errmode'}
1203 0 0 defined $objLastPollTime->{$key} ? :
1204 0 0 defined $args{'errmode'} ? :
1205 0 0 if ($ok) { }
0 0 elsif (not defined $ok) { }
1207 0 0 unless ($obj->{'POLLREPORTED'})
1214 0 0 unless ($obj->{'POLLREPORTED'})
1221 0 0 if ($objLastPollTime->{$key} - $objStartTime > $pollTimer and $args{'poll_code'}) { }
1235 0 0 if $running == 0 or $objComplete eq "next" and @lastCompleted or $objError eq "return" and @lastFailed
1237 0 0 if ($args{'poll_code'} and not $pollActHost)
1242 0 0 if $mainLoopSleep > 0
1245 0 0 unless wantarray
1255 0 0 if (defined $newSetting)
1257 0 0 if ($self->{'TYPE'} eq "TELNET")
1276 0 0 if defined $newSetting
1284 0 0 if defined $newSetting
1292 0 0 if defined $newSetting
1300 0 0 if defined $newSetting
1308 0 0 if defined $newSetting
1316 0 0 if defined $newSetting
1324 0 0 if (defined $newSetting)
1326 0 0 $newSetting eq "\r" ? :
1336 0 0 if (defined $newSetting)
1337 0 0 if (ref $newSetting and not validCodeRef($newSetting))
1356 0 0 if (defined $newSetting)
1367 0 0 if (defined $newSetting)
1378 0 0 if (defined $newSetting)
1389 0 0 if (defined $newSetting)
1390 0 0 length $newSetting ? :
1400 0 0 if (defined $width and not $width or defined $height and not $height) { }
0 0 elsif (defined $width and defined $height) { }
1404 0 0 if ($width =~ /^\d+$/ and $height =~ /^\d+$/) { }
1418 0 0 if defined $newSetting
1427 1 0 if (defined $newSetting and my $newMode = parse_errmode($pkgsub, $newSetting))
1438 0 0 if (@_ == 1) { }
1445 0 0 defined $args{'errmsg_format'} ? :
1447 0 0 if defined $args{'set_message'}
1457 0 0 if (defined $newSetting)
1458 0 0 if ($newSetting =~ /^\s*terse\s*$/i) { }
0 0 elsif ($newSetting =~ /^\s*verbose\s*$/i) { }
0 0 elsif ($newSetting =~ /^\s*default\s*$/i) { }
1465 0 0 if defined $newSetting
1474 0 0 if (defined $newSetting and $newSetting != $currentSetting)
1476 0 0 if ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
1477 0 0 $newSetting & 2 ? :
1480 0 0 if ($^O eq 'MSWin32') { }
1482 0 0 $newSetting & 2 ? :
1486 0 0 $newSetting & 2 ? :
1534 0 0 if ($self->{'TYPE'} eq 'SERIAL') { }
1609 0 0 if (defined $self->{'POLL'} and defined $self->{'POLL'}{'complete'} and $self->{'POLL'}{'complete'} == 0)
1646 0 0 unless defined $self->{'POLL'}
1648 0 0 if @{$self->{'POLL'}{'cache'};}
1659 0 0 unless ($self->{'POLLING'})
1673 0 0 if (defined $timeout)
1678 0 0 @{$self->{'POLL'}{'cache'};} ? :
1689 0 0 unless ($self->{'POLLING'})
1704 0 0 @{$self->{'POLL'}{'cache'};} ? :
1715 0 0 unless ($self->{'POLLING'})
1721 0 0 if (@{$self->{'POLL'}{'cache'};})
1722 0 0 if defined $ok and $ok == 0
1725 0 0 unless defined $ok
1726 0 0 unless wantarray
1731 0 0 unless $self->{'POLL'}{'output_requested'} and $self->{'POLL'}{'output_type'}
1734 0 0 if ($self->{'POLL'}{'output_type'} & 1)
1737 0 0 if ($self->{'POLL'}{'return_reference'}) { }
1744 0 0 if ($self->{'POLL'}{'output_type'} & 2)
1745 0 0 if (ref $self->{'POLL'}{'output_result'} eq 'ARRAY') { }
1746 0 0 if ($self->{'POLL'}{'return_list'}) { }
1765 0 0 unless ($self->{'POLLING'})
1770 0 0 if ($self->{'POLL'}{'blocking'}) { }
1774 0 0 unless (defined $self->{'POLL'}{'endtime'})
1777 0 0 unless &Control::CLI::time() > $self->{'POLL'}{'endtime'}
1787 0 0 unless ($self->{'POLLING'})
1792 0 0 if ($UseSocketIP) { }
1795 0 0 unless (defined $self->{'POLL'}{'socket'})
1798 0 0 unless ($self->{'POLL'}{'blocking'})
1799 0 0 if (defined $self->{'POLL'}{'timeout'}) { }
1807 0 0 unless $self->{'POLL'}{'socket'} = "IO::Socket::IP"->new("PeerHost", $host, "PeerPort", $port, "Blocking", 0)
1821 0 0 if ($self->{'POLL'}{'blocking'}) { }
1823 0 0 unless select undef, $wvec, $evec, $self->{'POLL'}{'timeout'}
1826 0 0 unless (select undef, $wvec, $evec, 0)
1827 0 0 unless &Control::CLI::time() > $self->{'POLL'}{'endtime'}
1832 0 0 if $!
1839 0 0 unless $self->{'POLL'}{'socket'} = "IO::Socket::INET"->new("PeerHost", $host, "PeerPort", $port, "Timeout", $self->{'POLL'}{'timeout'})
1849 0 0 unless ($self->{'POLLING'})
1854 0 0 if ($self->{'POLL'}{'blocking'}) { }
1861 0 0 unless (defined $self->{'POLL'}{'read_buffer'})
1862 0 0 if defined $errmsg
1868 0 0 if ($self->{'POLL'}{'already_polled'})
1874 0 0 unless (defined $self->{'POLL'}{'endtime'})
1883 0 0 unless (defined $self->{'POLL'}{'read_buffer'})
1884 0 0 if defined $errmsg
1887 0 0 if (length $self->{'POLL'}{'read_buffer'})
1894 0 0 if (&Control::CLI::time() > $self->{'POLL'}{'endtime'}) { }
1897 0 0 if defined $errmsg
1909 0 0 unless defined $readAttempts
1910 0 0 unless defined $readwaitTimer
1911 0 0 unless defined $dataWithError
1914 0 0 unless ($self->{'POLLING'})
1920 0 0 if ($self->{'POLL'}{'blocking'}) { }
1930 0 0 unless (defined $self->{'POLL'}{'read_buffer'})
1931 0 0 if defined $errmsg
1937 0 0 if ($self->{'POLL'}{'already_polled'})
1943 0 0 if ($firstReadRequired and not defined $self->{'POLL'}{'endtime'}) { }
0 0 elsif (not $firstReadRequired || defined $self->{'POLL'}{'waittime'}) { }
1956 0 0 unless (defined $outref)
1957 0 0 if ($dataWithError and length $self->{'POLL'}{'read_buffer'})
1963 0 0 if defined $errmsg
1966 0 0 if (length $$outref)
1973 0 0 if (defined $self->{'POLL'}{'waittime'}) { }
1974 0 0 if (&Control::CLI::time() > $self->{'POLL'}{'waittime'}) { }
1985 0 0 if (&Control::CLI::time() > $self->{'POLL'}{'endtime'}) { }
1988 0 0 if defined $errmsg
2004 0 0 unless ($self->{'POLLING'})
2009 0 0 unless (defined $self->{'POLL'}{$pollsub})
2015 0 0 if (@_ and not %args)
2046 0 0 defined $args{'username'} ? :
0 0 defined $args{'password'} ? :
0 0 defined $args{'passphrase'} ? :
0 0 defined $args{'prompt_credentials'} ? :
2051 0 0 if defined $connect->{'errmode'}
2055 0 0 if ($connect->{'stage'} < 1)
2060 0 0 if defined $connect->{'terminal_type'}
2061 0 0 if defined $connect->{'window_size'}
2064 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
0 0 elsif ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
2065 0 0 if ($connect->{'stage'} < 1)
2067 0 0 unless defined $connect->{'host'}
2070 0 0 unless defined $connect->{'port'}
2073 0 0 if (not $self->{'POLL'}{'blocking'} and $connect->{'atomic_connect'}) { }
2084 0 0 unless $ok
2089 0 0 unless $self->{'PARENT'}->fhopen($self->{'SOCKET'})
2090 0 0 if ($^O eq "MSWin32")
2094 0 0 if (exists $telobj->{'select_supported'} and not $telobj->{'select_supported'})
2104 0 0 if $connect->{'atomic_connect'}
2107 0 0 if ($connect->{'stage'} < 1)
2109 0 0 unless defined $connect->{'host'}
2110 0 0 unless defined $connect->{'port'}
2113 0 0 if (not $self->{'POLL'}{'blocking'} and $connect->{'atomic_connect'}) { }
2121 0 0 if ($connect->{'stage'} < 2)
2124 0 0 unless $ok
2136 0 0 if $@
2137 0 0 unless $ok
2138 0 0 unless $self->{'POLL'}{'blocking'}
2140 0 0 if ($connect->{'stage'} < 3)
2142 0 0 if ($connect->{'callback'})
2143 0 0 if (validCodeRef($connect->{'callback'})) { }
2145 0 0 defined $errmsg ? :
0 0 unless $ok
2146 0 0 unless $self->{'POLL'}{'blocking'}
2153 0 0 if ($connect->{'stage'} < 4)
2155 0 0 unless (defined $connect->{'username'})
2156 0 0 unless $connect->{'prompt_credentials'}
2161 0 0 if (not $self->{'POLL'}{'blocking'} and &Control::CLI::time() > $self->{'POLL'}{'endtime'})
2166 0 0 if $auth eq "publickey"
2167 0 0 if $auth eq "password"
2168 0 0 if $auth eq "keyboard-interactive"
2173 0 0 unless $self->{'POLL'}{'blocking'}
2175 0 0 if ($connect->{'stage'} < 5)
2177 0 0 if ($connect->{'authPublicKey'})
2178 0 0 if (defined $connect->{'publickey'} and defined $connect->{'privatekey'}) { }
0 0 elsif (not $connect->{'authPassword'}) { }
2180 0 0 unless -e $connect->{'publickey'}
2182 0 0 unless -e $connect->{'privatekey'}
2183 0 0 unless ($connect->{'passphrase'})
2185 0 0 unless defined $passphReq
2186 0 0 if ($passphReq)
2187 0 0 unless $connect->{'prompt_credentials'}
2194 0 0 if (not $self->{'POLL'}{'blocking'} and &Control::CLI::time() > $self->{'POLL'}{'endtime'})
2203 0 0 if ($ok) { }
0 0 elsif (not $connect->{'authPassword'} && (defined $connect->{'password'} || $connect->{'prompt_credentials'})) { }
2204 0 0 if $connect->{'passphrase'}
2211 0 0 unless $self->{'POLL'}{'blocking'}
2218 0 0 if ($connect->{'stage'} < 6)
2220 0 0 if ($connect->{'authPassword'} and not $self->{'PARENT'}->auth_ok)
2221 0 0 unless (defined $connect->{'password'})
2222 0 0 unless $connect->{'prompt_credentials'}
2227 0 0 if (not $self->{'POLL'}{'blocking'} and &Control::CLI::time() > $self->{'POLL'}{'endtime'})
2230 0 0 if ($connect->{'authPassword'} & 1) { }
0 0 elsif ($connect->{'authPassword'} & 2) { }
2232 0 0 unless $self->{'PARENT'}->auth_password($connect->{'username'}, $connect->{'password'})
2237 0 0 unless $self->{'PARENT'}->auth_keyboard($connect->{'username'}, $connect->{'password'})
2245 0 0 unless $self->{'POLL'}{'blocking'}
2249 0 0 unless $self->{'PARENT'}->auth_ok
2252 0 0 if (not $self->{'POLL'}{'blocking'} and &Control::CLI::time() > $self->{'POLL'}{'endtime'})
2260 0 0 if $connect->{'atomic_connect'}
2263 0 0 unless defined $connect->{'handshake'}
2264 0 0 unless defined $connect->{'baudrate'}
2265 0 0 unless defined $connect->{'parity'}
2266 0 0 unless defined $connect->{'databits'}
2267 0 0 unless defined $connect->{'stopbits'}
2268 0 0 unless $self->{'PARENT'}->handshake($connect->{'handshake'})
2269 0 0 unless ($self->{'PARENT'}->baudrate($connect->{'baudrate'}))
2271 0 0 if ($^O eq 'MSWin32' and $connect->{'forcebaud'}) { }
2278 0 0 unless $self->{'PARENT'}->parity($connect->{'parity'})
2279 0 0 unless ($connect->{'parity'} eq "none")
2280 0 0 unless $self->{'PARENT'}->parity_enable(1)
2282 0 0 unless $self->{'PARENT'}->databits($connect->{'databits'})
2283 0 0 unless $self->{'PARENT'}->stopbits($connect->{'stopbits'})
2284 0 0 unless $self->{'PARENT'}->write_settings
2286 0 0 unless $self->{'PARENT'}->buffers($ComPortReadBuffer, 0)
2287 0 0 if ($^O eq "MSWin32")
2288 0 0 unless $self->{'PARENT'}->read_interval($ComReadInterval)
2291 0 0 unless defined $self->{'PARENT'}->read_char_time(0)
2311 0 0 unless ($self->{'POLLING'})
2316 0 0 unless (defined $self->{'POLL'}{$pollsub})
2319 0 0 if (@_ and not %args)
2337 0 0 defined $args{'username'} ? :
0 0 defined $args{'password'} ? :
0 0 defined $args{'prompt'} ? :
0 0 defined $args{'username_prompt'} ? :
0 0 defined $args{'password_prompt'} ? :
0 0 defined $args{'prompt_credentials'} ? :
2342 0 0 if defined $login->{'errmode'}
2343 0 0 if $self->eof
2345 0 0 if ($login->{'stage'} < 1)
2347 0 0 if ($self->{'LOGINSTAGE'} eq 'username') { }
0 0 elsif ($self->{'LOGINSTAGE'} eq 'password') { }
2348 0 0 unless $login->{'username'}
2349 0 0 unless $self->print("line", $login->{'username'}, "errmode", "return")
2355 0 0 unless $login->{'password'}
2356 0 0 unless $self->print("line", $login->{'password'}, "errmode", "return")
2364 0 0 unless $ok
2369 0 0 if ($self->{'POLL'}{'local_buffer'} =~ /$login->{'username_prompt'}/)
2370 0 0 if ($login->{'login_attempted'})
2373 0 0 unless ($login->{'username'})
2374 0 0 if ($self->{'TYPE'} eq 'SSH') { }
2378 0 0 unless ($login->{'prompt_credentials'})
2385 0 0 unless $self->print("line", $login->{'username'}, "errmode", "return")
2392 0 0 if ($self->{'POLL'}{'local_buffer'} =~ /$login->{'password_prompt'}/)
2393 0 0 unless (defined $login->{'password'})
2394 0 0 unless (defined $login->{'prompt_credentials'})
2400 0 0 unless $self->print("line", $login->{'password'}, "errmode", "return")
2408 0 0 if $login->{'login_attempted'}
2418 0 0 unless ($self->{'POLLING'})
2423 0 0 unless (defined $self->{'POLL'}{$pollsub})
2426 0 0 if (@_ and not %args)
2429 0 0 unless ref $args{'match_list'} eq "ARRAY"
2445 0 0 if defined $waitfor->{'errmode'}
2446 0 0 if $self->eof
2448 0 0 if ($waitfor->{'stage'} < 1)
2450 0 0 unless @{$waitfor->{'matchpat'};}
2455 0 0 if ($@)
2463 0 0 unless $ok
2467 0 0 if ($self->{'POLL'}{'local_buffer'} =~ s/$pattern//)
2473 0 0 if length $self->{'POLL'}{'local_buffer'}
2483 0 0 unless ($self->{'POLLING'})
2488 0 0 unless (defined $self->{'POLL'}{$pollsub})
2491 0 0 if (@_ and not %args)
2504 0 0 defined $args{'prompt'} ? :
2509 0 0 if defined $cmd->{'errmode'}
2510 0 0 if $self->eof
2512 0 0 if ($cmd->{'stage'} < 1)
2519 0 0 unless $self->print("line", $cmd->{'command'}, "errmode", "return")
2526 0 0 unless $ok
2528 0 0 if ($cmd->{'cmdEchoRemoved'}) { }
2536 0 0 if ($self->{'POLL'}{'local_buffer'} =~ s/^.*\n//)
2554 0 0 unless ($self->{'POLLING'})
2559 0 0 unless (defined $self->{'POLL'}{$pollsub})
2562 0 0 if (@_ and not %args)
2578 0 0 defined $args{'baudrate'} ? :
0 0 defined $args{'parity'} ? :
0 0 defined $args{'databits'} ? :
0 0 defined $args{'stopbits'} ? :
0 0 defined $args{'handshake'} ? :
2583 0 0 if defined $changeBaud->{'errmode'}
2585 0 0 unless $self->{'TYPE'} eq "SERIAL"
2586 0 0 if $self->{'SERIALEOF'}
2588 0 0 if ($changeBaud->{'stage'} < 1)
2592 0 0 if ($changeBaud->{'stage'} < 2)
2594 0 0 unless $ok
2599 0 0 if ($^O eq 'MSWin32') { }
2600 0 0 unless $self->{'PARENT'} = "Win32::SerialPort"->new($self->{'COMPORT'}, !($self->{'debug'} & 1))
2604 0 0 unless $self->{'PARENT'} = "Device::SerialPort"->new($self->{'COMPORT'}, !($self->{'debug'} & 1))
2607 0 0 unless $self->{'PARENT'}->handshake($changeBaud->{'handshake'})
2608 0 0 unless ($self->{'PARENT'}->baudrate($changeBaud->{'baudrate'}))
2610 0 0 if ($^O eq 'MSWin32' and $changeBaud->{'forcebaud'}) { }
2617 0 0 unless $self->{'PARENT'}->parity($changeBaud->{'parity'})
2618 0 0 unless ($changeBaud->{'parity'} eq "none")
2619 0 0 unless $self->{'PARENT'}->parity_enable(1)
2621 0 0 unless $self->{'PARENT'}->databits($changeBaud->{'databits'})
2622 0 0 unless $self->{'PARENT'}->stopbits($changeBaud->{'stopbits'})
2623 0 0 unless $self->{'PARENT'}->write_settings
2625 0 0 unless $self->{'PARENT'}->buffers($ComPortReadBuffer, 0)
2626 0 0 if ($^O eq "MSWin32")
2627 0 0 unless $self->{'PARENT'}->read_interval($ComReadInterval)
2630 0 0 unless defined $self->{'PARENT'}->read_char_time(0)
2643 0 0 if (shift() & $self->{'debug'})
2657 0 0 if (length $self->{'QUERYBUFFER'})
2661 0 0 if ($$bufRef =~ /(\e(?:\[.?)?)$/)
2664 0 0 if ($VT100_QueryDeviceStatus =~ /^\Q$escFrag\E/)
2669 0 0 unless $$bufRef =~ s/\Q$VT100_QueryDeviceStatus\E//go
2681 0 0 $returnRef ? :
2691 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
0 0 elsif ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
2693 0 0 if $self->eof
2694 0 0 unless defined $buffer
2697 0 0 unless defined $self->{'SSHCHANNEL'}
2699 0 0 unless (defined $buffer and length $buffer)
2700 0 0 if $self->eof
2702 0 0 unless ($self->{'PARENT'}->poll($timeout * 1000, \@poll) and $poll[0]{'revents'}{'in'})
2706 0 0 unless defined $inBytes
2708 0 0 if defined $self->{'INPUTLOGFH'}
2709 0 0 if defined $self->{'DUMPLOGFH'}
2712 0 0 if $self->{'SERIALEOF'}
2713 0 0 if ($^O eq 'MSWin32') { }
2717 0 0 $timeout == 0 ? :
0 0 unless ($self->{'PARENT'}->read_const_time($timeout == 0 ? 1 : $timeout * 1000))
2723 0 0 unless $inBytes
2727 0 0 unless ($self->{'PARENT'}->read_const_time($PollTimer))
2736 0 0 if ($ticks++ > $ticksTimeout)
2742 0 0 if defined $self->{'INPUTLOGFH'}
2743 0 0 if defined $self->{'DUMPLOGFH'}
2749 0 0 if ($self->{'report_query_status'})
2751 0 0 unless (length $buffer)
2753 0 0 if $timeout <= 0
2758 0 0 $returnRef ? :
2766 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
0 0 elsif ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
2768 0 0 if $self->eof
2769 0 0 unless defined $buffer
2772 0 0 unless defined $self->{'SSHCHANNEL'}
2776 0 0 unless defined $buffer
2777 0 0 if (length $buffer)
2778 0 0 if defined $self->{'INPUTLOGFH'}
2779 0 0 if defined $self->{'DUMPLOGFH'}
2783 0 0 if $self->{'SERIALEOF'}
2787 0 0 unless ($self->{'PARENT'}->read_const_time(1))
2793 0 0 unless defined $buffer
2794 0 0 if (length $buffer)
2795 0 0 if defined $self->{'INPUTLOGFH'}
2796 0 0 if defined $self->{'DUMPLOGFH'}
2803 0 0 if length $buffer and $self->{'report_query_status'}
2806 0 0 if length $self->{'BUFFER'}
2809 0 0 $returnRef ? :
2816 0 0 if $self->eof
2818 0 0 if ($self->{'TYPE'} eq 'TELNET') { }
0 0 elsif ($self->{'TYPE'} eq 'SSH') { }
0 0 elsif ($self->{'TYPE'} eq 'SERIAL') { }
2822 0 0 unless $self->{'PARENT'}->put("String", $$outref, "Telnetmode", $self->{'TELNETMODE'})
2825 0 0 unless defined $self->{'SSHCHANNEL'}
2827 0 0 if defined $self->{'OUTPUTLOGFH'}
2828 0 0 if defined $self->{'DUMPLOGFH'}
2832 0 0 unless $countOut
2833 0 0 if $countOut != length $$outref
2834 0 0 if defined $self->{'OUTPUTLOGFH'}
2835 0 0 if defined $self->{'DUMPLOGFH'}
2848 0 0 if (ref $fh and ref $fh ne 'GLOB') { }
2866 0 0 if ($len >= 16) { }
2888 0 0 if $$dataRef
2896 0 0 if $msgFormat =~ /^\s*verbose\s*$/i
2898 0 0 if $msgFormat =~ /^\s*default\s*$/i or not $msgFormat =~ /^\s*terse\s*$/i
2909 0 0 if (defined $mode)
2910 0 0 if (ref $mode)
2914 0 0 if $mode eq "return"
2915 0 0 if $mode eq "croak"
2916 0 0 if $mode eq "die"
2927 0 0 unless ($self->{'POLLREPORTED'})
2928 0 0 if (defined $errmode)
2932 0 0 if ($timeCredit > 0 and defined $self->{'POLL'}{'endtime'})
2936 0 0 if defined $self->{'POLL'}{'endtime'}
2942 0 0 unless ($self->{'POLLREPORTED'})
2943 0 0 unless defined $ok
2945 0 0 if defined $errmode
2957 0 0 if defined &Net::Telnet::_log_option and $telobj->{'opt_log'}
2967 0 0 if defined $self->{'terminal_type'}
2968 0 0 if @{$self->{'window_size'};}
2971 0 0 if defined &Net::Telnet::_flush_opts and length $telobj->{'unsent_opts'}
2980 0 0 if ($option == &TELOPT_NAWS and @{$self->{'window_size'};})
2985 0 0 if (defined &Net::Telnet::_log_option and $telobj->{'opt_log'})
3001 0 0 if defined &Net::Telnet::_log_option and $telobj->{'opt_log'}
3004 0 0 if ($option == &TELOPT_TTYPE and defined $self->{'terminal_type'})
3007 0 0 if defined &Net::Telnet::_log_option and $telobj->{'opt_log'}
3011 0 0 if ($option == &TELOPT_NAWS and @{$self->{'window_size'};})
3014 0 0 if defined &Net::Telnet::_log_option and $telobj->{'opt_log'}