net

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 14 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

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

func ParseInterfaceAddr

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

func Resolve

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 ClientAddr

type ClientAddr interface {
	ClientAddr() net.Addr
}

type ListenConfig

type ListenConfig struct {
	Netns string
	net.ListenConfig
}

func (*ListenConfig) Listen

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

func (*ListenConfig) ListenPacket

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