Add ping client
This commit is contained in:
parent
036d61a0aa
commit
8dbb51cfb7
21 changed files with 710 additions and 384 deletions
16
ping/cmsg_unix.go
Normal file
16
ping/cmsg_unix.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//go:build !windows
|
||||
|
||||
package ping
|
||||
|
||||
import (
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func parseIPv6ControlMessage(cmsg []byte) (*ipv6.ControlMessage, error) {
|
||||
var controlMessage ipv6.ControlMessage
|
||||
err := controlMessage.Parse(cmsg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &controlMessage, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue