nat

package
v0.0.0-...-dddbfaa Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(
	device io.ReadWriter,
	network netip.Prefix,
	portal netip.Addr,
) (*TCP, *UDP, error)

Types

type Conn

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

func (*Conn) LocalAddr

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

func (*Conn) RawConn

func (c *Conn) RawConn() (net.Conn, bool)

func (*Conn) RemoteAddr

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

func (*Conn) Unwrap

func (c *Conn) Unwrap() (net.Conn, bool)

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) ReadFrom

func (u *UDP) ReadFrom(buf []byte) (int, net.Addr, net.Addr, error)

func (*UDP) WriteTo

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

Jump to

Keyboard shortcuts

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