X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_table.h;h=b310aea611d87e7c37fdc5d1dddadd26f8d65e0c;hb=a3af337e06a79f7d1dacf42a319f241c907122fc;hp=cfec516de1a94f0820d621c6d6328b4dcc39a82a;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vnet/fib/fib_table.h b/src/vnet/fib/fib_table.h index cfec516de1a..b310aea611d 100644 --- a/src/vnet/fib/fib_table.h +++ b/src/vnet/fib/fib_table.h @@ -28,18 +28,6 @@ */ typedef struct fib_table_t_ { - /** - * A union of the protocol specific FIBs that provide the - * underlying LPM mechanism. - * This element is first in the struct so that it is in the - * first cache line. - */ - union { - ip4_fib_t v4; - ip6_fib_t v6; - mpls_fib_t mpls; - }; - /** * Which protocol this table serves. Used to switch on the union above. */ @@ -729,4 +717,20 @@ extern u32 fib_table_get_num_entries(u32 fib_index, extern fib_table_t *fib_table_get(fib_node_index_t index, fib_protocol_t proto); +/** + * @brief Call back function when walking entries in a FIB table + */ +typedef int (*fib_table_walk_fn_t)(fib_node_index_t fei, + void *ctx); + +/** + * @brief Walk all entries in a FIB table + * N.B: This is NOT safe to deletes. If you need to delete walk the whole + * table and store elements in a vector, then delete the elements + */ +extern void fib_table_walk(u32 fib_index, + fib_protocol_t proto, + fib_table_walk_fn_t fn, + void *ctx); + #endif