summaryrefslogtreecommitdiffstats
path: root/src/vnet/mfib
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-12-20 03:01:49 -0800
committerDamjan Marion <dmarion@me.com>2018-12-20 15:00:30 +0000
commit775f73c6baaf9bc2283e7ab9752c81984823be99 (patch)
tree7c2496d34a590fae15f917f9e51867fa14aafec5 /src/vnet/mfib
parenta3aaa61e2f2fd81f9653cb678b38519e96e6c6cd (diff)
FIB: encode the label stack in the FIB path during table dump
Change-Id: I28e8a99b980ad343a4209e673201791b91ceab4e Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mfib')
-rw-r--r--src/vnet/mfib/mfib_entry.c7
-rw-r--r--src/vnet/mfib/mfib_table.c11
-rw-r--r--src/vnet/mfib/mfib_table.h15
3 files changed, 30 insertions, 3 deletions
diff --git a/src/vnet/mfib/mfib_entry.c b/src/vnet/mfib/mfib_entry.c
index 51d775dd295..ac37665fb72 100644
--- a/src/vnet/mfib/mfib_entry.c
+++ b/src/vnet/mfib/mfib_entry.c
@@ -1324,9 +1324,10 @@ mfib_entry_encode (fib_node_index_t mfib_entry_index,
if (FIB_NODE_INDEX_INVALID != bsrc->mfes_pl)
{
- fib_path_list_walk(bsrc->mfes_pl,
- fib_path_encode,
- api_rpaths);
+ fib_path_list_walk_w_ext(bsrc->mfes_pl,
+ NULL,
+ fib_path_encode,
+ api_rpaths);
}
}
diff --git a/src/vnet/mfib/mfib_table.c b/src/vnet/mfib/mfib_table.c
index 8ae4a784684..68154b37ff8 100644
--- a/src/vnet/mfib/mfib_table.c
+++ b/src/vnet/mfib/mfib_table.c
@@ -490,6 +490,17 @@ mfib_table_get_index_for_sw_if_index (fib_protocol_t proto,
}
u32
+mfib_table_get_table_id (u32 fib_index,
+ fib_protocol_t proto)
+{
+ mfib_table_t *mfib_table;
+
+ mfib_table = mfib_table_get(fib_index, proto);
+
+ return ((NULL != mfib_table ? mfib_table->mft_table_id : ~0));
+}
+
+u32
mfib_table_find (fib_protocol_t proto,
u32 table_id)
{
diff --git a/src/vnet/mfib/mfib_table.h b/src/vnet/mfib/mfib_table.h
index 89f194f254e..6be4f798cd7 100644
--- a/src/vnet/mfib/mfib_table.h
+++ b/src/vnet/mfib/mfib_table.h
@@ -291,6 +291,21 @@ extern u32 mfib_table_get_index_for_sw_if_index(fib_protocol_t proto,
/**
* @brief
+ * Get the Table-ID of the FIB from protocol and index
+ *
+ * @param fib_index
+ * The FIB index
+ *
+ * @paran proto
+ * The protocol of the FIB (and thus the entries therein)
+ *
+ * @return fib_index
+ * The tableID of the FIB
+ */
+extern u32 mfib_table_get_table_id(u32 fib_index, fib_protocol_t proto);
+
+/**
+ * @brief
* Get the index of the FIB for a Table-ID. This DOES NOT create the
* FIB if it does not exist.
*