=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/lib/Net/Telnet/Trango.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- trango/Net-Telnet-Trango/lib/Net/Telnet/Trango.pm 2007/02/05 21:09:26 1.36 +++ trango/Net-Telnet-Trango/lib/Net/Telnet/Trango.pm 2007/02/05 23:09:59 1.37 @@ -1,6 +1,6 @@ package Net::Telnet::Trango; -# $RedRiver: Trango.pm,v 1.35 2007/02/05 21:03:40 andrew Exp $ +# $RedRiver: Trango.pm,v 1.36 2007/02/05 21:09:26 andrew Exp $ use strict; use warnings; use base 'Net::Telnet'; @@ -52,8 +52,7 @@ =pod -=head2 B -- Creates a new Net::Telnet::Trango object. +=head2 B - Creates a new Net::Telnet::Trango object. new([Options from Net::Telnet,] [Decode => 0,]); @@ -173,57 +172,48 @@ These are usually only set internally. -=head2 B -- returns the firmware version +=head2 B - returns the firmware version Returns the firmware version if available, otherwise undef. It should be available after a successful open(). -=head2 B -- return the type of host you are connected to. +=head2 B - return the type of host you are connected to. returns the type of host from the login banner for example M5830S or M5300S. Should be available after a successful open(). -=head2 B -- Status of the connection to host. +=head2 B - Status of the connection to host. returns 1 when connected, undef otherwise. -=head2 B -- Status of being logged in to the host. +=head2 B - Status of being logged in to the host. returns 1 after a successful login(), 0 if it failed and undef if login() was never called. -=head2 B -- The banner when first connecting to the host. +=head2 B - The banner when first connecting to the host. returns the banner that is displayed when first connected at login. Only set after a successful open(). -=head2 B -- The last lines of output from the last cmd(). +=head2 B - The last lines of output from the last cmd(). returns, as an array ref, the output from the last cmd() that was run. -=head2 B -- A text output of the last error that was encountered. +=head2 B - A text output of the last error that was encountered. returns the last error reported. Probably contains the last entry in last_lines. =head1 ALIASES -=head2 B -- alias of exit() +=head2 B - alias of exit() Does the same as exit() -=head2 B -- alias of reboot() +=head2 B - alias of reboot() Does the same as reboot() @@ -234,8 +224,7 @@ Specifically they take a named paramater "args", for example: C 'on')> would enable tftpd -=head2 B -- The output from the tftpd command +=head2 B - The output from the tftpd command Returns a hash ref of the decoded output from the command. @@ -243,31 +232,26 @@ Also see enable_tftpd() and disable_tftpd() as those check that it was successfully changed. -=head2 B -- The output from the ver command +=head2 B - The output from the ver command Returns a hash ref of the decoded output from the command. -=head2 B -- The output from the sysinfo command +=head2 B - The output from the sysinfo command Returns a hash ref of the decoded output from the command. -=head2 B -- Exits the connection +=head2 B - Exits the connection exits the command session with the Trango and closes the connection -=head2 B -- Sends a reboot command +=head2 B - Sends a reboot command reboots the Trango and closes the connection -=head2 B -- Set or retrieve the remarks. +=head2 B - Set or retrieve the remarks. Takes an optional argument, which sets the remarks. If there is no argument, returns the current remarks. @@ -275,45 +259,37 @@ my $old_remarks = $t->remarks(); $t->remarks($new_remarks); -=head2 B -- The output from the sulog command +=head2 B - The output from the sulog command Returns an array ref of hashes containing each log line. -=head2 B -- saves the sudb +=head2 B - saves the sudb Returns true on success, undef on failure -=head2 B -- The output from the sulog command +=head2 B - The output from the sulog command Returns a hashref of the output from the syslog command -=head2 B -- the pipe command +=head2 B - the pipe command Returns the output from the pipe command -=head2 B -- retrieves the maclist +=head2 B - retrieves the maclist Returns the output from the maclist command -=head2 B -- resets the maclist. +=head2 B - resets the maclist. No useful output. -=head2 B -- eth list command +=head2 B - eth list command Returns the output from the eth list command -=head2 B -- gets the su info +=head2 B - gets the su info Returns information about the SU. @@ -321,16 +297,18 @@ $t->su_info($suid); -=head2 B -- tests the RF Link to an su +=head2 B - tests the RF Link to an su $t->su_testrflink($suid|'all'); -=head2 B -- saves the config. +=head2 B - saves the config. Returns 1 on success, undef on failure. +=head2 B - sets opmode ap y or returns the opmode + + $t->opmode([ap y]); + =cut my $success = 'Success\\.'; @@ -409,8 +387,7 @@ =pod -=head2 B -- Open a connection to a Trango AP. +=head2 B - Open a connection to a Trango AP. Calls Net::Telnet::open() then makes sure you get a password prompt so you are ready to login() and parses the login banner so you can get @@ -449,8 +426,7 @@ =pod -=head2 B -- Login to the AP. +=head2 B - Login to the AP. Calls open() if not already connected, then sends the password and sets logged_in() if successful @@ -485,9 +461,7 @@ =pod -=head2 B -- Converts the login_banner to some useful -variables. +=head2 B - Converts the login_banner to something useful. Takes a login banner (what you get when you first connect to the Trango) or reads what is already in login_banner() then parses it and sets @@ -520,8 +494,7 @@ =pod -=head2 B -- Set the password on SUs connected to the AP. +=head2 B - Set the password on SUs connected to the AP. su_password('new_password'[, 'suid']) If no suid is specified, the default is "all". @@ -549,9 +522,7 @@ =pod -=head2 B -- Change IP configuration on SUs connected to -the AP. +=head2 B - Change IP configuration on SUs connected to the AP. su_ipconfig( 'suid', 'new_ip', 'new_subnet', 'new_gateway' ) @@ -595,8 +566,7 @@ =pod -=head2 B -- Returns the output from the sudb view command +=head2 B - Returns the output from the sudb view command returns a reference to an array of hashes each containing these keys 'suid', 'type', 'cir', 'mir' and 'mac' @@ -638,7 +608,7 @@ =pod -=head2 B +=head2 B - Adds an su to the sudb Takes the following paramaters @@ -702,7 +672,7 @@ =pod -=head2 B +=head2 B - removes an su from the sudb Takes either 'all' or the suid of the su to delete and returns true on success or undef otherwise. @@ -729,7 +699,7 @@ =pod -=head2 B +=head2 B - changes the su information in the sudb Takes either the suid of the su to change as well as what you are changing, either "cir, mir or su2su" @@ -781,8 +751,7 @@ =pod -=head2 B -- enable the TFTP server +=head2 B - enable the TFTP server runs C 'on')> and makes sure that Tftpd is now 'listen'ing @@ -803,8 +772,7 @@ =pod -=head2 B -- disable the TFTP server +=head2 B - disable the TFTP server runs C 'off')> and makes sure that Tftpd is now 'disabled'