wgint

package
v1.79.0-mod Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL