func (wr *Sink) CreateTx(socket int) (*Tx, error) {
	tx := &Tx{ops: &C.rte_port_sink_ops}
	params := &C.struct_rte_port_sink_params{
		max_n_pkts: C.uint32_t(wr.MaxPackets),
	}
	if wr.Filename != "" {
		params.file_name = (*C.char)(C.CString(wr.Filename))
		defer C.free(unsafe.Pointer(params.file_name))
	}
	return tx, tx.doCreate(socket, unsafe.Pointer(params))
}
CreateTx implements TxFactory interface.
package port
import "C"
import (
	"unsafe"
	"github.com/yerden/go-dpdk/mempool"
)
var _ = []RxFactory{
	&Source{},
}
var _ = []TxFactory{
	&Sink{},
}
type Source struct {
	*mempool.Mempool
	Filename string
	BytesPerPacket uint32
}
func (rd *Source) CreateRx(socket int) (*Rx, error) {
	rx := &Rx{ops: &C.rte_port_source_ops}
	params := &C.struct_rte_port_source_params{
		mempool:         (*C.struct_rte_mempool)(unsafe.Pointer(rd.Mempool)),
		n_bytes_per_pkt: C.uint32_t(rd.BytesPerPacket),
	}
	if rd.Filename != "" {
		params.file_name = (*C.char)(C.CString(rd.Filename))
		defer C.free(unsafe.Pointer(params.file_name))
	}
	return rx, rx.doCreate(socket, unsafe.Pointer(params))
}
type Sink struct {
	Filename string
	MaxPackets uint32
}