Commit 63d6f910 authored by Robert Ricci's avatar Robert Ricci

Foundry and mixed-type stack support.

Contributed by Keith Sklower at Berkeley.
parent 08048e68
...@@ -46,6 +46,7 @@ LIBEXEC_STUFF = rmproj wanlinksolve wanlinkinfo \ ...@@ -46,6 +46,7 @@ LIBEXEC_STUFF = rmproj wanlinksolve wanlinkinfo \
LIB_STUFF = libtbsetup.pm exitonwarn.pm libtestbed.pm snmpit_intel.pm \ LIB_STUFF = libtbsetup.pm exitonwarn.pm libtestbed.pm snmpit_intel.pm \
snmpit_cisco.pm snmpit_lib.pm snmpit_apc.pm power_rpc27.pm \ snmpit_cisco.pm snmpit_lib.pm snmpit_apc.pm power_rpc27.pm \
snmpit_cisco_stack.pm snmpit_intel_stack.pm \ snmpit_cisco_stack.pm snmpit_intel_stack.pm \
snmpit_foundry.pm snmpit_stack.pm \
libaudit.pm libreboot.pm libosload.pm libtestbed.py libaudit.pm libreboot.pm libosload.pm libtestbed.py
# #
......
...@@ -114,6 +114,12 @@ foreach my $name (keys %portMap) { ...@@ -114,6 +114,12 @@ foreach my $name (keys %portMap) {
last; last;
}; };
/foundry/ && do {
require snmpit_foundry;
$device = new snmpit_foundry($name,0);
last;
};
# 'default' case # 'default' case
die "Unknown switch type ($type) for $name\n"; die "Unknown switch type ($type) for $name\n";
} }
......
...@@ -242,6 +242,11 @@ foreach my $name (keys %portMap) { ...@@ -242,6 +242,11 @@ foreach my $name (keys %portMap) {
$device = new snmpit_intel($name); $device = new snmpit_intel($name);
last; last;
}; };
/foundry/ && do {
require snmpit_foundry;
$device = new snmpit_foundry($name);
last;
};
# 'default' case # 'default' case
die "Unknown switch type ($type) for $name\n"; die "Unknown switch type ($type) for $name\n";
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-LGPL # EMULAB-LGPL
# Copyright (c) 2000-2003 University of Utah and the Flux Group. # Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -47,7 +47,7 @@ Usage: $0 [-h] [-v] [-n] [-i device] ...@@ -47,7 +47,7 @@ Usage: $0 [-h] [-v] [-n] [-i device]
[-r pid eid] [-r pid eid]
[-t pid eid] [-t pid eid]
[-d ports] [-e ports] [-a ports] [-d ports] [-e ports] [-a ports]
[-p <10|100> ports] [-u <half|full> ports] [-p <10|100|1000> ports] [-u <half|full> ports]
[-c] [-c]
General: General:
-h Display this help message -h Display this help message
...@@ -189,12 +189,14 @@ if ($opt{p}) { ...@@ -189,12 +189,14 @@ if ($opt{p}) {
# #
# We'll put the argument in the form needed by the portControl function # We'll put the argument in the form needed by the portControl function
# #
if ($opt{p} =~ /^100/) { if ($opt{p} =~ /^1000/) {
push @commands, ["portcontrol","1000mbit"];
} elsif ($opt{p} =~ /^100/) {
push @commands, ["portcontrol","100mbit"]; push @commands, ["portcontrol","100mbit"];
} elsif ($opt{p} =~ /^10/) { } elsif ($opt{p} =~ /^10/) {
push @commands, ["portcontrol","10mbit"]; push @commands, ["portcontrol","10mbit"];
} else { } else {
die "Bad port speed: $opt{p}. Valid values are 10 and 100\n"; die "Bad port speed: $opt{p}. Valid values are 10, 100, and 1000\n";
} }
} }
if ($opt{u}) { if ($opt{u}) {
...@@ -429,6 +431,12 @@ foreach my $command (@commands) { ...@@ -429,6 +431,12 @@ foreach my $command (@commands) {
@{$stacks{$stack_id}}); @{$stacks{$stack_id}});
last; last;
}; };
/generic/ && do {
require snmpit_stack;
$stack = new snmpit_stack($stack_id,$debug,
@{$stacks{$stack_id}});
last;
}; # /generic/
# 'default' case # 'default' case
die "Unknown stack type $stack_type for stack $stack_id\n"; die "Unknown stack type $stack_type for stack $stack_id\n";
...@@ -789,7 +797,7 @@ sub doReset($@) { ...@@ -789,7 +797,7 @@ sub doReset($@) {
my $errors = 0; my $errors = 0;
# #
# Just remove the VLAN from evey satck on which it exists. We keep a # Just remove the VLAN from evey stack on which it exists. We keep a
# list and do them all at once for efficiency. # list and do them all at once for efficiency.
# #
foreach my $stack (@$stacks) { foreach my $stack (@$stacks) {
......
This diff is collapsed.
This diff is collapsed.
...@@ -25,6 +25,7 @@ use lib '@prefix@/lib'; ...@@ -25,6 +25,7 @@ use lib '@prefix@/lib';
use libdb; use libdb;
use snmpit_lib; use snmpit_lib;
use snmpit_cisco; use snmpit_cisco;
use snmpit_foundry;
use SNMP; use SNMP;
use strict; use strict;
...@@ -103,6 +104,8 @@ SWITCH: ...@@ -103,6 +104,8 @@ SWITCH:
$switchtype = "intel"; last;}; $switchtype = "intel"; last;};
(/^nortel/) && do { $snmpversion = "1"; $useindexing = 0; (/^nortel/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "nortel"; last;}; $switchtype = "nortel"; last;};
(/^foundry/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "foundry"; last;};
warn "WARNING: Switch type $type is not supported for $switch!\n"; warn "WARNING: Switch type $type is not supported for $switch!\n";
next SWITCHLOOP; next SWITCHLOOP;
...@@ -142,6 +145,9 @@ SWITCH: ...@@ -142,6 +145,9 @@ SWITCH:
# Make up a fake VLAN, just so we get into the loop below # Make up a fake VLAN, just so we get into the loop below
# #
@vlanList = ([0,0,[]]); @vlanList = ([0,0,[]]);
if ($switchtype eq "foundry") {
$device = new snmpit_foundry($switch,$debug,$community);
}
} }
# #
...@@ -299,7 +305,7 @@ SWITCH: ...@@ -299,7 +305,7 @@ SWITCH:
# have only one module, and require no ifindex conversion. # have only one module, and require no ifindex conversion.
# #
my $modport; my $modport;
if ($switchtype eq "cisco") { if (($switchtype eq "cisco") || ($switchtype eq "foundry")) {
($modport) = $device->convertPortFormat(2, $ifIndex); ($modport) = $device->convertPortFormat(2, $ifIndex);
} else { } else {
$modport = "1.$ifIndex"; $modport = "1.$ifIndex";
......
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