aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/mfib/ip6_mfib.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-10-19 14:47:20 +0000
committerDamjan Marion <dmarion@me.com>2020-10-19 20:59:54 +0000
commit5a59b2bac48611a316adf128bdb0e1e2fe889656 (patch)
tree37e51dbf5d97fda9d9deee2d08e4b18a29981c5f /src/vnet/mfib/ip6_mfib.h
parent710d78074e07ffb5006ad01a0da4c1b6dc3de38b (diff)
ip: Move the IP6 fib into ip6_[m]fib.c
Type: improvement reduce the compile time by moving the bihash includes out of ip[46].h Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I6b9216e10aff1013071f9238b3e1ebbdd205bd80
Diffstat (limited to 'src/vnet/mfib/ip6_mfib.h')
-rw-r--r--src/vnet/mfib/ip6_mfib.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/vnet/mfib/ip6_mfib.h b/src/vnet/mfib/ip6_mfib.h
index f197b9d9fe8..67a821c6b88 100644
--- a/src/vnet/mfib/ip6_mfib.h
+++ b/src/vnet/mfib/ip6_mfib.h
@@ -25,11 +25,40 @@
#ifndef __IP6_MFIB_H__
#define __IP6_MFIB_H__
+#include <vppinfra/bihash_40_8.h>
+#include <vppinfra/bihash_template.h>
+
#include <vlib/vlib.h>
#include <vnet/ip/ip.h>
#include <vnet/mfib/mfib_table.h>
+/*
+ * Default size of the ip6 fib hash table
+ */
+#define IP6_MFIB_DEFAULT_HASH_NUM_BUCKETS (64 * 1024)
+#define IP6_MFIB_DEFAULT_HASH_MEMORY_SIZE (32<<20)
+
+
+/**
+ * A representation of a single IP6 mfib table
+ */
+typedef struct ip6_mfib_table_instance_t_
+{
+ /* The hash table */
+ clib_bihash_40_8_t ip6_mhash;
+
+ /* bitmap / refcounts / vector of mask widths to search */
+ uword *non_empty_dst_address_length_bitmap;
+ u16 *prefix_lengths_in_search_order;
+ i32 dst_address_length_refcounts[257];
+} ip6_mfib_table_instance_t;
+
+/**
+ * the single MFIB table
+ */
+extern ip6_mfib_table_instance_t ip6_mfib_table;
+
extern fib_node_index_t ip6_mfib_table_lookup(const ip6_mfib_t *fib,
const ip6_address_t *src,
const ip6_address_t *grp,