X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Finterface_api.c;fp=src%2Fvnet%2Finterface_api.c;h=01f2fd0c8b2f37f1b58983475b5f7cafe61fc105;hb=3f40755749b07e5a936ad6d15622e371e7e5c25e;hp=5b48fea02ebe9fbc3314db522256770c0b71aec1;hpb=4ab1aa31451c0db5deb9c726e82de241da126107;p=vpp.git diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c index 5b48fea02eb..01f2fd0c8b2 100644 --- a/src/vnet/interface_api.c +++ b/src/vnet/interface_api.c @@ -1603,6 +1603,33 @@ static void REPLY_MACRO (VL_API_SW_INTERFACE_ADDRESS_REPLACE_END_REPLY); } +static void +vl_api_pcap_set_filter_function_t_handler ( + vl_api_pcap_set_filter_function_t *mp) +{ + vnet_main_t *vnm = vnet_get_main (); + vnet_pcap_t *pp = &vnm->pcap; + vl_api_pcap_set_filter_function_reply_t *rmp; + unformat_input_t input = { 0 }; + vlib_is_packet_traced_fn_t *f; + char *filter_name; + int rv = 0; + filter_name = vl_api_from_api_to_new_c_string (&mp->filter_function_name); + unformat_init_cstring (&input, filter_name); + if (unformat (&input, "%U", unformat_vlib_trace_filter_function, &f) == 0) + { + rv = -1; + goto done; + } + + pp->current_filter_function = f; + +done: + unformat_free (&input); + vec_free (filter_name); + REPLY_MACRO (VL_API_PCAP_SET_FILTER_FUNCTION_REPLY); +} + static void vl_api_pcap_trace_on_t_handler (vl_api_pcap_trace_on_t *mp) {