Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProtocolICMP = 1 ProtocolIPv6ICMP = 58 // ICMP for IPv6 )
see https://godoc.org/golang.org/x/net/internal/iana#pkg-constants
View Source
const (
// TimeSliceLength is the length of the icmp payload holding the timestamp
TimeSliceLength = 8
)
Variables ¶
This section is empty.
Functions ¶
func BytesToTime ¶
BytesToTime converst a []byte into a time.Time
func TimeToBytes ¶
TimeToBytes converts a time.Time into a []byte for inclusion in the ICMP payload
Types ¶
type Packet ¶
type Packet struct { // Src is the source IP. This is probably 0.0.0.0 for sent packets, but a // specific IP on the sending host for recieved packets Src net.IP // Dst is the destination IP Dst net.IP // ID is the ICMP ID ID int // Seq is the ICMP Sequence Seq int // Sent is the time the echo was sent Sent time.Time // Recieved is the time the echo was recieved. Recieved time.Time // TimedOut is the time the echo timed out TimedOut time.Time // TTL is the ttl on the recieved packet. TTL int // Len is the length of the recieved packet Len int // RTT is the round trip time of the packet RTT time.Duration }
Packet is an ICMP packet that has been received
Click to show internal directories.
Click to hide internal directories.