net/sockstats: remove explicit dependency on wgengine/monitor

Followup to #7177 to avoid adding extra dependencies to the CLI. We
instead declare an interface for the link monitor.

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:
Mihai Parparita
2023-03-03 08:37:14 -08:00
committed by GitHub
parent 7b73c9628d
commit 3e71e0ef68
7 changed files with 22 additions and 20 deletions

View File

@@ -353,6 +353,12 @@ func (s *State) String() string {
return sb.String()
}
// ChangeFunc is a callback function (usually registered with
// wgengine/monitor's Mon) that's called when the network
// changed. The changed parameter is whether the network changed
// enough for State to have changed since the last callback.
type ChangeFunc func(changed bool, state *State)
// An InterfaceFilter indicates whether EqualFiltered should use i when deciding whether two States are equal.
// ips are all the IPPrefixes associated with i.
type InterfaceFilter func(i Interface, ips []netip.Prefix) bool