MCPcopy Create free account
hub / github.com/F-Stack/f-stack / open_single_tx_pcap

Function open_single_tx_pcap

dpdk/drivers/net/pcap/pcap_ethdev.c:546–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546static int
547open_single_tx_pcap(const char *pcap_filename, pcap_dumper_t **dumper)
548{
549 pcap_t *tx_pcap;
550
551 /*
552 * We need to create a dummy empty pcap_t to use it
553 * with pcap_dump_open(). We create big enough an Ethernet
554 * pcap holder.
555 */
556 tx_pcap = pcap_open_dead_with_tstamp_precision(DLT_EN10MB,
557 RTE_ETH_PCAP_SNAPSHOT_LEN, PCAP_TSTAMP_PRECISION_NANO);
558 if (tx_pcap == NULL) {
559 PMD_LOG(ERR, "Couldn't create dead pcap");
560 return -1;
561 }
562
563 /* The dumper is created using the previous pcap_t reference */
564 *dumper = pcap_dump_open(tx_pcap, pcap_filename);
565 if (*dumper == NULL) {
566 pcap_close(tx_pcap);
567 PMD_LOG(ERR, "Couldn't open %s for writing.",
568 pcap_filename);
569 return -1;
570 }
571
572 pcap_close(tx_pcap);
573 return 0;
574}
575
576static int
577open_single_rx_pcap(const char *pcap_filename, pcap_t **pcap)

Callers 2

eth_dev_startFunction · 0.85
open_tx_pcapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected