nat

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWriteBackProxy

func NewWriteBackProxy(wb C.WriteBack) C.WriteBackProxy

Types

type Entry

type Entry struct {
	PacketConn      C.PacketConn
	WriteBackProxy  C.WriteBackProxy
	LocalUDPConnMap *xsync.MapOf[string, *net.UDPConn]
	LocalLockMap    *xsync.MapOf[string, *sync.Cond]
}

type Table

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

func New

func New() *Table

New return *Cache

func (*Table) AddForLocalConn

func (t *Table) AddForLocalConn(lAddr, rAddr string, conn *net.UDPConn) bool

func (*Table) Delete

func (t *Table) Delete(key string)

func (*Table) DeleteForLocalConn

func (t *Table) DeleteForLocalConn(lAddr, key string)

func (*Table) DeleteLock

func (t *Table) DeleteLock(lockKey string)

func (*Table) DeleteLockForLocalConn

func (t *Table) DeleteLockForLocalConn(lAddr, key string)

func (*Table) Get

func (t *Table) Get(key string) (C.PacketConn, C.WriteBackProxy)

func (*Table) GetForLocalConn

func (t *Table) GetForLocalConn(lAddr, rAddr string) *net.UDPConn

func (*Table) GetOrCreateLock

func (t *Table) GetOrCreateLock(key string) (*sync.Cond, bool)

func (*Table) GetOrCreateLockForLocalConn

func (t *Table) GetOrCreateLockForLocalConn(lAddr, key string) (*sync.Cond, bool)

func (*Table) RangeForLocalConn

func (t *Table) RangeForLocalConn(lAddr string, f func(key string, value *net.UDPConn) bool)

func (*Table) Set

func (t *Table) Set(key string, e C.PacketConn, w C.WriteBackProxy)

Jump to

Keyboard shortcuts

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