blob: 47d33b9872e0bf60931646413fc125e1c566c0fe [file] [log] [blame]
Mohsin Kazmi41b23bc2021-06-30 18:26:25 +00001/*
2 * SPDX-License-Identifier: Apache-2.0
3 * Copyright(c) 2021 Cisco Systems, Inc.
4 */
5
6#include <vnet/vnet.h>
7#include <vnet/hash/hash.h>
8
9static clib_error_t *
10show_hash (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
11{
12 clib_error_t *error = 0;
13 vnet_hash_main_t *hm = &vnet_hash_main;
14 vnet_hash_function_registration_t *hash;
15
16 hash = hm->hash_registrations;
17
18 vlib_cli_output (vm, "%-25s%-8s%s", "Name", "Prio", "Description");
19 while (hash)
20 {
21 vlib_cli_output (vm, "%-25s%-8u%s", hash->name, hash->priority,
22 hash->description);
23 hash = hash->next;
24 }
25
26 return (error);
27}
28
29VLIB_CLI_COMMAND (cmd_show_hash, static) = {
30 .path = "show hash",
31 .short_help = "show hash",
32 .function = show_hash,
33};