summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-08-22 09:50:25 -0700
committerDamjan Marion <dmarion@me.com>2018-08-22 18:18:34 +0000
commit5779a441acaf1f613f548668262d8f9bb07560f2 (patch)
tree8e4abcdc8c2dd8f78ee43bd52bd72ca1a2b97d37
parent78cfeb43223fa572babd7f465f04528f4ca6cdb9 (diff)
show command for lookup DPOs
Change-Id: I4907f48e6c4a4e91343fd0d4fface00f09e5fa2b Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
-rw-r--r--src/vnet/dpo/lookup_dpo.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/vnet/dpo/lookup_dpo.c b/src/vnet/dpo/lookup_dpo.c
index ebdbc127cc6..1ac917cb0de 100644
--- a/src/vnet/dpo/lookup_dpo.c
+++ b/src/vnet/dpo/lookup_dpo.c
@@ -1482,6 +1482,46 @@ const static char* const * const lookup_dst_from_interface_nodes[DPO_PROTO_NUM]
[DPO_PROTO_MPLS] = lookup_dst_from_interface_mpls_nodes,
};
+static clib_error_t *
+lookup_dpo_show (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ index_t lkdi = INDEX_INVALID;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "%d", &lkdi))
+ ;
+ else
+ break;
+ }
+
+ if (INDEX_INVALID != lkdi)
+ {
+ vlib_cli_output (vm, "%U", format_lookup_dpo, lkdi);
+ }
+ else
+ {
+ lookup_dpo_t *lkd;
+
+ pool_foreach(lkd, lookup_dpo_pool,
+ ({
+ vlib_cli_output (vm, "[@%d] %U",
+ lookup_dpo_get_index(lkd),
+ format_lookup_dpo,
+ lookup_dpo_get_index(lkd));
+ }));
+ }
+
+ return 0;
+}
+
+VLIB_CLI_COMMAND (replicate_show_command, static) = {
+ .path = "show lookup-dpo",
+ .short_help = "show lookup-dpo [<index>]",
+ .function = lookup_dpo_show,
+};
void
lookup_dpo_module_init (void)