=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/lib/Net/Telnet/Trango.pm,v retrieving revision 1.11 retrieving revision 1.13 diff -u -r1.11 -r1.13 --- trango/Net-Telnet-Trango/lib/Net/Telnet/Trango.pm 2006/08/23 01:37:20 1.11 +++ trango/Net-Telnet-Trango/lib/Net/Telnet/Trango.pm 2006/09/07 03:39:36 1.13 @@ -1,5 +1,5 @@ package Net::Telnet::Trango; -# $RedRiver: Trango.pm,v 1.10 2006/07/31 22:16:52 andrew Exp $ +# $RedRiver: Trango.pm,v 1.12 2006/08/31 21:29:53 andrew Exp $ use strict; use warnings; use base 'Net::Telnet'; @@ -472,6 +472,38 @@ =pod +=item su_ipconfig + +C + +=cut + +sub su_ipconfig +{ + my $self = shift; + + my $suid = shift; + my $new_ip = shift; + my $new_subnet = shift; + my $new_gateway = shift; + + return undef unless $suid =~ /^\d+$/; + return undef unless $new_ip; + return undef unless $new_subnet; + return undef unless $new_gateway; + + # su ipconfig + return $self->cmd(String => 'su ipconfig ' . + $suid . ' ' . + $new_ip . ' ' . + $new_subnet . ' ' . + $new_gateway, + expect => $success, + ); +} + +=pod + =item sudb_view returns a reference to an array of hashes each containing: @@ -935,6 +967,7 @@ my @lines = @_; my @decoded; my $total_entries = 0; + my $current_tm = 0; foreach my $line (@lines) { $line =~ s/\r?\n$//; my ($mac, $loc, $tm) = $line =~ / @@ -960,9 +993,12 @@ loc => $loc, tm => $tm, suid => $suid, + cur_tm => \$current_tm, }; } elsif ($line =~ /(\d+)\s+entries/) { $total_entries = $1; + } elsif ($line =~ /current tm = (\d+)\s+sec/) { + $current_tm = $1 } } if (scalar @decoded == $total_entries) {