pingsocket

package
v0.0.0-...-79d17b8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TIMEOUTERR = unix.EWOULDBLOCK
)

Variables

View Source
var (
	ErrNotIPV4 = errors.New("the given address is not IPv4")
	ErrNotIPV6 = errors.New("the given address is not IPv6")
)

Functions

This section is empty.

Types

type IPv4

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

func NewIPv4

func NewIPv4() (s IPv4, err error)

func (IPv4) Close

func (s IPv4) Close() error

func (IPv4) Recvfrom

func (s IPv4) Recvfrom(buf []byte) (n int, from net.IP, err error)

func (IPv4) SendTo

func (s IPv4) SendTo(packet []byte, destination net.IP) error

func (IPv4) SetReadTimeout

func (s IPv4) SetReadTimeout(duration time.Duration) error

func (IPv4) SetTTL

func (s IPv4) SetTTL(ttl uint8) error

type IPv6

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

func NewIPv6

func NewIPv6() (s IPv6, err error)

func (IPv6) Close

func (s IPv6) Close() error

func (IPv6) Recvfrom

func (s IPv6) Recvfrom(buf []byte) (n int, from net.IP, err error)

func (IPv6) SendTo

func (s IPv6) SendTo(packet []byte, destination net.IP) error

func (IPv6) SetReadTimeout

func (s IPv6) SetReadTimeout(duration time.Duration) error

func (IPv6) SetTTL

func (s IPv6) SetTTL(ttl uint8) error

type Pingsocket

type Pingsocket interface {
	SetTTL(ttl uint8) error
	Close() error
	SetReadTimeout(duration time.Duration) error
	SendTo(packet []byte, destination net.IP) error
	Recvfrom(buf []byte) (n int, from net.IP, err error)
}

func SocketForAddress

func SocketForAddress(address net.IP) (Pingsocket, error)

Jump to

Keyboard shortcuts

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