mirror of
https://github.com/go-ping/ping.git
synced 2025-04-27 10:31:15 +00:00
This installation method was deprecated because the associated tool has been deprecated. Download "by hand" and run checks before trying to use binary. Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
26 lines
454 B
Go
26 lines
454 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package ping
|
|
|
|
import (
|
|
"golang.org/x/net/ipv4"
|
|
"golang.org/x/net/ipv6"
|
|
)
|
|
|
|
// Returns the length of an ICMP message, plus the IP packet header.
|
|
func (p *Pinger) getMessageLength() int {
|
|
if p.ipv4 {
|
|
return p.Size + 8 + ipv4.HeaderLen
|
|
}
|
|
return p.Size + 8 + ipv6.HeaderLen
|
|
}
|
|
|
|
// Attempts to match the ID of an ICMP packet.
|
|
func (p *Pinger) matchID(ID int) bool {
|
|
if ID != p.id {
|
|
return false
|
|
}
|
|
return true
|
|
}
|