ping

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIcmpError

func NewIcmpError(msg string) *icmpError

Types

type ICMPResponse

type ICMPResponse struct {
	// Rtt is the round-trip time it took to ping.
	Rtt  time.Duration
	Seq  int
	ID   int
	Code int
	Body []byte
	TTL  int    // time-to-live
	Src  net.IP // source address
	Dst  net.IP // destination address
}

type Ping

type Ping interface {
	SendIcmp(data []byte) error
	RecvIcmp() (*ICMPResponse, error)
}

func NewPingV4

func NewPingV4(raddr *net.IPAddr, timeout time.Duration, Identify int) (Ping, error)

func NewPingV6

func NewPingV6(raddr *net.IPAddr, timeout time.Duration) (Ping, error)

func NewUdpV4

func NewUdpV4(raddr *net.IPAddr, timeout time.Duration, Identify int) (Ping, error)

func NewUdpV6

func NewUdpV6(raddr *net.IPAddr, timeout time.Duration, Identify int) (Ping, error)

Jump to

Keyboard shortcuts

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