Skip to content
GitLab
Menu
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-stable
Commits
642fb80d
Commit
642fb80d
authored
Nov 29, 2000
by
Mac Newbold
Browse files
Obsolete. Replaced by ptopgen
parent
f927b10e
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/genptop
deleted
100755 → 0
View file @
f927b10e
#!/usr/local/bin/tclsh
set switches
{
{
155.99.214.170 alpha
}
{
155.99.214.171 beta
}
{
155.99.214.172 gamma
}
{
155.99.214.173 delta
}
{
155.99.214.174 eta
}
}
foreach switch $switches
{
set name
[
lindex $switch 1
]
puts
"node
$name
switch"
set switchmap
([
lindex $switch 0
])
$name
}
set numswitch
[
llength $switches
]
for
{
set i 0
}
{
$i
< $numswitch
}
{
incr i
}
{
set switcha
[
lindex
[
lindex $switches $i
]
1
]
for
{
set i2
[
expr $i + 1
]}
{
$i2
< $numswitch
}
{
incr i2
}
{
set switchb
[
lindex
[
lindex $switches $i2
]
1
]
puts
"link
$switcha
$switchb
400 1"
}
}
set fp
[
open macslist r
]
while
{[
gets $fp line
]
>= 0
}
{
set n
[
lindex $line 0
]
set mac
[
lindex $line 1
]
set switch
[
lindex $line 2
]
set port
[
lindex $line 3
]
set t
[
split $n :
]
if
{[
llength $t
]
== 1
}
{
# dnard
lappend dnards $node
}
else
{
set node
[
lindex $t 0
]
set nport
[
lindex $t 1
]
if
{
$nport
==
"c"
}
{
lappend nodes $node
continue
}
lappend links
(
$node
)
[
list $mac $switch
]
}
}
close $fp
foreach node $nodes
{
puts
"node
$node
pc:1 delay:2"
}
# ignore dnards for now
set linki 0
foreach node $nodes
{
foreach link $links
(
$node
)
{
if
{[
lindex $link 1
]
==
{}}
{
continue
}
puts
"link link
$linki
$node:
[
lindex $link 0
]
$switchmap
(
[
lindex $link 1
]
) 100 1"
incr linki
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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