netstack

package
v0.0.0-...-4f8b785 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Net

type Net netTun

func CreateNetTUN

func CreateNetTUN(localAddresses, dnsServers []netip.Addr, mtu int) (tun.Device, *Net, error)

func (*Net) Dial

func (tnet *Net) Dial(network, address string) (net.Conn, error)

func (*Net) DialContext

func (tnet *Net) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*Net) DialContextTCP

func (net *Net) DialContextTCP(ctx context.Context, addr *net.TCPAddr) (*gonet.TCPConn, error)

func (*Net) DialContextTCPAddrPort

func (net *Net) DialContextTCPAddrPort(ctx context.Context, addr netip.AddrPort) (*gonet.TCPConn, error)

func (*Net) DialPing

func (net *Net) DialPing(laddr, raddr *PingAddr) (*PingConn, error)

func (*Net) DialPingAddr

func (net *Net) DialPingAddr(laddr, raddr netip.Addr) (*PingConn, error)

func (*Net) DialTCP

func (net *Net) DialTCP(addr *net.TCPAddr) (*gonet.TCPConn, error)

func (*Net) DialTCPAddrPort

func (net *Net) DialTCPAddrPort(addr netip.AddrPort) (*gonet.TCPConn, error)

func (*Net) DialUDP

func (net *Net) DialUDP(laddr, raddr *net.UDPAddr) (*gonet.UDPConn, error)

func (*Net) DialUDPAddrPort

func (net *Net) DialUDPAddrPort(laddr, raddr netip.AddrPort) (*gonet.UDPConn, error)

func (*Net) ListenPing

func (net *Net) ListenPing(laddr *PingAddr) (*PingConn, error)

func (*Net) ListenPingAddr

func (net *Net) ListenPingAddr(laddr netip.Addr) (*PingConn, error)

func (*Net) ListenTCP

func (net *Net) ListenTCP(addr *net.TCPAddr) (*gonet.TCPListener, error)

func (*Net) ListenTCPAddrPort

func (net *Net) ListenTCPAddrPort(addr netip.AddrPort) (*gonet.TCPListener, error)

func (*Net) ListenUDP

func (net *Net) ListenUDP(laddr *net.UDPAddr) (*gonet.UDPConn, error)

func (*Net) ListenUDPAddrPort

func (net *Net) ListenUDPAddrPort(laddr netip.AddrPort) (*gonet.UDPConn, error)

func (*Net) LookupContextHost

func (tnet *Net) LookupContextHost(ctx context.Context, host string) ([]string, error)

func (*Net) LookupHost

func (net *Net) LookupHost(host string) (addrs []string, err error)

type PingAddr

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

func PingAddrFromAddr

func PingAddrFromAddr(addr netip.Addr) *PingAddr

func (PingAddr) Addr

func (ia PingAddr) Addr() netip.Addr

func (PingAddr) Network

func (ia PingAddr) Network() string

func (PingAddr) String

func (ia PingAddr) String() string

type PingConn

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

func (*PingConn) Close

func (pc *PingConn) Close() error

func (*PingConn) LocalAddr

func (pc *PingConn) LocalAddr() net.Addr

func (*PingConn) Read

func (pc *PingConn) Read(p []byte) (n int, err error)

func (*PingConn) ReadFrom

func (pc *PingConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*PingConn) RemoteAddr

func (pc *PingConn) RemoteAddr() net.Addr

func (*PingConn) SetDeadline

func (pc *PingConn) SetDeadline(t time.Time) error

func (*PingConn) SetReadDeadline

func (pc *PingConn) SetReadDeadline(t time.Time) error

func (*PingConn) SetWriteDeadline

func (pc *PingConn) SetWriteDeadline(t time.Time) error

func (*PingConn) Write

func (pc *PingConn) Write(p []byte) (n int, err error)

func (*PingConn) WriteTo

func (pc *PingConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

Jump to

Keyboard shortcuts

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