Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
beaf5cd2
Commit
beaf5cd2
authored
Dec 03, 2004
by
Mike Hibler
Browse files
Check in a change that Rob forgot (for -S option)
parent
e4fb0a0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/snmpit_lib.pm
View file @
beaf5cd2
...
...
@@ -14,7 +14,8 @@ package snmpit_lib;
use
Exporter
;
@ISA
=
("
Exporter
");
@EXPORT
=
qw( macport portnum Dev vlanmemb vlanid
getTestSwitches getControlSwitches getVlanPorts
getTestSwitches getControlSwitches getSwitchesInStack
getVlanPorts
getExperimentVlans getDeviceNames getDeviceType
getInterfaceSettings mapPortsToDevices getSwitchStack
getStackType getDeviceOptions getTrunks getTrunksFromSwitches
...
...
@@ -337,6 +338,20 @@ sub getControlSwitches () {
return
@switches
;
}
#
# Returns an array with the names of all switches in the given stack
#
sub
getSwitchesInStack
($)
{
my
(
$stack_id
)
=
@_
;
my
$result
=
DBQueryFatal
("
SELECT node_id FROM switch_stacks
"
.
"
WHERE stack_id='
$stack_id
'
");
my
@switches
=
();
while
(
my
@row
=
$result
->
fetchrow
())
{
push
@switches
,
$row
[
0
];
}
return
@switches
;
}
#
# Returns the stack_id that a switch belongs to
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment