wireguard

package
v0.0.0-...-890cd7e Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientBind

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

func NewClientBind

func NewClientBind(ctx context.Context, errorHandler E.Handler, dialer N.Dialer, isConnect bool, connectAddr M.Socksaddr, reserved [3]uint8) *ClientBind

func (*ClientBind) BatchSize

func (c *ClientBind) BatchSize() int

func (*ClientBind) Close

func (c *ClientBind) Close() error

func (*ClientBind) Open

func (c *ClientBind) Open(port uint16) (fns []conn.ReceiveFunc, actualPort uint16, err error)

func (*ClientBind) ParseEndpoint

func (c *ClientBind) ParseEndpoint(s string) (conn.Endpoint, error)

func (*ClientBind) Reset

func (c *ClientBind) Reset()

func (*ClientBind) Send

func (c *ClientBind) Send(bufs [][]byte, ep conn.Endpoint) error

func (*ClientBind) SetMark

func (c *ClientBind) SetMark(mark uint32) error

func (*ClientBind) SetReservedForEndpoint

func (c *ClientBind) SetReservedForEndpoint(destination M.Socksaddr, reserved [3]byte)

type Device

type Device interface {
	tun.Device
	N.Dialer
	Start() error
}

func NewStackDevice

func NewStackDevice(localAddresses []netip.Prefix, mtu uint32) (Device, error)

type Endpoint

type Endpoint M.Socksaddr

func (Endpoint) ClearSrc

func (e Endpoint) ClearSrc()

func (Endpoint) DstIP

func (e Endpoint) DstIP() netip.Addr

func (Endpoint) DstToBytes

func (e Endpoint) DstToBytes() []byte

func (Endpoint) DstToString

func (e Endpoint) DstToString() string

func (Endpoint) SrcIP

func (e Endpoint) SrcIP() netip.Addr

func (Endpoint) SrcToString

func (e Endpoint) SrcToString() string

type SystemDevice

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

func NewSystemDevice

func NewSystemDevice(router adapter.Router, interfaceName string, localPrefixes []netip.Prefix, mtu uint32) (*SystemDevice, error)

func (*SystemDevice) BatchSize

func (w *SystemDevice) BatchSize() int

func (*SystemDevice) Close

func (w *SystemDevice) Close() error

func (*SystemDevice) DialContext

func (w *SystemDevice) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*SystemDevice) Events

func (w *SystemDevice) Events() <-chan wgTun.Event

func (*SystemDevice) File

func (w *SystemDevice) File() *os.File

func (*SystemDevice) Flush

func (w *SystemDevice) Flush() error

func (*SystemDevice) Inet4Address

func (w *SystemDevice) Inet4Address() netip.Addr

func (*SystemDevice) Inet6Address

func (w *SystemDevice) Inet6Address() netip.Addr

func (*SystemDevice) ListenPacket

func (w *SystemDevice) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*SystemDevice) MTU

func (w *SystemDevice) MTU() (int, error)

func (*SystemDevice) Name

func (w *SystemDevice) Name() (string, error)

func (*SystemDevice) Read

func (w *SystemDevice) Read(bufs [][]byte, sizes []int, offset int) (count int, err error)

func (*SystemDevice) Start

func (w *SystemDevice) Start() error

func (*SystemDevice) Write

func (w *SystemDevice) Write(bufs [][]byte, offset int) (count int, err error)

Jump to

Keyboard shortcuts

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