[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Source & Destination ip are the same!
Hi,
I noticed that source ip and destination ip in the ip
header are the same. If you add the following code to
'recv' in ping.cc, you can see this problem.
{// Please include "arpa/inet.h"
char pBuf[129];
in_addr srcAddr, dstAddr;
srcAddr.s_addr = hdrip->src_.addr_;
dstAddr.s_addr = hdrip->dst_.addr_;
sprintf(pBuf, "puts \"Source ip addr: %s\ Destination
ip Addr: %s\n\"",
inet_ntoa(srcAddr),
inet_ntoa(dstAddr));
// You can use tcl.eval(pBuf) instead.
printf(pBuf);
}
I also found the ip addresses of the member variables,
here_ and dst_, of class Agent are the same during the
execution.
Is this my mistake or NS's bug? Any suggestion and
comments are welcome.
Best regards,
Canhui
__________________________________________________
Do You Yahoo!?
From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/