[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Source & Destination ip is the same!
Hi,
I noticed that source ip address and destination ip
address in a packet are the same. If you add the
following c code to 'recv' in ping.cc and recompile
it, you can see the situation.
{
// 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)
printf(pBuf);
}
I also found that the member variables, here_ & dst_,
of class Agent have the same ip address, namely
here_.addr and dst_.addr are the same.
Is this my mistake or NS's bug? Any suggestions and
comments are welcome.
__________________________________________________
Do You Yahoo!?
From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/