wireguard

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultBind

func NewDefaultBind(
	controlFns []func(network, address string, c syscall.RawConn) error,
	interfaceName string,
	reserved []byte,
) conn.Bind

func NewStdNetBind

func NewStdNetBind(
	controlFns []func(network, address string, c syscall.RawConn) error,
	interfaceName string,
	reserved []byte,
) wg.Bind

Types

type Net

type Net netTun

func CreateNetTUN

func CreateNetTUN(localAddresses, dnsServers []netip.Addr, mtu int) (tun.Device, *Net, error)

func (*Net) DialContextTCP

func (net *Net) DialContextTCP(ctx context.Context, addr *net.TCPAddr) (*gonet.TCPConn, error)

func (*Net) DialContextTCPAddrPort

func (net *Net) DialContextTCPAddrPort(ctx context.Context, addr netip.AddrPort) (*gonet.TCPConn, error)

func (*Net) DialTCP

func (net *Net) DialTCP(addr *net.TCPAddr) (*gonet.TCPConn, error)

func (*Net) DialTCPAddrPort

func (net *Net) DialTCPAddrPort(addr netip.AddrPort) (*gonet.TCPConn, error)

func (*Net) DialUDP

func (net *Net) DialUDP(laddr, raddr *net.UDPAddr) (*gonet.UDPConn, error)

func (*Net) DialUDPAddrPort

func (net *Net) DialUDPAddrPort(laddr, raddr netip.AddrPort) (*gonet.UDPConn, error)

func (*Net) ListenTCP

func (net *Net) ListenTCP(addr *net.TCPAddr) (*gonet.TCPListener, error)

func (*Net) ListenTCPAddrPort

func (net *Net) ListenTCPAddrPort(addr netip.AddrPort) (*gonet.TCPListener, error)

func (*Net) ListenUDP

func (net *Net) ListenUDP(laddr *net.UDPAddr) (*gonet.UDPConn, error)

func (*Net) ListenUDPAddrPort

func (net *Net) ListenUDPAddrPort(laddr netip.AddrPort) (*gonet.UDPConn, error)

type StdNetBind

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

func (*StdNetBind) BatchSize

func (s *StdNetBind) BatchSize() int

TODO: When all Binds handle IdealBatchSize, remove this dynamic function and rename the IdealBatchSize constant to BatchSize.

func (*StdNetBind) Close

func (s *StdNetBind) Close() error

func (*StdNetBind) Open

func (s *StdNetBind) Open(uport uint16) ([]wg.ReceiveFunc, uint16, error)

func (*StdNetBind) ParseEndpoint

func (*StdNetBind) ParseEndpoint(s string) (wg.Endpoint, error)

func (*StdNetBind) Send

func (s *StdNetBind) Send(bufs [][]byte, endpoint wg.Endpoint) error

func (*StdNetBind) SetMark

func (s *StdNetBind) SetMark(mark uint32) error

func (*StdNetBind) UpdateControlFns

func (s *StdNetBind) UpdateControlFns(controlFns []func(network, address string, c syscall.RawConn) error)

Jump to

Keyboard shortcuts

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