diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/ip/ip4_forward.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c index 750b75ffcff..be381718312 100644 --- a/src/vnet/ip/ip4_forward.c +++ b/src/vnet/ip/ip4_forward.c @@ -2663,103 +2663,6 @@ VLIB_REGISTER_NODE (ip4_midchain_node) = { }; /* *INDENT-ON */ -static int -ip4_lookup_validate (ip4_address_t * a, u32 fib_index0) -{ - ip4_fib_mtrie_t *mtrie0; - ip4_fib_mtrie_leaf_t leaf0; - u32 lbi0; - - mtrie0 = &ip4_fib_get (fib_index0)->mtrie; - - leaf0 = ip4_fib_mtrie_lookup_step_one (mtrie0, a); - leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, a, 2); - leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, a, 3); - - lbi0 = ip4_fib_mtrie_leaf_get_adj_index (leaf0); - - return lbi0 == ip4_fib_table_lookup_lb (ip4_fib_get (fib_index0), a); -} - -static clib_error_t * -test_lookup_command_fn (vlib_main_t * vm, - unformat_input_t * input, vlib_cli_command_t * cmd) -{ - ip4_fib_t *fib; - u32 table_id = 0; - f64 count = 1; - u32 n; - int i; - ip4_address_t ip4_base_address; - u64 errors = 0; - - while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) - { - if (unformat (input, "table %d", &table_id)) - { - /* Make sure the entry exists. */ - fib = ip4_fib_get (table_id); - if ((fib) && (fib->index != table_id)) - return clib_error_return (0, "<fib-index> %d does not exist", - table_id); - } - else if (unformat (input, "count %f", &count)) - ; - - else if (unformat (input, "%U", - unformat_ip4_address, &ip4_base_address)) - ; - else - return clib_error_return (0, "unknown input `%U'", - format_unformat_error, input); - } - - n = count; - - for (i = 0; i < n; i++) - { - if (!ip4_lookup_validate (&ip4_base_address, table_id)) - errors++; - - ip4_base_address.as_u32 = - clib_host_to_net_u32 (1 + - clib_net_to_host_u32 (ip4_base_address.as_u32)); - } - - if (errors) - vlib_cli_output (vm, "%llu errors out of %d lookups\n", errors, n); - else - vlib_cli_output (vm, "No errors in %d lookups\n", n); - - return 0; -} - -/*? - * Perform a lookup of an IPv4 Address (or range of addresses) in the - * given FIB table to determine if there is a conflict with the - * adjacency table. The fib-id can be determined by using the - * '<em>show ip fib</em>' command. If fib-id is not entered, default value - * of 0 is used. - * - * @todo This command uses fib-id, other commands use table-id (not - * just a name, they are different indexes). Would like to change this - * to table-id for consistency. - * - * @cliexpar - * Example of how to run the test lookup command: - * @cliexstart{test lookup 172.16.1.1 table 1 count 2} - * No errors in 2 lookups - * @cliexend -?*/ -/* *INDENT-OFF* */ -VLIB_CLI_COMMAND (lookup_test_command, static) = -{ - .path = "test lookup", - .short_help = "test lookup <ipv4-addr> [table <fib-id>] [count <nn>]", - .function = test_lookup_command_fn, -}; -/* *INDENT-ON* */ - static clib_error_t * set_ip_flow_hash_command_fn (vlib_main_t * vm, unformat_input_t * input, |