version 1.8, 2006/06/29 01:39:52 |
version 1.24, 2007/01/17 19:00:51 |
|
|
package Net::Telnet::Trango;
|
package Net::Telnet::Trango; |
# $RedRiver: Trango.pm,v 1.7 2006/06/28 22:33:18 andrew Exp $
|
# $RedRiver: Trango.pm,v 1.23 2007/01/08 22:16:29 mike Exp $ |
use strict;
|
use strict; |
use warnings;
|
use warnings; |
use base 'Net::Telnet';
|
use base 'Net::Telnet'; |
|
|
=pod
|
=pod |
|
|
=head1 NAME
|
=head1 NAME |
|
|
Net::Telnet::Trango - Perl extension for accessing the Trango telnet interface
|
Net::Telnet::Trango - Perl extension for accessing the Trango telnet interface |
|
|
=head1 SYNOPSIS
|
=head1 SYNOPSIS |
|
|
use Net::Telnet::Trango;
|
use Net::Telnet::Trango; |
my $t = new Net::Telnet::Trango ( Timeout => 5 );
|
my $t = new Net::Telnet::Trango ( Timeout => 5 ); |
|
|
$t->open( Host => $fox ) or die "Error connecting: $!";
|
$t->open( Host => $fox ) or die "Error connecting: $!"; |
|
|
$t->login('password') or die "Couldn't log in: $!";
|
$t->login('password') or die "Couldn't log in: $!"; |
|
|
# Do whatever
|
# Do whatever |
|
|
$t->exit;
|
$t->exit; |
$t->close;
|
$t->close; |
|
|
=head1 DESCRIPTION
|
=head1 DESCRIPTION |
|
|
Perl access to the telnet interface on Trango Foxes, SUs and APs.
|
Perl access to the telnet interface on Trango Foxes, SUs and APs. |
|
|
Another handy feature is that it will parse the output from certain commands that is in the format "[key1] value1 [key2] value2" and put those in a hashref that is returned. This makes using the output from things like sysinfo very easy to do.
|
Another handy feature is that it will parse the output from certain |
|
commands that is in the format "[key1] value1 [key2] value2" and put |
=head2 EXPORT
|
those in a hashref that is returned. This makes using the output from |
|
things like sysinfo very easy to do. |
None
|
|
|
=head2 EXPORT |
=cut
|
|
|
None |
our $VERSION = '0.01';
|
|
|
=head1 METHODS |
my %PRIVATE = (
|
|
is_connected => 0,
|
=over |
logged_in => 0,
|
|
);
|
=cut |
|
|
=pod
|
our $VERSION = '0.01'; |
|
|
=item new
|
my %PRIVATE = ( |
|
is_connected => 0, |
Same as new from L<Net::Telnet> but has defaults for the trango 'Prompt'
|
logged_in => 0, |
|
); |
=cut
|
|
|
=pod |
sub new
|
|
{
|
=item new |
my $class = shift;
|
|
|
Same as new from L<Net::Telnet> but has defaults for the trango 'Prompt' |
my %args;
|
|
if (@_ == 1) {
|
It also takes an optional parameter 'Decode'. If not defined it |
$args{'Host'} = shift;
|
defaults to 1, if it is set to 0, it will not decode the output and |
} else {
|
instead return an array of the lines that were returned from the |
%args = @_;
|
command. |
}
|
|
|
=cut |
$args{'Prompt'} ||= '/#> *$/';
|
|
|
sub new |
foreach my $key (keys %args) {
|
{ |
$PRIVATE{$key} = $args{$key};
|
my $class = shift; |
}
|
|
|
my %args; |
my $self = $class->SUPER::new(%args);
|
if (@_ == 1) { |
bless $self if ref $self;
|
$args{'Host'} = shift; |
|
} else { |
return $self;
|
%args = @_; |
}
|
} |
|
|
# _password <new password> <new password>
|
$args{'Prompt'} ||= '/#> *$/'; |
# ? [command]
|
|
# apsearch <secs> <ch#> <h|v> [<ch#> <h|v>]...
|
foreach my $key (keys %args) { |
# arp -bcast <on|off>
|
$PRIVATE{$key} = $args{$key}; |
# bcastscant <all|suid> <ch#> <h|v> [<ch#> <h|v> ...
|
} |
# bye
|
$PRIVATE{'Decode'} = 1 unless defined $PRIVATE{'Decode'}; |
# cf2cf ap [default|<size>]
|
delete $args{'Decode'}; |
# date
|
|
# date <month> <day> <year>
|
my $self = $class->SUPER::new(%args); |
# freq scantable
|
bless $self if ref $self; |
# freq channeltable
|
|
# freq writescan [<ch#> <h|v>]
|
return $self; |
# freq writechannel [<ch#> <freq>] ...
|
} |
# freq <ch #> <h|v>
|
|
# help [command]
|
# _password <new password> <new password> |
# heater [<on temp> <off temp>]
|
# ? [command] |
# ipconfig [<new ip> <new subnet mask> <new gateway>]
|
# apsearch <secs> <ch#> <h|v> [<ch#> <h|v>]... |
# log [<# of entries, 1..179>]
|
# arp -bcast <on|off> |
# log <sum> <# of entries, 1..179>
|
# bcastscant <all|suid> <ch#> <h|v> [<ch#> <h|v> ... |
# logout
|
# bye |
# opmode [ap [y]]
|
# cf2cf ap [default|<size>] |
# password
|
# date |
# ping <ip addr>
|
# date <month> <day> <year> |
# polar <h|v>
|
# freq scantable |
# power <setism|setunii> <max|min|<dBm>>
|
# freq channeltable |
# reboot
|
# freq writescan [<ch#> <h|v>] |
# restart
|
# freq writechannel [<ch#> <freq>] ... |
# remarks [<str>]
|
# freq <ch #> <h|v> |
# rfrxthreshold [<ism|unii> <-90|-85|-80|-75|-70|-65>]
|
# help [command] |
# rfrxth [<ism|unii> <-90|-85|-80|-75|-70|-65>]
|
# heater [<on temp> <off temp>] |
# sysinfo
|
# ipconfig [<new ip> <new subnet mask> <new gateway>] |
# set suid <id>
|
# log [<# of entries, 1..179>] |
# set apid <id>
|
# log <sum> <# of entries, 1..179> |
# set baseid <id>
|
# logout |
# set defaultopmode [<ap|su> <min,0..10>]
|
# opmode [ap [y]] |
# set defaultopmode off
|
# password |
# set snmpcomm [<read | write | trap (id or setall)> <str>]
|
# ping <ip addr> |
# set mir [on|off]
|
# polar <h|v> |
# set mir threshold <kbps>
|
# power <setism|setunii> <max|min|<dBm>> |
# set rssitarget [<ism|unii> <dBm>]
|
# reboot |
# set serviceradius [<ism | unii> <miles>]
|
# restart |
# ssrssi <ch #> <h|v>
|
# remarks [<str>] |
# su [<suid>|all]
|
# rfrxthreshold [<ism|unii> <-90|-85|-80|-75|-70|-65>] |
# su changechannel <all|suid> <ch#> <h|v>
|
# rfrxth [<ism|unii> <-90|-85|-80|-75|-70|-65>] |
# su ipconfig <suid> <new ip> <new subnet> <new gateway>
|
# sysinfo |
# su [live|poweroff|priority]
|
# set suid <id> |
# su <ping|info|status> <suid>
|
# set apid <id> |
# su powerleveling <all|suid>
|
# set baseid <id> |
# su reboot <all|suid>
|
# set defaultopmode [<ap|su> <min,0..10>] |
# su restart <all|suid>
|
# set defaultopmode off |
# su testrflink <all|suid> [r]
|
# set snmpcomm [<read | write | trap (id or setall)> <str>] |
# su testrflink <setlen> [64..1600]
|
# set mir [on|off] |
# su testrflink <aptx> [20..100]
|
# set mir threshold <kbps> |
# su sw <suid|all> <sw #> <on|off>
|
# set rssitarget [<ism|unii> <dBm>] |
# sudb [dload | view]
|
# set serviceradius [<ism | unii> <miles>] |
# sudb add <suid> pr <cir,kbps> <mir,kbps> <device id,hex>
|
# ssrssi <ch #> <h|v> |
# sudb add <suid> reg <cir,kbps> <mir,kbps> <device id,hex>
|
# su [<suid>|all] |
# sudb delete <all|<suid>>
|
# su changechannel <all|suid> <ch#> <h|v> |
# sudb modify <suid> <cir|mir> <kbps>
|
# su ipconfig <suid> <new ip> <new subnet> <new gateway> |
# sudb modify <suid> <su2su> <group id,hex>
|
# su [live|poweroff|priority] |
# sudb view
|
# su <ping|info|status> <suid> |
# sulog [lastmins | sampleperiod <1..60>]
|
# su powerleveling <all|suid> |
# sulog [<# of entry,1..18>]
|
# su reboot <all|suid> |
# survey <ism|unii> <time, sec> <h|v>
|
# su restart <all|suid> |
# sw [<sw #> <on|off>]
|
# su testrflink <all|suid> [r] |
# temp
|
# su testrflink <setlen> [64..1600] |
# tftpd [on|off]
|
# su testrflink <aptx> [20..100] |
# time
|
# su sw <suid|all> <sw #> <on|off> |
# time <hour> <min> <sec>
|
# sudb [dload | view] |
# save <mainimage|fpgaimage> <current chksum> <new chksum>
|
# sudb add <suid> pr <cir,kbps> <mir,kbps> <device id,hex> |
# save <systemsetting|sudb>
|
# sudb add <suid> reg <cir,kbps> <mir,kbps> <device id,hex> |
# updateflash <mainimage|fpgaimage> <current chksum> <new chksum>
|
# sudb delete <all|<suid>> |
# updateflash <systemsetting|sudb>
|
# sudb modify <suid> <cir|mir> <kbps> |
|
# sudb modify <suid> <su2su> <group id,hex> |
=pod
|
# sudb view |
|
# sulog [lastmins | sampleperiod <1..60>] |
=head1 METHODS
|
# sulog [<# of entry,1..18>] |
|
# survey <ism|unii> <time, sec> <h|v> |
=head2 ACCESSORS
|
# sw [<sw #> <on|off>] |
|
# temp |
=over
|
# tftpd [on|off] |
|
# time |
=item Host
|
# time <hour> <min> <sec> |
|
# save <mainimage|fpgaimage> <current chksum> <new chksum> |
returns the name of the host that you are accessing
|
# save <systemsetting|sudb> |
|
# updateflash <mainimage|fpgaimage> <current chksum> <new chksum> |
=item firmware_version
|
# updateflash <systemsetting|sudb> |
|
|
returns the firmware version on the trango if available otherwise undef.
|
=pod |
Available after a successful open()
|
|
This is usually only set internally
|
=back |
|
|
=item host_type
|
=head2 ACCESSORS |
|
|
returns the type of host from the login banner for example M5830S or M5300S.
|
=over |
Available after a successful open()
|
|
This is usually only set internally
|
=item Host |
|
|
=item is_connected
|
returns the name of the host that you are accessing |
|
|
returns 1 after a successful open() otherwise undef
|
=item firmware_version |
This is usually only set internally
|
|
|
returns the firmware version on the trango if available otherwise undef. |
=item logged_in
|
Available after a successful open() |
|
This is usually only set internally |
returns 1 after a successful login() 0 if it failed and undef if
|
|
login() was never called
|
=item host_type |
This is usually only set internally
|
|
|
returns the type of host from the login banner for example M5830S or M5300S. |
=item login_banner
|
Available after a successful open() |
|
This is usually only set internally |
returns the banner that is displayed when first connected at login. Only set after a successful open()
|
|
|
=item is_connected |
This is usually only set internally
|
|
|
returns 1 after a successful open() otherwise undef |
=item last_lines
|
This is usually only set internally |
|
|
returns the output from the last cmd() that was run as an array ref
|
=item logged_in |
This is usually only set internally
|
|
|
returns 1 after a successful login() 0 if it failed and undef if |
=back
|
login() was never called |
|
This is usually only set internally |
=head2 ALIASES
|
|
|
=item login_banner |
=over
|
|
|
returns the banner that is displayed when first connected at login. |
=item bye
|
Only set after a successful open() |
|
|
alias of exit()
|
This is usually only set internally |
|
|
=item restart
|
=item last_lines |
|
|
alias of reboot()
|
returns the output from the last cmd() that was run as an array ref |
|
This is usually only set internally |
=back
|
|
|
=back |
=head2 COMMANDS
|
|
|
=head2 ALIASES |
Most of these are just shortcuts to C<cmd(String =E<gt> METHOD)>, as such they accept the same options as C<cmd()>. Specifically they take a named paramater "args", for example:
|
|
C<tftpd(args =E<gt> 'on')> would enable tftpd
|
=over |
|
|
=over
|
=item bye |
|
|
=item tftpd
|
alias of exit() |
|
|
Returns a hash ref of the decoded output from the command.
|
=item restart |
|
|
Also see enable_tftpd() and disable_tftpd() as those check for correct output
|
alias of reboot() |
|
|
=item ver
|
=back |
|
|
Returns a hash ref of the decoded output from the command.
|
=head2 COMMANDS |
|
|
=item sysinfo
|
Most of these are just shortcuts to C<cmd(String =E<gt> METHOD)>, |
|
as such they accept the same options as C<cmd()>. |
Returns a hash ref of the decoded output from the command.
|
Specifically they take a named paramater "args", for example: |
|
C<tftpd(args =E<gt> 'on')> would enable tftpd |
=item exit
|
|
|
=over |
exits the command session with the trango and closes the connection
|
|
|
=item tftpd |
=item reboot
|
|
|
Returns a hash ref of the decoded output from the command. |
reboots the trango and closes the connection
|
|
|
Also see enable_tftpd() and disable_tftpd() as those check for correct output |
=item sulog
|
|
|
=item ver |
returns an array ref of hashes containing each log line.
|
|
|
Returns a hash ref of the decoded output from the command. |
=item save_sudb
|
|
|
=item sysinfo |
returns true on success, undef on failure
|
|
|
Returns a hash ref of the decoded output from the command. |
=cut
|
|
|
=item exit |
|
|
my $success = 'Success.';
|
exits the command session with the trango and closes the connection |
my %COMMANDS = (
|
|
tftpd => { decode => 'all', expect => $success },
|
=item reboot |
ver => { decode => 'all' },
|
|
sysinfo => { decode => 'all', expect => $success },
|
reboots the trango and closes the connection |
updateflash => { decode => 'all', expect => $success },
|
|
sulog => { decode => 'sulog', expect => $success },
|
=item remarks |
'exit' => { no_prompt => 1, cmd_disconnects => 1 },
|
|
reboot => { no_prompt => 1, cmd_disconnects => 1 },
|
Takes an optional argument, which sets the remarks. |
save_sudb => { String => "save sudb", expect => $success },
|
If there is no argument, returns the current remarks. |
#su password???
|
|
#_bootloader
|
=item sulog |
#temp
|
|
#heater
|
returns an array ref of hashes containing each log line. |
);
|
|
|
=item save_sudb |
my %ALIASES = (
|
|
bye => 'exit',
|
returns true on success, undef on failure |
restart => 'reboot',
|
|
);
|
=item syslog |
|
|
my %ACCESS = map { $_ => 1 } qw(
|
returns the output from the syslog command |
firmware_version
|
|
host_type
|
=item pipe |
Host
|
|
is_connected
|
returns the output from the pipe command |
logged_in
|
|
login_banner
|
=item maclist |
Timeout
|
|
last_lines
|
returns the output from the maclist command |
last_vals
|
|
);
|
=item maclist_reset |
|
|
sub AUTOLOAD
|
resets the maclist. No useful output. |
{
|
|
my $self = shift;
|
=item eth_list |
|
|
my ($method) = (our $AUTOLOAD) =~ /^.*::(\w+)$/
|
returns the output from the eth list command |
or die "Weird: $AUTOLOAD";
|
|
|
=item su_info |
if (exists $ALIASES{$method}) {
|
|
$method = $ALIASES{$method};
|
You need to pass in args => <suid> and it will return the info for that suid. |
return $self->$method(@_);
|
|
}
|
=item save_ss |
|
|
if (exists $COMMANDS{$method}) {
|
saves the config. Returns 1 on success, undef on failure. |
$method = shift if (@_ == 1);
|
|
$COMMANDS{$method}{'String'} ||= $method;
|
=cut |
return $self->cmd(%{ $COMMANDS{$method} }, @_);
|
|
}
|
|
|
my $success = 'Success.'; |
if (exists $ACCESS{$method}) {
|
my %COMMANDS = ( |
my $prev = $PRIVATE{$method};
|
tftpd => { decode => 'all', expect => $success }, |
($PRIVATE{$method}) = @_ if @_;
|
ver => { decode => 'all' }, |
return $prev;
|
sysinfo => { decode => 'all', expect => $success }, |
}
|
updateflash => { decode => 'all', expect => $success }, |
|
sulog => { decode => 'sulog', expect => $success }, |
$method = "SUPER::$method";
|
'exit' => { no_prompt => 1, cmd_disconnects => 1 }, |
return $self->$method(@_);
|
reboot => { no_prompt => 1, cmd_disconnects => 1 }, |
}
|
remarks => { decode => 'all', expect => $success }, |
|
save_sudb => { String => 'save sudb', expect => $success }, |
=pod
|
syslog => { expect => $success }, |
|
'pipe' => { }, # XXX needs a special decode |
=item open
|
maclist => { decode => 'maclist' }, |
|
maclist_reset => { String => 'maclist reset', expect => 'done' }, |
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 host_type() and firmware_version()
|
eth_link => { String => 'eth link', expect => $success }, |
|
su_info => { String => 'su info', decode => 'all', expect => $success }, |
=cut
|
save_ss => { String => 'save ss', expect => $success }, |
|
opmode => { decode => 'all', expect => $success }, |
sub open
|
# eth r, w and reset??? |
{
|
#su password??? |
my $self = shift;
|
#_bootloader |
|
#temp |
unless ( $self->SUPER::open(@_) ) {
|
#heater |
#$! = "Couldn't connect to " . $self->Host . ": $!";
|
); |
return undef;
|
|
}
|
my %ALIASES = ( |
|
bye => 'exit', |
## Get to login prompt
|
restart => 'reboot', |
unless ($self->waitfor(
|
); |
-match => '/password: ?$/i',
|
|
-errmode => "return",
|
my %ACCESS = map { $_ => 1 } qw( |
) ) {
|
firmware_version |
#$! = "problem connecting to host (" . $self->Host . "): " .
|
host_type |
# $self->lastline;
|
Host |
return undef;
|
is_connected |
}
|
logged_in |
|
login_banner |
$self->parse_login_banner($self->lastline);
|
Timeout |
|
last_lines |
$self->is_connected(1);
|
last_vals |
|
); |
return $self->is_connected;
|
|
}
|
sub AUTOLOAD |
|
{ |
=pod
|
my $self = shift; |
|
|
=item login
|
my ($method) = (our $AUTOLOAD) =~ /^.*::(\w+)$/ |
|
or die "Weird: $AUTOLOAD"; |
Calls open() if not already connected, then sends the password and sets logged_in() if successful
|
|
|
if (exists $ALIASES{$method}) { |
=cut
|
$method = $ALIASES{$method}; |
|
return $self->$method(@_); |
sub login
|
} |
{
|
|
my $self = shift;
|
if (exists $COMMANDS{$method}) { |
|
$COMMANDS{$method}{'String'} ||= $method; |
unless ($self->is_connected) {
|
$COMMANDS{$method}{'args'} .= ' ' . shift if (@_ == 1); |
$self->open or return undef;
|
return $self->cmd(%{ $COMMANDS{$method} }, @_); |
}
|
} |
|
|
my $password = shift;
|
if (exists $ACCESS{$method}) { |
|
my $prev = $PRIVATE{$method}; |
$self->print($password);
|
($PRIVATE{$method}) = @_ if @_; |
unless ($self->waitfor(
|
return $prev; |
-match => $self->prompt,
|
} |
-errmode => "return",
|
|
) ) {
|
$method = "SUPER::$method"; |
#$! = "login ($self->Host) failed: " . $self->lastline;
|
return $self->$method(@_); |
return undef;
|
} |
}
|
|
|
=pod |
$self->logged_in(1);
|
|
|
=item open |
return $self->logged_in;
|
|
}
|
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 |
=pod
|
host_type() and firmware_version() |
|
|
=item parse_login_banner
|
=cut |
|
|
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 host_type() and firmware_version() as well as login_banner()
|
sub open |
|
{ |
=cut
|
my $self = shift; |
|
|
sub parse_login_banner
|
unless ( $self->SUPER::open(@_) ) { |
{
|
#$! = "Couldn't connect to " . $self->Host . ": $!"; |
my $self = shift;
|
return undef; |
|
} |
if (@_) {
|
|
$self->login_banner(@_);
|
## Get to login prompt |
}
|
unless ($self->waitfor( |
|
-match => '/password: ?$/i', |
my $banner = $self->login_banner;
|
-errmode => "return", |
|
) ) { |
my ($type, $ver) = $banner =~
|
#$! = "problem connecting to host (" . $self->Host . "): " . |
/Welcome to Trango Broadband Wireless (\S+)[\s-]+(.+)$/i;
|
# $self->lastline; |
|
return undef; |
$self->login_banner($banner);
|
} |
$self->host_type($type);
|
|
$self->firmware_version($ver);
|
$self->parse_login_banner($self->lastline); |
|
|
return 1;
|
$self->is_connected(1); |
}
|
|
|
return $self->is_connected; |
=pod
|
} |
|
|
=item su_password
|
=pod |
|
|
C<su_password('all'|suid, 'new_password')>
|
=item login |
|
|
=cut
|
Calls open() if not already connected, then sends the password and sets |
|
logged_in() if successful |
sub su_password
|
|
{
|
=cut |
my $self = shift;
|
|
my $su = shift || '!';
|
sub login |
my $new_pass = shift || '';
|
{ |
|
my $self = shift; |
unless (defined $su) {
|
|
warn "No su passed!"
|
unless ($self->is_connected) { |
#return undef;
|
$self->open or return undef; |
}
|
} |
|
|
unless (defined $new_pass) {
|
my $password = shift; |
warn "No new password!"
|
|
#return undef;
|
$self->print($password); |
}
|
unless ($self->waitfor( |
|
-match => $self->prompt, |
return $self->cmd(String => 'su password ' .
|
-errmode => "return", |
$su . ' ' .
|
) ) { |
$new_pass . ' ' .
|
#$! = "login ($self->Host) failed: " . $self->lastline; |
$new_pass,
|
return undef; |
expect => $success,
|
} |
);
|
|
}
|
$self->logged_in(1); |
|
|
|
return $self->logged_in; |
=pod
|
} |
|
|
=item sudb_view
|
=pod |
|
|
returns a reference to an array of hashes each containing:
|
=item parse_login_banner |
|
|
suid
|
Takes a login banner (what you get when you first connect to the Trango) |
type
|
or reads what is already in login_banner() then parses it and sets |
cir
|
host_type() and firmware_version() as well as login_banner() |
mir
|
|
mac
|
=cut |
|
|
=cut
|
sub parse_login_banner |
|
{ |
sub sudb_view
|
my $self = shift; |
{
|
|
my $self = shift;
|
if (@_) { |
|
$self->login_banner(@_); |
my @lines = $self->cmd( String => 'sudb view', expect => $success );
|
} |
|
|
return undef unless @lines;
|
my $banner = $self->login_banner; |
|
|
my @sus;
|
my ($type, $ver) = $banner =~ |
foreach (@lines) {
|
/Welcome to Trango Broadband Wireless (\S+)[\s-]+(.+)$/i; |
if (/^\[(\d+)\]\s+(\d+)\s+(\d+)\s+(\d+)\s+([0-9A-Fa-f\s]+)$/) {
|
|
my %s = (
|
$self->login_banner($banner); |
suid => $1,
|
$self->host_type($type); |
type => $2,
|
$self->firmware_version($ver); |
cir => $3,
|
|
mir => $4,
|
return 1; |
mac => $5,
|
} |
);
|
|
|
=pod |
$s{'mac'} =~ s/\s//g;
|
|
$s{'mac'} = uc($s{'mac'});
|
=item su_password |
|
|
push @sus, \%s;
|
C<su_password('new_password'[, 'suid'])> If no suid is specified, |
}
|
the default is "all". |
}
|
|
|
=cut |
return \@sus;
|
|
}
|
sub su_password |
|
{ |
=pod
|
my $self = shift; |
|
my $new_pass = shift || ''; |
=item sudb_add
|
my $su = shift || 'all'; |
|
|
Takes the following paramaters
|
unless (defined $new_pass) { |
|
warn "No new password!" |
suid : numeric,
|
#return undef; |
type : (reg|pr)
|
} |
cir : numeric,
|
|
mir : numeric,
|
return $self->cmd(String => 'su password ' . |
mac : Almost any format, it will be reformatted,
|
$su . ' ' . |
|
$new_pass . ' ' . |
and returns true on success or undef otherwise.
|
$new_pass, |
|
expect => $success, |
You should save_sudb() after calling this, or your changes will be lost
|
); |
when the AP is rebooted.
|
} |
|
|
=cut
|
=pod |
|
|
sub sudb_add
|
=item su_ipconfig |
{
|
|
my $self = shift;
|
C<su_ipconfig( 'suid', 'new_ip', 'new_subnet', 'new_gateway' )> |
my $suid = shift;
|
|
my $type = shift;
|
=cut |
my $cir = shift;
|
|
my $mir = shift;
|
sub su_ipconfig |
my $mac = shift;
|
{ |
|
my $self = shift; |
if ($suid =~ /\D/) {
|
|
return undef;
|
my $suid = shift; |
}
|
my $new_ip = shift; |
|
my $new_subnet = shift; |
unless (lc($type) eq 'reg' || lc($type) eq 'pr') {
|
my $new_gateway = shift; |
warn "Invalid type '$type'!";
|
|
return undef;
|
return undef unless $suid =~ /^\d+$/; |
}
|
return undef unless $new_ip; |
|
return undef unless $new_subnet; |
if ($cir =~ /\D/) {
|
return undef unless $new_gateway; |
warn "Invalid CIR '$cir'!";
|
|
return undef;
|
# su ipconfig <suid> <new ip> <new subnet> <new gateway> |
}
|
return $self->cmd(String => 'su ipconfig ' . |
|
$suid . ' ' . |
if ($mir =~ /\D/) {
|
$new_ip . ' ' . |
warn "Invalid MIR '$mir'!";
|
$new_subnet . ' ' . |
return undef;
|
$new_gateway, |
}
|
expect => $success, |
|
); |
my $new_mac = $mac;
|
} |
$new_mac =~ s/[^0-9A-Fa-f]//;
|
|
unless (length $new_mac == 12) {
|
=pod |
warn "Invalid MAC '$mac'!";
|
|
return undef;
|
=item sudb_view |
}
|
|
$new_mac = join ' ', $new_mac =~ /../g;
|
returns a reference to an array of hashes each containing: |
|
|
my $string = 'sudb add ' .
|
suid |
$suid . ' ' .
|
type |
$type . ' ' .
|
cir |
$cir . ' ' .
|
mir |
$mir . ' ' .
|
mac |
$new_mac;
|
|
|
=cut |
|
|
return $self->cmd( String => $string, expect => $success );
|
sub sudb_view |
}
|
{ |
|
my $self = shift; |
=pod
|
|
|
my @lines = $self->cmd( String => 'sudb view', expect => $success ); |
=item sudb_delete
|
|
|
return undef unless @lines; |
Takes either 'all' or the suid of the su to delete
|
|
and returns true on success or undef otherwise.
|
unless ($PRIVATE{'Decode'}) { |
|
return @lines; |
You should save_sudb() after calling this, or your changes will be lost
|
} |
when the AP is rebooted.
|
|
|
my @sus; |
=cut
|
foreach (@lines) { |
|
next unless $_; |
sub sudb_delete
|
if (/^\[(\d+)\]\s+(\d+)\s+(\d+)\s+(\d+)\s+([0-9A-Fa-f\s]+)$/) { |
{
|
my %s = ( |
my $self = shift;
|
suid => $1, |
my $suid = shift;
|
type => $2, |
|
cir => $3, |
if (lc($suid) ne 'all' || $suid =~ /\D/) {
|
mir => $4, |
return undef;
|
mac => $5, |
}
|
); |
|
|
return $self->cmd( String => 'sudb delete ' . $suid, expect => $success );
|
$s{'mac'} =~ s/\s//g; |
}
|
$s{'mac'} = uc($s{'mac'}); |
|
|
|
push @sus, \%s; |
=pod
|
} |
|
} |
=item sudb_modify
|
|
|
return \@sus; |
Takes either the suid of the su to delete
|
} |
as well as what you are changing, either "cir, mir or su2su"
|
|
and returns true on success or undef otherwise.
|
=pod |
|
|
cir and mir also take a value to set the cir/mir to.
|
=item sudb_add |
|
|
su2su takes a group id parameter that is in hex.
|
Takes the following paramaters |
|
|
You should save_sudb() after calling this, or your changes will be lost
|
suid : numeric, |
when the AP is rebooted.
|
type : (reg|pr) |
|
cir : numeric, |
=cut
|
mir : numeric, |
|
mac : Almost any format, it will be reformatted, |
sub sudb_modify
|
|
{
|
and returns true on success or undef otherwise. |
my $self = shift;
|
|
my $suid = shift;
|
You should save_sudb() after calling this, or your changes will be lost |
my $opt = shift;
|
when the AP is rebooted. |
my $value = shift;
|
|
|
=cut |
if ($suid =~ /\D/) {
|
|
return undef;
|
sub sudb_add |
}
|
{ |
|
my $self = shift; |
if (lc($opt) eq 'cir' or lc($opt) eq 'mir') {
|
my $suid = shift; |
if ($value =~ /\D/) {
|
my $type = shift; |
return undef;
|
my $cir = shift; |
}
|
my $mir = shift; |
} elsif (lc($opt) eq 'su2su') {
|
my $mac = shift; |
if ($value =~ /[^0-9A-Za-f]/) {
|
|
return undef;
|
if ($suid =~ /\D/) { |
}
|
return undef; |
} else {
|
} |
return undef;
|
|
}
|
unless (lc($type) eq 'reg' || lc($type) eq 'pr') { |
|
warn "Invalid type '$type'!"; |
my $string = 'sudb modify ' . $suid . ' ' . $opt . ' ' . $value;
|
return undef; |
|
} |
return $self->cmd( String => $string, expect => $success );
|
|
}
|
if ($cir =~ /\D/) { |
|
warn "Invalid CIR '$cir'!"; |
=pod
|
return undef; |
|
} |
=item enable_tftpd
|
|
|
if ($mir =~ /\D/) { |
runs C<tftpd(args =E<gt> 'on')> and makes sure that Tftpd is now 'listen'ing
|
warn "Invalid MIR '$mir'!"; |
|
return undef; |
=cut
|
} |
|
|
sub enable_tftpd
|
my $new_mac = $mac; |
{
|
$new_mac =~ s/[^0-9A-Fa-f]//; |
my $self = shift;
|
unless (length $new_mac == 12) { |
|
warn "Invalid MAC '$mac'!"; |
my $vals = $self->tftpd( args => 'on' );
|
return undef; |
|
} |
if ($vals->{'Tftpd'} eq 'listen') {
|
$new_mac = join ' ', $new_mac =~ /../g; |
return $vals;
|
|
} else {
|
my $string = 'sudb add ' . |
return undef;
|
$suid . ' ' . |
}
|
$type . ' ' . |
}
|
$cir . ' ' . |
|
$mir . ' ' . |
=pod
|
$new_mac; |
|
|
=item disable_tftpd
|
|
|
return $self->cmd( String => $string, expect => $success ); |
runs C<tftpd(args =E<gt> 'off')> and makes sure that Tftpd is now 'disabled'
|
} |
|
|
=cut
|
=pod |
|
|
sub disable_tftpd
|
=item sudb_delete |
{
|
|
my $self = shift;
|
Takes either 'all' or the suid of the su to delete |
|
and returns true on success or undef otherwise. |
my $vals = $self->tftpd( args => 'off' );
|
|
|
You should save_sudb() after calling this, or your changes will be lost |
if (ref $vals eq 'HASH' && $vals->{'Tftpd'} eq 'disabled') {
|
when the AP is rebooted. |
return $vals;
|
|
} else {
|
=cut |
return undef;
|
|
}
|
sub sudb_delete |
}
|
{ |
|
my $self = shift; |
=pod
|
my $suid = shift; |
|
|
=item cmd
|
if (lc($suid) ne 'all' || $suid =~ /\D/) { |
|
return undef; |
This does most of the work. At the heart, it calls Net::Telnet::cmd() but it also does some special stuff for Trango.
|
} |
|
|
Normally returns the last lines from from the command
|
return $self->cmd( String => 'sudb delete ' . $suid, expect => $success ); |
|
} |
Also accepts these options:
|
|
|
=pod |
I<decode>
|
|
- if this is true, then it will send the output lines to _decode_lines() and then returns the decoded output
|
=item sudb_modify |
|
|
I<cmd_disconnects>
|
Takes either the suid of the su to delete |
- if this is true, it then sets logged_in() to false, then it will close() the connection and then sets is_connected() to false
|
as well as what you are changing, either "cir, mir or su2su" |
|
and returns true on success or undef otherwise. |
I<expect>
|
|
- if this is set (usually to 'Success.') it will check for that in the last line of output and if it does not, will return undef because the command probably failed
|
cir and mir also take a value to set the cir/mir to. |
|
|
I<args>
|
su2su takes a group id parameter that is in hex. |
- a string containing the command line options that are passed to the command
|
|
|
You should save_sudb() after calling this, or your changes will be lost |
=cut
|
when the AP is rebooted. |
|
|
sub cmd
|
=cut |
{
|
|
my $self = shift;
|
sub sudb_modify |
|
{ |
my @valid_net_telnet_opts = qw(
|
my $self = shift; |
String
|
my $suid = shift; |
Output
|
my $opt = shift; |
Cmd_remove_mode
|
my $value = shift; |
Errmode
|
|
Input_record_separator
|
if ($suid =~ /\D/) { |
Ors
|
return undef; |
Output_record_separator
|
} |
Prompt
|
|
Rs
|
if (lc($opt) eq 'cir' or lc($opt) eq 'mir') { |
Timeout
|
if ($value =~ /\D/) { |
);
|
return undef; |
|
} |
my %cfg;
|
} elsif (lc($opt) eq 'su2su') { |
if (@_ == 2) {
|
if ($value =~ /[^0-9A-Za-f]/) { |
$cfg{'String'} = shift;
|
return undef; |
} elsif (@_ > 2) {
|
} |
%cfg = @_;
|
} else { |
}
|
return undef; |
|
} |
$cfg{'Timeout'} ||= $self->Timeout;
|
|
|
my $string = 'sudb modify ' . $suid . ' ' . $opt . ' ' . $value; |
unless ($cfg{'String'}) {
|
|
#$! = "No command passed";
|
return $self->cmd( String => $string, expect => $success ); |
#warn "No command passed\n";
|
} |
return undef;
|
|
}
|
=pod |
|
|
unless ($self->is_connected) {
|
=item enable_tftpd |
#$! = "Not connected";
|
|
#warn "Not connected\n";
|
runs C<tftpd(args =E<gt> 'on')> and makes sure that Tftpd is now 'listen'ing |
return undef;
|
|
}
|
=cut |
|
|
unless ($self->logged_in) {
|
sub enable_tftpd |
#$! = "Not logged in";
|
{ |
#warn "Not logged in\n";
|
my $self = shift; |
return undef;
|
|
}
|
my $vals = $self->tftpd( args => 'on' ); |
|
|
|
if ($vals->{'Tftpd'} eq 'listen') { |
my %cmd;
|
return $vals; |
foreach (@valid_net_telnet_opts) {
|
} else { |
if (exists $cfg{$_}) {
|
return undef; |
$cmd{$_} = $cfg{$_};
|
} |
}
|
} |
}
|
|
if ($cfg{'args'}) {
|
=pod |
$cmd{'String'} .= ' ' . $cfg{'args'};
|
|
}
|
=item disable_tftpd |
my @lines;
|
|
unless ($cfg{'no_prompt'}) {
|
runs C<tftpd(args =E<gt> 'off')> and makes sure that Tftpd is now 'disabled' |
@lines = $self->SUPER::cmd(%cmd);
|
|
} else {
|
=cut |
$self->print($cmd{'String'});
|
|
@lines = $self->lastline;
|
sub disable_tftpd |
}
|
{ |
|
my $self = shift; |
$self->last_lines(\@lines);
|
|
|
my $vals = $self->tftpd( args => 'off' ); |
my $vals = 1;
|
|
if ($cfg{'decode'}) {
|
if (ref $vals eq 'HASH' && $vals->{'Tftpd'} eq 'disabled') { |
if ($cfg{'decode'} eq 'each') {
|
return $vals; |
$vals = _decode_each_line(@lines);
|
} else { |
} elsif ($cfg{'decode'} eq 'sulog') {
|
return undef; |
$vals = _decode_sulog(@lines);
|
} |
} else {
|
} |
$vals = _decode_lines(@lines);
|
|
}
|
=pod |
}
|
|
|
=item cmd |
$self->last_vals($vals);
|
|
|
This does most of the work. At the heart, it calls Net::Telnet::cmd() |
|
but it also does some special stuff for Trango. |
my $last = $self->lastline;
|
|
|
Normally returns the last lines from from the command |
if ((not $cfg{'expect'}) || $last =~ /$cfg{'expect'}$/) {
|
|
if ($cfg{'cmd_disconnects'}) {
|
Also accepts these options: |
$self->logged_in(0);
|
|
$self->close;
|
I<decode> |
$self->is_connected(0);
|
- if this is true, then it will send the output lines to _decode_lines() |
}
|
and then returns the decoded output |
|
|
if ($cfg{'decode'}) {
|
I<cmd_disconnects> |
return $vals;
|
- if this is true, it then sets logged_in() to false, then it will |
} else {
|
close() the connection and then sets is_connected() to false |
return @lines;
|
|
}
|
I<expect> |
} else {
|
- if this is set (usually to 'Success.') it will check for that in the |
#$! = "Error with command ($cfg{'string'}): $last";
|
last line of output and if it does not, will return undef because the |
return undef;
|
command probably failed |
}
|
|
}
|
I<args> |
|
- a string containing the command line options that are passed to the |
#=item _decode_lines
|
command |
|
|
sub _decode_lines
|
=cut |
{
|
|
my @lines = @_;
|
sub cmd |
|
{ |
my %conf;
|
my $self = shift; |
|
|
my $key = '';
|
my @valid_net_telnet_opts = qw( |
my $val = '';
|
String |
my $in_key = 0;
|
Output |
my $in_val = 0;
|
Cmd_remove_mode |
|
Errmode |
foreach my $line (@lines) {
|
Input_record_separator |
next if $line =~ /$success$/;
|
Ors |
|
Output_record_separator |
my @chars = split //, $line;
|
Prompt |
|
Rs |
my $last_key = '';
|
Timeout |
foreach my $c (@chars) {
|
); |
|
|
if ($c eq '[' || $c eq "\r" || $c eq "\n") {
|
my %cfg; |
if ($c eq '[') {
|
if (@_ == 1) { |
$in_key = 1;
|
$cfg{'String'} = shift; |
$in_val = 0;
|
} elsif (@_ > 1) { |
} else {
|
%cfg = @_; |
$in_key = 0;
|
} |
$in_val = 0;
|
|
}
|
$cfg{'Timeout'} ||= $self->Timeout; |
|
|
if ($key) {
|
unless ($cfg{'String'}) { |
$key =~ s/^\s+//;
|
#$! = "No command passed"; |
$key =~ s/\s+$//;
|
#warn "No command passed\n"; |
|
return undef; |
$val =~ s/^\s+//;
|
} |
$val =~ s/\s+$//;
|
|
|
unless ($self->is_connected) { |
if ($key eq 'Checksum' && $last_key) {
|
#$! = "Not connected"; |
# Special case for these bastids.
|
#warn "Not connected\n"; |
my $new = $last_key;
|
return undef; |
$new =~ s/\s+\S+$//;
|
} |
$key = $new . " " . $key;
|
|
}
|
unless ($self->logged_in) { |
|
#$! = "Not logged in"; |
$last_key = $key;
|
#warn "Not logged in\n"; |
$conf{$key} = $val;
|
return undef; |
$key = '';
|
} |
$val = '';
|
|
}
|
|
|
my %cmd; |
} elsif ($c eq ']') {
|
foreach (@valid_net_telnet_opts) { |
$in_val = 1;
|
if (exists $cfg{$_}) { |
$in_key = 0;
|
$cmd{$_} = $cfg{$_}; |
$c = shift @chars;
|
} |
|
} |
} elsif ($in_key) {
|
if ($cfg{'args'}) { |
$key .= $c;
|
$cmd{'String'} .= ' ' . $cfg{'args'}; |
|
} |
} elsif ($in_val) {
|
my @lines; |
$val .= $c;
|
unless ($cfg{'no_prompt'}) { |
}
|
@lines = $self->SUPER::cmd(%cmd); |
}
|
} else { |
}
|
$self->print($cmd{'String'}); |
|
@lines = $self->lastline; |
if (%conf) {
|
} |
return \%conf;
|
|
} else {
|
$self->last_lines(\@lines); |
return undef;
|
|
}
|
my $vals = 1; |
}
|
if ($PRIVATE{'Decode'} && $cfg{'decode'}) { |
|
if ($cfg{'decode'} eq 'each') { |
#=item _decode_each_line
|
$vals = _decode_each_line(@lines); |
|
} elsif ($cfg{'decode'} eq 'sulog') { |
sub _decode_each_line
|
$vals = _decode_sulog(@lines); |
{
|
} elsif ($cfg{'decode'} eq 'maclist') { |
my @lines = @_;
|
$vals = _decode_maclist(@lines); |
my @decoded;
|
} else { |
foreach my $line (@lines) {
|
$vals = _decode_lines(@lines); |
my $decoded = _decode_lines($line);
|
} |
push @decoded, $decoded if defined $decoded;
|
} |
}
|
|
return \@decoded;
|
$self->last_vals($vals); |
}
|
|
|
|
#=item _decode_sulog
|
my $last = $self->lastline; |
|
|
sub _decode_sulog
|
if ((not $cfg{'expect'}) || $last =~ /$cfg{'expect'}$/) { |
{
|
if ($cfg{'cmd_disconnects'}) { |
my @lines = @_;
|
$self->logged_in(0); |
my @decoded;
|
$self->close; |
my $last_tm;
|
$self->is_connected(0); |
foreach my $line (@lines) {
|
} |
my $decoded = _decode_lines($line);
|
|
|
if ($PRIVATE{'Decode'} && $cfg{'decode'}) { |
if (defined $decoded) {
|
return $vals; |
if ($decoded->{'tm'}) {
|
} else { |
$last_tm = $decoded->{'tm'};
|
return @lines; |
next;
|
} |
} else {
|
} else { |
$decoded->{'tm'} = $last_tm;
|
#$! = "Error with command ($cfg{'string'}): $last"; |
}
|
return undef; |
next unless $last_tm;
|
} |
|
} |
push @decoded, $decoded if defined $decoded;
|
|
}
|
#=item _decode_lines |
}
|
|
return \@decoded;
|
sub _decode_lines |
}
|
{ |
|
my @lines = @_; |
1;
|
|
__END__
|
my %conf; |
|
|
=back
|
my $key = ''; |
|
my $val = undef; |
=head1 SEE ALSO
|
my $in_key = 0; |
|
my $in_val = 1; |
Trango Documentation - http://www.trangobroadband.com/support/product_docs.htm
|
|
|
foreach my $line (@lines) { |
L<Net::Telnet>
|
next if $line =~ /$success$/; |
|
|
=head1 TODO
|
my @chars = split //, $line; |
|
|
There are still a lot of commands that are not accessed directly. If you call them (as cmd("command + args") or whatever) and it works, please send me examples that work and I will try to get it incorporated into the next version of the script.
|
my $last_key = ''; |
|
foreach my $c (@chars) { |
I also want to be able to parse the different types of output from commands like su, sudb all and anything else that would be better available as a perl datastructure.
|
|
|
if ($c eq '[' || $c eq "\r" || $c eq "\n") { |
=head1 AUTHOR
|
if ($c eq '[') { |
|
$in_key = 1; |
Andrew Fresh E<lt>andrew@rraz.netE<gt>
|
$in_val = 0; |
|
} else { |
=head1 COPYRIGHT AND LICENSE
|
$in_key = 0; |
|
$in_val = 1; |
Copyright (C) 2005 by Andrew Fresh
|
} |
|
|
This library is free software; you can redistribute it and/or modify
|
if ($key) { |
it under the same terms as Perl itself, either Perl version 5.8.7 or,
|
$key =~ s/^\s+//; |
at your option, any later version of Perl 5 you may have available.
|
$key =~ s/\s+$//; |
|
|
|
if (defined $val) { |
=cut
|
$val =~ s/^\s+//; |
|
$val =~ s/\s+$//; |
|
} |
|
|
|
if ($key eq 'Checksum' && $last_key) { |
|
# Special case for these bastids. |
|
my $new = $last_key; |
|
$new =~ s/\s+\S+$//; |
|
$key = $new . " " . $key; |
|
} |
|
|
|
$last_key = $key; |
|
$conf{$key} = $val; |
|
$key = ''; |
|
$val = ''; |
|
} |
|
|
|
} elsif ($c eq ']') { |
|
$in_val = 1; |
|
$in_key = 0; |
|
$c = shift @chars; |
|
|
|
} elsif ($in_key) { |
|
$key .= $c; |
|
|
|
} elsif ($in_val) { |
|
$val .= $c; |
|
} |
|
} |
|
} |
|
|
|
if (%conf) { |
|
return \%conf; |
|
} else { |
|
return $val; |
|
} |
|
} |
|
|
|
#=item _decode_each_line |
|
|
|
sub _decode_each_line |
|
{ |
|
my @lines = @_; |
|
my @decoded; |
|
foreach my $line (@lines) { |
|
my $decoded = _decode_lines($line); |
|
push @decoded, $decoded if defined $decoded; |
|
} |
|
return \@decoded; |
|
} |
|
|
|
#=item _decode_sulog |
|
|
|
sub _decode_sulog |
|
{ |
|
my @lines = @_; |
|
my @decoded; |
|
my $last_tm; |
|
foreach my $line (@lines) { |
|
my $decoded = _decode_lines($line); |
|
|
|
if (defined $decoded) { |
|
if ($decoded->{'tm'}) { |
|
$last_tm = $decoded->{'tm'}; |
|
next; |
|
} else { |
|
$decoded->{'tm'} = $last_tm; |
|
} |
|
next unless $last_tm; |
|
|
|
push @decoded, $decoded if defined $decoded; |
|
} |
|
} |
|
return \@decoded; |
|
} |
|
|
|
#=item _decode_maclist |
|
|
|
sub _decode_maclist |
|
{ |
|
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 =~ / |
|
([0-9a-fA-F ]{17})\s+ |
|
(.*)\s+ |
|
tm\s+ |
|
(\d+) |
|
/x; |
|
|
|
if ($mac) { |
|
$mac =~ s/\s+//g; |
|
$loc =~ s/^\s+//; |
|
$loc =~ s/\s+$//; |
|
|
|
my $suid = undef; |
|
if ($loc =~ /suid\s+=\s+(\d+)/) { |
|
$suid = $1; |
|
$loc = undef; |
|
} |
|
|
|
push @decoded, { |
|
mac => $mac, |
|
loc => $loc, |
|
tm => $tm, |
|
suid => $suid, |
|
}; |
|
} elsif ($line =~ /(\d+)\s+entries/) { |
|
$total_entries = $1; |
|
} elsif ($line =~ /current tm = (\d+)\s+sec/) { |
|
$current_tm = $1 |
|
} |
|
} |
|
|
|
map { $_->{'cur_tm'} = $current_tm } @decoded; |
|
|
|
if (scalar @decoded == $total_entries) { |
|
return \@decoded; |
|
} else { |
|
# XXX we should have a way to set last error, not sure why we don't |
|
return undef; |
|
} |
|
} |
|
|
|
1; |
|
__END__ |
|
|
|
=back |
|
|
|
=head1 SEE ALSO |
|
|
|
Trango Documentation - |
|
http://www.trangobroadband.com/support/product_docs.htm |
|
|
|
L<Net::Telnet> |
|
|
|
=head1 TODO |
|
|
|
There are still a lot of commands that are not accessed directly. If |
|
you call them (as cmd("command + args") or whatever) and it works, |
|
please send me examples that work and I will try to get it incorporated |
|
into the next version of the script. |
|
|
|
I also want to be able to parse the different types of output from |
|
commands like su, sudb all and anything else that would be better |
|
available as a perl datastructure. |
|
|
|
=head1 AUTHOR |
|
|
|
Andrew Fresh E<lt>andrew@rraz.netE<gt> |
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
|
|
Copyright (C) 2005 by Andrew Fresh |
|
|
|
This library is free software; you can redistribute it and/or modify |
|
it under the same terms as Perl itself, either Perl version 5.8.7 or, |
|
at your option, any later version of Perl 5 you may have available. |
|
|
|
|
|
=cut |