summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorDamjan Marion <dmarion@me.com>2022-10-04 18:08:51 +0200
committerNeale Ranns <neale@graphiant.com>2022-10-07 04:17:21 +0000
commit9260b8861e62fb9bb0c9dfb5a89c9636ef9a05e2 (patch)
tree0062fef2f5bca2a9c4392f8f957597658e73008b /src/vnet
parentba3d5afb92cf2c89e9b17d17a6668baf17260009 (diff)
fib: add fib_entry_get_path_list_for_source
Type: improvement Change-Id: Ie035bebf64226691cffc84484e4bf7310287d1b7 Signed-off-by: Damjan Marion <dmarion@me.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/fib/fib_entry.h3
-rw-r--r--src/vnet/fib/fib_entry_src.c19
2 files changed, 22 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_entry.h b/src/vnet/fib/fib_entry.h
index 4053ff65181..223928354b7 100644
--- a/src/vnet/fib/fib_entry.h
+++ b/src/vnet/fib/fib_entry.h
@@ -421,6 +421,9 @@ extern const int fib_entry_get_dpo_for_source (
fib_node_index_t fib_entry_index,
fib_source_t source,
dpo_id_t *dpo);
+extern fib_node_index_t fib_entry_get_path_list_for_source (
+ fib_node_index_t fib_entry_index,
+ fib_source_t source);
extern adj_index_t fib_entry_get_adj(fib_node_index_t fib_entry_index);
diff --git a/src/vnet/fib/fib_entry_src.c b/src/vnet/fib/fib_entry_src.c
index 39e719e6a7a..ff81f6bcddd 100644
--- a/src/vnet/fib/fib_entry_src.c
+++ b/src/vnet/fib/fib_entry_src.c
@@ -1797,6 +1797,25 @@ fib_entry_get_dpo_for_source (fib_node_index_t fib_entry_index,
return (0);
}
+fib_node_index_t
+fib_entry_get_path_list_for_source (fib_node_index_t fib_entry_index,
+ fib_source_t source)
+{
+ fib_entry_t *fib_entry;
+ fib_entry_src_t *esrc;
+
+ if (FIB_NODE_INDEX_INVALID == fib_entry_index)
+ return FIB_NODE_INDEX_INVALID;
+
+ fib_entry = fib_entry_get(fib_entry_index);
+ esrc = fib_entry_src_find(fib_entry, source);
+
+ if (esrc)
+ return esrc->fes_pl;
+
+ return FIB_NODE_INDEX_INVALID;
+}
+
u32
fib_entry_get_resolving_interface_for_source (fib_node_index_t entry_index,
fib_source_t source)