Re: [ns] hello (ZRP)

2009-02-21 Thread Brijesh Patel


For all ZRP packets, it decrements the ttl value at the recv function.
he(coder) asserts the [hdrip-ttl() -= 1;] statement with another variable
'jem'. That's it!!!
Now if ttl value is less than 0, then it simply drops the packet. [which
cannot happen]


Batbold Toiruul-2 wrote:
 
 
 Dear ns users,
 from zrp.cc code, Could anyone explain below piece of code to me, please?
 
 if (hdrc-ptype() == PT_ZRP) {
 jem =  hdrip-ttl();
 hdrip-ttl() -= 1;
 assert(jem == (hdrip-ttl() + 1) );
 if (hdrip-ttl()  0) {
   zdrop(p, DROP_RTR_TTL);
   return;
 }
 
 

-- 
View this message in context: 
http://www.nabble.com/hello-%28ZRP%29-tp20561055p22136559.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] hello (ZRP)

2008-11-18 Thread Batbold Toiruul

Dear ns users,
from zrp.cc code, Could anyone explain below piece of code to me, please?

if (hdrc-ptype() == PT_ZRP) {
jem =  hdrip-ttl();
hdrip-ttl() -= 1;
assert(jem == (hdrip-ttl() + 1) );
if (hdrip-ttl()  0) {
  zdrop(p, DROP_RTR_TTL);
  return;
}