Documentation ¶
Overview ¶
link/bridge implements a bridging LinkEndpoint It can be writable.
Index ¶
- type BridgeableEndpoint
- type Endpoint
- func (e *Endpoint) ARPHardwareType() header.ARPHardwareType
- func (e *Endpoint) AddHeader(local, remote tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, ...)
- func (ep *Endpoint) Attach(d stack.NetworkDispatcher)
- func (ep *Endpoint) Capabilities() stack.LinkEndpointCapabilities
- func (ep *Endpoint) DeliverNetworkPacketToBridge(rxEP *BridgeableEndpoint, srcLinkAddr, dstLinkAddr tcpip.LinkAddress, ...)
- func (*Endpoint) DeviceClass() network.DeviceClass
- func (*Endpoint) Down() error
- func (ep *Endpoint) IsAttached() bool
- func (ep *Endpoint) LinkAddress() tcpip.LinkAddress
- func (ep *Endpoint) MTU() uint32
- func (ep *Endpoint) MaxHeaderLength() uint16
- func (*Endpoint) SetPromiscuousMode(bool) error
- func (*Endpoint) Up() error
- func (*Endpoint) Wait()
- func (ep *Endpoint) WritePacket(r stack.RouteInfo, protocol tcpip.NetworkProtocolNumber, ...) tcpip.Error
- func (ep *Endpoint) WritePackets(r stack.RouteInfo, pkts stack.PacketBufferList, ...) (int, tcpip.Error)
- func (ep *Endpoint) WriteRawPacket(pkt *stack.PacketBuffer) tcpip.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeableEndpoint ¶
func NewEndpoint ¶
func NewEndpoint(lower stack.LinkEndpoint) *BridgeableEndpoint
func (*BridgeableEndpoint) DeliverNetworkPacket ¶
func (e *BridgeableEndpoint) DeliverNetworkPacket(src, dst tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
func (*BridgeableEndpoint) IsBridged ¶
func (e *BridgeableEndpoint) IsBridged() bool
func (*BridgeableEndpoint) SetBridge ¶
func (e *BridgeableEndpoint) SetBridge(b *Endpoint)
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func New ¶
func New(links []*BridgeableEndpoint) (*Endpoint, error)
New creates a new link from a list of BridgeableEndpoints that bridges packets written to it and received from any of its constituent links.
`links` must be non-empty, as properties of the new link are derived from the constituent links: it will have the minimum of the MTUs, the maximum of the max header lengths, and the minimum set of capabilities.
func (*Endpoint) ARPHardwareType ¶
func (e *Endpoint) ARPHardwareType() header.ARPHardwareType
ARPHardwareType implements stack.LinkEndpoint.
func (*Endpoint) AddHeader ¶
func (e *Endpoint) AddHeader(local, remote tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
AddHeader implements stack.LinkEndpoint.
func (*Endpoint) Attach ¶
func (ep *Endpoint) Attach(d stack.NetworkDispatcher)
func (*Endpoint) Capabilities ¶
func (ep *Endpoint) Capabilities() stack.LinkEndpointCapabilities
func (*Endpoint) DeliverNetworkPacketToBridge ¶
func (ep *Endpoint) DeliverNetworkPacketToBridge(rxEP *BridgeableEndpoint, srcLinkAddr, dstLinkAddr tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
DeliverNetworkPacketToBridge delivers a network packet to the bridged network.
Endpoint does not implement stack.NetworkEndpoint.DeliverNetworkPacket because we need to know which BridgeableEndpoint the packet was delivered from to prevent packet loops.
func (*Endpoint) DeviceClass ¶
func (*Endpoint) DeviceClass() network.DeviceClass
func (*Endpoint) Down ¶
TODO(https://fxbug.dev/86388): Implement disabling the bridge.
func (*Endpoint) IsAttached ¶
func (*Endpoint) LinkAddress ¶
func (ep *Endpoint) LinkAddress() tcpip.LinkAddress
func (*Endpoint) MaxHeaderLength ¶
func (*Endpoint) SetPromiscuousMode ¶
SetPromiscuousMode on a bridge is a no-op, since all of the constituent links on a bridge need to already be in promiscuous mode for bridging to work.
func (*Endpoint) WritePacket ¶
func (ep *Endpoint) WritePacket(r stack.RouteInfo, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer) tcpip.Error
func (*Endpoint) WritePackets ¶
func (ep *Endpoint) WritePackets(r stack.RouteInfo, pkts stack.PacketBufferList, protocol tcpip.NetworkProtocolNumber) (int, tcpip.Error)
WritePackets returns the number of packets in hdrs that were successfully written to all links.
func (*Endpoint) WriteRawPacket ¶
func (ep *Endpoint) WriteRawPacket(pkt *stack.PacketBuffer) tcpip.Error