mirror of
https://github.com/go-ping/ping.git
synced 2025-08-09 08:57:43 +00:00
17 lines
297 B
Go
17 lines
297 B
Go
// +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
|
|
}
|