#include <vlib/vlib.h>
#include <vnet/vnet.h>
#include <vnet/srv6/sr.h>
-#include <vnet/ip/ip.h>
+#include <vnet/ip/ip4_inlines.h>
+#include <vnet/ip/ip6_inlines.h>
#include <vnet/srv6/sr_packet.h>
-#include <vnet/ip/ip6_packet.h>
#include <vnet/fib/ip6_fib.h>
#include <vnet/dpo/dpo.h>
#include <vnet/dpo/replicate_dpo.h>
clib_memcpy_fast (&sr_pr_encaps_src, address, sizeof (sr_pr_encaps_src));
}
+ip6_address_t *
+sr_get_encaps_source ()
+{
+ return &sr_pr_encaps_src;
+}
+
static clib_error_t *
set_sr_src_command_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd)
};
/* *INDENT-ON* */
+/**
+ * @brief CLI to display onscreen the SR encaps source addr
+ */
+static clib_error_t *
+show_sr_encaps_source_command_fn (vlib_main_t * vm, unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ vlib_cli_output (vm, "SR encaps source addr = %U", format_ip6_address,
+ sr_get_encaps_source ());
+
+ return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (show_sr_encaps_source_command, static) = {
+ .path = "show sr encaps source addr",
+ .short_help = "show sr encaps source addr",
+ .function = show_sr_encaps_source_command_fn,
+};
+/* *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