magicsock, wgengine, ipn, controlclient: plumb regular netchecks to map poll

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-03-03 22:21:56 -08:00
committed by Brad Fitzpatrick
parent 4cf5ac3060
commit b27d4c017a
13 changed files with 271 additions and 63 deletions

View File

@ -40,6 +40,9 @@ type Status struct {
// Exactly one of Status or error is non-nil.
type StatusCallback func(*Status, error)
// NetInfoCallback is the type used by Engine.SetNetInfoCallback.
type NetInfoCallback func(*tailcfg.NetInfo)
// RouteSettings is the full WireGuard config data (set of peers keys,
// IP, etc in wgcfg.Config) plus the things that WireGuard doesn't do
// itself, like DNS stuff.
@ -123,4 +126,8 @@ type Engine interface {
// where sending packets uses substantial power or money,
// such as mobile data on a phone.
LinkChange(isExpensive bool)
// SetNetInfoCallback sets the function to call when a
// new NetInfo summary is available.
SetNetInfoCallback(NetInfoCallback)
}