udpnat

package
v0.6.0-alpha.18 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 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 interface {
	N.PacketConn
	SetHandler(handler N.UDPHandlerEx)
}

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)

func (*Service) Purge

func (s *Service) Purge()

func (*Service) PurgeExpired

func (s *Service) PurgeExpired()

func (*Service) ResetMetrics

func (s *Service) ResetMetrics() Metrics

Jump to

Keyboard shortcuts

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