Using the Ring CRDT and Weave gossip, provides an interface for the weave script to allocate IP addresses in `weave run`, `weave start` and `weave expose`. See docs/ipam.md for implementation details, and site/features.md for user-visible changes.
29 lines
453 B
Go
29 lines
453 B
Go
package router
|
|
|
|
const (
|
|
Protocol = "weave"
|
|
ProtocolVersion = 102
|
|
)
|
|
|
|
type ProtocolTag byte
|
|
|
|
const (
|
|
ProtocolHeartbeat ProtocolTag = iota
|
|
ProtocolConnectionEstablished
|
|
ProtocolFragmentationReceived
|
|
ProtocolStartFragmentationTest
|
|
ProtocolPMTUVerified
|
|
ProtocolGossip
|
|
ProtocolGossipUnicast
|
|
ProtocolGossipBroadcast
|
|
)
|
|
|
|
type ProtocolMsg struct {
|
|
tag ProtocolTag
|
|
msg []byte
|
|
}
|
|
|
|
type ProtocolSender interface {
|
|
SendProtocolMsg(m ProtocolMsg)
|
|
}
|