summaryrefslogtreecommitdiffstats
path: root/src/vnet/hash/cli.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-06-30 18:26:25 +0000
committerDamjan Marion <dmarion@me.com>2021-09-20 11:11:02 +0000
commit41b23bc9554a134aee37b430ebf5553cc3260624 (patch)
tree9094c812a8833a37292244e9c2023d466d99a606 /src/vnet/hash/cli.c
parente3cf4d0cf3b83f912474220ff52dfedc5a432084 (diff)
hash: add support for hashing infra
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I3652ae275385d9b1eb1b11f418e3a7e5fef2f556
Diffstat (limited to 'src/vnet/hash/cli.c')
-rw-r--r--src/vnet/hash/cli.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vnet/hash/cli.c b/src/vnet/hash/cli.c
new file mode 100644
index 00000000000..47d33b9872e
--- /dev/null
+++ b/src/vnet/hash/cli.c
@@ -0,0 +1,33 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vnet/vnet.h>
+#include <vnet/hash/hash.h>
+
+static clib_error_t *
+show_hash (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
+{
+ clib_error_t *error = 0;
+ vnet_hash_main_t *hm = &vnet_hash_main;
+ vnet_hash_function_registration_t *hash;
+
+ hash = hm->hash_registrations;
+
+ vlib_cli_output (vm, "%-25s%-8s%s", "Name", "Prio", "Description");
+ while (hash)
+ {
+ vlib_cli_output (vm, "%-25s%-8u%s", hash->name, hash->priority,
+ hash->description);
+ hash = hash->next;
+ }
+
+ return (error);
+}
+
+VLIB_CLI_COMMAND (cmd_show_hash, static) = {
+ .path = "show hash",
+ .short_help = "show hash",
+ .function = show_hash,
+};