Documentation ¶
Overview ¶
Package wireguard manages user-space Wireguard interface.
Index ¶
Constants ¶
View Source
const PeerDownInterval = (180 + 5 + 90) * time.Second
PeerDownInterval is the time since last handshake when established peer is considered to be down.
WG whitepaper defines a downed peer as being: Handshake Timeout (180s) + Rekey Timeout (5s) + Rekey Attempt Timeout (90s)
This interval is applied when the link is already established.
Variables ¶
This section is empty.
Functions ¶
func NetworkPrefix ¶
NetworkPrefix returns IPv6 prefix for the SideroLink.
Server is using the first address in the block. Nodes are using random addresses from the /64 space.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device manages Wireguard link.
func NewDevice ¶
func NewDevice(address netaddr.IPPrefix, privateKey wgtypes.Key, listenPort uint16) (*Device, error)
NewDevice creates a new device with settings.
type PeerSource ¶
type PeerSource interface {
EventCh() <-chan PeerEvent
}
PeerSource is the interface of the "database" providing SideroLink peer information.
Click to show internal directories.
Click to hide internal directories.