net

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBuffer

func CopyBuffer(dst io.Writer, src io.Reader, bufSize int) error

func IsIPv4

func IsIPv4(address string) bool

func NewReadWriteConn added in v0.0.3

func NewReadWriteConn(r io.Reader, w io.Writer, c net.Conn) net.Conn

func ParseInterfaceAddr added in v0.0.3

func ParseInterfaceAddr(ifceName, network string) (ifce string, addr []net.Addr, err error)

func Pipe added in v0.0.3

func Pipe(ctx context.Context, rw1, rw2 io.ReadWriteCloser) error

func Resolve added in v0.0.3

func Resolve(ctx context.Context, network, addr string, r resolver.Resolver, hosts hosts.HostMapper, log logger.Logger) (string, error)

func Transport

func Transport(rw1, rw2 io.ReadWriter) error

Types

type AddrPortRange

type AddrPortRange string

AddrPortRange is the network address with port range supported. e.g. 192.168.1.1:0-65535

func (AddrPortRange) Addrs

func (p AddrPortRange) Addrs() (addrs []string)

type IPRange added in v0.0.3

type IPRange struct {
	Min netip.Addr
	Max netip.Addr
}

func (*IPRange) Contains added in v0.0.3

func (r *IPRange) Contains(addr netip.Addr) bool

func (*IPRange) Parse added in v0.0.3

func (r *IPRange) Parse(s string) error

type ListenConfig added in v0.0.3

type ListenConfig struct {
	Netns string
	net.ListenConfig
}

func (*ListenConfig) Listen added in v0.0.3

func (lc *ListenConfig) Listen(ctx context.Context, network, address string) (net.Listener, error)

func (*ListenConfig) ListenPacket added in v0.0.3

func (lc *ListenConfig) ListenPacket(ctx context.Context, network, address string) (net.PacketConn, error)

type PortRange

type PortRange struct {
	Min int
	Max int
}

Port range is a range of port list.

func (*PortRange) Contains

func (pr *PortRange) Contains(port int) bool

func (*PortRange) Parse

func (pr *PortRange) Parse(s string) error

Parse parses the s to PortRange. The s can be a single port number and will be converted to port range port-port.

type RemoteAddr

type RemoteAddr interface {
	RemoteAddr() net.Addr
}

type SetBuffer

type SetBuffer interface {
	SetReadBuffer(bytes int) error
	SetWriteBuffer(bytes int) error
}

type SetDSCP

type SetDSCP interface {
	SetDSCP(int) error
}

tcpraw.TCPConn

type SyscallConn

type SyscallConn interface {
	SyscallConn() (syscall.RawConn, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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