> In the ping program 'ping.tcl', a 'recv' function has been
> defined under the class 'Agent/Ping'.
> Please tell me where this 'recv' function has been called
> from, as i could not find any place in ' ping.tcl' where it
> has been called.
See the PingAgent::recv() member function (apps/ping.cc file
in the NS source tree). Focus there on the lines 199-207.
The tcl command (including the function name - recv) is written
to the <out> buffer as string and the tcl interpreter invoked
by calling tcl.eval(out); The C++ sources are very well
documented.
hih
--Joachim
>
>
> The exact from ping.tcl code is
>
> #Define a 'recv' function for the class 'Agent/Ping'
> Agent/Ping instproc recv {from rtt} {
> $self instvar node_
> puts "node [$node_ id] received ping answer from \
> $from with round-trip-time $rtt ms."
> }
>
>
> It would be very nice if you could give me a detailed
> explanantion of each line and the variables in the attached code.
>