#include <vnet/ip/ip.h>
#include <vnet/ethernet/ethernet.h>
-/*
- * ip4 FIB tester. Add, probe, delete a bunch of
+/**
+ * @file
+ * @brief IPv4 FIB Tester.
+ *
+ * Not compiled in by default. IPv4 FIB tester. Add, probe, delete a bunch of
* random routes / masks and make sure that the mtrie agrees with
* the hash-table FIB.
*
}
/* Find or create FIB table 11 */
- fib = find_ip4_fib_by_table_index_or_id (im, table_id, IP4_ROUTE_FLAG_TABLE_ID);
+ fib = ip4_fib_find_or_create_fib_by_table_id (table_id);
for (i = tm->test_interfaces_created; i < ninterfaces; i++)
{
hw = vnet_get_hw_interface (vnm, hw_if_index);
vec_validate (im->fib_index_by_sw_if_index, hw->sw_if_index);
im->fib_index_by_sw_if_index[hw->sw_if_index] = fib->index;
+ ip4_sw_interface_enable_disable(sw_if_index, 1);
}
tm->test_interfaces_created = ninterfaces;
return 0;
}
+/*?
+ * This command in not in the build by default. It is an internal
+ * command used to test the route functonality.
+ *
+ * Create test routes on IPv4 FIB table 11. Table will be created if it
+ * does not exist.
+ *
+ * There are several optional attributes:
+ * - If not provided, <seed> defaults to 0xdeaddabe.
+ * - If not provided, <num-iter> defaults to 10.
+ * - If not provided, <num-iface> defaults to 4.
+ * - If not provided, <min-mask> defaults to 7.0.
+ * - If not provided, <max-mask> defaults to 32.0.
+ *
+ * @cliexpar
+ * Example of how to run:
+ * @cliexcmd{test route}
+?*/
+/* *INDENT-OFF* */
VLIB_CLI_COMMAND (test_route_command, static) = {
.path = "test route",
- .short_help = "test route",
+ .short_help = "test route [seed <seed-num>] [niter <num-iter>] [ninterfaces <num-iface>] [min-mask-bits <min-mask>] [max-mask-bits <max-mask>] [verbose]", .function = thrash,
.function = thrash,
};
+/* *INDENT-ON* */
clib_error_t *test_route_init (vlib_main_t *vm)
{