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

Re: [ns] multicast variables



Here's the code, maybe this will be clearer:


Agent/NewAgent instproc recv { variable1 variable2 } {
	$self instvar node_
	set returnValue [ $node_ recvInfo $variable1 variable2 ]
}

Node instproc recvInfo { variable1 variable2 } {
	$self instvar ns_ mcastproto_
	puts "mcastproto_ is $mcastproto_"
	set theNodeIs [ $mcastproto_ set Node ]
	puts "this node is $self and theNodeIs $theNodeIs"
	puts "simulator is $ns_"
	set theType [ $mcastproto_ set type ]
##PROBLEM HAPPENS HERE!! GET MESSAGE SAYING 'NO SUCH VARIABLE' FOR 'TYPE'
	puts "type is $theType"
}


This is the output I get from running my code using the gdb debugger:
mcastproto_ is _o24
this node is _o20 and theNodeIs _o20
simulator is _o3
ns: _o381 recv 4 99 1: can't read "type": no such variable
    (Object set line 1)
    invoked from within



I need to access a variable and a function from the pimDM class, similar
to how I try to access the pimDM variable 'type' above.  Either
'$mcastproto_' is not the pimDM instantiation (if so, where is it?) or
else there is some problem trying to access these variables.

Thanks for looking at this,
Lori