packetmmap

package
v0.0.0-...-f9b03d3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Overview

Package packetmmap contains the packet mmap implementation for netstack.

See https://docs.kernel.org/networking/packet_mmap.html for a full description of the PACKET_MMAP interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

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

Endpoint is a memmap.Mappable implementation for stack.PacketMMapEndpoint. It implements the PACKET_MMAP interface as described in https://docs.kernel.org/networking/packet_mmap.html.

+stateify savable

func (*Endpoint) AddMapping

func (m *Endpoint) AddMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, offset uint64, writable bool) error

AddMapping implements memmap.Mappable.AddMapping.

func (*Endpoint) Close

func (m *Endpoint) Close()

Close implements stack.PacketMMapEndpoint.Close.

func (*Endpoint) ConfigureMMap

func (m *Endpoint) ConfigureMMap(ctx context.Context, opts *memmap.MMapOpts) error

ConfigureMMap implements vfs.FileDescriptionImpl.ConfigureMMap.

func (*Endpoint) CopyMapping

func (m *Endpoint) CopyMapping(ctx context.Context, ms memmap.MappingSpace, srcAR, dstAR hostarch.AddrRange, offset uint64, writable bool) error

CopyMapping implements memmap.Mappable.CopyMapping.

func (*Endpoint) HandlePacket

func (m *Endpoint) HandlePacket(nicID tcpip.NICID, netProto tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)

HandlePacket implements stack.PacketMMapEndpoint.HandlePacket.

func (*Endpoint) Init

func (m *Endpoint) Init(ctx context.Context, opts stack.PacketMMapOpts) error

Init initializes the endpoint. It is called when the endpoint is created during setsockopt(PACKET_(RX|TX)_RING) with the options retrieved from its corresponding packet socket.

func (*Endpoint) InvalidateUnsavable

func (*Endpoint) InvalidateUnsavable(context.Context) error

InvalidateUnsavable implements memmap.Mappable.InvalidateUnsavable.

func (*Endpoint) Mapped

func (m *Endpoint) Mapped() bool

Mapped returns whether the endpoint has been mapped.

func (*Endpoint) Readiness

func (m *Endpoint) Readiness(mask waiter.EventMask) waiter.EventMask

Readiness implements stack.PacketMmapEndpoint.Readiness.

func (*Endpoint) RemoveMapping

func (m *Endpoint) RemoveMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, offset uint64, writable bool)

RemoveMapping implements memmap.Mappable.RemoveMapping.

func (*Endpoint) Translate

func (m *Endpoint) Translate(ctx context.Context, required, optional memmap.MappableRange, at hostarch.AccessType) ([]memmap.Translation, error)

Translate implements memmap.Mappable.Translate.

Jump to

Keyboard shortcuts

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