Add ping client

This commit is contained in:
世界
2025-08-23 10:38:54 +08:00
parent 036d61a0aa
commit 8dbb51cfb7
21 changed files with 710 additions and 384 deletions

16
ping/cmsg_unix.go Normal file
View 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
}