您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

24 行
553 B

  1. // Copyright 2013 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package icmp
  5. import (
  6. "net"
  7. "golang.org/x/net/internal/iana"
  8. )
  9. const ipv6PseudoHeaderLen = 2*net.IPv6len + 8
  10. // IPv6PseudoHeader returns an IPv6 pseudo header for checksum
  11. // calculation.
  12. func IPv6PseudoHeader(src, dst net.IP) []byte {
  13. b := make([]byte, ipv6PseudoHeaderLen)
  14. copy(b, src.To16())
  15. copy(b[net.IPv6len:], dst.To16())
  16. b[len(b)-1] = byte(iana.ProtocolIPv6ICMP)
  17. return b
  18. }