nat

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT, MIT Imports: 20 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 {
	*net.TCPConn
	// contains filtered or unexported fields
}

func (*Conn) Close added in v0.3.5

func (c *Conn) Close() error

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

type Nat added in v0.3.4

type Nat struct {
	*TCP
	*UDP
	// contains filtered or unexported fields
}

func Start added in v0.3.4

func Start(opt *tun.Opt) (*Nat, error)

func (*Nat) Close added in v0.3.4

func (n *Nat) Close() error

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 Tuple

type Tuple struct {
	SourceAddr      tcpip.Address
	SourcePort      uint16
	DestinationAddr tcpip.Address
	DestinationPort uint16
}

type UDP added in v0.3.5

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

func NewUDPv2

func NewUDPv2(mtu int32, device netlink.Tun) *UDP

func (*UDP) Close added in v0.3.5

func (u *UDP) Close() error

func (*UDP) ReadFrom added in v0.3.5

func (u *UDP) ReadFrom(buf []byte) (int, Tuple, error)

func (*UDP) WriteTo added in v0.3.5

func (u *UDP) WriteTo(buf []byte, tuple Tuple) (int, error)

Jump to

Keyboard shortcuts

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