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

Re: Validation problem again



> After compiling ns okay, I tried to add ping agent as in Marc Greis's
> tutorial, but it gave me this error message:
> ping.cc: in methos 'void PingAgent::recv(class Packet *, class Handler *)':
> ping.cc:93: no match for 'ns_addr_tag & >> int &'
> 
> I found this error occurs at this line:  
> 
> sprintf(out, "%s recv %d %3.1f", name(), 
>         hdrip->src_ >> Address::instance().NodeShift_[1], 
>     (Scheduler::instance().clock()-hdr->send_time) * 1000);
>     
> Can someone please help me? I really appreciate your help.

This occurs because of the update to the addressing in ns of about 9/9/99.
I think that the ns team are getting rid of the notion of non extended and
extended addressing and making extended addressing the norm, although I'm
not sure about this.

I think that the fix is to change the above line to

sprintf(out, "%s recv %d %3.1f", name(),
         hdrip->saddr() >> Address::instance().NodeShift_[1],
     (Scheduler::instance().clock()-hdr->send_time) * 1000);

Haven't tried this, so I'm not sure if it works (specifically, I'm not
sure about the Address::instance() stuff), but a general rule seems to be
to change iph->src_ or iph->src() to iph->saddr() and iph->dst_ or
iph->dst() to iph->daddr().

Sean.

-----
Sean Murphy,			Email: [email protected]
Teltec Ireland,			Phone: +353-1-7045080
DCU, Dublin 9,			Fax:   +353-1-7045092
Ireland.