netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
linuxlist.h File Reference
#include <stddef.h>
Include dependency graph for linuxlist.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  llist_head
 

Macros

#define inline   __inline__
 
#define container_of(ptr, type, member)
 container_of - cast a member of a structure out to the containing structure More...
 
#define LLIST_POISON1   ((void *) 0x00100100)
 
#define LLIST_POISON2   ((void *) 0x00200200)
 
#define LLIST_HEAD_INIT(name)   { &(name), &(name) }
 
#define LLIST_HEAD(name)   struct llist_head name = LLIST_HEAD_INIT(name)
 
#define INIT_LLIST_HEAD(ptr)
 
#define llist_entry(ptr, type, member)   container_of(ptr, type, member)
 llist_entry - get the struct for this entry : the &struct llist_head pointer. More...
 
#define llist_for_each(pos, head)
 llist_for_each - iterate over a llist : the &struct llist_head to use as a loop counter. More...
 
#define __llist_for_each(pos, head)   for (pos = (head)->next; pos != (head); pos = pos->next)
 __llist_for_each - iterate over a llist : the &struct llist_head to use as a loop counter. More...
 
#define llist_for_each_prev(pos, head)
 llist_for_each_prev - iterate over a llist backwards : the &struct llist_head to use as a loop counter. More...
 
#define llist_for_each_safe(pos, n, head)
 llist_for_each_safe - iterate over a llist safe against removal of llist entry : the &struct llist_head to use as a loop counter. More...
 
#define llist_for_each_entry(pos, head, member)
 llist_for_each_entry - iterate over llist of given type : the type * to use as a loop counter. More...
 
#define llist_for_each_entry_reverse(pos, head, member)
 llist_for_each_entry_reverse - iterate backwards over llist of given type. More...
 
#define llist_for_each_entry_continue(pos, head, member)
 llist_for_each_entry_continue - iterate over llist of given type continuing after existing point : the type * to use as a loop counter. More...
 
#define llist_for_each_entry_safe(pos, n, head, member)
 llist_for_each_entry_safe - iterate over llist of given type safe against removal of llist entry : the type * to use as a loop counter. More...
 
#define llist_for_each_rcu(pos, head)
 llist_for_each_rcu - iterate over an rcu-protected llist : the &struct llist_head to use as a loop counter. More...
 
#define __llist_for_each_rcu(pos, head)
 
#define llist_for_each_safe_rcu(pos, n, head)
 llist_for_each_safe_rcu - iterate over an rcu-protected llist safe against removal of llist entry : the &struct llist_head to use as a loop counter. More...
 
#define llist_for_each_entry_rcu(pos, head, member)
 llist_for_each_entry_rcu - iterate over rcu llist of given type : the type * to use as a loop counter. More...
 
#define llist_for_each_continue_rcu(pos, head)
 llist_for_each_continue_rcu - iterate over an rcu-protected llist continuing after existing point. More...
 

Macro Definition Documentation

#define __llist_for_each (   pos,
  head 
)    for (pos = (head)->next; pos != (head); pos = pos->next)

__llist_for_each - iterate over a llist : the &struct llist_head to use as a loop counter.

: the head for your llist.

This variant differs from llist_for_each() in that it's the simplest possible llist iteration code, no prefetching is done. Use this for code that knows the llist to be very short (empty or 1 entry) most of the time.

#define __llist_for_each_rcu (   pos,
  head 
)
Value:
for (pos = (head)->next; pos != (head); \
pos = pos->next, ({ smp_read_barrier_depends(); 0;}))
u8 pos
Definition: ip_set_hash_gen.h:187
#define container_of (   ptr,
  type,
  member 
)
Value:
({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
struct expr
#define offsetof(TYPE, MEMBER)
Definition: linux_list.h:7

container_of - cast a member of a structure out to the containing structure

: the pointer to the member. : the type of the container struct this is embedded in. : the name of the member within the struct.

#define INIT_LLIST_HEAD (   ptr)
Value:
do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)

Referenced by hashtable_create(), ulogd_db_configure(), and ulogd_do_timer_run().

#define inline   __inline__
#define llist_entry (   ptr,
  type,
  member 
)    container_of(ptr, type, member)

llist_entry - get the struct for this entry : the &struct llist_head pointer.

: the type of the struct this is embedded in. : the name of the llist_struct within the struct.

Referenced by hashtable_find(), hashtable_flush(), and hashtable_iterate_limit().

#define llist_for_each (   pos,
  head 
)
Value:
for (pos = (head)->next, prefetch(pos->next); pos != (head); \
pos = pos->next, prefetch(pos->next))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32

llist_for_each - iterate over a llist : the &struct llist_head to use as a loop counter.

: the head for your llist.

Referenced by hashtable_find().

#define llist_for_each_continue_rcu (   pos,
  head 
)
Value:
for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \
(pos) = (pos)->next, ({ smp_read_barrier_depends(); 0;}), prefetch((pos)->next))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32

llist_for_each_continue_rcu - iterate over an rcu-protected llist continuing after existing point.

: the &struct llist_head to use as a loop counter. : the head for your llist.

#define llist_for_each_entry (   pos,
  head,
  member 
)
Value:
for (pos = llist_entry((head)->next, typeof(*pos), member), \
prefetch(pos->member.next); \
&pos->member != (head); \
pos = llist_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32
#define llist_entry(ptr, type, member)
llist_entry - get the struct for this entry : the &struct llist_head pointer.
Definition: linuxlist.h:213

llist_for_each_entry - iterate over llist of given type : the type * to use as a loop counter.

: the head for your llist. : the name of the llist_struct within the struct.

Referenced by ulogd_do_timer_run(), ulogd_select_main(), ulogd_unregister_fd(), and ulogd_wildcard_inputkeys().

#define llist_for_each_entry_continue (   pos,
  head,
  member 
)
Value:
for (pos = llist_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next); \
&pos->member != (head); \
pos = llist_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32
#define llist_entry(ptr, type, member)
llist_entry - get the struct for this entry : the &struct llist_head pointer.
Definition: linuxlist.h:213

llist_for_each_entry_continue - iterate over llist of given type continuing after existing point : the type * to use as a loop counter.

: the head for your llist. : the name of the llist_struct within the struct.

Referenced by ulogd_propagate_results().

#define llist_for_each_entry_rcu (   pos,
  head,
  member 
)
Value:
for (pos = llist_entry((head)->next, typeof(*pos), member), \
prefetch(pos->member.next); \
&pos->member != (head); \
pos = llist_entry(pos->member.next, typeof(*pos), member), \
({ smp_read_barrier_depends(); 0;}), \
prefetch(pos->member.next))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32
#define llist_entry(ptr, type, member)
llist_entry - get the struct for this entry : the &struct llist_head pointer.
Definition: linuxlist.h:213

llist_for_each_entry_rcu - iterate over rcu llist of given type : the type * to use as a loop counter.

: the head for your llist. : the name of the llist_struct within the struct.

#define llist_for_each_entry_reverse (   pos,
  head,
  member 
)
Value:
for (pos = llist_entry((head)->prev, typeof(*pos), member), \
prefetch(pos->member.prev); \
&pos->member != (head); \
pos = llist_entry(pos->member.prev, typeof(*pos), member), \
prefetch(pos->member.prev))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32
#define llist_entry(ptr, type, member)
llist_entry - get the struct for this entry : the &struct llist_head pointer.
Definition: linuxlist.h:213

llist_for_each_entry_reverse - iterate backwards over llist of given type.

: the type * to use as a loop counter. : the head for your llist. : the name of the llist_struct within the struct.

#define llist_for_each_entry_safe (   pos,
  n,
  head,
  member 
)
Value:
for (pos = llist_entry((head)->next, typeof(*pos), member), \
n = llist_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = llist_entry(n->member.next, typeof(*n), member))
u8 pos
Definition: ip_set_hash_gen.h:187
#define llist_entry(ptr, type, member)
llist_entry - get the struct for this entry : the &struct llist_head pointer.
Definition: linuxlist.h:213

llist_for_each_entry_safe - iterate over llist of given type safe against removal of llist entry : the type * to use as a loop counter.


: another type * to use as temporary storage : the head for your llist. : the name of the llist_struct within the struct.

#define llist_for_each_prev (   pos,
  head 
)
Value:
for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
pos = pos->prev, prefetch(pos->prev))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32

llist_for_each_prev - iterate over a llist backwards : the &struct llist_head to use as a loop counter.

: the head for your llist.

#define llist_for_each_rcu (   pos,
  head 
)
Value:
for (pos = (head)->next, prefetch(pos->next); pos != (head); \
pos = pos->next, ({ smp_read_barrier_depends(); 0;}), prefetch(pos->next))
u8 pos
Definition: ip_set_hash_gen.h:187
#define prefetch(x)
Definition: linux_list.h:32

llist_for_each_rcu - iterate over an rcu-protected llist : the &struct llist_head to use as a loop counter.

: the head for your llist.

#define llist_for_each_safe (   pos,
  n,
  head 
)
Value:
for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)
u8 pos
Definition: ip_set_hash_gen.h:187

llist_for_each_safe - iterate over a llist safe against removal of llist entry : the &struct llist_head to use as a loop counter.


: another &struct llist_head to use as temporary storage : the head for your llist.

Referenced by hashtable_flush(), and hashtable_iterate_limit().

#define llist_for_each_safe_rcu (   pos,
  n,
  head 
)
Value:
for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, ({ smp_read_barrier_depends(); 0;}), n = pos->next)
u8 pos
Definition: ip_set_hash_gen.h:187

llist_for_each_safe_rcu - iterate over an rcu-protected llist safe against removal of llist entry : the &struct llist_head to use as a loop counter.


: another &struct llist_head to use as temporary storage : the head for your llist.

#define LLIST_HEAD (   name)    struct llist_head name = LLIST_HEAD_INIT(name)
#define LLIST_HEAD_INIT (   name)    { &(name), &(name) }
#define LLIST_POISON1   ((void *) 0x00100100)
#define LLIST_POISON2   ((void *) 0x00200200)