diff options
author | Damjan Marion <damarion@cisco.com> | 2016-10-28 20:30:15 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-11-01 21:34:05 +0000 |
commit | 2231150b52b58c4114f8520cde8b26df2761e064 (patch) | |
tree | f4f5e5dcd4608bc94f02dabb6aa480fa411b85b8 /vnet/vnet/interface_cli.c | |
parent | 3dffb1e4c628f0698e369d1cbb3cb2068a3a698c (diff) |
feature: add new feature handling code and device-input features
Signed-off-by: Damjan Marion <damarion@cisco.com>
Change-Id: I010ecde93863dbdad84b993cd3680a5446db59b5
Diffstat (limited to 'vnet/vnet/interface_cli.c')
-rw-r--r-- | vnet/vnet/interface_cli.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/vnet/vnet/interface_cli.c b/vnet/vnet/interface_cli.c index 05e650e252c..cd7a620b836 100644 --- a/vnet/vnet/interface_cli.c +++ b/vnet/vnet/interface_cli.c @@ -225,12 +225,12 @@ show_sw_interfaces (vlib_main_t * vm, vnet_main_t *vnm = vnet_get_main (); vnet_interface_main_t *im = &vnm->interface_main; vnet_sw_interface_t *si, *sorted_sis = 0; + u32 sw_if_index = ~(u32) 0; u8 show_addresses = 0; + u8 show_features = 0; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { - u32 sw_if_index; - /* See if user wants to show specific interface */ if (unformat (input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index)) @@ -240,6 +240,8 @@ show_sw_interfaces (vlib_main_t * vm, } else if (unformat (input, "address") || unformat (input, "addr")) show_addresses = 1; + else if (unformat (input, "features") || unformat (input, "feat")) + show_features = 1; else { error = clib_error_return (0, "unknown input `%U'", @@ -248,6 +250,15 @@ show_sw_interfaces (vlib_main_t * vm, } } + if (show_features) + { + if (sw_if_index == ~(u32) 0) + return clib_error_return (0, "Interface not specified..."); + + vnet_interface_features_show (vm, sw_if_index); + return 0; + } + if (!show_addresses) vlib_cli_output (vm, "%U\n", format_vnet_sw_interface, vnm, 0); @@ -390,7 +401,7 @@ done: /* *INDENT-OFF* */ VLIB_CLI_COMMAND (show_sw_interfaces_command, static) = { .path = "show interfaces", - .short_help = "show interfaces [address|addr] [<if-name1> <if-name2> ...]", + .short_help = "show interfaces [address|addr|features|feat] [<if-name1> <if-name2> ...]", .function = show_sw_interfaces, }; /* *INDENT-ON* */ |