From 3bab8f9c5396a7bf1115b93a9e0691a76a9ed14c Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Wed, 4 Dec 2019 06:11:00 +0000 Subject: 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 Change-Id: I890ee820fbc16079ee417ea1fbc163192806e853 --- src/plugins/pppoe/pppoe.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/plugins/pppoe') diff --git a/src/plugins/pppoe/pppoe.c b/src/plugins/pppoe/pppoe.c index 2d63b3e8674..1f8a7288aeb 100644 --- a/src/plugins/pppoe/pppoe.c +++ b/src/plugins/pppoe/pppoe.c @@ -37,6 +37,8 @@ pppoe_main_t pppoe_main; +static fib_source_t pppoe_fib_src; + u8 * format_pppoe_session (u8 * s, va_list * args) { @@ -376,7 +378,7 @@ int vnet_pppoe_add_del_session /* add reverse route for client ip */ fib_table_entry_path_add (a->decap_fib_index, &pfx, - FIB_SOURCE_PLUGIN_HI, FIB_ENTRY_FLAG_NONE, + pppoe_fib_src, FIB_ENTRY_FLAG_NONE, fib_proto_to_dpo (pfx.fp_proto), &pfx.fp_addr, sw_if_index, ~0, 1, NULL, FIB_ROUTE_PATH_FLAG_NONE); @@ -408,7 +410,7 @@ int vnet_pppoe_add_del_session /* delete reverse route for client ip */ fib_table_entry_path_remove (a->decap_fib_index, &pfx, - FIB_SOURCE_PLUGIN_HI, + pppoe_fib_src, fib_proto_to_dpo (pfx.fp_proto), &pfx.fp_addr, sw_if_index, ~0, 1, @@ -721,6 +723,10 @@ pppoe_init (vlib_main_t * vm) ethernet_register_input_type (vm, ETHERNET_TYPE_PPPOE_DISCOVERY, pppoe_cp_dispatch_node.index); + pppoe_fib_src = fib_source_allocate ("pppoe", + FIB_SOURCE_PRIORITY_HI, + FIB_SOURCE_BH_API); + return 0; } -- cgit 1.2.3-korg