udpnat

package
v0.6.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) InitializeReadWaiter

func (c *Conn) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) ReadPacket

func (c *Conn) ReadPacket(buffer *buf.Buffer) (addr M.Socksaddr, err error)

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

func (*Conn) SetHandler

func (c *Conn) SetHandler(handler N.UDPHandlerEx)

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) Upstream

func (c *Conn) Upstream() any

func (*Conn) WaitReadPacket

func (c *Conn) WaitReadPacket() (buffer *buf.Buffer, destination M.Socksaddr, err error)

func (*Conn) WritePacket

func (c *Conn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error

type Metrics

type Metrics struct {
	Creates uint64
	Rejects uint64
	Inputs  uint64
	Drops   uint64
}

type PrepareFunc

type PrepareFunc func(source M.Socksaddr, destination M.Socksaddr, userData any) (bool, context.Context, N.PacketWriter, N.CloseHandlerFunc)

type Service

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

func New

func New(handler N.UDPConnectionHandlerEx, prepare PrepareFunc, timeout time.Duration, shared bool) *Service

func (*Service) Metrics

func (s *Service) Metrics() Metrics

func (*Service) NewPacket

func (s *Service) NewPacket(bufferSlices [][]byte, source M.Socksaddr, destination M.Socksaddr, userData any)

Jump to

Keyboard shortcuts

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