summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_test.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-10-13 05:15:07 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-10-14 09:11:42 +0000
commit054c03ac9c20a5e38121590b83f01fd91f82acf0 (patch)
tree93ec5f8d85defb3e58d12fdca917a68000dbe6d3 /src/vnet/fib/fib_test.c
parentd77275307b6ad6459ecba01912a302fb7dbf0f02 (diff)
Source Lookup progammable via API
Change-Id: I5d5d4f22b6369d504455a644f73076d772fbcfb4 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_test.c')
-rw-r--r--src/vnet/fib/fib_test.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_test.c b/src/vnet/fib/fib_test.c
index 03c9ee75f48..da517b0ceea 100644
--- a/src/vnet/fib/fib_test.c
+++ b/src/vnet/fib/fib_test.c
@@ -3543,6 +3543,49 @@ fib_test_v4 (void)
"4.4.4.4/32 is deag in %d %U",
lkd->lkd_fib_index,
format_dpo_id, dpo, 0);
+ FIB_TEST((LOOKUP_INPUT_DST_ADDR == lkd->lkd_input),
+ "4.4.4.4/32 is source deag in %d %U",
+ lkd->lkd_input,
+ format_dpo_id, dpo, 0);
+
+ fib_table_entry_delete(fib_index,
+ &pfx_4_4_4_4_s_32,
+ FIB_SOURCE_API);
+ FIB_TEST(FIB_NODE_INDEX_INVALID ==
+ fib_table_lookup_exact_match(fib_index, &pfx_4_4_4_4_s_32),
+ "4.4.4.4/32 removed");
+ vec_free(r_paths);
+
+ /*
+ * A route deag route in a source lookup table
+ */
+ fib_table_entry_path_add(fib_index,
+ &pfx_4_4_4_4_s_32,
+ FIB_SOURCE_API,
+ FIB_ENTRY_FLAG_NONE,
+ DPO_PROTO_IP4,
+ &zero_addr,
+ ~0,
+ fib_index,
+ 1,
+ NULL,
+ FIB_ROUTE_PATH_SOURCE_LOOKUP);
+
+ fei = fib_table_lookup_exact_match(fib_index, &pfx_4_4_4_4_s_32);
+ FIB_TEST((FIB_NODE_INDEX_INVALID != fei), "4.4.4.4/32 present");
+
+ dpo = fib_entry_contribute_ip_forwarding(fei);
+ dpo = load_balance_get_bucket(dpo->dpoi_index, 0);
+ lkd = lookup_dpo_get(dpo->dpoi_index);
+
+ FIB_TEST((fib_index == lkd->lkd_fib_index),
+ "4.4.4.4/32 is deag in %d %U",
+ lkd->lkd_fib_index,
+ format_dpo_id, dpo, 0);
+ FIB_TEST((LOOKUP_INPUT_SRC_ADDR == lkd->lkd_input),
+ "4.4.4.4/32 is source deag in %d %U",
+ lkd->lkd_input,
+ format_dpo_id, dpo, 0);
fib_table_entry_delete(fib_index,
&pfx_4_4_4_4_s_32,