Documentation ¶
Index ¶
- Variables
- type NoisySocketsNetwork
- func (net *NoisySocketsNetwork) AddPeer(peerConf latestconfig.PeerConfig) error
- func (net *NoisySocketsNetwork) AddRoute(routeConf *latestconfig.RouteConfig) error
- func (net *NoisySocketsNetwork) Close() error
- func (net *NoisySocketsNetwork) ListenPort() uint16
- func (net *NoisySocketsNetwork) RemovePeer(publicKey types.NoisePublicKey) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnknownPeer = errors.New("unknown peer")
)
Functions ¶
This section is empty.
Types ¶
type NoisySocketsNetwork ¶ added in v0.10.0
type NoisySocketsNetwork struct { *network.UserspaceNetwork // contains filtered or unexported fields }
NoisySocketsNetwork is a wrapper around a userspace WireGuard peer.
func OpenNetwork ¶ added in v0.18.0
func OpenNetwork(logger *slog.Logger, conf *latestconfig.Config) (*NoisySocketsNetwork, error)
OpenNetwork creates a new network using the provided configuration. The returned network is a userspace WireGuard peer that exposes Dial() and Listen() methods compatible with the net package.
func (*NoisySocketsNetwork) AddPeer ¶ added in v0.15.0
func (net *NoisySocketsNetwork) AddPeer(peerConf latestconfig.PeerConfig) error
AddPeer adds a wireguard peer to the network.
func (*NoisySocketsNetwork) AddRoute ¶ added in v0.15.0
func (net *NoisySocketsNetwork) AddRoute(routeConf *latestconfig.RouteConfig) error
AddRoute adds a route to the network.
func (*NoisySocketsNetwork) Close ¶ added in v0.10.0
func (net *NoisySocketsNetwork) Close() error
Close closes the network.
func (*NoisySocketsNetwork) ListenPort ¶ added in v0.23.4
func (net *NoisySocketsNetwork) ListenPort() uint16
ListenPort returns the port that wireguard is listening on.
func (*NoisySocketsNetwork) RemovePeer ¶ added in v0.15.0
func (net *NoisySocketsNetwork) RemovePeer(publicKey types.NoisePublicKey) error
RemovePeer removes a wireguard peer from the network.
Directories ¶
Path | Synopsis |
---|---|
benchmark
module
|
|
examples
module
|
|
internal
|
|
conn
Package conn implements WireGuard's network connections.
|
Package conn implements WireGuard's network connections. |
replay
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479.
|
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479. |
Click to show internal directories.
Click to hide internal directories.