nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man7p / icmp.7p
blob21a9fc164b91ce21e3a583898014da6147155468
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\" Copyright (C) 1999, Sun Microsystems, Inc.
4 .\" All Rights Reserved
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH ICMP 7P "Dec 03, 2015"
9 .SH NAME
10 icmp, ICMP \- Internet Control Message Protocol
11 .SH SYNOPSIS
12 .LP
13 .nf
14 #include <sys/socket.h>
15 #include <netinet/in.h>
16 #include <netinet/ip_icmp.h>
17 s = socket(AF_INET, SOCK_RAW, proto);
18 t = t_open("/dev/icmp", O_RDWR);
19 .fi
21 .SH DESCRIPTION
22 .LP
23 \fBICMP\fR is the error and control message protocol used by the Internet
24 protocol family. It is used by the kernel to handle and report errors in
25 protocol processing. It may also be accessed by programs using the socket
26 interface or the Transport Level Interface (\fBTLI\fR) for network monitoring
27 and diagnostic functions. When used with the socket interface, a "raw socket"
28 type is used. The protocol number for \fBICMP,\fR used in the \fIproto\fR
29 parameter to the socket call, can be obtained from
30 \fBgetprotobyname\fR(3SOCKET). \fBICMP\fR file descriptors and sockets are
31 connectionless, and are normally used with the \fBt_sndudata\fR /
32 \fBt_rcvudata\fR and the \fBsendto()\fR / \fBrecvfrom()\fR calls. In order to
33 send \fBICMP\fR packets, a process needs the \fBPRIV_NET_ICMPACCESS\fR
34 privilege. (See \fBprivileges\fR(5) for more information on privileges.)
35 .sp
36 .LP
37 Outgoing packets automatically have an Internet Protocol (\fBIP\fR) header
38 prepended to them. Incoming packets are provided to the user with the \fBIP\fR
39 header and options intact.
40 .sp
41 .LP
42 \fBICMP\fR is an datagram protocol layered above \fBIP.\fR It is used
43 internally by the protocol code for various purposes including routing, fault
44 isolation, and congestion control. Receipt of an \fBICMP\fR "redirect" message
45 will add a new entry in the routing table, or modify an existing one.
46 \fBICMP\fR messages are routinely sent by the protocol code. Received
47 \fBICMP\fR messages may be reflected back to users of higher-level protocols
48 such as \fBTCP\fR or \fBUDP\fR as error returns from system calls. A copy of
49 all \fBICMP\fR message received by the system is provided to every holder of an
50 open \fBICMP\fR socket or \fBTLI\fR descriptor.
51 .SH SEE ALSO
52 .LP
53 \fBgetprotobyname\fR(3SOCKET), \fBrecv\fR(3SOCKET), \fBsend\fR(3SOCKET),
54 \fBt_rcvudata\fR(3NSL), \fBt_sndudata\fR(3NSL), \fBprivileges\fR(5),
55 \fBinet\fR(7P), \fBip\fR(7P), \fBrouting\fR(7P)
56 .sp
57 .LP
58 Postel, Jon, \fIInternet Control Message Protocol \(em DARPA Internet Program
59 Protocol Specification\fR, \fBRFC\fR 792, Network Information Center, \fBSRI\fR
60 International, Menlo Park, Calif., September 1981.
61 .SH DIAGNOSTICS
62 .LP
63 A socket operation may fail with one of the following errors returned:
64 .sp
65 .ne 2
66 .na
67 \fB\fBEISCONN\fR\fR
68 .ad
69 .RS 17n
70 An attempt was made to establish a connection on a socket which already has
71 one, or when trying to send a datagram with the destination address specified
72 and the socket is already connected.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fBENOTCONN\fR\fR
79 .ad
80 .RS 17n
81 An attempt was made to send a datagram, but no destination address is
82 specified, and the socket has not been connected.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fBENOBUFS\fR\fR
89 .ad
90 .RS 17n
91 The system ran out of memory for an internal data structure.
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fBEADDRNOTAVAIL\fR\fR
98 .ad
99 .RS 17n
100 An attempt was made to create a socket with a network address for which no
101 network interface exists.
104 .SH NOTES
106 Replies to \fBICMP\fR "echo" messages which are source routed are not sent back
107 using inverted source routes, but rather go back through the normal routing
108 mechanisms.