Go to the source code of this file.
Macros  
#define  rn_masktop (squid_mask_rnhead>rnh_treetop) 
#define  rn_dupedkey rn_u.rn_leaf.rn_Dupedkey 
#define  rn_off rn_u.rn_node.rn_Off 
#define  rn_l rn_u.rn_node.rn_L 
#define  rn_r rn_u.rn_node.rn_R 
#define  rm_mask rm_rmu.rmu_mask 
#define  rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */ 
#define  squid_Bcmp(a, b, l) (l == 0 ? 0 : memcmp((caddr_t)(a), (caddr_t)(b), (u_long)l)) 
#define  squid_R_Malloc(p, t, n) (p = (t) xmalloc((unsigned int)(n))) 
#define  squid_Free(p) xfree((char *)p) 
#define  squid_MKGet(m) 
#define  squid_MKFree(m) { (m)>rm_mklist = squid_rn_mkfreelist; squid_rn_mkfreelist = (m);} 
#define  min(x, y) ((x)<(y)? (x) : (y)) 
Variables  
int  squid_max_keylen 
struct squid_radix_mask *  squid_rn_mkfreelist 
struct squid_radix_node_head *  squid_mask_rnhead 
static char *  addmask_key 
static unsigned char  normal_chars [] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xFF} 
static char *  rn_zeros 
static char *  rn_ones 
Macro Definition Documentation
#define min  (  x,  
y  
)  ((x)<(y)? (x) : (y)) 
Definition at line 115 of file radix.c.
Referenced by handle_read(), rn_satsifies_leaf(), and squid_rn_match().
#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */ 
#define rn_masktop (squid_mask_rnhead>rnh_treetop) 
Definition at line 92 of file radix.c.
Referenced by squid_rn_addmask().
Definition at line 103 of file radix.c.
Referenced by squid_rn_addmask().
#define squid_MKFree  (  m  )  { (m)>rm_mklist = squid_rn_mkfreelist; squid_rn_mkfreelist = (m);} 
Definition at line 112 of file radix.c.
Referenced by squid_rn_delete().
#define squid_MKGet  (  m  ) 
Definition at line 104 of file radix.c.
Referenced by rn_new_radix_mask().
Definition at line 102 of file radix.c.
Referenced by squid_rn_addmask(), squid_rn_init(), and squid_rn_inithead().
Function Documentation

static 
Definition at line 508 of file radix.c.
Referenced by squid_rn_addroute().

static 
Definition at line 522 of file radix.c.
References squid_radix_mask::rm_b, squid_radix_mask::rm_flags, squid_radix_mask::rm_mklist, squid_radix_node::rn_b, squid_radix_node::rn_flags, squid_radix_node::rn_mklist, RNF_NORMAL, and squid_MKGet.
Referenced by squid_rn_addroute().

static 
Definition at line 225 of file radix.c.
Referenced by squid_rn_match().
struct squid_radix_node* squid_rn_addmask  (  void *  n_arg, 
int  search,  
int  skip  
) 
Definition at line 437 of file radix.c.
References addmask_key, normal_chars, squid_radix_node::rn_b, squid_radix_node::rn_flags, rn_masktop, rn_ones, RNF_NORMAL, squid_radix_node_head::rnh_nodes, squid_Free, squid_max_keylen, squid_R_Malloc, squid_rn_insert(), and squid_rn_search().
Referenced by squid_rn_addroute(), squid_rn_delete(), and squid_rn_lookup().
struct squid_radix_node* squid_rn_addroute  (  void *  v_arg, 
void *  n_arg,  
struct squid_radix_node_head *  head,  
struct squid_radix_node  treenodes[2]  
) 
Definition at line 543 of file radix.c.
References NULL, squid_radix_mask::rm_b, squid_radix_mask::rm_flags, squid_radix_mask::rm_mklist, squid_radix_mask::rm_refs, squid_radix_node::rn_b, squid_radix_node::rn_flags, rn_lexobetter(), squid_radix_node::rn_mklist, rn_new_radix_mask(), squid_radix_node::rn_p, RNF_ACTIVE, RNF_NORMAL, squid_radix_node_head::rnh_treetop, squid_rn_addmask(), squid_rn_insert(), and squid_rn_refines().
Referenced by asnAddNet(), and squid_rn_inithead().
struct squid_radix_node* squid_rn_delete  (  void *  v_arg, 
void *  netmask_arg,  
struct squid_radix_node_head *  head  
) 
Definition at line 696 of file radix.c.
References assert, NULL, p, squid_radix_mask::rm_mklist, squid_radix_mask::rm_refs, squid_radix_node::rn_b, squid_radix_node::rn_flags, squid_radix_node::rn_mklist, squid_radix_node::rn_p, RNF_ACTIVE, RNF_NORMAL, RNF_ROOT, squid_radix_node_head::rnh_treetop, squid_MKFree, squid_rn_addmask(), and squid_rn_search().
Referenced by destroyRadixNode(), and squid_rn_inithead().
void squid_rn_init  (  void  ) 
Definition at line 941 of file radix.c.
References addmask_key, NULL, rn_ones, rn_zeros, squid_max_keylen, squid_R_Malloc, and squid_rn_inithead().
Referenced by asnInit().
int squid_rn_inithead  (  struct squid_radix_node_head **  head, 
int  off  
) 
Definition at line 911 of file radix.c.
References squid_radix_node::rn_b, squid_radix_node::rn_flags, rn_ones, squid_radix_node::rn_p, rn_zeros, RNF_ACTIVE, RNF_ROOT, squid_radix_node_head::rnh_addaddr(), squid_radix_node_head::rnh_deladdr(), squid_radix_node_head::rnh_lookup(), squid_radix_node_head::rnh_matchaddr(), squid_radix_node_head::rnh_nodes, squid_radix_node_head::rnh_treetop, squid_radix_node_head::rnh_walktree(), squid_R_Malloc, squid_rn_addroute(), squid_rn_delete(), squid_rn_lookup(), squid_rn_match(), squid_rn_newpair(), and squid_rn_walktree().
Referenced by asnInit(), and squid_rn_init().
struct squid_radix_node* squid_rn_insert  (  void *  v_arg, 
struct squid_radix_node_head *  head,  
int *  dupentry,  
struct squid_radix_node  nodes[2]  
) 
Definition at line 372 of file radix.c.
References int, log(), p, squid_radix_node::rn_b, squid_radix_node::rn_bmask, squid_radix_node::rn_p, squid_radix_node_head::rnh_treetop, squid_rn_newpair(), and squid_rn_search().
Referenced by squid_rn_addmask(), and squid_rn_addroute().
struct squid_radix_node* squid_rn_lookup  (  void *  v_arg, 
void *  m_arg,  
struct squid_radix_node_head *  head  
) 
Definition at line 207 of file radix.c.
References squid_radix_node_head::rnh_treetop, squid_rn_addmask(), and squid_rn_match().
Referenced by asnAddNet(), and squid_rn_inithead().
struct squid_radix_node* squid_rn_match  (  void *  v_arg, 
struct squid_radix_node_head *  head  
) 
Definition at line 245 of file radix.c.
References min, squid_radix_mask::rm_b, squid_radix_mask::rm_flags, squid_radix_mask::rm_mklist, squid_radix_node::rn_b, squid_radix_node::rn_bmask, squid_radix_node::rn_flags, squid_radix_node::rn_mklist, squid_radix_node::rn_p, rn_satsifies_leaf(), RNF_NORMAL, RNF_ROOT, squid_radix_node_head::rnh_treetop, and squid_rn_search_m().
Referenced by asnAddNet(), asnMatchIp(), squid_rn_inithead(), and squid_rn_lookup().
struct squid_radix_node* squid_rn_newpair  (  void *  v, 
int  b,  
struct squid_radix_node  nodes[2]  
) 
Definition at line 351 of file radix.c.
References squid_radix_node::rn_b, squid_radix_node::rn_flags, squid_radix_node::rn_p, and RNF_ACTIVE.
Referenced by squid_rn_inithead(), and squid_rn_insert().
int squid_rn_refines  (  void *  m_arg, 
void *  n_arg  
) 
struct squid_radix_node* squid_rn_search  (  void *  v_arg, 
struct squid_radix_node *  head  
) 
Definition at line 152 of file radix.c.
References squid_radix_node::rn_b, and squid_radix_node::rn_bmask.
Referenced by squid_rn_addmask(), squid_rn_delete(), and squid_rn_insert().
struct squid_radix_node* squid_rn_search_m  (  void *  v_arg, 
struct squid_radix_node *  head,  
void *  m_arg  
) 
Definition at line 166 of file radix.c.
References squid_radix_node::rn_b, and squid_radix_node::rn_bmask.
Referenced by squid_rn_match().
int squid_rn_walktree  (  struct squid_radix_node_head *  h, 
int(*)(struct squid_radix_node *, void *)  f,  
void *  w  
) 
Definition at line 875 of file radix.c.
References error(), squid_radix_node::rn_b, squid_radix_node::rn_flags, squid_radix_node::rn_p, RNF_ROOT, and squid_radix_node_head::rnh_treetop.
Referenced by asnFreeMemory(), asnStats(), and squid_rn_inithead().
Variable Documentation

static 
Definition at line 87 of file radix.c.
Referenced by squid_rn_addmask(), and squid_rn_init().

static 
Definition at line 88 of file radix.c.
Referenced by squid_rn_addmask().

static 
Definition at line 89 of file radix.c.
Referenced by rn_satsifies_leaf(), squid_rn_addmask(), squid_rn_init(), and squid_rn_inithead().

static 
Definition at line 89 of file radix.c.
Referenced by squid_rn_init(), and squid_rn_inithead().
struct squid_radix_node_head* squid_mask_rnhead 
int squid_max_keylen 
Definition at line 84 of file radix.c.
Referenced by asnInit(), squid_rn_addmask(), and squid_rn_init().
struct squid_radix_mask* squid_rn_mkfreelist 