Line data Source code
1 : /* 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 : 9 : static clib_error_t * 10 0 : show_hash (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd) 11 : { 12 0 : clib_error_t *error = 0; 13 0 : vnet_hash_main_t *hm = &vnet_hash_main; 14 : vnet_hash_function_registration_t *hash; 15 : 16 0 : hash = hm->hash_registrations; 17 : 18 0 : vlib_cli_output (vm, "%-25s%-8s%s", "Name", "Prio", "Description"); 19 0 : while (hash) 20 : { 21 0 : vlib_cli_output (vm, "%-25s%-8u%s", hash->name, hash->priority, 22 : hash->description); 23 0 : hash = hash->next; 24 : } 25 : 26 0 : return (error); 27 : } 28 : 29 272887 : VLIB_CLI_COMMAND (cmd_show_hash, static) = { 30 : .path = "show hash", 31 : .short_help = "show hash", 32 : .function = show_hash, 33 : };