22 BVT (clib_bihash_kv) kv, value;
25 kv.key[1] = (
u64) vni;
28 rv = BV (clib_bihash_search_inline_2) (&db->mac_lookup_table, &kv, &value);
40 BVT (clib_bihash_kv) kv, value;
44 for (i = 0; i < len; i++)
49 ASSERT (dst_address_length >= 0 && dst_address_length <= 32);
59 BV (clib_bihash_search_inline_2) (&db->ip4_lookup_table, &kv, &value);
72 BVT (clib_bihash_kv) kv, value;
76 for (i = 0; i < len; i++)
81 ASSERT (dst_address_length >= 0 && dst_address_length <= 128);
87 kv.key[2] = (
u64) vni;
90 BV (clib_bihash_search_inline_2) (&db->ip6_lookup_table, &kv, &value);
145 int dst_address_length = 32 - i;
146 vec_add1 (db->ip4_prefix_lengths_in_search_order, dst_address_length);
156 BVT (clib_bihash_kv) kv, value;
187 kv.key[0] = ((
u64) vni << 32) | key.
as_u32;
192 old_val = value.value;
214 int dst_address_length = 128 - i;
215 vec_add1 (db->ip6_prefix_lengths_in_search_order, dst_address_length);
224 BVT (clib_bihash_kv) kv, value;
254 kv.key[0] = key.
as_u64[0];
255 kv.key[1] = key.
as_u64[1];
256 kv.key[2] = (
u64) vni;
260 old_val = value.value;
275 BVT (clib_bihash_kv) kv, value;
278 kv.key[0] = ((
u64 *) mac)[0];
279 kv.key[1] = (
u64) vni;
283 old_val = value.value;
382 for (j = 0; j < i0; j++)
387 clib_host_to_net_u32 (
pow2_mask (i1) << (32 - i1));
static void ip6_address_mask(ip6_address_t *a, ip6_address_t *mask)
#define IP6_LOOKUP_DEFAULT_HASH_NUM_BUCKETS
static void ip6_compute_prefix_lengths_in_search_order(gid_dictionary_t *db)
sll srl srl sll sra u16x4 i
#define gid_address_type(_a)
uword * ip6_non_empty_dst_address_length_bitmap
uword ip4_lookup_table_size
uword mac_lookup_table_size
u32 ip6_lookup_table_nbuckets
#define MAC_LOOKUP_DEFAULT_HASH_NUM_BUCKETS
static void ip4_lookup_init(gid_dictionary_t *db)
static u32 add_del_mac(gid_dictionary_t *db, u32 vni, u8 *mac, u32 val, u8 is_add)
#define ip_prefix_len(_a)
u32 ip4_prefix_len_refcount[33]
#define IP4_LOOKUP_DEFAULT_HASH_NUM_BUCKETS
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 ip4_compute_prefix_lengths_in_search_order(gid_dictionary_t *db)
#define IP4_LOOKUP_DEFAULT_HASH_MEMORY_SIZE
#define ip_prefix_version(_a)
void gid_dictionary_init(gid_dictionary_t *db)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static u32 add_del_ip4_key(gid_dictionary_t *db, u32 vni, ip_prefix_t *pref, u32 val, u8 is_add)
static void ip6_lookup_init(gid_dictionary_t *db)
static u32 mac_lookup(gid_dictionary_t *db, u32 vni, u8 *key)
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.
static uword pow2_mask(uword x)
static u32 ip_lookup(gid_dictionary_t *db, u32 vni, ip_prefix_t *key)
static foreach_gid_address_type_fcns u64 mac_to_u64(u8 *m)
#define clib_warning(format, args...)
static u32 add_del_ip6_key(gid_dictionary_t *db, u32 vni, ip_prefix_t *pref, u32 val, u8 is_add)
u32 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
u32 gid_dictionary_add_del(gid_dictionary_t *db, gid_address_t *key, u32 value, u8 is_add)
#define gid_address_mac(_a)
u64 ip6_prefix_len_refcount[129]
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
#define gid_address_ippref(_a)
u8 * ip4_prefix_lengths_in_search_order
static u32 add_del_ip(gid_dictionary_t *db, u32 vni, ip_prefix_t *key, u32 value, u8 is_add)
#define clib_memcpy(a, b, c)
struct _gid_address_t gid_address_t
#define IP6_LOOKUP_DEFAULT_HASH_MEMORY_SIZE
static u32 ip6_lookup(gid_dictionary_t *db, u32 vni, ip_prefix_t *key)
ip4_address_t ip4_fib_masks[33]
int clib_bihash_search(clib_bihash *h, clib_bihash_kv *search_v, clib_bihash_kv *return_v)
Search a bi-hash table.
u8 * ip6_prefix_lengths_in_search_order
ip6_address_t ip6_fib_masks[129]
#define gid_address_vni(_a)
u32 mac_lookup_table_nbuckets
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void mac_lookup_init(gid_dictionary_t *db)
static uword max_log2(uword x)
uword ip6_lookup_table_size
uword * ip4_non_empty_dst_address_length_bitmap
static u32 ip4_lookup(gid_dictionary_t *db, u32 vni, ip_prefix_t *key)
#define MAC_LOOKUP_DEFAULT_HASH_MEMORY_SIZE
u32 ip4_lookup_table_nbuckets