udp

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const MTU = 9001

Variables

This section is empty.

Functions

func NewUDPStatsEmitter

func NewUDPStatsEmitter(udpConns []Conn) func()

Types

type Conn

type Conn interface {
	Rebind() error
	LocalAddr() (netip.AddrPort, error)
	ListenOut(r EncReader, lhf LightHouseHandlerFunc, cache *firewall.ConntrackCacheTicker, q int)
	WriteTo(b []byte, addr netip.AddrPort) error
	ReloadConfig(c *config.C)
	Close() error
}

func NewListener

func NewListener(l *logrus.Logger, ip netip.Addr, port int, multi bool, batch int) (Conn, error)

type EncReader

type EncReader func(
	addr netip.AddrPort,
	out []byte,
	packet []byte,
	header *header.H,
	fwPacket *firewall.Packet,
	lhh LightHouseHandlerFunc,
	nb []byte,
	q int,
	localCache firewall.ConntrackCache,
)

type LightHouseHandlerFunc

type LightHouseHandlerFunc func(rAddr netip.AddrPort, vpnIp netip.Addr, p []byte)

TODO: IPV6-WORK this can likely be removed now

type NoopConn added in v1.8.0

type NoopConn struct{}

func (NoopConn) Close added in v1.8.0

func (NoopConn) Close() error

func (NoopConn) ListenOut added in v1.8.0

func (NoopConn) LocalAddr added in v1.8.0

func (NoopConn) LocalAddr() (netip.AddrPort, error)

func (NoopConn) Rebind added in v1.8.0

func (NoopConn) Rebind() error

func (NoopConn) ReloadConfig added in v1.8.0

func (NoopConn) ReloadConfig(_ *config.C)

func (NoopConn) WriteTo added in v1.8.0

func (NoopConn) WriteTo(_ []byte, _ netip.AddrPort) error

type StdConn added in v1.8.0

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

func (*StdConn) Close added in v1.8.0

func (u *StdConn) Close() error

func (*StdConn) GetRecvBuffer added in v1.8.0

func (u *StdConn) GetRecvBuffer() (int, error)

func (*StdConn) GetSendBuffer added in v1.8.0

func (u *StdConn) GetSendBuffer() (int, error)

func (*StdConn) ListenOut added in v1.8.0

func (u *StdConn) ListenOut(r EncReader, lhf LightHouseHandlerFunc, cache *firewall.ConntrackCacheTicker, q int)

func (*StdConn) LocalAddr added in v1.8.0

func (u *StdConn) LocalAddr() (netip.AddrPort, error)

func (*StdConn) PrepareRawMessages added in v1.8.0

func (u *StdConn) PrepareRawMessages(n int) ([]rawMessage, [][]byte, [][]byte)

func (*StdConn) ReadMulti added in v1.8.0

func (u *StdConn) ReadMulti(msgs []rawMessage) (int, error)

func (*StdConn) ReadSingle added in v1.8.0

func (u *StdConn) ReadSingle(msgs []rawMessage) (int, error)

func (*StdConn) Rebind added in v1.8.0

func (u *StdConn) Rebind() error

func (*StdConn) ReloadConfig added in v1.8.0

func (u *StdConn) ReloadConfig(c *config.C)

func (*StdConn) SetRecvBuffer added in v1.8.0

func (u *StdConn) SetRecvBuffer(n int) error

func (*StdConn) SetSendBuffer added in v1.8.0

func (u *StdConn) SetSendBuffer(n int) error

func (*StdConn) WriteTo added in v1.8.0

func (u *StdConn) WriteTo(b []byte, ip netip.AddrPort) error

Jump to

Keyboard shortcuts

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