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

Data Structures

struct  rb_node
 
struct  rb_root
 

Macros

#define RB_RED   0
 
#define RB_BLACK   1
 
#define rb_parent(r)   ((struct rb_node *)((r)->rb_parent_color & ~3))
 
#define rb_color(r)   ((r)->rb_parent_color & 1)
 
#define rb_is_red(r)   (!rb_color(r))
 
#define rb_is_black(r)   rb_color(r)
 
#define rb_set_red(r)   do { (r)->rb_parent_color &= ~1; } while (0)
 
#define rb_set_black(r)   do { (r)->rb_parent_color |= 1; } while (0)
 
#define RB_ROOT   (struct rb_root) { NULL, }
 
#define rb_entry(ptr, type, member)   container_of(ptr, type, member)
 
#define RB_EMPTY_ROOT(root)   ((root)->rb_node == NULL)
 
#define RB_EMPTY_NODE(node)   (rb_parent(node) == node)
 
#define RB_CLEAR_NODE(node)   (rb_set_parent(node, node))
 
#define rb_for_each_entry(pos, root, member)
 
#define rb_for_each_entry_safe(pos, node, next, root, member)
 

Functions

void rb_insert_color (struct rb_node *, struct rb_root *)
 
void rb_erase (struct rb_node *, struct rb_root *)
 
struct rb_noderb_next (struct rb_node *)
 
struct rb_noderb_prev (struct rb_node *)
 
struct rb_noderb_first (struct rb_root *)
 
struct rb_noderb_last (struct rb_root *)
 
void rb_replace_node (struct rb_node *victim, struct rb_node *new, struct rb_root *root)
 

Macro Definition Documentation

#define RB_BLACK   1
#define RB_CLEAR_NODE (   node)    (rb_set_parent(node, node))
#define rb_color (   r)    ((r)->rb_parent_color & 1)
#define RB_EMPTY_NODE (   node)    (rb_parent(node) == node)
#define RB_EMPTY_ROOT (   root)    ((root)->rb_node == NULL)
#define rb_entry (   ptr,
  type,
  member 
)    container_of(ptr, type, member)
#define rb_for_each_entry (   pos,
  root,
  member 
)
Value:
for ((pos) = (root)->rb_node ? \
rb_entry(rb_first(root), typeof(*pos), member) : NULL; \
(pos) != NULL; \
(pos) = rb_entry(rb_next(&(pos)->member), typeof(*pos), member))
#define NULL
Definition: linux_stddef.h:8
struct rb_node * rb_first(struct rb_root *)
Definition: rbtree.c:292
u8 pos
Definition: ip_set_hash_gen.h:187
#define rb_entry(ptr, type, member)
Definition: rbtree.h:57
struct rb_node * rb_next(struct rb_node *)
Definition: rbtree.c:316
Definition: linux_rbtree.h:99
#define rb_for_each_entry_safe (   pos,
  node,
  next,
  root,
  member 
)
Value:
for ((node) = rb_first(root); \
(pos) = (node) ? rb_entry((node), typeof(*pos), member) : NULL, \
(next) = (node) ? rb_next(node) : NULL, \
(pos) != NULL; \
(node) = (next))
#define NULL
Definition: linux_stddef.h:8
struct rb_node * rb_first(struct rb_root *)
Definition: rbtree.c:292
u8 pos
Definition: ip_set_hash_gen.h:187
#define rb_entry(ptr, type, member)
Definition: rbtree.h:57
struct rb_node * rb_next(struct rb_node *)
Definition: rbtree.c:316
#define rb_is_black (   r)    rb_color(r)
#define rb_is_red (   r)    (!rb_color(r))
#define rb_parent (   r)    ((struct rb_node *)((r)->rb_parent_color & ~3))
#define RB_RED   0
#define RB_ROOT   (struct rb_root) { NULL, }
#define rb_set_black (   r)    do { (r)->rb_parent_color |= 1; } while (0)
#define rb_set_red (   r)    do { (r)->rb_parent_color &= ~1; } while (0)

Function Documentation

void rb_erase ( struct rb_node ,
struct rb_root  
)
struct rb_node* rb_first ( struct rb_root )
void rb_insert_color ( struct rb_node ,
struct rb_root  
)
struct rb_node* rb_last ( struct rb_root )
struct rb_node* rb_next ( struct rb_node )
struct rb_node* rb_prev ( struct rb_node )
void rb_replace_node ( struct rb_node victim,
struct rb_node new,
struct rb_root root 
)