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

how to access packet header ?



hi,

when configuring a packet header, I found there are two approaches to access
the packet header. For example, assuming p is the packet, to access the IP
header of p, two approaches can be used :
1)  hdr_ip *iph = (hdr_ip *) p->access(hdr_ip::offset_);
2)  In initializing :
         bind("off_ip_", &off_ip_);
    Then use :
         hdr_ip *iph = (hdr_ip *) p->access(off_ip_);

What is the difference between these two approaches ? Which one is correct ?

Thanks in advance for any answers.

-- Wei Peng


_____________________________________________
�׶�����--�й��˵����ϼ�԰ http://www.263.net
@263.net�й����������ʾ� http://freemail.263.net