[BACK]Return to update_trango.pl CVS log [TXT][DIR] Up to [local] / trango / Net-Telnet-Trango / scripts

Diff for /trango/Net-Telnet-Trango/scripts/update_trango.pl between version 1.9 and 1.23

version 1.9, 2005/11/18 19:17:12 version 1.23, 2007/02/01 18:44:30
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $RedRiver: update_trango.pl,v 1.8 2005/11/17 20:20:59 andrew Exp $  # $RedRiver: update_trango.pl,v 1.22 2007/02/01 17:58:33 andrew Exp $
 ########################################################################  ########################################################################
 # update_trango.pl *** Updates trango foxes with a new firmware  # update_trango.pl *** Updates trango foxes with a new firmware
 #  #
 # 2005.11.15 #*#*# andrew fresh <andrew@mad-techies.org>  # 2005.11.15 #*#*# andrew fresh <andrew@mad-techies.org>
 ########################################################################  ########################################################################
 use strict;  use strict;
 use warnings;  use warnings;
   
 use Net::TFTP;  use YAML qw/ LoadFile /;
   use Net::TFTP;
 my $config_file = shift || 'update_trango.conf';  use lib '.';
 my $max_tries = 3;  use Net::Telnet::Trango;
   
   my $config_file = shift || 'update_trango.yaml';
   my $max_tries = 3;
 my $l = Mylogger->new( { log_prefix => 'UT' } );  
   my $l = Mylogger->new( { log_prefix => 'UT' } );
   
 $l->sp("Reading config file '$config_file'");  $l->sp("Reading config file '$config_file'");
 my $conf = read_conf($config_file);  my $conf = LoadFile($config_file);
   
 $l->sp("  Hardware Type: $conf->{'type'}");  my @foxes = (
 $l->sp("  File Name:     $conf->{'file_name'}");  '10.100.1.2',
 $l->sp("  File Size:     $conf->{'file_size'}");  '10.100.2.2',
 $l->sp("  File Checksum: $conf->{'file_cksum'}");  '10.100.3.2',
 $l->sp("  FW Version:    $conf->{'ver'}");  '10.100.4.2',
 $l->sp("  FW Checksum:   $conf->{'cksum'}");  );
 $l->sp("");  
   foreach my $fox (@foxes) {
     $l->sp("Checking: $fox");
     my $needs_reboot = 0;
   
     ## Connect and login.
     my $t = new Net::Telnet::Trango (
 foreach my $fox (@{ $conf->{'ips'} }) {      Timeout => 5,
   $l->sp("Updating: $fox");      Errmode => 'return',
     ) or die "Couldn't make new connection: $!";
   ## Connect and login.    $l->p("Connecting to $fox");
   my $t = new Trango::Telnet ({    unless ( $t->open($fox) ) {
     Host    => $fox,      $l->sp("Error connecting: $!");
     Timeout => 5,      next;
   });    }
   
   $l->p("Connecting to $fox");    foreach my $firmware_type ('Firmware', 'FPGA') {
   my ($type, $version) = $t->connect();  
       if (! exists $conf->{$firmware_type}) {
   unless (defined $type && defined $version) {            $l->s("No configs for '$firmware_type'");
     $l->sp("Error connecting!");            $t->close();
     next;            next;
   }          }
   
   if ($type ne $conf->{'type'}) {      my $host_type = $t->host_type;
     $l->sp("Wrong type of unit ('$type' should be '$conf->{'type'}')");      if ($firmware_type eq 'FPGA') {
     $t->close;        $host_type =~ s/\s.*$//;
     next;      }
   }  
       if (! exists $conf->{$firmware_type}->{$host_type}) {
   if ($version eq $conf->{'ver'}) {            $l->sp("No '$firmware_type' config for type $host_type");
     $l->sp("Already up to date with firmware version '$version'");            $t->close();
     $t->close;            next;
     next;          }
   }  
       if (! $t->logged_in) {
   $l->p("Logging in");        $l->p("Logging in");
   $t->login($conf->{'password'}) || die "Couldn't login: $!";        $t->login($conf->{general}->{'password'});
         unless ($t->logged_in) {
   $l->p("Sending commands");          $l->p('Failed!');
   ## Send commands          $t->bye();
   if ( upload($t, $conf->{'file_name'}) ) {          next;
     $l->p("Rebooting");        }
     $t->reboot;      }
   } else {  
     $l->p("Exiting");          foreach my $k (keys %{ $conf->{general} }) {
     $t->exit;            $conf->{$firmware_type}->{$host_type}->{$k} ||= $conf->{general}->{$k};
   }      }
   $t->close;          $conf->{$firmware_type}->{$host_type}->{firmware_type} ||= $firmware_type;
   $l->sp("");          $conf->{$firmware_type}->{$host_type}->{type} ||= $host_type;
 }  
       $l->sp("$host_type $firmware_type");
 sub upload      $l->p("Sending commands");
 {      ## Send commands
   my $t    = shift;      my $rc = upload($t, $conf->{$firmware_type}->{$host_type});
   my $file = shift;          if ($rc) {
         $l->sp("Successfull!");
   $l->p("Getting current version");            $needs_reboot = 1;
   my $ver = $t->ver;      } elsif (defined $rc) {
             $l->sp("Already up to date");
   if (      } else {
     $ver->{'Firmware Version'}  eq $conf->{'ver'} &&            $l->sp("Failed");
     $ver->{'Firmware Checksum'} eq $conf->{'cksum'}            $t->bye;
   ) {            next;
     $l->sp("Already updated!");      }
     return 1;  
   }    }
   
   my $try = 0;    if ($needs_reboot) {
   while (1) {      $l->sp("Rebooting $fox");
     if ($try >= $max_tries) {      $t->reboot;
       $l->sp("Couldn't update in $max_tries tries!");    } else {
       return undef;      $l->sp("Bye $fox");
     }      $t->bye();
     $try++;    }
     $l->sp("");
     #sysinfo($self->{'_host'});  }
       
     $l->p("Enabling TFTPd");  sub upload
     $t->enable_tftpd || die "Couldn't enable tftpd";  {
     my $t    = shift;
     $l->p("Uploading file ($file)");    my $conf = shift;
     # use tftp to push the file up  
     my $tftp = Net::TFTP->new($t->Host, Mode => 'octet');    my $file = $conf->{firmware_path} . '/' . $conf->{file_name};
   
     $tftp->put($file, $file)    my $fw_type = $conf->{firmware_type};
       or die "Error uploading: " . $tftp->error;  
     my $ver = $t->ver;
     # waitfor some sort of output  
     # make sure it says 'Success.' otherwise error    if (
     #print "LAST: " . $self->lastline;      $ver->{$fw_type . ' Version'}  eq $conf->{'ver'} &&
     #my @lines = $self->getlines;      $ver->{$fw_type . ' Checksum'} eq $conf->{'cksum'}
     #print Dump \@lines;    ) {
           return 0;
     $l->p("Checking upload ($conf->{'file_cksum'})");    }
     my $results = $t->tftpd;  
     # check the 'File Length' against ???    $l->sp("Config information:");
     if ( $results->{'File Checksum'} ne $conf->{'file_cksum'}) {    $l->sp("  Hardware Type: $conf->{'type'}");
       $l->sp("File checksum does not match config file!");    $l->sp("  File Name:     $conf->{'file_name'}");
       next;    $l->sp("  File Size:     $conf->{'file_size'}");
     }    $l->sp("  File Checksum: $conf->{'file_cksum'}");
     $l->p("File checksum ($results->{'File Checksum'}) " .    $l->sp("  Conf Version:  $conf->{'ver'}");
           "matches ($conf->{'file_cksum'})");    $l->sp("  Cur  Version:  $ver->{$fw_type . ' Version'}");
     $l->sp("  Conf Checksum: $conf->{'cksum'}");
     if ($results->{'File Length'}   !~ /^$conf->{'file_size'} bytes/) {    $l->sp("  Cur  Checksum: $ver->{$fw_type . ' Checksum'}");
       $l->sp("File length does not match config file!");  
       next;    $l->sp("Updating");
     }    my $try = 0;
     $l->p("File length ($results->{'File Length'}) " .    while (1) {
           "matches ($conf->{'file_size'})");      if ($try >= $max_tries) {
         $l->sp("Couldn't update in $max_tries tries!");
     if ( uc($results->{'File Name'}) ne uc($conf->{'file_name'}) ) {        return;
       $l->sp("File name does not match config file!");      }
       next;      $try++;
     }  
     $l->p("File name ($results->{'File Name'}) " .      #sysinfo($self->{'_host'});
           "matches ($conf->{'file_name'})");  
       $l->p("Enabling TFTPd");
     $l->p("Updating flash (new checksum '$conf->{'cksum'}')");      unless ($t->enable_tftpd) {
     unless ($results = $t->updateflash(        $l->sp("Couldn't enable tftpd");
       $ver->{'Firmware Checksum'}, $conf->{'cksum'}        next;
     ) ) {      }
       $l->sp("Couldn't update flash: $!");  
       next;      $l->p("Uploading file ($file)");
     }      # use tftp to push the file up
       my $tftp = Net::TFTP->new($t->Host, Mode => 'octet');
     unless (  
       defined $results->{'Checksum'} &&      unless ($tftp->put($file, $file)) {
       $results->{'Checksum'} eq $conf->{'cksum'}        $l->sp("Error uploading: " . $tftp->error);
     ) {        next;
       $l->sp("Saved checksum does not match config file!");      }
       next;  
     }      $l->p("Checking upload ($conf->{'file_cksum'})");
     $l->p("Uploaded checksum ($results->{'Checksum'}) " .      my $results = $t->tftpd;
           "matches ($conf->{'cksum'})");      # check the 'File Length' against ???
           if ( $results->{'File Checksum'} ne $conf->{'file_cksum'}) {
     $l->sp("Successfully updated!");        $l->sp(
     return 1;          "File checksum '" . $results->{'File Checksum'} .
   }          " does not match config file '" . $conf->{'file_cksum'} . "'!"
 }        );
         next;
 sub read_conf      }
 {      $l->p("File checksum matches . . . ");
   my $file = shift;  
   my %conf;      if ($results->{'File Length'}   !~ /^$conf->{'file_size'} bytes/) {
   my $in_ip_list = 0;        $l->sp(
   open my $fh, $file or die "Couldn't open file $file: $!";          "File length '" . $results->{'File Length'} .
   while (<$fh>) {          "does not match config file '" . $conf->{'file_size'} . " bytes'!"
     chomp;        );
     next if /^#/;        next;
     next if /^$/;      }
     if ($in_ip_list) {      $l->p("File length matches . . . ");
       if (/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)(\d{1,3})-(\d{1,3})/) {  
         push @{ $conf{'ips'} }, $1 . $_ for ($2..$3);      if ( uc($results->{'File Name'}) ne uc($conf->{'file_name'}) ) {
       } else {        $l->sp(
         push @{ $conf{'ips'} }, $_;          "File name '" . $results->{'File Name'} .
       }          "' does not match config file '" . $conf->{'file_name'} . "'!"
     } else {        );
       my ($key, $val) = split /\s+/, $_, 2;        next;
       }
       if (lc($key) eq 'ips') {      $l->p("File name  matches . . . ");
         $in_ip_list = 1;  
         next;      my $image_type = 'mainimage';
       }      if ($fw_type eq 'FPGA') {
         $image_type = 'fpgaimage';
       $conf{ lc($key) } = $val;      }
     }      $l->p("Updating $image_type (new checksum '$conf->{'cksum'}')");
   }      unless ($results = $t->updateflash(
   close $fh;        args => $image_type . ' ' . $ver->{$fw_type . ' Checksum'} .
                 ' '          . $conf->{'cksum'},
   #print Dump \%conf;        Timeout => 90,
   foreach (      ) ) {
     'password',        $l->sp("Couldn't update flash: $!");
     'file_name', 'file_size', 'file_cksum',        next;
     'ver', 'cksum', 'ips',      }
   ) {  
     die "No $_ specified in config file!"      unless (
       if (not exists $conf{$_});        defined $results->{'Checksum'} &&
   }        $results->{'Checksum'} eq $conf->{'cksum'}
       ) {
   #print Dump \%conf;        $l->sp("Saved checksum " . $results->{'Checksum'} . " does not match config file " .  $conf->{'cksum'} . "!");
   #exit;        next;
   return \%conf;      }
 }      $l->p("Uploaded checksum ($results->{'Checksum'}) " .
             "matches ($conf->{'cksum'})");
 package Trango::Telnet;  
 use base 'Net::Telnet';      $l->sp("Successfully updated!");
       return 1;
 my %PRIVATE = (    }
   connected => 0,  }
   logged_in => 0,  
 );  package Mylogger;
   
 sub new {  use Fcntl ':flock'; # import LOCK_* constants
   my $class = shift;  #use YAML;
   my $args = shift || {};  use constant LOG_PRINT => 128;
   use constant LOG_SAVE  =>  64;
   $args->{'Timeout'} ||= 5;  
   $args->{'Prompt'}  ||= '/#> *$/';  DESTROY {
     my $self = shift;
   foreach my $key (keys %{ $args }) {    if ($self->{'MYLOG'}) {
     $PRIVATE{$key} = $args->{$key};      $self->p("Closing log ($self->{'log_path'}/$self->{'log_file'})");
   }      close $self->{'MYLOG'};
     }
   my $self = $class->SUPER::new(%{ $args });  }
   bless $self;  
   sub new {
   #bless $self, $package;    my $package = shift;
   return $self;    my $self = shift || {};
 }  
     $self->{'base_path'}  ||= '.';
 sub connect    $self->{'log_path'}   ||= $self->{'base_path'};
 {    $self->{'log_prefix'} ||= 'LOG';
   my $self = shift;    $self->{'log_file'}   ||= GetLogName(
       $self->{'log_prefix'},
   unless ( $self->open(      $self->{'log_path'}
       Host => $PRIVATE{'Host'},    );
       Errmode => 'return',    bless $self, $package;
   ) ) {  }
     $! = "Couldn't connect to $self->{'Host'}.  Connection timed out.";  
     return undef, undef;  sub s
   }  {
   #$self->dump_log('dump.log');    my $self = shift;
     my $m = shift;
   ## Login to remote host.    return $self->mylog($m, LOG_SAVE);
   unless ($self->waitfor(  }
     -match => '/password: ?$/i',  
     -errmode => "return",  sub p
   ) ) {  {
     $! = "problem connecting to host ($self->{'Host'}): " . $self->lastline;    my $self = shift;
     return undef;    my $m = shift;
   }    return $self->mylog($m, LOG_PRINT);
   }
   $self->login_banner($self->lastline);  
   sub sp
   $PRIVATE{'connected'} = 1;  {
     my $self = shift;
   return ($self->host_type, $self->firmware_version);    my $m = shift;
 }    return $self->mylog($m, LOG_SAVE | LOG_PRINT);
   }
 sub login  
 {  sub mylog
   my $self = shift;  {
     my $self = shift;
   my $password = shift;  
     my $thing = shift;
   $self->print($password);    chomp $thing;
   unless ($self->waitfor(  
     -match => $self->prompt,    my $which = shift;
     -errmode => "return",  
   ) ) {    my $MYLOG;
     $! = "login ($self->{'Host'}) failed: " . $self->lastline;    if ($which & LOG_PRINT) {
     return undef;      print $thing, "\n";
   }    }
   
   $PRIVATE{'logged_in'} = 1;    if ($which & LOG_SAVE) {
       if ($self->{'MYLOG'}) {
   return 1;        $MYLOG = $self->{'MYLOG'};
 }      } else {
         unless ($MYLOG) {
 sub login_banner                  open ($MYLOG, '>>', $self->{'log_path'} . '/' . $self->{'log_file'})
 {            or die "Couldn't open logfile!\n";
   my $self = shift;          my $ofh = select $MYLOG;
           $|=1;
   my $banner = shift || $PRIVATE{'login_banner'};          select $ofh;
           $self->{'MYLOG'} = $MYLOG;
   my ($type, $ver) = $banner =~  
     /Welcome to Trango Broadband Wireless (\w+)-(.+)$/i;          $self->p("Opened log ($self->{'log_path'}/$self->{'log_file'})");
         }
   $self->host_type($type);      }
   $self->firmware_version($ver);      flock($MYLOG, LOCK_EX);
       print $MYLOG (scalar gmtime), "\t", $thing, "\n"
   return $banner;        or die "Couldn't print to MYLOG: $!";
 }      flock($MYLOG, LOCK_UN);
     }
 sub host_type  }
 {  
   my $self = shift;  sub GetLogName
   {
   my $type = shift || $PRIVATE{'host_type'};    my $prefix  = shift || die "Invalid prefix passed for log";
   $PRIVATE{'host_type'} = $type;  
     my $logdate = GetLogDate();
   return $type;    my $logver  = 0;
 }    my $logname;
   
 sub firmware_version    do {
 {      $logname = $prefix . $logdate . sprintf("%02d", $logver) . '.log';
   my $self = shift;      $logver++;
     } until (not -e $logname);
   my $ver = shift || $PRIVATE{'firmware_version'};  
   $PRIVATE{'firmware_version'} = $ver;    return $logname;
     }
   return $ver  
 }  sub GetLogDate
   {
 sub Host    my ($sec,$min,$hour,$mday,$mon,$year,,,) = localtime();
 {  
   my $self = shift;    $mon++;
       $year += 1900;
   my $host = shift || $PRIVATE{'Host'};  
   $PRIVATE{'HOST'} = $host;    if ($min  < 10) { $min  = "0$min"  }
     if ($sec  < 10) { $sec  = "0$sec"  }
   return $host;    if ($hour < 10) { $hour = "0$hour" }
 }    if ($mday < 10) { $mday = "0$mday" }
     if ($mon  < 10) { $mon  = "0$mon"  }
   
 sub reboot    my $time = $year . $mon . $mday;
 {  
   my $self = shift;    return $time;
   }
   $self->print("reboot\n");  
   $self->getline;  
   
   return 1;  
 }  
   
 sub exit  
 {  
   my $self = shift;  
   
   $self->print("exit\n");  
   $self->getline;  
   
   return 1;  
 }  
   
 sub ver  
 {  
   my $self = shift;  
   
   return $self->cmd('ver');  
 }  
   
 sub tftpd  
 {  
   my $self = shift;  
   
   return $self->cmd('tftpd', 'Success.');  
 }  
   
 sub sysinfo  
 {  
   my $self = shift;  
   
   return $self->cmd('sysinfo', 'Success.');  
 }  
   
 sub enable_tftpd  
 {  
   my $self = shift;  
   
   my $vals = $self->cmd('tftpd on', 'Success.');  
   
   if ($vals->{'Tftpd'} eq 'listen') {  
     return $vals;  
   } else {  
     return undef;  
   }  
 }  
   
 sub updateflash  
 {  
   my $self = shift;  
   
   my $old = shift;  
   my $new = shift;  
   
   return undef unless $new;  
   
   return $self->cmd("updateflash mainimage $old $new", 'Success.', 90);  
 }  
   
 sub cmd  
 {  
   my $self = shift;  
   
   my $string = shift;  
   my $expect_last = shift;  
   my $timeout = shift || $PRIVATE{'Timeout'};  
   
   unless (defined $string) {  
     $! = "No command passed";  
     return undef;  
   }  
   
   unless ($PRIVATE{'connected'}) {  
     $! = "Not connected";  
     return undef;  
   }  
   
   unless ($PRIVATE{'logged_in'}) {  
     $! = "Not logged in";  
     return undef;  
   }  
   
   my @lines = $self->SUPER::cmd(String => $string, Timeout => $timeout);  
   
   my $vals = _decode_lines(@lines);  
   
   unless ($expect_last) {  
     return $vals;  
   }  
   
   my $last = $self->lastline;  
   
   if ($last =~ /$expect_last$/) {  
     return $vals;  
   } else {  
     warn "Error with command ($string): $last";  
     return undef;  
   }  
 }  
   
 sub _decode_lines  
 {  
   my @lines = @_;  
   
   my %conf;  
   
   my $key = '';  
   my $val = '';  
   my $in_key = 0;  
   my $in_val = 0;  
   
   foreach my $line (@lines) {  
     my @chars = split //, $line;  
   
     my $last_key = '';  
     foreach my $c (@chars) {  
   
       if ($c eq '[' || $c eq "\r" || $c eq "\n") {  
         if ($c eq '[') {  
           $in_key = 1;  
           $in_val = 0;  
         } else {  
           $in_key = 0;  
           $in_val = 0;  
         }  
   
         if ($key) {  
           $key =~ s/^\s+//;  
           $key =~ s/\s+$//;  
   
           $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;  
       }  
     }  
   }  
   #print Dump \%conf;  
   
   if (%conf) {  
     return \%conf;  
   } else {  
     return \@lines;  
   }  
 }  
   
   
   
 package Mylogger;  
   
 use Fcntl ':flock'; # import LOCK_* constants  
 #use YAML;  
 use constant LOG_PRINT => 128;  
 use constant LOG_SAVE  =>  64;  
   
 DESTROY {  
   my $self = shift;  
   if ($self->{'MYLOG'}) {  
     $self->p("Closing log ($self->{'log_path'}/$self->{'log_file'})");  
     close $self->{'MYLOG'};  
   }  
 }  
   
 sub new {  
   my $package = shift;  
   my $self = shift || {};  
   
   $self->{'base_path'}  ||= '.';  
   $self->{'log_path'}   ||= $self->{'base_path'};  
   $self->{'log_prefix'} ||= 'LOG';  
   $self->{'log_file'}   ||= GetLogName(  
     $self->{'log_prefix'},  
     $self->{'log_path'}  
   );  
   bless $self, $package;  
 }  
   
 sub s  
 {  
   my $self = shift;  
   my $m = shift;  
   return $self->mylog($m, LOG_SAVE);  
 }  
   
 sub p  
 {  
   my $self = shift;  
   my $m = shift;  
   return $self->mylog($m, LOG_PRINT);  
 }  
   
 sub sp  
 {  
   my $self = shift;  
   my $m = shift;  
   return $self->mylog($m, LOG_SAVE | LOG_PRINT);  
 }  
   
 sub mylog  
 {  
   my $self = shift;  
   
   my $thing = shift;  
   chomp $thing;  
   
   my $which = shift;  
   
   my $MYLOG;  
   if ($which & LOG_PRINT) {  
     print $thing, "\n";  
   }  
   
   if ($which & LOG_SAVE) {  
     if ($self->{'MYLOG'}) {  
       $MYLOG = $self->{'MYLOG'};  
     } else {  
       unless ($MYLOG) {  
                 open ($MYLOG, '>>', $self->{'log_path'} . '/' . $self->{'log_file'})  
           or die "Couldn't open logfile!\n";  
         my $ofh = select $MYLOG;  
         $|=1;  
         select $ofh;  
         $self->{'MYLOG'} = $MYLOG;  
   
         $self->p("Opened log ($self->{'log_path'}/$self->{'log_file'})");  
       }  
     }  
     flock($MYLOG, LOCK_EX);  
     print $MYLOG (scalar gmtime), "\t", $thing, "\n"  
       or die "Couldn't print to MYLOG: $!";  
     flock($MYLOG, LOCK_UN);  
   }  
 }  
   
 sub GetLogName  
 {  
   my $prefix  = shift || die "Invalid prefix passed for log";  
   
   my $logdate = GetLogDate();  
   my $logver  = 0;  
   my $logname;  
   
   do {  
     $logname = $prefix . $logdate . sprintf("%02d", $logver) . '.log';  
     $logver++;  
   } until (not -e $logname);  
   
   return $logname;  
 }  
   
 sub GetLogDate  
 {  
   my ($sec,$min,$hour,$mday,$mon,$year,,,) = localtime();  
   
   $mon++;  
   $year += 1900;  
   
   if ($min  < 10) { $min  = "0$min"  }  
   if ($sec  < 10) { $sec  = "0$sec"  }  
   if ($hour < 10) { $hour = "0$hour" }  
   if ($mday < 10) { $mday = "0$mday" }  
   if ($mon  < 10) { $mon  = "0$mon"  }  
   
   my $time = $year . $mon . $mday;  
   
   return $time;  
 }  

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.23

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>