summaryrefslogtreecommitdiffstats
path: root/src/plugins/pppoe
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/pppoe
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/pppoe')
-rw-r--r--src/plugins/pppoe/pppoe.c10
1 files changed, 8 insertions, 2 deletions
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;
}