Documentation ¶
Overview ¶
Package nested provides helpers to implement the pattern of nested stack.LinkEndpoints.
Index ¶
- type Endpoint
- func (e *Endpoint) ARPHardwareType() header.ARPHardwareType
- func (e *Endpoint) AddHeader(local, remote tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, ...)
- func (e *Endpoint) Attach(dispatcher stack.NetworkDispatcher)
- func (e *Endpoint) Capabilities() stack.LinkEndpointCapabilities
- func (e *Endpoint) DeliverNetworkPacket(remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, ...)
- func (e *Endpoint) GSOMaxSize() uint32
- func (e *Endpoint) Init(child stack.LinkEndpoint, embedder stack.NetworkDispatcher)
- func (e *Endpoint) IsAttached() bool
- func (e *Endpoint) LinkAddress() tcpip.LinkAddress
- func (e *Endpoint) MTU() uint32
- func (e *Endpoint) MaxHeaderLength() uint16
- func (e *Endpoint) SupportedGSO() stack.SupportedGSO
- func (e *Endpoint) Wait()
- func (e *Endpoint) WritePackets(r stack.RouteInfo, pkts stack.PacketBufferList, ...) (int, tcpip.Error)
- func (e *Endpoint) WriteRawPacket(pkt *stack.PacketBuffer) tcpip.Error
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 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.
func (*Endpoint) ARPHardwareType ¶
func (e *Endpoint) ARPHardwareType() header.ARPHardwareType
ARPHardwareType implements stack.LinkEndpoint.ARPHardwareType
func (*Endpoint) AddHeader ¶
func (e *Endpoint) AddHeader(local, remote tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, 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) DeliverNetworkPacket ¶
func (e *Endpoint) DeliverNetworkPacket(remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
DeliverNetworkPacket implements stack.NetworkDispatcher.
func (*Endpoint) GSOMaxSize ¶
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 ¶
IsAttached implements stack.LinkEndpoint.
func (*Endpoint) LinkAddress ¶
func (e *Endpoint) LinkAddress() tcpip.LinkAddress
LinkAddress implements stack.LinkEndpoint.
func (*Endpoint) MaxHeaderLength ¶
MaxHeaderLength implements stack.LinkEndpoint.
func (*Endpoint) SupportedGSO ¶
func (e *Endpoint) SupportedGSO() stack.SupportedGSO
SupportedGSO implements stack.GSOEndpoint.
func (*Endpoint) WritePackets ¶
func (e *Endpoint) WritePackets(r stack.RouteInfo, pkts stack.PacketBufferList, protocol tcpip.NetworkProtocolNumber) (int, tcpip.Error)
WritePackets implements stack.LinkEndpoint.
func (*Endpoint) WriteRawPacket ¶
func (e *Endpoint) WriteRawPacket(pkt *stack.PacketBuffer) tcpip.Error
WriteRawPacket implements stack.LinkEndpoint.