tunnel

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumQueues

func NumQueues(link netlink.Link) (int, error)

Types

type Handler

type Handler interface {
	// PhyToVirt converts a physical frame to a virtual frame typically by performing decapsulation.
	// Returns the length of the resulting virtual frame.
	PhyToVirt(phyFrame, virtFrame []byte) int
	// VirtToPhy converts a virtual frame to a physical frame typically by performing encapsulation.
	// Returns the length of the resulting physical frame.
	VirtToPhy(virtFrame, phyFrame []byte) (length int, loopback bool)
}

Decapsulate and encapsulate frames between physical and virtual interfaces.

type Tunnel

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

Tunnel splices frames between a physical and a virtual interface using XDP sockets. It uses a handler to convert frames between the two interfaces.

func NewTunnel

func NewTunnel(phyName, virtName string, phyFilter *xdp.Program, handler Handler, pcapWriter *pcapgo.Writer) (*Tunnel, error)

func (*Tunnel) Close

func (t *Tunnel) Close() (err error)

func (*Tunnel) Start

func (t *Tunnel) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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