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

[ns] Date: Sun, 2 Jul 2000 23:00:52 +0800



Dear NS-users,

I stipulate the arrival of a "echo" packet to trigger TCP set a flag bit.
When the next TCP segment is permitted to be send, i.e. within the window,
the TcpAgent::output function is expected to be invoked. But when I want to
step into output function, I found the code in ptypes.cc was executed
instead of that of the output function. The contents of the ptypes.cc are as
follows:-

static const char code[] = "\n\
global ptype pvals\n\
set ptype(error) -1\n\
set pvals(-1) error\n\
set ptype(tcp) 0\n\
set pvals(0) tcp\n\
set ptype(udp) 1\n\
set pvals(1) udp\n\
	.......
set pvals(43) tcpFriendCtl\n\
set ptype(echo) 44\n\
set pvals(44) echo\n\
proc ptype2val {str} {\n\
global ptype\n\
set str [string tolower $str]\n\
if ![info exists ptype($str)] {\n\
set str error\n\
}\n\
set ptype($str)\n\
}\n\
proc pval2type {val} {\n\
global pvals\n\
if ![info exists pvals($val)] {\n\
set val -1\n\
}\n\
set pvals($val)\n\
}\n\
";
#include "config.h"
EmbeddedTcl et_ns_ptypes(code);

Does anyone give me some hints on it? The program stack is :-
(gdb) bt
#0  0x185230 in TracedInt::operator int () at gen/ptypes.cc:112
#1  0xc0f90 in TcpAgent::send_much (this=0x3d3200, force=0, reason=0, 
    maxburst=0) at tcp.cc:549
#2  0xc2ac0 in TcpAgent::recv (this=0x3d3200, pkt=0x3ece48) at tcp.cc:1021
	.....