github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/net/icmp/listen_stub.go (about)

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