Commit 2b8a1434 authored by Timothy Stack's avatar Timothy Stack

The event for setting the initial values for traffic generators wasn't

making into the eventlist.
parent bccb515f
......@@ -227,6 +227,8 @@ Node instproc updatedb {DB} {
foreach agent $agentlist {
$agent updatedb $DB
$sim agentinit [$agent set application]
# The following is for NSE traffic generation
# Simulated nodes in make-simulated should not be doing this
if { $simulated != 1 } {
......
......@@ -478,7 +478,7 @@ proc new {class args} {
# <unit> is any of b, bps, kb, kbps, Mb, Mbps, Gb, or Gbps. If no
# unit is given then bytes (b) is assumed. It returns the bandwidth
# in Kbps.
proc parse_bw {bspec} {
proc parse_bw {bspec {islink 1}} {
# Default to bytes
if {[scan $bspec "%f%s" bw unit] == 1} {
set unit b
......@@ -506,7 +506,7 @@ proc parse_bw {bspec} {
}
}
if {$val < 10} {
if {$val < 10 && $islink} {
perror "Bandwidth of $val Kbs is too low."
return 0
}
......
......@@ -646,6 +646,17 @@ Simulator instproc attach-agent {node agent} {
$node attach-agent $agent
}
Simulator instproc agentinit {agent} {
$self instvar event_list
$self instvar event_count
if {[$agent info class Application/Traffic/CBR]} {
set event_count [expr $event_count + 1]
lappend event_list [list \
"0" [$agent get_node] $agent TRAFGEN MODIFY [$agent get_params] ""]
}
}
# connect <src> <dst>
# Connects two agents together.
Simulator instproc connect {src dst} {
......@@ -680,16 +691,6 @@ Simulator instproc connect {src dst} {
if {$error} {return}
$src connect $dst
$dst connect $src
if {[$src info class Application/Traffic/CBR]} {
set event_count [expr $event_count + 1]
lappend event_list [list \
"0" [$src get_node] $src TRAFGEN MODIFY [$src get_params] ""]
}
if {[$dst info class Application/Traffic/CBR]} {
set event_count [expr $event_count + 1]
lappend event_list [list \
"0" [$dst get_node] $dst TRAFGEN MODIFY [$dst get_params] ""]
}
}
# at <time> <event>
......
# -*- tcl -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2003, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -410,7 +410,7 @@ Application/Traffic/CBR instproc get_params {} {
$self instvar iptos_
if {$rate_ != {} && $rate_ != 0} {
set rate [parse_bw $rate_]
set rate [parse_bw $rate_ 0]
} else {
set rate -1
}
......
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