From 775f73c6baaf9bc2283e7ab9752c81984823be99 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 20 Dec 2018 03:01:49 -0800 Subject: FIB: encode the label stack in the FIB path during table dump Change-Id: I28e8a99b980ad343a4209e673201791b91ceab4e Signed-off-by: Neale Ranns --- src/vnet/fib/fib_path_list.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/vnet/fib/fib_path_list.c') diff --git a/src/vnet/fib/fib_path_list.c b/src/vnet/fib/fib_path_list.c index 568886af143..4e110fba9f0 100644 --- a/src/vnet/fib/fib_path_list.c +++ b/src/vnet/fib/fib_path_list.c @@ -24,6 +24,7 @@ #include #include #include +#include /** * The magic number of child entries that make a path-list popular. @@ -722,7 +723,7 @@ fib_path_list_create (fib_path_list_flags_t flags, if (FIB_NODE_INDEX_INVALID != old_path_list_index) { fib_path_list_destroy(path_list); - + path_list_index = old_path_list_index; } else @@ -747,7 +748,7 @@ fib_path_list_create (fib_path_list_flags_t flags, return (path_list_index); } -static fib_path_cfg_flags_t +static fib_path_cfg_flags_t fib_path_list_flags_2_path_flags (fib_path_list_flags_t plf) { fib_path_cfg_flags_t pf = FIB_PATH_CFG_FLAG_NONE; @@ -1343,6 +1344,29 @@ fib_path_list_walk (fib_node_index_t path_list_index, } } +void +fib_path_list_walk_w_ext (fib_node_index_t path_list_index, + const fib_path_ext_list_t *ext_list, + fib_path_list_walk_w_ext_fn_t func, + void *ctx) +{ + fib_node_index_t *path_index; + fib_path_list_t *path_list; + fib_path_ext_t *path_ext; + + path_list = fib_path_list_get(path_list_index); + + vec_foreach(path_index, path_list->fpl_paths) + { + path_ext = fib_path_ext_list_find_by_path_index(ext_list, *path_index); + + if (FIB_PATH_LIST_WALK_STOP == func(path_list_index, + *path_index, + path_ext, + ctx)) + break; + } +} void fib_path_list_module_init (void) -- cgit 1.2.3-korg