[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Calculate link bandwidth in C++



If i understand it correctly, you should use:

Simplelink instpro .. {
	return [[$self set link_] set bandwidth_]
}

xref how bandwidth is set in SimpleLink::init{} in tcl/lib/ns-link.tcl

On Wed, 31 Jan 2001, Lee wrote:

> 
> Hi,
> 
> I want to get the bandwidth of some link in C++
> however the following instproc failed.
> (Called by evalf(), it always returns 1000.)
> Would you like to tell me how to do that?
> Thanks,
> 
> Lee
> 
> SimpleLink instproc bandwidth? {} {
> 	$self instvar bandwidth_
> 	if ![info exists bandwidth_] {
> 		set bandwidth_ 1000
> 	}
> 	set bandwidth_
> }
> 
> Link is created using
> $ns duplex-link $src $dst $bw $delay DropTail
> 
>