Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | #ifndef __FIB_TEST_H__ |
| 17 | #define __FIB_TEST_H__ |
| 18 | |
| 19 | #include <vnet/fib/fib_types.h> |
| 20 | |
| 21 | typedef enum fib_test_lb_bucket_type_t_ { |
| 22 | FT_LB_LABEL_O_ADJ, |
| 23 | FT_LB_LABEL_STACK_O_ADJ, |
| 24 | FT_LB_LABEL_O_LB, |
| 25 | FT_LB_O_LB, |
| 26 | FT_LB_SPECIAL, |
| 27 | FT_LB_ADJ, |
| 28 | FT_LB_INTF, |
Neale Ranns | 6f63115 | 2017-10-03 08:20:21 -0700 | [diff] [blame] | 29 | FT_LB_L2, |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 30 | } fib_test_lb_bucket_type_t; |
| 31 | |
| 32 | typedef struct fib_test_lb_bucket_t_ { |
| 33 | fib_test_lb_bucket_type_t type; |
| 34 | |
| 35 | union |
| 36 | { |
| 37 | struct |
| 38 | { |
| 39 | mpls_eos_bit_t eos; |
| 40 | mpls_label_t label; |
| 41 | u8 ttl; |
| 42 | adj_index_t adj; |
| 43 | } label_o_adj; |
| 44 | struct |
| 45 | { |
| 46 | mpls_eos_bit_t eos; |
| 47 | mpls_label_t label_stack[8]; |
| 48 | u8 label_stack_size; |
| 49 | u8 ttl; |
| 50 | adj_index_t adj; |
| 51 | } label_stack_o_adj; |
| 52 | struct |
| 53 | { |
| 54 | mpls_eos_bit_t eos; |
| 55 | mpls_label_t label; |
| 56 | u8 ttl; |
| 57 | index_t lb; |
| 58 | } label_o_lb; |
| 59 | struct |
| 60 | { |
| 61 | index_t adj; |
| 62 | } adj; |
| 63 | struct |
| 64 | { |
| 65 | index_t lb; |
| 66 | } lb; |
| 67 | struct |
| 68 | { |
| 69 | index_t adj; |
| 70 | } special; |
| 71 | }; |
| 72 | } fib_test_lb_bucket_t; |
| 73 | |
| 74 | typedef enum fib_test_rep_bucket_type_t_ { |
| 75 | FT_REP_LABEL_O_ADJ, |
Neale Ranns | 6f63115 | 2017-10-03 08:20:21 -0700 | [diff] [blame] | 76 | FT_REP_DISP_MFIB_LOOKUP, |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 77 | FT_REP_INTF, |
| 78 | } fib_test_rep_bucket_type_t; |
| 79 | |
| 80 | typedef struct fib_test_rep_bucket_t_ { |
| 81 | fib_test_rep_bucket_type_t type; |
| 82 | |
| 83 | union |
| 84 | { |
| 85 | struct |
| 86 | { |
| 87 | mpls_eos_bit_t eos; |
| 88 | mpls_label_t label; |
| 89 | u8 ttl; |
| 90 | adj_index_t adj; |
| 91 | } label_o_adj; |
| 92 | struct |
| 93 | { |
| 94 | adj_index_t adj; |
| 95 | } adj; |
| 96 | }; |
| 97 | } fib_test_rep_bucket_t; |
| 98 | |
| 99 | |
| 100 | extern int fib_test_validate_rep_v(const replicate_t *rep, |
| 101 | u16 n_buckets, |
Christophe Fontaine | d3c008d | 2017-10-02 18:10:54 +0200 | [diff] [blame] | 102 | va_list *ap); |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 103 | |
| 104 | extern int fib_test_validate_lb_v(const load_balance_t *lb, |
| 105 | u16 n_buckets, |
Christophe Fontaine | d3c008d | 2017-10-02 18:10:54 +0200 | [diff] [blame] | 106 | va_list *ap); |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 107 | |
| 108 | extern int fib_test_validate_entry(fib_node_index_t fei, |
| 109 | fib_forward_chain_type_t fct, |
Gabriel Ganne | d71e0fc | 2017-10-26 10:35:28 +0200 | [diff] [blame^] | 110 | int n_buckets, |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 111 | ...); |
| 112 | |
| 113 | #endif |