gvisorgvisor.dev/gvisor/pkg/tcpip/link/nested Index | Files

package nested

import "gvisor.dev/gvisor/pkg/tcpip/link/nested"

Package nested provides helpers to implement the pattern of nested stack.LinkEndpoints.

Index

Types

type Endpoint

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

Endpoint is a wrapper around stack.LinkEndpoint and stack.NetworkDispatcher that can be used to implement nesting safely by providing lifecycle concurrency guards.

See the tests in this package for example usage.

+stateify savable

func (*Endpoint) ARPHardwareType

func (e *Endpoint) ARPHardwareType() header.ARPHardwareType

ARPHardwareType implements stack.LinkEndpoint.ARPHardwareType

func (*Endpoint) AddHeader

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

AddHeader implements stack.LinkEndpoint.AddHeader.

func (*Endpoint) Attach

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

Attach implements stack.LinkEndpoint.

func (*Endpoint) Capabilities

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

Capabilities implements stack.LinkEndpoint.

func (*Endpoint) Child

func (e *Endpoint) Child() stack.LinkEndpoint

Child returns the child endpoint.

func (*Endpoint) Close

func (e *Endpoint) Close()

Close implements stack.LinkEndpoint.

func (*Endpoint) DeliverLinkPacket

func (e *Endpoint) DeliverLinkPacket(protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)

DeliverLinkPacket implements stack.NetworkDispatcher.

func (*Endpoint) DeliverNetworkPacket

func (e *Endpoint) DeliverNetworkPacket(protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)

DeliverNetworkPacket implements stack.NetworkDispatcher.

func (*Endpoint) GSOMaxSize

func (e *Endpoint) GSOMaxSize() uint32

GSOMaxSize implements stack.GSOEndpoint.

func (*Endpoint) Init

func (e *Endpoint) Init(child stack.LinkEndpoint, embedder stack.NetworkDispatcher)

Init initializes a nested.Endpoint that uses embedder as the dispatcher for child on Attach.

See the tests in this package for example usage.

func (*Endpoint) IsAttached

func (e *Endpoint) IsAttached() bool

IsAttached implements stack.LinkEndpoint.

func (*Endpoint) LinkAddress

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

LinkAddress implements stack.LinkEndpoint.

func (*Endpoint) MTU

func (e *Endpoint) MTU() uint32

MTU implements stack.LinkEndpoint.

func (*Endpoint) MaxHeaderLength

func (e *Endpoint) MaxHeaderLength() uint16

MaxHeaderLength implements stack.LinkEndpoint.

func (*Endpoint) ParseHeader

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

ParseHeader implements stack.LinkEndpoint.ParseHeader.

func (*Endpoint) SetLinkAddress

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

SetLinkAddress implements stack.LinkEndpoint.SetLinkAddress.

func (*Endpoint) SetMTU

func (e *Endpoint) SetMTU(mtu uint32)

SetMTU implements stack.LinkEndpoint.

func (*Endpoint) SetOnCloseAction

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

SetOnCloseAction implement stack.LinkEndpoints.

func (*Endpoint) SupportedGSO

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

SupportedGSO implements stack.GSOEndpoint.

func (*Endpoint) Wait

func (e *Endpoint) Wait()

Wait implements stack.LinkEndpoint.

func (*Endpoint) WritePackets

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

WritePackets implements stack.LinkEndpoint.

Source Files

nested.go

Version
v0.0.0-20250515200445-d30c58e5b8a4 (latest)
Published
May 15, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
12 hours ago

Tools for package owners.