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:
Daniel Redetzke
2026-10-04 14:28:44 +03:00
parent b0be0b0ceb
commit 7391aac429
14 changed files with 737 additions and 33 deletions
+4
View File
@@ -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
}