Conn is an actively listening Wireguard connection.
| 439 | |
| 440 | // Conn is an actively listening Wireguard connection. |
| 441 | type Conn struct { |
| 442 | // Unique ID used for telemetry. |
| 443 | id uuid.UUID |
| 444 | mutex sync.Mutex |
| 445 | closed chan struct{} |
| 446 | logger slog.Logger |
| 447 | |
| 448 | dialer *tsdial.Dialer |
| 449 | tunDevice *tstun.Wrapper |
| 450 | configMaps *configMaps |
| 451 | nodeUpdater *nodeUpdater |
| 452 | netStack *netstack.Impl |
| 453 | magicConn *magicsock.Conn |
| 454 | wireguardMonitor *netmon.Monitor |
| 455 | wireguardRouter *router.Config |
| 456 | wireguardEngine wgengine.Engine |
| 457 | dnsConfigurator dns.OSConfigurator |
| 458 | listeners map[listenKey]*listener |
| 459 | clientType proto.TelemetryEvent_ClientType |
| 460 | createdAt time.Time |
| 461 | |
| 462 | telemetrySink TelemetrySink |
| 463 | // telemetryStore will be nil if telemetrySink is nil. |
| 464 | telemetryStore *TelemetryStore |
| 465 | telemetryWg sync.WaitGroup |
| 466 | |
| 467 | watchCtx context.Context |
| 468 | watchCancel func() |
| 469 | |
| 470 | trafficStats *connstats.Statistics |
| 471 | lastNetInfo *tailcfg.NetInfo |
| 472 | } |
| 473 | |
| 474 | func (c *Conn) GetNetInfo() *tailcfg.NetInfo { |
| 475 | c.mutex.Lock() |
nothing calls this directly
no outgoing calls
no test coverage detected