Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
40c15782
Commit
40c15782
authored
Jul 06, 2001
by
Christopher Alfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed to do the right thing when nodes are reserved.
parent
c5ef5b96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
tbsetup/ptopgen.in
tbsetup/ptopgen.in
+14
-12
No files found.
tbsetup/ptopgen.in
View file @
40c15782
...
...
@@ -113,19 +113,21 @@ $sth = $dbh->prepare("SELECT type,node_id1,card1,port1,node_id2,card2,port2" .
$sth
->
execute
;
while
((
$type
,
$node1
,
$card1
,
$port1
,
$node2
,
$card2
,
$port2
)
=
$sth
->
fetchrow_array
)
{
$iface1
=
get_iface
(
$node1
,
$card1
,
$port1
);
$iface2
=
get_iface
(
$node2
,
$card2
,
$port2
);
$iface1bw
=
get_ifacebw
(
$node1
,
$card1
,
$port1
);
$iface2bw
=
get_ifacebw
(
$node2
,
$card2
,
$port2
);
if
(
$iface1bw
<
$iface2bw
)
{
$bw
=
$iface1bw
;
}
else
{
$bw
=
$iface2bw
;
if
(
defined
(
$nodes
{
$node1
})
&&
defined
(
$nodes
{
$node2
}))
{
$iface1
=
get_iface
(
$node1
,
$card1
,
$port1
);
$iface2
=
get_iface
(
$node2
,
$card2
,
$port2
);
$iface1bw
=
get_ifacebw
(
$node1
,
$card1
,
$port1
);
$iface2bw
=
get_ifacebw
(
$node2
,
$card2
,
$port2
);
if
(
$iface1bw
<
$iface2bw
)
{
$bw
=
$iface1bw
;
}
else
{
$bw
=
$iface2bw
;
}
# !!! - Here we use our knowledge that in the wires table links
# to the switch always come as node2.
print
"
link link-
$node1
:
$iface1
-
$node2
:
$iface2
$node1
:
$node1
/
$iface1
"
.
"
$node2
:
$iface2
$bw
1
\n
";
}
# !!! - Here we use our knowledge that in the wires table links
# to the switch always come as node2.
print
"
link link-
$node1
:
$iface1
-
$node2
:
$iface2
$node1
:
$node1
/
$iface1
"
.
"
$node2
:
$iface2
$bw
1
\n
"
}
$sth
->
finish
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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