Peers: optional latency check with per-peer setting
The server pings a peer's tunnel address every 30 s and shows the median of the last 5 minutes in the peer list (with a 1-hour sparkline) and a 24-hour chart on the peer page. Off by default; "active" pings only while the device sends traffic, "always" keeps the tunnel up.
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"net/netip"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -30,6 +31,9 @@ type Kernel interface {
|
||||
Sample(iface string) ([]PeerSample, error)
|
||||
Checks(c *Config) []Check
|
||||
Uplink(c *Config, v6 bool) string
|
||||
// Ping sends one echo request to each address and returns the round-trip
|
||||
// times of the replies that came within timeout.
|
||||
Ping(dsts []netip.Addr, timeout time.Duration) (map[netip.Addr]time.Duration, error)
|
||||
Down(c *Config) error
|
||||
Close() error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user