sr: show the hop-limit value used for SRv6 encapsulation 70/29870/2
authorAhmed Abdelsalam <ahabdels@cisco.com>
Tue, 10 Nov 2020 17:19:12 +0000 (17:19 +0000)
committerNeale Ranns <nranns@cisco.com>
Fri, 13 Nov 2020 09:54:13 +0000 (09:54 +0000)
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 <ahabdels@cisco.com>
Change-Id: I1f3d8f71fb94494ae6ab8104b9fcf989c5585d5c

src/vnet/srv6/sr_policy_rewrite.c

index 77e1485..a0b151d 100644 (file)
@@ -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