wireguard

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNetTUN

func CreateNetTUN(localAddresses []netip.Prefix, mtu int) (*netTun, error)

func NewClient added in v0.3.3

func NewClient(conf *protocol.Protocol_Wireguard) point.WrapProxy

Types

type Batch added in v0.3.7

type Batch struct {
	net.PacketConn
	// contains filtered or unexported fields
}

func NewIPv6Batch added in v0.3.7

func NewIPv6Batch(batchSize int, conn net.PacketConn) *Batch

func (*Batch) ReadBatch added in v0.3.7

func (b *Batch) ReadBatch(bufs [][]byte, sizes []int, eps []conn.Endpoint) (n int, err error)

func (*Batch) WriteBatch added in v0.3.7

func (b *Batch) WriteBatch(buf [][]byte, addr *net.UDPAddr) error

type ChannelDevice added in v0.3.6

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

func NewChannelDevice added in v0.3.6

func NewChannelDevice(ctx context.Context, mtu int) *ChannelDevice

func (*ChannelDevice) BatchSize added in v0.3.6

func (p *ChannelDevice) BatchSize() int

func (*ChannelDevice) Close added in v0.3.6

func (p *ChannelDevice) Close() error

func (*ChannelDevice) Events added in v0.3.6

func (p *ChannelDevice) Events() <-chan wun.Event

func (*ChannelDevice) File added in v0.3.6

func (p *ChannelDevice) File() *os.File

func (*ChannelDevice) Inbound added in v0.3.6

func (p *ChannelDevice) Inbound(b []byte) (int, error)

func (*ChannelDevice) MTU added in v0.3.6

func (p *ChannelDevice) MTU() (int, error)

func (*ChannelDevice) Name added in v0.3.6

func (p *ChannelDevice) Name() (string, error)

func (*ChannelDevice) Outbound added in v0.3.6

func (p *ChannelDevice) Outbound(b []byte) error

func (*ChannelDevice) Read added in v0.3.6

func (p *ChannelDevice) Read(b [][]byte, size []int, offset int) (int, error)

func (*ChannelDevice) Write added in v0.3.6

func (p *ChannelDevice) Write(b [][]byte, offset int) (int, error)

type Endpoint added in v0.3.4

type Endpoint netip.AddrPort

func (Endpoint) ClearSrc added in v0.3.4

func (e Endpoint) ClearSrc()

func (Endpoint) DstIP added in v0.3.4

func (e Endpoint) DstIP() netip.Addr

func (Endpoint) DstToBytes added in v0.3.4

func (e Endpoint) DstToBytes() []byte

func (Endpoint) DstToString added in v0.3.4

func (e Endpoint) DstToString() string

func (Endpoint) SrcIP added in v0.3.4

func (e Endpoint) SrcIP() netip.Addr

func (Endpoint) SrcToString added in v0.3.4

func (e Endpoint) SrcToString() string

type Wireguard

type Wireguard struct {
	netapi.EmptyDispatch
	// contains filtered or unexported fields
}

func (*Wireguard) Conn

func (w *Wireguard) Conn(ctx context.Context, addr netapi.Address) (net.Conn, error)

func (*Wireguard) PacketConn

func (w *Wireguard) PacketConn(ctx context.Context, addr netapi.Address) (net.PacketConn, error)

Jump to

Keyboard shortcuts

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