Commit 8fa77458 authored by Weibin Sun's avatar Weibin Sun

merge portmerge

parent a00ec03b
...@@ -48,6 +48,7 @@ use libtestbed; ...@@ -48,6 +48,7 @@ use libtestbed;
use Experiment; use Experiment;
use User; use User;
use snmpit_lib; use snmpit_lib;
use Port;
# The set of OIDs we care about # The set of OIDs we care about
my @oids = ('ifAdminStatus','ifOperStatus'); my @oids = ('ifAdminStatus','ifOperStatus');
...@@ -150,12 +151,11 @@ foreach my $name (keys %portMap) { ...@@ -150,12 +151,11 @@ foreach my $name (keys %portMap) {
# #
# Try to translate the port name to the node's vname # Try to translate the port name to the node's vname
# #
$port =~ /^(.+):(\d+)/;
my $nickname; my $nickname;
if ($1) { if (defined($port->node_id())) {
my $portnum = $2; my $portnum = $port->port();
my ($junk, $vname); my ($junk, $vname);
NodeidToExp($1,\$junk,\$junk,\$vname); NodeidToExp($port->node_id(),\$junk,\$junk,\$vname);
$nickname = "$vname:$portnum"; $nickname = "$vname:$portnum";
} }
...@@ -173,7 +173,8 @@ my $errors = 0; ...@@ -173,7 +173,8 @@ my $errors = 0;
foreach my $line (sort {$$a[0] cmp $$b[0]} @portinfo) { foreach my $line (sort {$$a[0] cmp $$b[0]} @portinfo) {
my ($nickname,$port,$adminStatus,$operStatus) = @$line; my ($nickname,$port,$adminStatus,$operStatus) = @$line;
if ($adminStatus ne $operStatus) { if ($adminStatus ne $operStatus) {
print "Switch port for $nickname ($port) should be $adminStatus, " . print "Switch port for $nickname (".$port->toString().
") should be $adminStatus, " .
"but is $operStatus\n"; "but is $operStatus\n";
$errors++; $errors++;
} }
......
...@@ -1271,12 +1271,12 @@ sub listPorts($) { ...@@ -1271,12 +1271,12 @@ sub listPorts($) {
# if port is actived, use actual rate, otherwise use desired rate # if port is actived, use actual rate, otherwise use desired rate
# #
if ( $arate[0] eq "00" ) { if ( $arate[0] eq "00" ) {
push @ports, [$finalport->getPCPort(), "no", "down", $strdrate[2], $strdrate[1]]; push @ports, [$finalport->getOtherEndPort(), "no", "down", $strdrate[2], $strdrate[1]];
} else { } else {
# #
# Not sure if it is OK to just ignore the desired rate # Not sure if it is OK to just ignore the desired rate
# #
push @ports, [$finalport->getPCPort(), "yes", "up", $arate[3], $arate[2]]; push @ports, [$finalport->getOtherEndPort(), "yes", "up", $arate[3], $arate[2]];
} }
} }
......
...@@ -33,6 +33,7 @@ use snmpit_nortel; ...@@ -33,6 +33,7 @@ use snmpit_nortel;
use snmpit_hp; use snmpit_hp;
use SNMP; use SNMP;
use Getopt::Long; use Getopt::Long;
use Port;
use strict; use strict;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment