sourcesink

package
v0.0.0-...-8fa78e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

type Sink struct {
	*device.Device
	// contains filtered or unexported fields
}

Sink represents a Sink device

func (*Sink) BindToPipelineInputPort

func (s *Sink) BindToPipelineInputPort(pl *pipeline.Pipeline, portID int, rxq uint16, bsz uint) error

bind to given pipeline input port

func (*Sink) BindToPipelineOutputPort

func (s *Sink) BindToPipelineOutputPort(pl *pipeline.Pipeline, portID int, txq uint16, bsz uint) error

bind to given pipeline output port

func (*Sink) Free

func (s *Sink) Free() error

Free deletes the current Sink record and calls the clean callback function given at init

func (*Sink) Init

func (s *Sink) Init(name string, params *SinkParams, clean func()) error

Create and initialize Sink device

type SinkParams

type SinkParams struct {
	// Name of a valid PCAP file to write the output packets to. When NULL, all the output packets are dropped instead
	// of being saved to a PCAP file.
	FileName string
}

type Source

type Source struct {
	*device.Device
	// contains filtered or unexported fields
}

Source represents a Source device

func (*Source) BindToPipelineInputPort

func (s *Source) BindToPipelineInputPort(pl *pipeline.Pipeline, portID int, rxq uint16, bsz uint) error

bind to given pipeline input port

func (*Source) BindToPipelineOutputPort

func (s *Source) BindToPipelineOutputPort(pl *pipeline.Pipeline, portID int, txq uint16, bsz uint) error

bind to given pipeline output port

func (*Source) Free

func (s *Source) Free() error

Free deletes the current Sink record and calls the clean callback function given at init

func (*Source) Init

func (s *Source) Init(name string, params *SourceParams, clean func()) error

Create and initialize Source device

type SourceParams

type SourceParams struct {
	// Name of a valid PCAP file to read the input packets from.
	FileName string
	// Number of times to loop through the input PCAP file. Loop infinite times when set to 0.
	NLoops uint64
	// Maximum number of packets to read from the PCAP file. When 0, it is internally set to RTE_SWX_PORT_SOURCE_PKTS_MAX.
	// Once read from the PCAP file, the same packets are looped forever.
	NPktsMax uint32
	// Pktmbuf packet buffer pool. Must be valid.
	Pktmbuf *pktmbuf.Pktmbuf
}

type SwxPortSinkParams

type SwxPortSinkParams struct {
	// contains filtered or unexported fields
}

func (*SwxPortSinkParams) FreeParams

func (e *SwxPortSinkParams) FreeParams()

func (*SwxPortSinkParams) GetReaderParams

func (e *SwxPortSinkParams) GetReaderParams() unsafe.Pointer

func (*SwxPortSinkParams) GetWriterParams

func (e *SwxPortSinkParams) GetWriterParams() unsafe.Pointer

func (*SwxPortSinkParams) PortName

func (e *SwxPortSinkParams) PortName() string

func (*SwxPortSinkParams) PortType

func (e *SwxPortSinkParams) PortType() string

type SwxPortSourceParams

type SwxPortSourceParams struct {
	// contains filtered or unexported fields
}

func (*SwxPortSourceParams) FreeParams

func (e *SwxPortSourceParams) FreeParams()

func (*SwxPortSourceParams) GetReaderParams

func (e *SwxPortSourceParams) GetReaderParams() unsafe.Pointer

func (*SwxPortSourceParams) GetWriterParams

func (e *SwxPortSourceParams) GetWriterParams() unsafe.Pointer

func (*SwxPortSourceParams) PortName

func (e *SwxPortSourceParams) PortName() string

func (*SwxPortSourceParams) PortType

func (e *SwxPortSourceParams) PortType() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL