aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/fib_entry.c21
-rw-r--r--src/vnet/fib/fib_entry.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c
index a8dec1a8c20..33c29a6e33c 100644
--- a/src/vnet/fib/fib_entry.c
+++ b/src/vnet/fib/fib_entry.c
@@ -1464,6 +1464,27 @@ fib_entry_get_resolving_interface (fib_node_index_t entry_index)
return (fib_path_list_get_resolving_interface(fib_entry->fe_parent));
}
+u32
+fib_entry_get_any_resolving_interface (fib_node_index_t entry_index)
+{
+ const fib_entry_src_t *src;
+ fib_entry_t *fib_entry;
+ fib_source_t source;
+ u32 sw_if_index;
+
+ fib_entry = fib_entry_get(entry_index);
+
+ FOR_EACH_SRC_ADDED(fib_entry, src, source,
+ ({
+ sw_if_index = fib_entry_get_resolving_interface_for_source (entry_index,
+ source);
+
+ if (~0 != sw_if_index)
+ break;
+ }));
+ return (sw_if_index);
+}
+
fib_source_t
fib_entry_get_best_source (fib_node_index_t entry_index)
{
diff --git a/src/vnet/fib/fib_entry.h b/src/vnet/fib/fib_entry.h
index b97c80fd8bf..4053ff65181 100644
--- a/src/vnet/fib/fib_entry.h
+++ b/src/vnet/fib/fib_entry.h
@@ -440,6 +440,7 @@ extern u32 fib_entry_child_add(fib_node_index_t fib_entry_index,
extern void fib_entry_child_remove(fib_node_index_t fib_entry_index,
u32 sibling_index);
extern u32 fib_entry_get_resolving_interface(fib_node_index_t fib_entry_index);
+extern u32 fib_entry_get_any_resolving_interface(fib_node_index_t fib_entry_index);
extern u32 fib_entry_get_resolving_interface_for_source(
fib_node_index_t fib_entry_index,
fib_source_t source);