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

Re: [ns] sending a new packet type



Hi Yuri, Srinivasan, Haobo, and Tarik.

Thanks for the attempts to help me, to everyone who has tried.

Yes I connect the two agents this way, from the Tcl script.  Then, I call
the new agent's "send" function from the Tcl script:
$newAgent send $myArgument

The new send function is defined in my 'newAgent.cc' file, and it
definitely gets called, since I put a 'printf' function within the 
newAgent::command function definition for the 'send' command.  I check to
make sure that the command called is 'send' (just like in the Ping example
from Greis).  

Next I set the destination for the new packet by doing this (from the
newAgent.cc script).  I use the '$myArgument' value which was sent from
the tcl code as an argument to the function call:
hdrip->dst()= $valueSentToFunction;

And then I send the packet from within the 'newAgent.cc' code,
using the following line:
send(pkt, 0);

The code I have looked at makes me think that the Handler (from the C++
code for the send function, the second argument, '0' refers to an object
of type 'Handler') will now queue up my new packet and send it along the
correct link object to the destination node I specified using the
$valueSentToFunction.  ***However, this doesn't seem to happen.***  My new
agent type has a Tcl recv function with a 'puts'  for debugging
purposes...the Tcl 'recv' code never prints a statement.  My 'newAgent.cc'
code has a newAgent::recv function with a 'printf' statement for debugging
purposes which also never prints anything.

I'm getting this error message when I don't use gdb (and 8 happens to be
the node which should be receiving the packet!):
_o312: no target for slot 8

When I do use gdb, I get this error message:
"_o312: no target for slot 8
Program exited with code 01."
(and when I try to print values for _o312, it doesn't exist anymore...)

Thanks ahead for any helpful hints!
-Lori
  
On Thu, 9 Mar 2000, Srinivasan Jagannathan wrote:

> did you connect the two agents ?
> use "$ns connect $agent1 $agent2"
> 
> -Srinivasan