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

package ethernet

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

Package ethernet provides an implementation of an ethernet link endpoint that wraps an inner link endpoint.

Index

Types

type Endpoint

type Endpoint struct {
	nested.Endpoint
}

Endpoint is an ethernet endpoint.

It adds an ethernet header to packets before sending them out through its inner link endpoint and consumes an ethernet header before sending the packet to the stack.

+stateify savable

func New

func New(ep stack.LinkEndpoint) *Endpoint

New returns an ethernet link endpoint that wraps an inner link endpoint.

func (*Endpoint) ARPHardwareType

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

ARPHardwareType implements stack.LinkEndpoint.

func (*Endpoint) AddHeader

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

AddHeader implements stack.LinkEndpoint.

func (*Endpoint) Capabilities

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

Capabilities implements stack.LinkEndpoint.

func (*Endpoint) DeliverNetworkPacket

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

DeliverNetworkPacket implements stack.NetworkDispatcher.

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 (*Endpoint) ParseHeader(pkt *stack.PacketBuffer) bool

ParseHeader implements stack.LinkEndpoint.

Source Files

ethernet.go

Version
v0.0.0-20250605235530-a6711d1e1dc6 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
4 hours ago

Tools for package owners.