- if (dm->pcap_filename == 0)
- dm->pcap_filename = format (0, "/tmp/vpe.pcap%c", 0);
-
- memset (&dm->pcap_main, 0, sizeof (dm->pcap_main));
- dm->pcap_main.file_name = (char *) dm->pcap_filename;
- dm->pcap_main.n_packets_to_capture = PCAP_DEF_PKT_TO_CAPTURE;
- if (dm->pcap_pkts_to_capture)
- dm->pcap_main.n_packets_to_capture = dm->pcap_pkts_to_capture;
-
- dm->pcap_main.packet_type = PCAP_PACKET_TYPE_ethernet;
- dm->tx_pcap_enable = 1;
- vlib_cli_output (vm, "pcap tx capture on...");
+ if (dm->pcap[rx_tx].pcap_main.file_name == 0)
+ dm->pcap[rx_tx].pcap_main.file_name
+ = (char *) format (0, "/tmp/vpe.pcap%c", 0);
+
+ dm->pcap[rx_tx].pcap_main.n_packets_captured = 0;
+ dm->pcap[rx_tx].pcap_main.packet_type = PCAP_PACKET_TYPE_ethernet;
+ if (dm->pcap[rx_tx].pcap_main.lock == 0)
+ clib_spinlock_init (&(dm->pcap[rx_tx].pcap_main.lock));
+ dm->pcap[rx_tx].pcap_enable = 1;
+ vlib_cli_output (vm, "pcap %s capture on...",
+ rx_tx == VLIB_RX ? "rx" : "tx");