gvisor

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

github.com/google/gvisor/pkg/tcpip/link/fdbased/mmap.go only support linux,amd64 linux,arm64 so add build tag for fdbased

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(o *device.Opt) (netapi.Accepter, error)

func Open added in v0.3.4

func Open(sc netlink.TunScheme, driver listener.TunEndpointDriver, mtu int) (_ stack.LinkEndpoint, err error)

Types

type Endpoint

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

Endpoint is link layer endpoint that stores outbound packets in a channel and allows injection of inbound packets.

func NewEndpoint

func NewEndpoint(w netlink.Tun) *Endpoint

New creates a new channel endpoint.

func (*Endpoint) ARPHardwareType

func (*Endpoint) ARPHardwareType() header.ARPHardwareType

ARPHardwareType implements stack.LinkEndpoint.ARPHardwareType.

func (*Endpoint) AddHeader

func (*Endpoint) AddHeader(*stack.PacketBuffer)

AddHeader implements stack.LinkEndpoint.AddHeader.

func (*Endpoint) Attach

func (e *Endpoint) Attach(dispatcher stack.NetworkDispatcher)

Attach saves the stack network-layer dispatcher for use later when packets are injected.

func (*Endpoint) Capabilities

func (e *Endpoint) Capabilities() stack.LinkEndpointCapabilities

Capabilities implements stack.LinkEndpoint.Capabilities.

func (*Endpoint) Close

func (e *Endpoint) Close()

Close closes e. Further packet injections will return an error, and all pending packets are discarded. Close may be called concurrently with WritePackets.

func (*Endpoint) Forward added in v0.3.6

func (e *Endpoint) Forward()

func (*Endpoint) GSOMaxSize added in v0.3.6

func (e *Endpoint) GSOMaxSize() uint32

func (*Endpoint) IsAttached

func (e *Endpoint) IsAttached() bool

IsAttached implements stack.LinkEndpoint.IsAttached.

func (*Endpoint) LinkAddress

func (e *Endpoint) LinkAddress() tcpip.LinkAddress

LinkAddress returns the link address of this endpoint.

func (*Endpoint) MTU

func (e *Endpoint) MTU() uint32

MTU implements stack.LinkEndpoint.MTU. It returns the value initialized during construction.

func (*Endpoint) MaxHeaderLength

func (*Endpoint) MaxHeaderLength() uint16

MaxHeaderLength returns the maximum size of the link layer header. Given it doesn't have a header, it just returns 0.

func (*Endpoint) ParseHeader

func (*Endpoint) ParseHeader(*stack.PacketBuffer) bool

ParseHeader implements stack.LinkEndpoint.ParseHeader.

func (*Endpoint) SetLinkAddress added in v0.3.6

func (e *Endpoint) SetLinkAddress(addr tcpip.LinkAddress)

func (*Endpoint) SetMTU added in v0.3.6

func (e *Endpoint) SetMTU(mtu uint32)

func (*Endpoint) SetOnCloseAction added in v0.3.6

func (e *Endpoint) SetOnCloseAction(func())

func (*Endpoint) SupportedGSO added in v0.3.6

func (e *Endpoint) SupportedGSO() stack.SupportedGSO

SupportedGSO returns the supported segmentation offloading.

func (*Endpoint) Wait

func (e *Endpoint) Wait()

Wait implements stack.LinkEndpoint.Wait.

func (*Endpoint) WritePackets

func (e *Endpoint) WritePackets(pkts stack.PacketBufferList) (int, tcpip.Error)

WritePackets stores outbound packets into the channel. Multiple concurrent calls are permitted.

func (*Endpoint) Writer added in v0.3.4

func (e *Endpoint) Writer() netlink.Tun

Jump to

Keyboard shortcuts

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