Commit 73367cff authored by Robert Ricci's avatar Robert Ricci

Add a new function, getControlSwitches

parent c08f30a1
......@@ -15,9 +15,10 @@ package snmpit_lib;
use Exporter;
@ISA = ("Exporter");
@EXPORT = qw( macport portnum Dev vlanmemb vlanid
getTestSwitches getVlanPorts getExperimentVlans getDeviceNames
getDeviceType getInterfaceSettings mapPortsToDevices
getSwitchStack getStackType getTrunks getTrunksFromSwitches
getTestSwitches getControlSwitches getVlanPorts
getExperimentVlans getDeviceNames getDeviceType
getInterfaceSettings mapPortsToDevices getSwitchStack
getStackType getTrunks getTrunksFromSwitches
getExperimentPorts snmpitGetWarn snmpitGetFatal
snmpitWarn snmpitFatal printVars tbsort );
......@@ -314,6 +315,21 @@ sub getTestSwitches () {
return @switches;
}
#
# Returns an array with the names of all switches identified as control switches
#
sub getControlSwitches () {
my $result =
DBQueryFatal("SELECT node_id FROM nodes WHERE role='ctrlswitch'");
my @switches = ();
while (my @row = $result->fetchrow()) {
push @switches, $row[0];
}
return @switches;
}
#
# Returns the stack_id that a switch belongs to
#
......
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