Dear Monks

I am not able to login onto DSL Switch using perl code, Same script on other switch from other vendors is successful without any issues. From past 2 weeks I am re-writing the code in different ways but no success. Seems like the Telnet server based on the VxWorks Target is having minute details that I am not able to understand. Please help me to solve this puzzle.

use IO::Socket; #============Main=============== my $sock; $sock=login_router(); print $sock; exit; #============End=============== sub login_router { my $socket; $socket = new IO::Socket::INET (PeerAddr => "192.168.1.240", + PeerPort => "23" , Proto => 'tcp') ; if ($socket) { print "Connection is established\n"; } else { die "Error: $!"; } sleep(4); $socket->autoflush(); my $input = ""; my $char = ""; until ($input =~ /Login :/){ $socket->sysread($char, 1); $input .= $char; } print $input; # Write the login name syswrite $socket, "ecidslam\r\n"; sleep(2); # Wait for the Password prompt my $input = ""; my $char = ""; until ($input =~ /Password :/){ $socket->sysread($char, 1); $input .= $char; } print $input; syswrite $socket, "Hi-FOCuS\r\n"; # To read the output from the socket while(<$socket>) { last if (/welcome/); die "Exit... Login error\n" if (/Permission Denied/); # Print each line read from socket print $_; } return $socket; }

On Executing Perl code following is the trace

C:\Perl>perl login.pl Connection is established VxWorks vxTarget Login : v? ²? ¦?am Password :******** Exit... Login error

Login using hyperterminal

Manual login onto the DSL Swith will have following trace VxWorks vxTarget Login :ecidslam Password :******** Welcome IPNI >

In reply to Login to ECI DSL switch fails always by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.