aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest
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/unittest
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/unittest')
-rw-r--r--src/plugins/unittest/fib_test.c7
1 files changed, 5 insertions, 2 deletions
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,