version 1.34, 2007/02/05 21:02:07 |
version 1.35, 2007/02/05 21:03:40 |
|
|
package Net::Telnet::Trango;
|
package Net::Telnet::Trango;
|
|
|
# $RedRiver: Trango.pm,v 1.33 2007/02/02 21:26:56 andrew Exp $
|
# $RedRiver: Trango.pm,v 1.34 2007/02/05 21:02:07 andrew Exp $
|
use strict;
|
use strict;
|
use warnings;
|
use warnings;
|
use base 'Net::Telnet';
|
use base 'Net::Telnet';
|
|
|
=head2 B<new>
|
=head2 B<new>
|
- Creates a new Net::Telnet::Trango object.
|
- Creates a new Net::Telnet::Trango object.
|
|
|
new([Options from Net::Telnet,]
|
new([Options from Net::Telnet,]
|
[Decode => 0,]);
|
[Decode => 0,]);
|
|
|
Same as new from L<Net::Telnet> but sets the default Trango Prompt:
|
Same as new from L<Net::Telnet> but sets the default Trango Prompt:
|
'/#> *$/'
|
'/#> *$/'
|
|
|
|
|
Takes the following paramaters
|
Takes the following paramaters
|
|
|
suid : numeric,
|
suid : numeric,
|
type : (reg|pr)
|
type : (reg|pr)
|
cir : numeric,
|
cir : numeric,
|
mir : numeric,
|
mir : numeric,
|
mac : Almost any format, it will be reformatted,
|
mac : Almost any format, it will be reformatted,
|
|
|
and returns true on success or undef otherwise.
|
and returns true on success or undef otherwise.
|
|
|
|
|
- a string containing the command line options that are passed to the
|
- a string containing the command line options that are passed to the
|
command
|
command
|
|
|
$t->cmd( String => 'exit', no_prompt => 1, cmd_disconnects => 1 );
|
$t->cmd( String => 'exit', no_prompt => 1, cmd_disconnects => 1 );
|
|
|
=cut
|
=cut
|
|
|
|
|
foreach my $line (@lines) {
|
foreach my $line (@lines) {
|
$line =~ s/\r?\n$//;
|
$line =~ s/\r?\n$//;
|
my ( $mac, $loc, $tm ) = $line =~ /
|
my ( $mac, $loc, $tm ) = $line =~ /
|
([0-9a-fA-F ]{17})\s+
|
([0-9a-fA-F ]{17})\s+
|
(.*)\s+
|
(.*)\s+
|
tm\s+
|
tm\s+
|
(\d+)
|
(\d+)
|
/x;
|
/x;
|
|
|
if ($mac) {
|
if ($mac) {
|
$mac =~ s/\s+//g;
|
$mac =~ s/\s+//g;
|