summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_test.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-10-21 10:53:20 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-09 15:16:52 +0000
commitd792d9c01e60656cbfe1b0f1fd6a9b125f5dab0c (patch)
treedb88d99dd8102389fb92e8ed44bc7d6a55dc3080 /src/vnet/fib/fib_test.c
parenta2ff7b8cfc829ffbb6d5de7534efb51f7cba9cf3 (diff)
BIER
- see draft-ietf-bier-mpls-encapsulation-10 - midpoint, head and tail functions - supported payload protocols; IPv4 and IPv6 only. Change-Id: I59d7363bb6fdfdce8e4016a68a9c8f5a5e5791cb 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.c67
1 files changed, 52 insertions, 15 deletions
diff --git a/src/vnet/fib/fib_test.c b/src/vnet/fib/fib_test.c
index 66a38236216..2658eb27811 100644
--- a/src/vnet/fib/fib_test.c
+++ b/src/vnet/fib/fib_test.c
@@ -13,6 +13,7 @@
* limitations under the License.
*/
+#include <vnet/fib/fib_test.h>
#include <vnet/fib/ip6_fib.h>
#include <vnet/fib/ip4_fib.h>
#include <vnet/fib/mpls_fib.h>
@@ -544,15 +545,31 @@ fib_test_validate_lb_v (const load_balance_t *lb,
dpo->dpoi_index,
exp->lb.lb);
break;
- case FT_LB_SPECIAL:
- FIB_TEST_I((DPO_DROP == dpo->dpoi_type),
- "bucket %d stacks on %U",
- bucket,
- format_dpo_type, dpo->dpoi_type);
- FIB_TEST_LB((exp->special.adj == dpo->dpoi_index),
- "bucket %d stacks on drop %d",
+ case FT_LB_BIER_TABLE:
+ FIB_TEST_LB((DPO_BIER_TABLE == dpo->dpoi_type),
+ "bucket %d stacks on %U",
+ bucket,
+ format_dpo_type, dpo->dpoi_type);
+ FIB_TEST_LB((exp->bier.table == dpo->dpoi_index),
+ "bucket %d stacks on lb %d",
+ bucket,
+ exp->bier.table);
+ break;
+ case FT_LB_BIER_FMASK:
+ FIB_TEST_LB((DPO_BIER_FMASK == dpo->dpoi_type),
+ "bucket %d stacks on %U",
+ bucket,
+ format_dpo_type, dpo->dpoi_type);
+ FIB_TEST_LB((exp->bier.fmask == dpo->dpoi_index),
+ "bucket %d stacks on lb %d",
bucket,
- exp->special.adj);
+ exp->bier.fmask);
+ break;
+ case FT_LB_DROP:
+ FIB_TEST_LB((DPO_DROP == dpo->dpoi_type),
+ "bucket %d stacks on %U",
+ bucket,
+ format_dpo_type, dpo->dpoi_type);
break;
}
}
@@ -560,6 +577,29 @@ fib_test_validate_lb_v (const load_balance_t *lb,
}
int
+fib_test_validate_lb (const dpo_id_t *dpo,
+ u16 n_buckets,
+ ...)
+{
+ const load_balance_t *lb;
+ va_list ap;
+ int res;
+
+ va_start(ap, n_buckets);
+
+ FIB_TEST_LB((DPO_LOAD_BALANCE == dpo->dpoi_type),
+ "Entry links to %U",
+ format_dpo_type, dpo->dpoi_type);
+ lb = load_balance_get(dpo->dpoi_index);
+
+ res = fib_test_validate_lb_v(lb, n_buckets, &ap);
+
+ va_end(ap);
+
+ return (res);
+}
+
+int
fib_test_validate_entry (fib_node_index_t fei,
fib_forward_chain_type_t fct,
int n_buckets,
@@ -6678,13 +6718,10 @@ fib_test_label (void)
* remove the other path with a valid label
*/
fib_test_lb_bucket_t bucket_drop = {
- .type = FT_LB_SPECIAL,
- .special = {
- .adj = DPO_PROTO_IP4,
- },
+ .type = FT_LB_DROP,
};
fib_test_lb_bucket_t mpls_bucket_drop = {
- .type = FT_LB_SPECIAL,
+ .type = FT_LB_DROP,
.special = {
.adj = DPO_PROTO_MPLS,
},
@@ -8497,13 +8534,13 @@ lfib_test (void)
* A recursive via a label that does not exist
*/
fib_test_lb_bucket_t bucket_drop = {
- .type = FT_LB_SPECIAL,
+ .type = FT_LB_DROP,
.special = {
.adj = DPO_PROTO_IP4,
},
};
fib_test_lb_bucket_t mpls_bucket_drop = {
- .type = FT_LB_SPECIAL,
+ .type = FT_LB_DROP,
.special = {
.adj = DPO_PROTO_MPLS,
},