tailscale.comtailscale.com/wgengine/wgint Index | Files

package wgint

import "tailscale.com/wgengine/wgint"

Package wgint provides somewhat shady access to wireguard-go internals that don't (yet) have public APIs.

Index

Types

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

Peer is a wrapper around a wireguard-go device.Peer pointer.

func PeerOf

func PeerOf(p *device.Peer) Peer

PeerOf returns a Peer wrapper around a wireguard-go device.Peer.

func (Peer) HandshakeAttempts

func (p Peer) HandshakeAttempts() uint32

HandshakeAttempts returns the number of failed WireGuard handshake attempts made for the current handshake. It resets to zero before every new handshake and after a successful handshake.

func (Peer) IsValid

func (p Peer) IsValid() bool

func (Peer) LastHandshake

func (p Peer) LastHandshake() time.Time

LastHandshake returns the last handshake time.

If the handshake has never happened, it returns the zero value.

func (Peer) RxBytes

func (p Peer) RxBytes() uint64

RxBytes returns the number of bytes received from this peer.

func (Peer) TxBytes

func (p Peer) TxBytes() uint64

TxBytes returns the number of bytes sent to this peer.

Source Files

wgint.go

Version
v1.84.0 (latest)
Published
May 21, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
16 hours ago

Tools for package owners.