The tracker's HandleUpdate method is called by the ring update routines. In addition, we add a dummy overlay for AWSVPC to make `weave (status| report)` to produce reasonable reports which includes AWS hosts connection state.
45 lines
876 B
Go
45 lines
876 B
Go
package router
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
// Interface to packet handling on the local virtual 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
|
|
}
|
|
|
|
// A function that determines how to handle locally captured packets.
|
|
type BridgeConsumer func(PacketKey) FlowOp
|
|
|
|
type NullBridge struct{}
|
|
|
|
func (NullBridge) InjectPacket(PacketKey) FlowOp {
|
|
return nil
|
|
}
|
|
|
|
func (NullBridge) StartConsumingPackets(BridgeConsumer) error {
|
|
return nil
|
|
}
|
|
|
|
func (NullBridge) Interface() *net.Interface {
|
|
return nil
|
|
}
|
|
|
|
func (NullBridge) String() string {
|
|
return "no overlay bridge"
|
|
}
|
|
|
|
func (NullBridge) Stats() map[string]int {
|
|
return nil
|
|
}
|