Commit 4294b67c authored by David Anderson's avatar David Anderson
Browse files

modified tb_compat for use with linktest. works with a patch to the tcl...

modified tb_compat for use with linktest. works with a patch to the tcl libraries in ns (coming to cvs soon) . first version.
parent e4f70f6d
# -*- tcl -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#
# This is a nop tb_compact.tcl file that should be used when running scripts
# under ns.
proc tb-set-ip {node ip} {}
proc tb-set-ip-interface {src dst ip} {}
proc tb-set-ip-link {src link ip} {}
proc tb-set-ip-lan {src lan ip} {}
proc tb-set-hardware {node type args} {}
proc tb-set-node-os {node os} {}
proc tb-set-link-loss {src args} {}
proc tb-set-lan-loss {lan rate} {}
proc tb-set-node-rpms {node args} {}
proc tb-set-node-startup {node cmd} {}
proc tb-set-node-cmdline {node cmd} {}
proc tb-set-node-deltas {node args} {}
proc tb-set-node-tarfiles {node args} {}
proc tb-set-node-lan-delay {node lan delay} {}
proc tb-set-node-lan-bandwidth {node lan bw} {}
proc tb-set-node-lan-loss {node lan loss} {}
proc tb-set-node-lan-params {node lan delay bw loss} {}
proc tb-set-node-failure-action {node type} {}
proc tb-set-ip-routing {type} {}
proc tb-fix-node {v p} {}
proc tb-make-weighted-vtype {name weight types} {}
proc tb-make-soft-vtype {name types} {}
proc tb-make-hard-vtype {name types} {}
proc tb-set-lan-simplex-params {lan node todelay tobw toloss fromdelay frombw fromloss} {}
proc tb-set-link-simplex-params {link src delay bw loss} {}
proc tb-set-uselatestwadata {onoff} {}
proc tb-set-usewatunnels {onoff} {}
proc tb-set-wasolver-weights {delay bw plr} {}
proc tb-set-uselinkdelays {onoff} {}
proc tb-set-forcelinkdelays {onoff} {}
Class Program
Program instproc init {args} {
}
Program instproc unknown {m args} {
}
Class NSENode -superclass Node
NSENode instproc make-simulated {args} {
uplevel 1 eval $args
}
# We are just syntax checking the NS file
Simulator instproc run {args} {
}
Simulator instproc nsenode {args} {
return [new NSENode]
}
Simulator instproc make-simulated {args} {
uplevel 1 eval $args
}
# LINKTEST OVERRIDES
# holds a pair of simplex links.
Class Duplink
# get accessors for various instance vars (including new loss)
SimpleLink instproc loss { } {
$self instvar link_
$link_ set loss_
}
Vlink instproc loss {} {
$self instvar loss_
$self set loss_
}
# just output info about the topology.
Simulator instproc run {args} {
$self instvar Node_ link_
puts "foo"
foreach foo [array names Node_] {
puts "node $Node_($foo)"
if { 0 == [string compare [$Node_($foo) info class] "LanNode"]} {
puts "lan found"
} else {
# useful info, works for both links and lans
puts "neighbors [$Node_($foo) neighbors]"
}
}
foreach foo [array names link_] {
puts "$link_($foo) $foo"
puts "[$link_($foo) info class]"
if { 0 == [string compare [$link_($foo) info class] "Vlink"]} {
# lan link
puts "[$link_($foo) set bw_ ]"
puts "[$link_($foo) set delay_]"
puts "[$link_($foo) set loss_ ]"
} else {
# simple link
puts "[$link_($foo) bw ]"
puts "[$link_($foo) delay ]"
puts "[$link_($foo) loss ]"
}
}
}
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