nat

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(device dev.Device, gateway, portal, _ netip.Addr) (*TCP, *UDP, error)

Types

type TCP

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

func (*TCP) Accept

func (t *TCP) Accept() (net.Conn, error)

func (*TCP) Addr

func (t *TCP) Addr() net.Addr

func (*TCP) Close

func (t *TCP) Close() error

func (*TCP) SetDeadline

func (t *TCP) SetDeadline(time time.Time) error

type UDP

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

func (*UDP) Close

func (u *UDP) Close() error

func (*UDP) PutUDPElement added in v1.51.0

func (u *UDP) PutUDPElement(elem *UDPElement)

func (*UDP) ReadFrom

func (u *UDP) ReadFrom() (ue *UDPElement, err error)

func (*UDP) WriteTo

func (u *UDP) WriteTo(buf []byte, local netip.AddrPort, remote netip.AddrPort) (int, error)

type UDPElement added in v1.51.0

type UDPElement struct {
	Packet      *[]byte
	Source      netip.AddrPort
	Destination netip.AddrPort
}

Jump to

Keyboard shortcuts

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