feat: add option to speedtest to dump a pcap of network traffic (#11848)

This commit is contained in:
Colin Adler
2024-01-29 09:57:31 -06:00
committed by GitHub
parent b2bc3fff33
commit bc14e926d8
4 changed files with 41 additions and 0 deletions
+7
View File
@@ -30,6 +30,7 @@ import (
tslogger "tailscale.com/types/logger"
"tailscale.com/types/netlogtype"
"tailscale.com/wgengine"
"tailscale.com/wgengine/capture"
"tailscale.com/wgengine/magicsock"
"tailscale.com/wgengine/netstack"
"tailscale.com/wgengine/router"
@@ -310,6 +311,12 @@ type Conn struct {
trafficStats *connstats.Statistics
}
func (c *Conn) InstallCaptureHook(f capture.Callback) {
c.mutex.Lock()
defer c.mutex.Unlock()
c.wireguardEngine.InstallCaptureHook(f)
}
func (c *Conn) MagicsockSetDebugLoggingEnabled(enabled bool) {
c.magicConn.SetDebugLoggingEnabled(enabled)
}