X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fmfib%2Fmfib_table.h;h=83aa04ef7972b5f4d9523ccdccd6b633b52720f8;hb=0f26c5a0138ac86d7ebd197c31a09d8d624c35fe;hp=4faa69ee99970ff5198705d3a0cd931442496e3b;hpb=32e1c010b0c34fd0984f7fc45fae648a182025c5;p=vpp.git diff --git a/src/vnet/mfib/mfib_table.h b/src/vnet/mfib/mfib_table.h index 4faa69ee999..83aa04ef797 100644 --- a/src/vnet/mfib/mfib_table.h +++ b/src/vnet/mfib/mfib_table.h @@ -18,6 +18,7 @@ #include #include +#include #include @@ -121,6 +122,7 @@ extern fib_node_index_t mfib_table_lookup_exact_match(u32 fib_index, extern fib_node_index_t mfib_table_entry_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, + fib_rpf_id_t rpf_id, mfib_entry_flags_t flags); /** @@ -212,6 +214,37 @@ extern void mfib_table_entry_delete(u32 fib_index, extern void mfib_table_entry_delete_index(fib_node_index_t entry_index, mfib_source_t source); +/** + * @brief + * Add a 'special' entry to the mFIB that links to the DPO passed + * A special entry is an entry that the FIB is not expect to resolve + * via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup). + * Instead the client/source provides the index of a replicate DPO to link to. + * + * @param fib_index + * The index of the FIB + * + * @param prefix + * The prefix to add + * + * @param source + * The ID of the client/source adding the entry. + * + * @param flags + * Flags for the entry. + * + * @param rep_dpo + * The replicate DPO index to link to. + * + * @return + * the index of the fib_entry_t that is created (or existed already). + */ +extern fib_node_index_t mfib_table_entry_special_add(u32 fib_index, + const mfib_prefix_t *prefix, + mfib_source_t source, + mfib_entry_flags_t flags, + index_t rep_dpo); + /** * @brief * Flush all entries from a table for the source @@ -328,4 +361,20 @@ extern u32 mfib_table_get_num_entries(u32 fib_index, extern mfib_table_t *mfib_table_get(fib_node_index_t index, fib_protocol_t proto); +/** + * @brief Call back function when walking entries in a FIB table + */ +typedef int (*mfib_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 mfib_table_walk(u32 fib_index, + fib_protocol_t proto, + mfib_table_walk_fn_t fn, + void *ctx); + #endif