diff options
Diffstat (limited to 'src/vnet/fib')
-rw-r--r-- | src/vnet/fib/fib_entry.c | 10 | ||||
-rw-r--r-- | src/vnet/fib/fib_entry.h | 2 | ||||
-rw-r--r-- | src/vnet/fib/fib_table.c | 8 | ||||
-rw-r--r-- | src/vnet/fib/fib_table.h | 11 |
4 files changed, 31 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c index 655526586cb..8d7ce00b9c0 100644 --- a/src/vnet/fib/fib_entry.c +++ b/src/vnet/fib/fib_entry.c @@ -1495,6 +1495,16 @@ fib_entry_set_flow_hash_config (fib_node_index_t fib_entry_index, } } +u32 +fib_entry_get_stats_index (fib_node_index_t fib_entry_index) +{ + fib_entry_t *fib_entry; + + fib_entry = fib_entry_get(fib_entry_index); + + return (fib_entry->fe_lb.dpoi_index); +} + static int fib_ip4_address_compare (const ip4_address_t * a1, const ip4_address_t * a2) diff --git a/src/vnet/fib/fib_entry.h b/src/vnet/fib/fib_entry.h index 61b81493756..9175a571032 100644 --- a/src/vnet/fib/fib_entry.h +++ b/src/vnet/fib/fib_entry.h @@ -623,6 +623,8 @@ extern void fib_entry_set_flow_hash_config(fib_node_index_t fib_entry_index, extern void fib_entry_module_init(void); +extern u32 fib_entry_get_stats_index(fib_node_index_t fib_entry_index); + /* * unsafe... beware the raw pointer. */ diff --git a/src/vnet/fib/fib_table.c b/src/vnet/fib/fib_table.c index f63edaa76f0..d8e8d63b9ae 100644 --- a/src/vnet/fib/fib_table.c +++ b/src/vnet/fib/fib_table.c @@ -885,6 +885,14 @@ fib_table_entry_delete_index (fib_node_index_t fib_entry_index, fib_entry_index, prefix, source); } +u32 +fib_table_entry_get_stats_index(u32 fib_index, + const fib_prefix_t *prefix) +{ + return (fib_entry_get_stats_index( + fib_table_lookup_exact_match(fib_index, prefix))); +} + fib_node_index_t fib_table_entry_local_label_add (u32 fib_index, const fib_prefix_t *prefix, diff --git a/src/vnet/fib/fib_table.h b/src/vnet/fib/fib_table.h index 8b86f8d6dd9..f13dd77c8b4 100644 --- a/src/vnet/fib/fib_table.h +++ b/src/vnet/fib/fib_table.h @@ -596,6 +596,17 @@ extern void fib_table_entry_delete_index(fib_node_index_t entry_index, /** * @brief + * Return the stats index for a FIB entry + * @param fib_index + * The table's FIB index + * @param prefix + * The entry's prefix's + */ +extern u32 fib_table_entry_get_stats_index(u32 fib_index, + const fib_prefix_t *prefix); + +/** + * @brief * Flush all entries from a table for the source * * @param fib_index |