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 \
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_stack.pm snmpit_intel_stack.pm \
snmpit_foundry.pm snmpit_stack.pm \
libaudit.pm libreboot.pm libosload.pm libtestbed.py
#
......
......@@ -114,6 +114,12 @@ foreach my $name (keys %portMap) {
last;
};
/foundry/ && do {
require snmpit_foundry;
$device = new snmpit_foundry($name,0);
last;
};
# 'default' case
die "Unknown switch type ($type) for $name\n";
}
......
......@@ -242,6 +242,11 @@ foreach my $name (keys %portMap) {
$device = new snmpit_intel($name);
last;
};
/foundry/ && do {
require snmpit_foundry;
$device = new snmpit_foundry($name);
last;
};
# 'default' case
die "Unknown switch type ($type) for $name\n";
......
......@@ -2,7 +2,7 @@
#
# 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.
#
......@@ -47,7 +47,7 @@ Usage: $0 [-h] [-v] [-n] [-i device]
[-r pid eid]
[-t pid eid]
[-d ports] [-e ports] [-a ports]
[-p <10|100> ports] [-u <half|full> ports]
[-p <10|100|1000> ports] [-u <half|full> ports]
[-c]
General:
-h Display this help message
......@@ -189,12 +189,14 @@ if ($opt{p}) {
#
# 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"];
} elsif ($opt{p} =~ /^10/) {
push @commands, ["portcontrol","10mbit"];
} 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}) {
......@@ -429,6 +431,12 @@ foreach my $command (@commands) {
@{$stacks{$stack_id}});
last;
};
/generic/ && do {
require snmpit_stack;
$stack = new snmpit_stack($stack_id,$debug,
@{$stacks{$stack_id}});
last;
}; # /generic/
# 'default' case
die "Unknown stack type $stack_type for stack $stack_id\n";
......@@ -789,7 +797,7 @@ sub doReset($@) {
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.
#
foreach my $stack (@$stacks) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -25,6 +25,7 @@ use lib '@prefix@/lib';
use libdb;
use snmpit_lib;
use snmpit_cisco;
use snmpit_foundry;
use SNMP;
use strict;
......@@ -103,6 +104,8 @@ SWITCH:
$switchtype = "intel"; last;};
(/^nortel/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "nortel"; last;};
(/^foundry/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "foundry"; last;};
warn "WARNING: Switch type $type is not supported for $switch!\n";
next SWITCHLOOP;
......@@ -142,6 +145,9 @@ SWITCH:
# Make up a fake VLAN, just so we get into the loop below
#
@vlanList = ([0,0,[]]);
if ($switchtype eq "foundry") {
$device = new snmpit_foundry($switch,$debug,$community);
}
}
#
......@@ -299,7 +305,7 @@ SWITCH:
# have only one module, and require no ifindex conversion.
#
my $modport;
if ($switchtype eq "cisco") {
if (($switchtype eq "cisco") || ($switchtype eq "foundry")) {
($modport) = $device->convertPortFormat(2, $ifIndex);
} else {
$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