1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
4 #ifndef __INCLUDE_RTE_SWX_PORT_SOURCE_SINK_H__
5 #define __INCLUDE_RTE_SWX_PORT_SOURCE_SINK_H__
13 * RTE SWX Source and Sink Ports
16 #include "rte_swx_port.h"
18 /** Maximum number of packets to read from the PCAP file. */
19 #ifndef RTE_SWX_PORT_SOURCE_PKTS_MAX
20 #define RTE_SWX_PORT_SOURCE_PKTS_MAX 1024
23 /** Source port creation parameters. */
24 struct rte_swx_port_source_params {
25 /** Buffer pool. Must be valid. */
26 struct rte_mempool *pool;
28 /** Name of a valid PCAP file to read the input packets from. */
29 const char *file_name;
31 /** Maximum number of packets to read from the PCAP file. When 0, it is
32 * internally set to RTE_SWX_PORT_SOURCE_PKTS_MAX. Once read from the
33 * PCAP file, the same packets are looped forever.
38 /** Source port operations. */
39 extern struct rte_swx_port_in_ops rte_swx_port_source_ops;
41 /** Sink port creation parameters. */
42 struct rte_swx_port_sink_params {
43 /** Name of a valid PCAP file to write the output packets to. When NULL,
44 * all the output packets are dropped instead of being saved to a PCAP
47 const char *file_name;
50 /** Sink port operations. */
51 extern struct rte_swx_port_out_ops rte_swx_port_sink_ops;