Documentation ¶
Index ¶
- Constants
- func PosixError(err error) error
- type AWSVPC
- func (vpc AWSVPC) AddFeaturesTo(features map[string]string)
- func (vpc AWSVPC) Diagnostics() interface{}
- func (vpc AWSVPC) InvalidateRoutes()
- func (vpc AWSVPC) InvalidateShortIDs()
- func (vpc AWSVPC) PrepareConnection(params mesh.OverlayConnectionParams) (mesh.OverlayConnection, error)
- func (vpc AWSVPC) StartConsumingPackets(localPeer *mesh.Peer, peers *mesh.Peers, consumer OverlayConsumer) error
- type AWSVPCConnection
- func (conn *AWSVPCConnection) Confirm()
- func (conn *AWSVPCConnection) ControlMessage(tag byte, msg []byte)
- func (conn *AWSVPCConnection) DisplayName() string
- func (conn *AWSVPCConnection) ErrorChannel() <-chan error
- func (conn *AWSVPCConnection) EstablishedChannel() <-chan struct{}
- func (conn *AWSVPCConnection) Forward(key ForwardPacketKey) FlowOp
- func (conn *AWSVPCConnection) Stop()
- type Bridge
- type BridgeConsumer
- type Decryptor
- type DiscardingFlowOp
- type Encryptor
- type EthernetDecoder
- type FastDPMetrics
- type FastDPStatus
- type FastDatapath
- func (fastdp *FastDatapath) Bridge() Bridge
- func (fastdp *FastDatapath) Close() error
- func (fastdp *FastDatapath) Error(err error, stopped bool)
- func (fastdp *FastDatapath) Miss(packet []byte, fks odp.FlowKeys) error
- func (fastdp *FastDatapath) Overlay() NetworkOverlay
- func (fastdp *FastDatapath) VportCreated(dpid odp.DatapathID, vport odp.Vport) error
- func (fastdp *FastDatapath) VportDeleted(dpid odp.DatapathID, vport odp.Vport) error
- type FlowOp
- type FlowStatus
- type ForwardPacketKey
- type FrameConsumer
- type MAC
- type MACStatus
- type MacCache
- type MacCacheEntry
- type MultiFlowOp
- type NaClDecryptor
- type NaClDecryptorInstance
- type NaClEncryptor
- type NetworkConfig
- type NetworkOverlay
- type NetworkRouter
- func (router *NetworkRouter) CreateRestartSentinel() error
- func (router *NetworkRouter) ForgetConnections(peers []string)
- func (router *NetworkRouter) HandleHTTP(muxRouter *mux.Router)
- func (router *NetworkRouter) InitialPeers(resume bool, peers []string) ([]string, error)
- func (router *NetworkRouter) InitiateConnections(peers []string, replace bool) []error
- func (router *NetworkRouter) Start()
- type NetworkRouterStatus
- type NonDecryptor
- type NonDiscardingFlowOp
- type NonEncryptor
- type NullBridge
- type NullNetworkOverlay
- type OverlayConsumer
- type OverlayForwarder
- type OverlaySwitch
- func (osw *OverlaySwitch) Add(name string, overlay NetworkOverlay)
- func (osw *OverlaySwitch) AddFeaturesTo(features map[string]string)
- func (osw *OverlaySwitch) Diagnostics() interface{}
- func (osw *OverlaySwitch) InvalidateRoutes()
- func (osw *OverlaySwitch) InvalidateShortIDs()
- func (osw *OverlaySwitch) PrepareConnection(params mesh.OverlayConnectionParams) (mesh.OverlayConnection, error)
- func (osw *OverlaySwitch) SetCompatOverlay(overlay NetworkOverlay)
- func (osw *OverlaySwitch) StartConsumingPackets(localPeer *mesh.Peer, peers *mesh.Peers, consumer OverlayConsumer) error
- type PacketDecodingError
- type PacketKey
- type PacketLogging
- type Pcap
- type SleeveOverlay
- func (*SleeveOverlay) AddFeaturesTo(map[string]string)
- func (*SleeveOverlay) Diagnostics() interface{}
- func (*SleeveOverlay) InvalidateRoutes()
- func (*SleeveOverlay) InvalidateShortIDs()
- func (sleeve *SleeveOverlay) PrepareConnection(params mesh.OverlayConnectionParams) (mesh.OverlayConnection, error)
- func (sleeve *SleeveOverlay) StartConsumingPackets(localPeer *mesh.Peer, peers *mesh.Peers, consumer OverlayConsumer) error
- type VportStatus
Constants ¶
View Source
const ( ChannelSize = 16 MaxUDPPacketSize = 65535 FastHeartbeat = 500 * time.Millisecond SlowHeartbeat = 10 * time.Second MaxMissedHeartbeats = 6 HeartbeatTimeout = MaxMissedHeartbeats * SlowHeartbeat MaxDuration = time.Duration(math.MaxInt64) NameSize = mesh.NameSize )
View Source
const ( EthernetOverhead = 14 UDPOverhead = 28 // 20 bytes for IPv4, 8 bytes for UDP DefaultMTU = 65535 FragTestSize = 60001 PMTUDiscoverySize = 60000 FragTestInterval = 5 * time.Minute MTUVerifyAttempts = 8 MTUVerifyTimeout = 10 * time.Millisecond // doubled with each attempt ProtocolConnectionEstablished = mesh.ProtocolReserved1 ProtocolFragmentationReceived = mesh.ProtocolReserved2 ProtocolPMTUVerified = mesh.ProtocolReserved3 )
View Source
const (
FastDatapathHeartbeatAck = iota
)
View Source
const (
WindowSize = 20 // bits
)
Variables ¶
This section is empty.
Functions ¶
func PosixError ¶
Look inside an error produced by the net package to get to the syscall.Errno at the root of the problem.
Types ¶
type AWSVPC ¶
type AWSVPC struct{}
func (AWSVPC) AddFeaturesTo ¶
func (AWSVPC) Diagnostics ¶
func (vpc AWSVPC) Diagnostics() interface{}
func (AWSVPC) InvalidateRoutes ¶
func (vpc AWSVPC) InvalidateRoutes()
func (AWSVPC) InvalidateShortIDs ¶
func (vpc AWSVPC) InvalidateShortIDs()
func (AWSVPC) PrepareConnection ¶
func (vpc AWSVPC) PrepareConnection(params mesh.OverlayConnectionParams) (mesh.OverlayConnection, error)
func (AWSVPC) StartConsumingPackets ¶
type AWSVPCConnection ¶
type AWSVPCConnection struct {
// contains filtered or unexported fields
}
func (*AWSVPCConnection) Confirm ¶
func (conn *AWSVPCConnection) Confirm()
func (*AWSVPCConnection) ControlMessage ¶
func (conn *AWSVPCConnection) ControlMessage(tag byte, msg []byte)
func (*AWSVPCConnection) DisplayName ¶
func (conn *AWSVPCConnection) DisplayName() string
func (*AWSVPCConnection) ErrorChannel ¶
func (conn *AWSVPCConnection) ErrorChannel() <-chan error
func (*AWSVPCConnection) EstablishedChannel ¶
func (conn *AWSVPCConnection) EstablishedChannel() <-chan struct{}
func (*AWSVPCConnection) Forward ¶
func (conn *AWSVPCConnection) Forward(key ForwardPacketKey) FlowOp
func (*AWSVPCConnection) Stop ¶
func (conn *AWSVPCConnection) Stop()
type Bridge ¶
type Bridge interface { // Inject a packet to be delivered locally InjectPacket(PacketKey) FlowOp // Start consuming packets from the bridge. Injected packets // should not be included. StartConsumingPackets(BridgeConsumer) error Interface() *net.Interface String() string Stats() map[string]int }
Interface to packet handling on the local virtual bridge
type BridgeConsumer ¶
A function that determines how to handle locally captured packets.
type Decryptor ¶
type Decryptor interface {
IterateFrames([]byte, FrameConsumer) error
}
type DiscardingFlowOp ¶
type DiscardingFlowOp struct{}
func (DiscardingFlowOp) Discards ¶
func (DiscardingFlowOp) Discards() bool
func (DiscardingFlowOp) Process ¶
func (DiscardingFlowOp) Process([]byte, *EthernetDecoder, bool)
type EthernetDecoder ¶
type EthernetDecoder struct { Eth layers.Ethernet IP layers.IPv4 // contains filtered or unexported fields }
func NewEthernetDecoder ¶
func NewEthernetDecoder() *EthernetDecoder
func (*EthernetDecoder) DF ¶
func (dec *EthernetDecoder) DF() bool
func (*EthernetDecoder) DecodeLayers ¶
func (dec *EthernetDecoder) DecodeLayers(data []byte)
func (*EthernetDecoder) IsSpecial ¶
func (dec *EthernetDecoder) IsSpecial() bool
func (*EthernetDecoder) PacketKey ¶
func (dec *EthernetDecoder) PacketKey() (key PacketKey)
type FastDPMetrics ¶
type FastDPStatus ¶
type FastDPStatus struct { Vports []VportStatus Flows []FlowStatus }
func (FastDPStatus) Metrics ¶
func (s FastDPStatus) Metrics() interface{}
type FastDatapath ¶
type FastDatapath struct {
// contains filtered or unexported fields
}
func NewFastDatapath ¶
func NewFastDatapath(iface *net.Interface, port int) (*FastDatapath, error)
func (*FastDatapath) Bridge ¶
func (fastdp *FastDatapath) Bridge() Bridge
func (*FastDatapath) Close ¶
func (fastdp *FastDatapath) Close() error
func (*FastDatapath) Error ¶
func (fastdp *FastDatapath) Error(err error, stopped bool)
func (*FastDatapath) Overlay ¶
func (fastdp *FastDatapath) Overlay() NetworkOverlay
func (*FastDatapath) VportCreated ¶
func (fastdp *FastDatapath) VportCreated(dpid odp.DatapathID, vport odp.Vport) error
func (*FastDatapath) VportDeleted ¶
func (fastdp *FastDatapath) VportDeleted(dpid odp.DatapathID, vport odp.Vport) error
type FlowOp ¶
type FlowOp interface { // The caller must supply an EthernetDecoder specific to this // thread, which has already been used to decode the frame. // The broadcast parameter is a hint whether the packet is // being broadcast. Process(frame []byte, dec *EthernetDecoder, broadcast bool) // Does the FlowOp discard the packet? Discards() bool }
func FlattenFlowOp ¶
Flatten out a FlowOp to eliminate any MultiFlowOps
type FlowStatus ¶
func (*FlowStatus) MarshalJSON ¶
func (flowStatus *FlowStatus) MarshalJSON() ([]byte, error)
type ForwardPacketKey ¶
type FrameConsumer ¶
type MACStatus ¶
func NewMACStatusSlice ¶
type MacCacheEntry ¶
type MacCacheEntry struct {
// contains filtered or unexported fields
}
type MultiFlowOp ¶
type MultiFlowOp struct {
// contains filtered or unexported fields
}
func NewMultiFlowOp ¶
func NewMultiFlowOp(broadcast bool, ops ...FlowOp) *MultiFlowOp
func (*MultiFlowOp) Add ¶
func (mfop *MultiFlowOp) Add(op FlowOp)
func (*MultiFlowOp) Discards ¶
func (mfop *MultiFlowOp) Discards() bool
func (*MultiFlowOp) Process ¶
func (mfop *MultiFlowOp) Process(frame []byte, dec *EthernetDecoder, broadcast bool)
type NaClDecryptor ¶
type NaClDecryptor struct { NonDecryptor // contains filtered or unexported fields }
func NewNaClDecryptor ¶
func NewNaClDecryptor(sessionKey *[32]byte, outbound bool) *NaClDecryptor
func (*NaClDecryptor) IterateFrames ¶
func (nd *NaClDecryptor) IterateFrames(packet []byte, consumer FrameConsumer) error
type NaClDecryptorInstance ¶
type NaClDecryptorInstance struct {
// contains filtered or unexported fields
}
func NewNaClDecryptorInstance ¶
func NewNaClDecryptorInstance(outbound bool) *NaClDecryptorInstance
type NaClEncryptor ¶
type NaClEncryptor struct { NonEncryptor // contains filtered or unexported fields }
func NewNaClEncryptor ¶
func NewNaClEncryptor(prefix []byte, sessionKey *[32]byte, outbound bool, df bool) *NaClEncryptor
func (*NaClEncryptor) Bytes ¶
func (ne *NaClEncryptor) Bytes() ([]byte, error)
func (*NaClEncryptor) PacketOverhead ¶
func (ne *NaClEncryptor) PacketOverhead() int
func (*NaClEncryptor) TotalLen ¶
func (ne *NaClEncryptor) TotalLen() int
type NetworkConfig ¶
type NetworkConfig struct { BufSz int PacketLogging PacketLogging Bridge Bridge }
type NetworkOverlay ¶
type NetworkOverlay interface { mesh.Overlay // The routes have changed, so any cached information should // be discarded. InvalidateRoutes() // A mapping of a short id to a peer has changed InvalidateShortIDs() // Start consuming forwarded packets. StartConsumingPackets(*mesh.Peer, *mesh.Peers, OverlayConsumer) error }
Interface to overlay network packet handling
func NewSleeveOverlay ¶
func NewSleeveOverlay(host string, localPort int) NetworkOverlay
type NetworkRouter ¶
type NetworkRouter struct { *mesh.Router NetworkConfig Macs *MacCache // contains filtered or unexported fields }
func NewNetworkRouter ¶
func NewNetworkRouter(config mesh.Config, networkConfig NetworkConfig, name mesh.PeerName, nickName string, overlay NetworkOverlay, db db.DB) *NetworkRouter
func (*NetworkRouter) CreateRestartSentinel ¶
func (router *NetworkRouter) CreateRestartSentinel() error
func (*NetworkRouter) ForgetConnections ¶
func (router *NetworkRouter) ForgetConnections(peers []string)
func (*NetworkRouter) HandleHTTP ¶
func (router *NetworkRouter) HandleHTTP(muxRouter *mux.Router)
func (*NetworkRouter) InitialPeers ¶
func (router *NetworkRouter) InitialPeers(resume bool, peers []string) ([]string, error)
func (*NetworkRouter) InitiateConnections ¶
func (router *NetworkRouter) InitiateConnections(peers []string, replace bool) []error
func (*NetworkRouter) Start ¶
func (router *NetworkRouter) Start()
Start listening for TCP connections, locally captured packets, and forwarded packets.
type NetworkRouterStatus ¶
type NetworkRouterStatus struct { *mesh.Status Interface string CaptureStats map[string]int MACs []MACStatus }
func NewNetworkRouterStatus ¶
func NewNetworkRouterStatus(router *NetworkRouter) *NetworkRouterStatus
type NonDecryptor ¶
type NonDecryptor struct { }
func NewNonDecryptor ¶
func NewNonDecryptor() *NonDecryptor
func (*NonDecryptor) IterateFrames ¶
func (nd *NonDecryptor) IterateFrames(packet []byte, consumer FrameConsumer) error
type NonDiscardingFlowOp ¶
type NonDiscardingFlowOp struct{}
func (NonDiscardingFlowOp) Discards ¶
func (NonDiscardingFlowOp) Discards() bool
type NonEncryptor ¶
type NonEncryptor struct {
// contains filtered or unexported fields
}
func NewNonEncryptor ¶
func NewNonEncryptor(prefix []byte) *NonEncryptor
func (*NonEncryptor) AppendFrame ¶
func (ne *NonEncryptor) AppendFrame(src []byte, dst []byte, frame []byte)
func (*NonEncryptor) Bytes ¶
func (ne *NonEncryptor) Bytes() ([]byte, error)
func (*NonEncryptor) FrameOverhead ¶
func (ne *NonEncryptor) FrameOverhead() int
func (*NonEncryptor) PacketOverhead ¶
func (ne *NonEncryptor) PacketOverhead() int
func (*NonEncryptor) TotalLen ¶
func (ne *NonEncryptor) TotalLen() int
type NullBridge ¶
type NullBridge struct{}
func (NullBridge) InjectPacket ¶
func (NullBridge) InjectPacket(PacketKey) FlowOp
func (NullBridge) Interface ¶
func (NullBridge) Interface() *net.Interface
func (NullBridge) StartConsumingPackets ¶
func (NullBridge) StartConsumingPackets(BridgeConsumer) error
func (NullBridge) Stats ¶
func (NullBridge) Stats() map[string]int
func (NullBridge) String ¶
func (NullBridge) String() string
type NullNetworkOverlay ¶
type NullNetworkOverlay struct{ mesh.NullOverlay }
func (NullNetworkOverlay) Forward ¶
func (NullNetworkOverlay) Forward(ForwardPacketKey) FlowOp
func (NullNetworkOverlay) InvalidateRoutes ¶
func (NullNetworkOverlay) InvalidateRoutes()
func (NullNetworkOverlay) InvalidateShortIDs ¶
func (NullNetworkOverlay) InvalidateShortIDs()
func (NullNetworkOverlay) StartConsumingPackets ¶
func (NullNetworkOverlay) StartConsumingPackets(*mesh.Peer, *mesh.Peers, OverlayConsumer) error
type OverlayConsumer ¶
type OverlayConsumer func(ForwardPacketKey) FlowOp
When a consumer is called, the decoder will already have been used to decode the frame.
type OverlayForwarder ¶
type OverlayForwarder interface { mesh.OverlayConnection // Forward a packet across the connection. May be called as soon // as the overlay connection is created, in particular before // Confirm(). The return value nil means the key could not be // handled by this forwarder. Forward(ForwardPacketKey) FlowOp }
All of the machinery to forward packets to a particular peer
type OverlaySwitch ¶
type OverlaySwitch struct {
// contains filtered or unexported fields
}
func NewOverlaySwitch ¶
func NewOverlaySwitch() *OverlaySwitch
func (*OverlaySwitch) Add ¶
func (osw *OverlaySwitch) Add(name string, overlay NetworkOverlay)
func (*OverlaySwitch) AddFeaturesTo ¶
func (osw *OverlaySwitch) AddFeaturesTo(features map[string]string)
func (*OverlaySwitch) Diagnostics ¶
func (osw *OverlaySwitch) Diagnostics() interface{}
func (*OverlaySwitch) InvalidateRoutes ¶
func (osw *OverlaySwitch) InvalidateRoutes()
func (*OverlaySwitch) InvalidateShortIDs ¶
func (osw *OverlaySwitch) InvalidateShortIDs()
func (*OverlaySwitch) PrepareConnection ¶
func (osw *OverlaySwitch) PrepareConnection(params mesh.OverlayConnectionParams) (mesh.OverlayConnection, error)
func (*OverlaySwitch) SetCompatOverlay ¶
func (osw *OverlaySwitch) SetCompatOverlay(overlay NetworkOverlay)
func (*OverlaySwitch) StartConsumingPackets ¶
func (osw *OverlaySwitch) StartConsumingPackets(localPeer *mesh.Peer, peers *mesh.Peers, consumer OverlayConsumer) error
type PacketDecodingError ¶
type PacketDecodingError struct {
Desc string
}
func (PacketDecodingError) Error ¶
func (pde PacketDecodingError) Error() string
type PacketLogging ¶
type PacketLogging interface { LogPacket(string, PacketKey) LogForwardPacket(string, ForwardPacketKey) }
type Pcap ¶
type Pcap struct { NonDiscardingFlowOp // contains filtered or unexported fields }
func (*Pcap) InjectPacket ¶
func (*Pcap) StartConsumingPackets ¶
func (p *Pcap) StartConsumingPackets(consumer BridgeConsumer) error
type SleeveOverlay ¶
type SleeveOverlay struct {
// contains filtered or unexported fields
}
func (*SleeveOverlay) AddFeaturesTo ¶
func (*SleeveOverlay) AddFeaturesTo(map[string]string)
func (*SleeveOverlay) Diagnostics ¶
func (*SleeveOverlay) Diagnostics() interface{}
func (*SleeveOverlay) InvalidateRoutes ¶
func (*SleeveOverlay) InvalidateRoutes()
func (*SleeveOverlay) InvalidateShortIDs ¶
func (*SleeveOverlay) InvalidateShortIDs()
func (*SleeveOverlay) PrepareConnection ¶
func (sleeve *SleeveOverlay) PrepareConnection(params mesh.OverlayConnectionParams) (mesh.OverlayConnection, error)
func (*SleeveOverlay) StartConsumingPackets ¶
func (sleeve *SleeveOverlay) StartConsumingPackets(localPeer *mesh.Peer, peers *mesh.Peers, consumer OverlayConsumer) error
type VportStatus ¶
func (*VportStatus) MarshalJSON ¶
func (vport *VportStatus) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.