From: Ahmed Abdelsalam Date: Tue, 10 Nov 2020 17:19:12 +0000 (+0000) Subject: sr: show the hop-limit value used for SRv6 encapsulation X-Git-Tag: v21.06-rc0~188 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=80f0b88fc388c82627dafef19c01f4c4536bbfa2;p=vpp.git sr: show the hop-limit value used for SRv6 encapsulation Implements CLI to show the hop-limit value used for the outer IPv6 header of the SRv6 encapsulation. Type: feature Signed-off-by: Ahmed Abdelsalam Change-Id: I1f3d8f71fb94494ae6ab8104b9fcf989c5585d5c --- diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c index 77e14853bfa..a0b151decdd 100644 --- a/src/vnet/srv6/sr_policy_rewrite.c +++ b/src/vnet/srv6/sr_policy_rewrite.c @@ -1189,6 +1189,27 @@ VLIB_CLI_COMMAND (show_sr_encaps_source_command, static) = { }; /* *INDENT-ON* */ +/** + * @brief CLI to display onscreen the hop-limit value used for SRv6 encapsulation + */ +static clib_error_t * +show_sr_encaps_hop_limit_command_fn (vlib_main_t * vm, + unformat_input_t * input, + vlib_cli_command_t * cmd) +{ + vlib_cli_output (vm, "SR encaps hop-limit = %u", sr_get_hop_limit ()); + + return 0; +} + +/* *INDENT-OFF* */ +VLIB_CLI_COMMAND (show_sr_encaps_hop_limit_command, static) = { + .path = "show sr encaps hop-limit", + .short_help = "show sr encaps hop-limit", + .function = show_sr_encaps_hop_limit_command_fn, +}; +/* *INDENT-ON* */ + /*************************** SR rewrite graph node ****************************/ /** * @brief Trace for the SR Policy Rewrite graph node