FD.io VPP  v18.01-8-g0eacf49
Vector Packet Processing
radix.c File Reference
+ Include dependency graph for radix.c:

Go to the source code of this file.

Macros

#define rn_masktop   (mask_rnhead->rnh_treetop)
 
#define SUBTREE_OPEN   "[ "
 
#define SUBTREE_CLOSE   " ]"
 
#define MIN(x, y)   (((x)<(y))?(x):(y))
 
#define R_Malloc(p, t, n)
 
#define Free(p)   clib_mem_free((p))
 
#define log(a, b, c...)
 
#define bool   i32
 

Typedefs

typedef void(* rn_printer_t) (void *, const char *fmt,...)
 

Functions

static int rn_satisfies_leaf (const char *, struct radix_node *, int)
 
static int rn_lexobetter (const void *, const void *)
 
static struct radix_maskrn_new_radix_mask (struct radix_node *, struct radix_mask *)
 
static struct radix_nodern_walknext (struct radix_node *, rn_printer_t, void *)
 
static struct radix_nodern_walkfirst (struct radix_node *, rn_printer_t, void *)
 
static void rn_nodeprint (struct radix_node *, rn_printer_t, void *, const char *)
 
static struct radix_maskrm_alloc (void)
 
static void rm_free (struct radix_mask *rm)
 
struct radix_nodern_search (const void *v_arg, struct radix_node *head)
 
struct radix_nodern_search_m (const void *v_arg, struct radix_node *head, const void *m_arg)
 
int rn_refines (const void *m_arg, const void *n_arg)
 
struct radix_nodern_lookup (const void *v_arg, const void *m_arg, struct radix_node_head *head)
 
struct radix_nodern_match (const void *v_arg, struct radix_node_head *head)
 
struct radix_nodern_newpair (const void *v, int b, struct radix_node nodes[2])
 
struct radix_nodern_insert (const void *v_arg, struct radix_node_head *head, int *dupentry, struct radix_node nodes[2])
 
struct radix_nodern_addmask (const void *n_arg, int search, int skip)
 
struct radix_nodern_addroute (const void *v_arg, const void *n_arg, struct radix_node_head *head, struct radix_node treenodes[2])
 
struct radix_nodern_delete1 (const void *v_arg, const void *netmask_arg, struct radix_node_head *head, struct radix_node *rn)
 
struct radix_nodern_delete (const void *v_arg, const void *netmask_arg, struct radix_node_head *head)
 
int rn_walktree (struct radix_node_head *h, int(*f)(struct radix_node *, void *), void *w)
 
struct radix_nodern_search_matched (struct radix_node_head *h, int(*matcher)(struct radix_node *, void *), void *w)
 
int rn_inithead (void **head, int off)
 
int rn_inithead0 (struct radix_node_head *rnh, int off)
 
static clib_error_trn_module_init (vlib_main_t *vm)
 

Variables

static int max_keylen = 33
 
struct radix_maskrn_mkfreelist
 
struct radix_node_headmask_rnhead
 
static char * addmask_key
 
static const char normal_chars []
 
static char * rn_zeros
 
static char * rn_ones
 

Macro Definition Documentation

#define bool   i32

Definition at line 95 of file radix.c.

#define Free (   p)    clib_mem_free((p))

Definition at line 93 of file radix.c.

#define log (   a,
  b,
  c... 
)

Definition at line 94 of file radix.c.

#define MIN (   x,
  y 
)    (((x)<(y))?(x):(y))

Definition at line 70 of file radix.c.

#define R_Malloc (   p,
  t,
 
)
Value:
{ \
p = (t) clib_mem_alloc((unsigned int)(n)); \
memset(p, 0, n); \
}
static void * clib_mem_alloc(uword size)
Definition: mem.h:112

Definition at line 88 of file radix.c.

#define rn_masktop   (mask_rnhead->rnh_treetop)

Definition at line 50 of file radix.c.

#define SUBTREE_CLOSE   " ]"

Definition at line 64 of file radix.c.

#define SUBTREE_OPEN   "[ "

Definition at line 63 of file radix.c.

Typedef Documentation

typedef void(* rn_printer_t) (void *, const char *fmt,...)

Definition at line 40 of file radix.c.

Function Documentation

static struct radix_mask* rm_alloc ( void  )
static

Definition at line 73 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void rm_free ( struct radix_mask rm)
static

Definition at line 83 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct radix_node* rn_addmask ( const void *  n_arg,
int  search,
int  skip 
)

Definition at line 485 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct radix_node* rn_addroute ( const void *  v_arg,
const void *  n_arg,
struct radix_node_head head,
struct radix_node  treenodes[2] 
)

Definition at line 602 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct radix_node* rn_delete ( const void *  v_arg,
const void *  netmask_arg,
struct radix_node_head head 
)

Definition at line 944 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct radix_node* rn_delete1 ( const void *  v_arg,
const void *  netmask_arg,
struct radix_node_head head,
struct radix_node rn 
)

Definition at line 760 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int rn_inithead ( void **  head,
int  off 
)

Definition at line 1046 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int rn_inithead0 ( struct radix_node_head rnh,
int  off 
)

Definition at line 1060 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct radix_node* rn_insert ( const void *  v_arg,
struct radix_node_head head,
int *  dupentry,
struct radix_node  nodes[2] 
)

Definition at line 417 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int rn_lexobetter ( const void *  m_arg,
const void *  n_arg 
)
static

Definition at line 560 of file radix.c.

+ Here is the caller graph for this function:

struct radix_node* rn_lookup ( const void *  v_arg,
const void *  m_arg,
struct radix_node_head head 
)

Definition at line 199 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct radix_node* rn_match ( const void *  v_arg,
struct radix_node_head head 
)

Definition at line 244 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* rn_module_init ( vlib_main_t vm)
static

Definition at line 1085 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct radix_mask * rn_new_radix_mask ( struct radix_node tt,
struct radix_mask next 
)
static

Definition at line 578 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct radix_node* rn_newpair ( const void *  v,
int  b,
struct radix_node  nodes[2] 
)

Definition at line 402 of file radix.c.

+ Here is the caller graph for this function:

static void rn_nodeprint ( struct radix_node rn,
rn_printer_t  printer,
void *  arg,
const char *  delim 
)
static

Definition at line 351 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int rn_refines ( const void *  m_arg,
const void *  n_arg 
)

Definition at line 169 of file radix.c.

+ Here is the caller graph for this function:

static int rn_satisfies_leaf ( const char *  trial,
struct radix_node leaf,
int  skip 
)
static

Definition at line 221 of file radix.c.

+ Here is the caller graph for this function:

struct radix_node* rn_search ( const void *  v_arg,
struct radix_node head 
)

Definition at line 132 of file radix.c.

+ Here is the caller graph for this function:

struct radix_node* rn_search_m ( const void *  v_arg,
struct radix_node head,
const void *  m_arg 
)

Definition at line 149 of file radix.c.

+ Here is the caller graph for this function:

struct radix_node* rn_search_matched ( struct radix_node_head h,
int(*)(struct radix_node *, void *)  matcher,
void *  w 
)

Definition at line 1015 of file radix.c.

+ Here is the call graph for this function:

static struct radix_node * rn_walkfirst ( struct radix_node rn,
rn_printer_t  printer,
void *  arg 
)
static

Definition at line 973 of file radix.c.

+ Here is the caller graph for this function:

static struct radix_node * rn_walknext ( struct radix_node rn,
rn_printer_t  printer,
void *  arg 
)
static

Definition at line 953 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int rn_walktree ( struct radix_node_head h,
int(*)(struct radix_node *, void *)  f,
void *  w 
)

Definition at line 985 of file radix.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

char* addmask_key
static

Definition at line 45 of file radix.c.

struct radix_node_head* mask_rnhead

Definition at line 44 of file radix.c.

int max_keylen = 33
static

Definition at line 42 of file radix.c.

const char normal_chars[]
static
Initial value:
=
{0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, -1}

Definition at line 46 of file radix.c.

struct radix_mask* rn_mkfreelist

Definition at line 43 of file radix.c.

char * rn_ones
static

Definition at line 48 of file radix.c.

char* rn_zeros
static

Definition at line 48 of file radix.c.