1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2016 Intel Corporation
5 #ifndef __INCLUDE_RTE_PORT_SOURCE_SINK_H__
6 #define __INCLUDE_RTE_PORT_SOURCE_SINK_H__
14 * RTE Port Source/Sink
16 * source: input port that can be used to generate packets
17 * sink: output port that drops all packets written to it
23 /** source port parameters */
24 struct rte_port_source_params {
25 /** Pre-initialized buffer pool */
26 struct rte_mempool *mempool;
28 /** The full path of the pcap file to read packets from */
29 const char *file_name;
30 /** The number of bytes to be read from each packet in the
31 * pcap file. If this value is 0, the whole packet is read;
32 * if it is bigger than packet size, the generated packets
33 * will contain the whole packet */
34 uint32_t n_bytes_per_pkt;
37 /** source port operations */
38 extern struct rte_port_in_ops rte_port_source_ops;
40 /** sink port parameters */
41 struct rte_port_sink_params {
42 /** The full path of the pcap file to write the packets to */
43 const char *file_name;
44 /** The maximum number of packets write to the pcap file.
45 * If this value is 0, the "infinite" write will be carried
51 /** sink port operations */
52 extern struct rte_port_out_ops rte_port_sink_ops;