[Click] ipfilter

Eddie Kohler kohler at cs.ucla.edu
Thu Jan 11 11:43:39 EST 2007


TRANSP_FAKE_OFFSET has little to do with the actual header bytes.  It is 
used internally to IPFilter, so that a single set of "offsets" can be 
used for EITHER network or transport header info.  IPFilter::push():

   const unsigned char *neth_data = (const unsigned char *)p->ip_header();
   const unsigned char *transph_data = (const unsigned char 
*)p->transport_header();

     ...

     if (off >= TRANSP_FAKE_OFFSET)
       data = *(const unsigned *)(transph_data + off - TRANSP_FAKE_OFFSET);
     else
       data = *(const unsigned *)(neth_data + off);


We picked 64 because it is greater than any offset in the IP header.

In IPv6 things get more complex because of the header chain.  You could 
pick 64, though; or 128, 256, 396, anything divisible by 4.

E



wang houfen wrote:
> Hello,
> 
> I have the following questions:
> Why is a variable TRANSP_FAKE_OFFSET defined 64 in ipfilter.hh? How should TRANSP_FAKE_OFFSET
> be defined in ipv6?
> 
> Thanks!
> 
> 
> Best Regards,
> Fen
> 
> 
> 
> 
> 
> 
>  
> ____________________________________________________________________________________
> Have a burning question?  
> Go to www.Answers.yahoo.com and get answers from real people who know.
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list