[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns-users] Printing Protected Variables (seqno)
If you want to print out a C++ variable in a packet header, one way is to
do a tcl function call from C++ to tcl, something like:
void PingAgent::recv(...)
{
...
Tcl::instance().evalf("%s recv-packet %d", name(), seqno_);
...
}
Then you can access this seqno in your otcl function.
- Haobo
On Wed, 12 May 1999 [email protected] wrote:
>
> I have a packet structure which contains a protected 'seqno_' variable,
> just the same as in UDP.h.
>
> I would like to output this variable in my TCL script. Could anyone
> provide a snippet to do this? I currently have:
>
> -----------------------
> Agent/Ping instproc recv {from rtt} {
> $self instvar node_
>
> puts "node [$node_ id] received ping ack from $from \\
> with round-trip-time $rtt ms."
>
> # I would like to output the sequence number 'seqno_' here.
>
> }
> -----------------------
>
> many thanks,
> rik wade
>
>