Commit 642fb80d authored by Mac Newbold's avatar Mac Newbold

Obsolete. Replaced by ptopgen

parent 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
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