"Main program"
#!/usr/bin/perl -w
... # docu and version info -- skipped
use strict;
use FileHandle;
use File::stat;
use Getopt::Long;
use POSIX ":sys_wait_h";
use POSIX qw(ceil);
use Socket;
#==============================================================================
#== Find the lib dir
use Cwd;
use File::Basename;
BEGIN {
my $dir = dirname($0);
my $path;
if ($dir =~ /^\//) {
#--absolute path
$path = $dir;
} elsif ($dir eq ".") {
#-- relative, current dir
$path = getcwd();
} else {
#-- relative, but not from current dir
$dir =~ s/^\.\///;
$path = getcwd()."/$dir";
}
unshift(@INC, "$path/lib");
unshift(@INC, "$path/lib-perl");
unshift(@INC, "$path/lib-perl/sun4-solaris-64int");
}
#==============================================================================
use Net::TFTP;
use Net::SNMP::Security::USM v3.0.0;
use IsamCli;
use Isam7354RUCli;
use Crypt::Lite;
use Utils; # -- BB --
use Octopus;
use Capability;
use ToolCommon qw(:CONSTANTS);
use PbmtConfig;
use ErrorCodes qw(:EXIT_CODES :SWDL);
use FamilyCommon;
....
####
use Octopus;
use Capability;
####
package Octopus;
use strict;
use File::Basename;
use Cwd;
BEGIN {
my $dir = dirname($0);
my $path;
if ($dir =~ /^\//) {
#--absolute path
$path = $dir;
} elsif ($dir eq ".") {
#-- relative, current dir
$path = getcwd();
} else {
#-- relative, but not from current dir
$dir =~ s/^\.\///;
$path = getcwd()."/$dir";
}
unshift(@INC, "$path/lib");
unshift(@INC, "$path/lib-perl");
}
require Utils;
require Capability;
use ErrorCodes qw(:EXIT_CODES);
use ToolCommon qw(:CONSTANTS);
require ReduceSWP;
...
####
package Capability;
use strict;
use Cwd;
use File::Basename;
BEGIN {
my $dir = dirname($0);
my $path;
if ($dir =~ /^\//) {
#--absolute path
$path = $dir;
} elsif ($dir eq ".") {
#-- relative, current dir
$path = getcwd();
} else {
#-- relative, but not from current dir
$dir =~ s/^\.\///;
$path = getcwd()."/$dir";
}
unshift(@INC, "$path/lib");
unshift(@INC, "$path/lib-perl");
}
use IsamCli;
use ToolCommon qw(:CONSTANTS);
use ErrorCodes qw(:EXIT_CODES);
#==============================================================================
#== Prototypes
#==============================================================================
sub GetVersion();
sub GetError();
...
my %ntCapabilities = ('EANT-A' => {'SW_PAR' => undef},
'EBNT-A' => {'SW_PAR' => undef},
'ECNT-A' => {'SW_PAR' => $ECNTA_MINSWPARSIZE,
'PREFIX' => {'ALL' => 'L5YY'},
'BRDCODE' => 12355,
'SAFE_ICS' => 13,
'SHUB_TYPE' => 'ECNTA',
'EQPT_TYPE' => $XD,
'IF_BASE' => $OTHER_IFBASE,
'FAMILY' => {'ALL' => $ISAM,
'400 410' => $ISAM_ANSI},
'NO_UPG' => {'240' => [$IMPOSSIBLE, $FTP_ISSUE],
'241' => ['248 249 244 246', $INCOMP_RELSTREAM],
'242' => ['248 249 244 246', $INCOMP_RELSTREAM]},
'NO_MIG' => {'117' => [$IMPOSSIBLE,
'No migration possible from this release'], # No migrations for this release
'233' => ['241 242 243 248 249 244 246 250',
'Feature incompatibilty w.r.t. pppoe relay tagging'], # No migrations due to pppoe relay tags of 2.3.03
'240' => [$IMPOSSIBLE,
'No upgrade possible due to file transfer problem'],
'241' => ['248 249 244 246 300', $INCOMP_RELSTREAM],
'242' => ['248 249 244 246 300', $INCOMP_RELSTREAM],
'244' => ['250 300 310 320', $INCOMP_RELSTREAM],
'245' => ['250', $NO_MIG_PATH ],
'246' => ['250 300 310 320', $INCOMP_RELSTREAM],
'248' => ['250', $INCOMP_RELSTREAM],
'249' => ['250', $INCOMP_RELSTREAM],
'250' => ['300', $INCOMP_RELSTREAM]},
'MIG_EXCLUDED_TO' => {$ISAM => "330 340 400"} },
....
);
####
defined($ntCapabilities{$type}{'SW_PAR'}).