+/** Enable / disable packet trace filter */
+int
+vlib_enable_disable_pkt_trace_filter (int enable)
+{
+ if (enable)
+ {
+ vnet_classify_main_t *cm = &vnet_classify_main;
+ vnet_classify_filter_set_t *set;
+ u32 set_index = vlib_global_main.trace_filter.trace_filter_set_index;
+
+ if (set_index == ~0)
+ return -1;
+
+ set = pool_elt_at_index (cm->filter_sets, set_index);
+ vlib_global_main.trace_filter.trace_classify_table_index =
+ set->table_indices[0];
+ vlib_global_main.trace_filter.trace_filter_enable = 1;
+ }
+ else
+ {
+ vlib_global_main.trace_filter.trace_filter_enable = 0;
+ }
+ return 0;
+}
+