All of lore.kernel.org
 help / color / mirror / Atom feed
* size of a rule
@ 2004-04-26 13:54 Ozgur AKAN
  2004-04-26 14:08 ` Ozgur AKAN
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ozgur AKAN @ 2004-04-26 13:54 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

Hi,
I am trying to find the size of a rule in memory.

const struct ipt_entry *e;

sizeof (*e) is equal to 112 always. But the size of rule should be 
different because we can give different parameters to each rule. (I 
guess that this is the size of the header-like place)

So I looked at the source of libiptc and found this in linux_list.h 
while searching for the size value.

#define list_entry(ptr, type, member) \
        ((type *) ( (char *)(ptr)-(unsigned long)(&((type *)0)->member) ) )

What is the meaning of ((type *)0)->member ? I can not understand the 
part with 0.  

thanks,
-- 
Ozgur Akan


[-- Attachment #2: Type: text/html, Size: 1043 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-04-27  8:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-26 13:54 size of a rule Ozgur AKAN
2004-04-26 14:08 ` Ozgur AKAN
2004-04-26 14:12 ` zhi wang
2004-04-26 14:24 ` Henrik Nordstrom
2004-04-27  8:41   ` Ozgur AKAN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.