Versions in this module Expand all Collapse all v0 v0.4.6 Dec 4, 2023 v0.4.5 Oct 10, 2023 v0.4.4 Aug 14, 2023 v0.4.3 Aug 14, 2023 Changes in this version + const ConfigPath + const DefaultMTU + const DefaultPort + const MinimalMTU + const SocketPath + const TunnelOverhead + var ErrNoConn = errors.New("no connection for endpoint") + func CleanupUserSockets() error + func CmpDevices(a, b wgtypes.Device) int + func CmpPeerHandshakeTime(a, b wgtypes.Peer) int + func CmpPeers(a, b wgtypes.Peer) int + func KernelModuleExists() bool + func SetMark(_ net.PacketConn, _ uint32) error — darwin/amd64, js/wasm, windows/amd64 + func SetMark(conn net.PacketConn, mark uint32) error — linux/amd64 + type Bind struct + Conns []BindConn + func NewBind(logger *log.Logger) *Bind + func (b *Bind) AddConn(conn net.PacketConn) + func (b *Bind) AddOpenHandler(h BindHandler) + func (b *Bind) AddPacketHandler(h netx.PacketHandler) + func (b *Bind) BatchSize() int + func (b *Bind) Close() error + func (b *Bind) Endpoint(ap netip.AddrPort) *BindEndpoint + func (b *Bind) Open(port uint16) ([]wgconn.ReceiveFunc, uint16, error) + func (b *Bind) ParseEndpoint(s string) (ep wgconn.Endpoint, err error) + func (b *Bind) RemoveOpenHandler(h BindHandler) + func (b *Bind) RemovePacketHandler(h netx.PacketHandler) + func (b *Bind) Send(packets [][]byte, cep wgconn.Endpoint) error + func (b *Bind) SetMark(mark uint32) error + type BindConn interface + BindClose func() error + ListenPort func() (uint16, bool) + Receive func(buf []byte) (int, wgconn.Endpoint, error) + Send func(buf []byte, ep wgconn.Endpoint) (int, error) + SetMark func(mark uint32) error + type BindEndpoint struct + Conn BindConn + func (BindEndpoint) ClearSrc() + func (ep BindEndpoint) DstIP() netip.Addr + func (ep BindEndpoint) DstToBytes() []byte + func (ep BindEndpoint) DstToString() string + func (ep BindEndpoint) DstUDPAddr() *net.UDPAddr + func (ep BindEndpoint) SrcIP() netip.Addr + func (ep BindEndpoint) SrcToString() string + type BindHandler interface + OnBindOpen func(b *Bind, port uint16) + type BindKernelConn interface + WriteKernel func([]byte) (int, error) + type Config struct + Address []net.IPNet + DNS []net.IPAddr + MTU *int + PeerEndpoints []string + PeerNames []string + PostDown []string + PostUp []string + PreDown []string + PreUp []string + SaveConfig *bool + Table *string + func ParseConfig(data []byte) (*Config, error) + func (cfg *Config) Dump(wr io.Writer) error + type Interface wgtypes.Device + func (d *Interface) Config() *Config + func (d *Interface) Dump(wr io.Writer, hideKeys bool) error + func (d *Interface) DumpEnv(wr io.Writer) error