hello (ZRP)

View: New views
3 Messages — Rating Filter:   Alert me  

hello (ZRP)

by Batbold Toiruul-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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;
    }

Re: hello (ZRP)

by Brijesh Patel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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;
    }

Re: hello (ZRP)

by Brijesh Patel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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;
    }