Commit 2b7e2a47 authored by Christopher Alfeld's avatar Christopher Alfeld

Fixed bug in tb-set-lan-loss.

Added code for user naming links.  This will be used later for the
multiple link support.
parent b968282a
......@@ -15,7 +15,11 @@ link instproc print {file} {
} else {
set dstname [$self set dst]
}
puts $file "$prefix-l[$self set id] $srcname [$self set srcport] $dstname [$self set dstport] [$self set bw] [$self set bw] [$self set delay] [$self set delay]"
if {[info exists nodeid_map(l[$self set id])]} {
set linkname $nodeid_map(l[$self set id])
} else {
set linkname "l[$self set id]"
}
puts $file "$prefix-$linkname $srcname [$self set srcport] $dstname [$self set dstport] [$self set bw] [$self set bw] [$self set delay] [$self set delay]"
}
......@@ -38,7 +38,8 @@ proc set {args} {
set var $out
real_set val [lindex $args 1]
if {([regexp {^n[0-9]+$} $val] != -1) ||
([regexp {^lan[0-9]+$} $val] != -1)} {
([regexp {^lan[0-9]+$} $val] != -1) ||
([regexp {^l[0-9]+$} $val] != -1)} {
if {![info exists nodeid_map($val)]} {
real_set nodeid_map($val) $var
}
......
......@@ -35,7 +35,7 @@
# SUCH DAMAGE.
#
# @(#) $Header: /home/cvs_mirrors/cvs-public.flux.utah.edu/CVS/testbed/tbsetup/ns2ir/Attic/sim.tcl,v 1.5 2001-02-14 16:34:53 calfeld Exp $
# @(#) $Header: /home/cvs_mirrors/cvs-public.flux.utah.edu/CVS/testbed/tbsetup/ns2ir/Attic/sim.tcl,v 1.6 2001-03-14 19:37:37 calfeld Exp $
#
......@@ -263,7 +263,7 @@ Simulator instproc duplex-link { n1 n2 bw delay type args } {
# $self duplex-link $n2 $dnode 0 0 $type $args
# }
set currLink l$linkID
real_set currLink l$linkID
link $currLink
$currLink set src $n1
$currLink set srcport -1
......@@ -279,6 +279,8 @@ Simulator instproc duplex-link { n1 n2 bw delay type args } {
incr linkID
lappend linkslist $currLink
return $currLink
}
# ROB added
......
......@@ -32,8 +32,8 @@ proc tb-set-link-loss {src dst rate} {
puts $TBCMD "tb-set-link-loss $nodeid_map($src) $nodeid_map($dst) $rate"
}
proc tb-set-lan-loss {lan rate} {
global TBCMD nodeid_map
puts $TBCMD "tb-set-lan-loss $nodeid_map($lan) $rate"
global TBCMD nodeid_map prefix
puts $TBCMD "tb-set-lan-loss $prefix-$nodeid_map($lan) $rate"
}
proc tb-set-dnard-os {shelf number os} {
global TBCMD nodeid_map
......
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