+static clib_error_t *
+show_classify_filter_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ vnet_classify_main_t *cm = &vnet_classify_main;
+ vnet_main_t *vnm = vnet_get_main ();
+ vnet_classify_filter_set_t *set;
+ u8 *name = 0;
+ u8 *s = 0;
+ u32 set_index;
+ u32 table_index;
+ int verbose = 0;
+ int i, j;
+
+ (void) unformat (input, "verbose %=", &verbose, 1);
+
+ vlib_cli_output (vm, "%-30s%s", "Filter Used By", " Table(s)");
+ vlib_cli_output (vm, "%-30s%s", "--------------", " --------");
+
+ for (i = 0; i < vec_len (cm->filter_set_by_sw_if_index); i++)
+ {
+ set_index = cm->filter_set_by_sw_if_index[i];
+
+ if (set_index == 0 && verbose == 0)
+ continue;
+
+ set = pool_elt_at_index (cm->filter_sets, set_index);
+
+ if (i == 0)
+ name = format (0, "pcap rx/tx/drop:");
+ else
+ name = format (0, "%U:", format_vnet_sw_if_index_name, vnm, i);
+
+ if (verbose)
+ {
+ u8 *s = 0;
+ u32 table_index;
+
+ for (j = 0; j < vec_len (set->table_indices); j++)
+ {
+ table_index = set->table_indices[j];
+ if (table_index != ~0)
+ s = format (s, " %u", table_index);
+ else
+ s = format (s, " none");
+ }
+
+ vlib_cli_output (vm, "%-30s table(s)%s", name, s);
+ vec_reset_length (s);
+ }
+ else
+ {
+ u8 *s = 0;
+ table_index = set->table_indices[0];
+
+ if (table_index != ~0)
+ s = format (s, " %u", table_index);
+ else
+ s = format (s, " none");
+
+ vlib_cli_output (vm, "%-30s first table%s", name, s);
+ vec_reset_length (s);
+ }
+ vec_reset_length (name);
+ }
+ vec_free (s);
+ vec_free (name);
+ return 0;
+}
+
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (show_classify_filter, static) =
+{
+ .path = "show classify filter",
+ .short_help = "show classify filter [verbose [nn]]",
+ .function = show_classify_filter_command_fn,
+};
+/* *INDENT-ON* */
+
+
+
+