Documentation
¶
Overview ¶
Package netstatus holds what the setup of a network made on a node: the device it set up, the part of the network the node hands out, how the node reaches each other node of the network, and what failed. Each node records it for itself, from the decisions its setup made on what only the node knows, as its interface addresses, and publishes it in the cluster data.
Index ¶
Constants ¶
const ( ViaTunnel = "tunnel" ViaRoute = "route" ViaVXLAN = "vxlan" )
The ways a node reaches a peer of a network.
Variables ¶
var StatusData = NewData()
StatusData holds the statuses of the networks on every node the daemon knows.
Functions ¶
func Load ¶
Load returns the statuses saved in dir, by network name. A file that does not parse is skipped.
Types ¶
type Data ¶
Data holds the statuses of the networks of the cluster nodes.
type Peer ¶
type Peer struct {
// Nodename is the name of the peer node.
Nodename string `json:"nodename"`
// Local is the address of this node the network reaches the peer
// from, and Remote the address of the peer it reaches.
Local net.IP `json:"local"`
Remote net.IP `json:"remote"`
// Subnet is the part of the network the peer hands out.
Subnet string `json:"subnet"`
// Tunnel is the device of the tunnel carrying the network to the
// peer, empty when the network is routed to it.
Tunnel string `json:"tunnel"`
// TunnelMode is the mode of the tunnel, as ipip, ip6ip6 or gre,
// empty when the peer is reached by no tunnel.
TunnelMode string `json:"tunnel_mode"`
// Via says how the node reaches the peer: ViaTunnel, ViaRoute or
// ViaVXLAN.
Via string `json:"via"`
// Error is why the setup could not reach the peer, empty when it
// did.
Error string `json:"error,omitempty"`
}
Peer is another node of a network, as this node reaches it.
type Port ¶
type Port struct {
// Name is the port the configuration names.
Name string `json:"name"`
// Dev is the device enslaved: the port, or the vlan interface the
// setup created on it.
Dev string `json:"dev"`
// Error is why the setup could not enslave it, empty when it did.
Error string `json:"error,omitempty"`
}
Port is a device of the node the setup of a network enslaved, or failed to.
type Status ¶
type Status struct {
// Type is the type of the network.
Type string `json:"type"`
// Network is the address range of the network, empty for a
// network with no address, as a l2_bridge.
Network string `json:"network"`
// Dev is the device of the node the network is on, as its bridge,
// empty for a network on none.
Dev string `json:"dev,omitempty"`
// Subnet is the part of the network this node hands out, empty
// when the node hands out the whole network, or none of it.
Subnet string `json:"subnet,omitempty"`
// Peers are the other nodes of the network the node reaches
// itself, by a route or a tunnel, as the setup reached them.
Peers []Peer `json:"peers,omitempty"`
// Ports are the devices of the node the setup enslaved to the
// device of the network, as the ports of a l2_bridge.
Ports []Port `json:"ports,omitempty"`
// Skipped says why the setup left the network alone, as a
// network disabled.
Skipped string `json:"skipped,omitempty"`
// Error is the failure of the setup, empty when it succeeded.
Error string `json:"error,omitempty"`
// AppliedAt is when the setup ended, by the clock of the node.
AppliedAt time.Time `json:"applied_at"`
}
Status is what the last setup of a network made on a node.