X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_path_list.c;h=4e110fba9f0bf8d83244d769fd1bba798c12ad3d;hp=568886af143ca7f37014a4b0bc9e29f70f578c2d;hb=775f73c;hpb=a3aaa61e2f2fd81f9653cb678b38519e96e6c6cd 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)