[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Very basic questions
Hi folks,
I am a new user to NS2. I have been struggling for past month or so to
modify
NS2 to make event based changes.
I have some very basic questions for which I didn't get satisfactory
answer
from NS2 documentation (I have read it all). These questions are
following:
1: In tcl function always begins with code like following:
CBQLink instproc init { src dst bw delay q cl {lltype "DelayLink"} } {
$self next $src $dst $bw $delay $q $lltype ; # SimpleLink ctor
$self instvar head_ queue_ link_
$self instvar classifier_ ; # not found in a SimpleLink
# $self instvar drophead_ ; # not found in a SimpleLink
$queue_ link $link_ ; # queue_ set by SimpleLink ctor, CBQ needs
$link_
set classifier_ $cl
I don't understand what does the variable $self mean, what does next
mean,
I am not clear on instvar either. Does instavar make all the private
variables
accessible.
2: When I bind a variable like following in the queue.cc:
Queue::Queue() : Connector(), blocked_(0), unblock_on_resume_(1),
qh_(*this),
pq_(0) /* temporarily NULL */
{
bind("limit_", &qlim_);
bind_bool("blocked_", &blocked_);
bind_bool("unblock_on_resume_", &unblock_on_resume_);
bind_bool("control_jitter_", &control_jitter_);
}
It compiles fine but give me segmentation fault when I run tcl script.
I even have the following code in ns-defaults.tcl
Queue set control_jitter_ false
In addition I don't understand the fist line of this code in queue.cc.
What are
they trying to do.
Queue::Queue() : Connector(), blocked_(0), unblock_on_resume_(1),
qh_(*this),
pq_(0) /* temporarily NULL */
I know my knowledge is bit rusty, but I will appreciate your help very
much.
I have been stuck here for a while.
Thank you in advance,
-Sanjay K. Agrawal, Cisco Systems
begin:vcard
n:Agrawal;Sanjay
tel;work:(408) 525-0938
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:[email protected]
end:vcard