|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
19 #include <arpa/inet.h>
26 return htonl(
len == 32 ?
a :
a & ~(~0u >>
len));
38 uword * hash, * result;
42 hash = lpm->
hash[pfxlen];
45 clib_warning(
"%U/%d already exists in table for domain %d",
56 lpm->
hash[pfxlen] = hash;
62 uword * hash, * result;
66 hash = lpm->
hash[pfxlen];
70 lpm->
hash[pfxlen] = hash;
76 uword * hash, * result;
80 for (mask_len = pfxlen; mask_len >= 0; mask_len--) {
81 hash = lpm->
hash[mask_len];
96 BVT(clib_bihash_kv) kv, v;
111 ip6_address_t *
addr = addr_v;
126 BVT(clib_bihash_kv) kv;
127 ip6_address_t *
addr = addr_v;
141 ip6_address_t *
addr = addr_v;
142 BVT(clib_bihash_kv) kv;
160 memset(lpm, 0,
sizeof(*lpm));
174 "LPM 128", 64*1024, 32<<20);
static void hash_set_flags(void *v, uword flags)
static int lpm_128_lookup_core(lpm_t *lpm, ip6_address_t *addr, u8 pfxlen, u32 *value)
static u32 lpm_128_lookup(lpm_t *lpm, void *addr_v, u8 pfxlen)
#define HASH_FLAG_NO_AUTO_SHRINK
static uint32_t masked_address32(uint32_t addr, uint8_t len)
#define hash_create(elts, value_bytes)
static void lpm_128_add(lpm_t *lpm, void *addr_v, u8 pfxlen, u32 value)
int clib_bihash_search_inline_2(clib_bihash *h, clib_bihash_kv *search_key, clib_bihash_kv *valuep)
Search a bi-hash table.
#define hash_set(h, key, value)
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
static uint64_t masked_address64(uint64_t addr, uint8_t len)
BVT(clib_bihash)
The table of adjacencies indexed by the rewrite string.
sll srl srl sll sra u16x4 i
u32(* lookup)(struct lpm_ *lpm, void *addr_v, u8 pfxlen)
static void lpm_32_add(lpm_t *lpm, void *addr_v, u8 pfxlen, u32 value)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
static void lpm_128_delete(lpm_t *lpm, void *addr_v, u8 pfxlen)
static u32 lpm_32_lookup(lpm_t *lpm, void *addr_v, u8 pfxlen)
uword * prefix_lengths_bitmap
static void lpm_32_delete(lpm_t *lpm, void *addr_v, u8 pfxlen)
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
void(* add)(struct lpm_ *lpm, void *addr_v, u8 pfxlen, u32 value)
#define hash_unset(h, key)
void(* delete)(struct lpm_ *lpm, void *addr_v, u8 pfxlen)
lpm_t * lpm_table_init(enum lpm_type_e lpm_type)
#define clib_warning(format, args...)
u32 prefix_length_refcount[129]
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
static void * clib_mem_alloc(uword size)