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/unittest/fib_test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins/unittest') diff --git a/src/plugins/unittest/fib_test.c b/src/plugins/unittest/fib_test.c index f220eb0d358..2d75f28a8ca 100644 --- a/src/plugins/unittest/fib_test.c +++ b/src/plugins/unittest/fib_test.c @@ -9310,13 +9310,16 @@ fib_test_inherit (void) "%U via 10.10.10.2", format_fib_prefix, &pfx_10_10_10_0_s_24); + fib_source_t hi_src = fib_source_allocate("test", 0x50, + FIB_SOURCE_BH_SIMPLE); + /* * add the source that replaces inherited state. * inheriting source is not the best, so it doesn't push state. */ fib_table_entry_update_one_path(0, &pfx_10_10_10_0_s_24, - FIB_SOURCE_PLUGIN_HI, + hi_src, FIB_ENTRY_FLAG_NONE, DPO_PROTO_IP4, &nh_10_10_10_1, @@ -9354,7 +9357,7 @@ fib_test_inherit (void) * withdraw the higher priority source and expect the inherited to return * throughout the sub-tree */ - fib_table_entry_delete(0, &pfx_10_10_10_0_s_24, FIB_SOURCE_PLUGIN_HI); + fib_table_entry_delete(0, &pfx_10_10_10_0_s_24, hi_src); fei = fib_table_lookup_exact_match(0, &pfx_10_10_10_21_s_32); FIB_TEST(!fib_test_validate_entry(fei, -- cgit 1.2.3-korg