You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
1.2 KiB

  1. // Copyright 2014 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. // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
  5. package icmp
  6. // ListenPacket listens for incoming ICMP packets addressed to
  7. // address. See net.Dial for the syntax of address.
  8. //
  9. // For non-privileged datagram-oriented ICMP endpoints, network must
  10. // be "udp4" or "udp6". The endpoint allows to read, write a few
  11. // limited ICMP messages such as echo request and echo reply.
  12. // Currently only Darwin and Linux support this.
  13. //
  14. // Examples:
  15. // ListenPacket("udp4", "192.168.0.1")
  16. // ListenPacket("udp4", "0.0.0.0")
  17. // ListenPacket("udp6", "fe80::1%en0")
  18. // ListenPacket("udp6", "::")
  19. //
  20. // For privileged raw ICMP endpoints, network must be "ip4" or "ip6"
  21. // followed by a colon and an ICMP protocol number or name.
  22. //
  23. // Examples:
  24. // ListenPacket("ip4:icmp", "192.168.0.1")
  25. // ListenPacket("ip4:1", "0.0.0.0")
  26. // ListenPacket("ip6:ipv6-icmp", "fe80::1%en0")
  27. // ListenPacket("ip6:58", "::")
  28. func ListenPacket(network, address string) (*PacketConn, error) {
  29. return nil, errNotImplemented
  30. }