net

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 15 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 NewBufferReaderConn

func NewBufferReaderConn(conn net.Conn, br *bufio.Reader) 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 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