aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ila/ila.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-12-04 06:11:00 +0000
committerOle Trøan <otroan@employees.org>2019-12-04 22:47:12 +0000
commit3bab8f9c5396a7bf1115b93a9e0691a76a9ed14c (patch)
tree0212708b47f042ac393848e0471669f837788278 /src/plugins/ila/ila.c
parent5f8f6173328f8d77feea5fd100e150c3094c11f0 (diff)
fib: Decouple source from priority and behaviour
Type: feature the fib_source_t enum alone no longer defines the priority and behaviour, instead each source must be allocated these attributes. This allows the creation of other sources by the plugins (and soon over the API). Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I890ee820fbc16079ee417ea1fbc163192806e853
Diffstat (limited to 'src/plugins/ila/ila.c')
-rw-r--r--src/plugins/ila/ila.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/ila/ila.c b/src/plugins/ila/ila.c
index bac76151c28..162d417d772 100644
--- a/src/plugins/ila/ila.c
+++ b/src/plugins/ila/ila.c
@@ -68,6 +68,11 @@ static dpo_type_t ila_dpo_type;
*/
static fib_node_type_t ila_fib_node_type;
+/**
+ * FIB source for adding entries
+ */
+static fib_source_t ila_fib_src;
+
u8 *
format_half_ip6_address (u8 * s, va_list * va)
{
@@ -758,7 +763,7 @@ ila_add_del_entry (ila_add_del_entry_args_t * args)
fib_table_entry_special_dpo_add(0,
&pfx,
- FIB_SOURCE_PLUGIN_HI,
+ ila_fib_src,
FIB_ENTRY_FLAG_EXCLUSIVE,
&dpo);
dpo_reset(&dpo);
@@ -794,7 +799,7 @@ ila_add_del_entry (ila_add_del_entry_args_t * args)
.fp_proto = FIB_PROTOCOL_IP6,
};
- fib_table_entry_special_remove(0, &pfx, FIB_SOURCE_PLUGIN_HI);
+ fib_table_entry_special_remove(0, &pfx, ila_fib_src);
/*
* remove this ILA entry as child of the FIB netry for the next-hop
*/
@@ -935,7 +940,9 @@ ila_init (vlib_main_t * vm)
ila_dpo_type = dpo_register_new_type(&ila_vft, ila_nodes);
ila_fib_node_type = fib_node_register_new_type(&ila_fib_node_vft);
-
+ ila_fib_src = fib_source_allocate("ila",
+ FIB_SOURCE_PRIORITY_HI,
+ FIB_SOURCE_BH_SIMPLE);
return NULL;
}