From 5c1e48c01b50ddbd7623228e3dbc94d835d23813 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Thu, 15 Oct 2020 14:41:36 -0400 Subject: classify: add pcap/trace classfier mgmt API calls Add lookup/get/set API calls to manage both PCAP and Trace filtering Classifier tables. The "lookup" call may be used to identify a Classifier table within a chain of tables taht matches a particular mask vector. For efficiency, this call should be used to determine to which table a match vector should be added. The "get" calls return the first table within a chain (either a PCAP or the Trace) set of tables. The "set" call may be used to add a new table to one such chain. If the "sort_masks" flag is set, the tables within the chain are ordered such that the most-specific mask is first, and the least-specific mask is last. A call that "sets" a chain to ~0 will delete and free all the tables with a chain. The PCAP filters are per-interface, with "local0", (that is, sw_if_index == 0) holding the system-wide PCAP filter. The Classifier used a reference-counted "set" for each PCAP or trace filter that it stored. The ref counts were not used, and the vector of tables was only used temporarily to establish a sorted order for tables based on masks. None of that complexity was actually warranted, and where it was used, the same could be achieved more simply. Type: refactor Signed-off-by: Jon Loeliger Change-Id: Icc56116cca91b91c631ca0628e814fb53f3677d2 --- src/vlib/trace_funcs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vlib/trace_funcs.h') diff --git a/src/vlib/trace_funcs.h b/src/vlib/trace_funcs.h index 8dd5310ae76..357079c4e3d 100644 --- a/src/vlib/trace_funcs.h +++ b/src/vlib/trace_funcs.h @@ -154,7 +154,7 @@ vlib_trace_buffer (vlib_main_t * vm, { /* See if we're supposed to trace this packet... */ if (vnet_is_packet_traced - (b, vlib_global_main.trace_filter.trace_classify_table_index, + (b, vlib_global_main.trace_filter.classify_table_index, 0 /* full classify */ ) != 1) return 0; } -- cgit 1.2.3-korg