loop

package
v0.0.0-...-9039e2f Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMTU = 1420

Variables

This section is empty.

Functions

func CreateLoop

func CreateLoop(name string, mtu int) (tun.Device, error)

CreateLoop creates a new loop device that echoes packets back

Types

type Device

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

func (*Device) BatchSize

func (d *Device) BatchSize() int

func (*Device) Close

func (d *Device) Close() error

func (*Device) Events

func (d *Device) Events() <-chan tun.Event

func (*Device) File

func (d *Device) File() *os.File

func (*Device) MTU

func (d *Device) MTU() (int, error)

func (*Device) Name

func (d *Device) Name() (string, error)

func (*Device) Read

func (d *Device) Read(bufs [][]byte, sizes []int, offset int) (n int, err error)

func (*Device) Write

func (d *Device) Write(bufs [][]byte, offset int) (int, error)

Jump to

Keyboard shortcuts

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