xref: /freebsd/share/man/man4/icmp.4 (revision a0866c8d4e955257b45404ca7dec08c4a3148fa8)
1afe61c15SRodney W. Grimes.\" Copyright (c) 1986, 1991, 1993
2afe61c15SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3afe61c15SRodney W. Grimes.\"
4afe61c15SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
5afe61c15SRodney W. Grimes.\" modification, are permitted provided that the following conditions
6afe61c15SRodney W. Grimes.\" are met:
7afe61c15SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
8afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
9afe61c15SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
10afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
11afe61c15SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12afe61c15SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
13afe61c15SRodney W. Grimes.\"    must display the following acknowledgement:
14afe61c15SRodney W. Grimes.\"	This product includes software developed by the University of
15afe61c15SRodney W. Grimes.\"	California, Berkeley and its contributors.
16afe61c15SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
17afe61c15SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
18afe61c15SRodney W. Grimes.\"    without specific prior written permission.
19afe61c15SRodney W. Grimes.\"
20afe61c15SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21afe61c15SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22afe61c15SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23afe61c15SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24afe61c15SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25afe61c15SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26afe61c15SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27afe61c15SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28afe61c15SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29afe61c15SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30afe61c15SRodney W. Grimes.\" SUCH DAMAGE.
31afe61c15SRodney W. Grimes.\"
32afe61c15SRodney W. Grimes.\"     @(#)icmp.4	8.1 (Berkeley) 6/5/93
337f3dea24SPeter Wemm.\" $FreeBSD$
34afe61c15SRodney W. Grimes.\"
35a0866c8dSAndre Oppermann.Dd August 21, 2005
36afe61c15SRodney W. Grimes.Dt ICMP 4
373d45e180SRuslan Ermilov.Os
38afe61c15SRodney W. Grimes.Sh NAME
39afe61c15SRodney W. Grimes.Nm icmp
40afe61c15SRodney W. Grimes.Nd Internet Control Message Protocol
41afe61c15SRodney W. Grimes.Sh SYNOPSIS
4232eef9aeSRuslan Ermilov.In sys/types.h
4332eef9aeSRuslan Ermilov.In sys/socket.h
4432eef9aeSRuslan Ermilov.In netinet/in.h
45afe61c15SRodney W. Grimes.Ft int
46afe61c15SRodney W. Grimes.Fn socket AF_INET SOCK_RAW proto
47afe61c15SRodney W. Grimes.Sh DESCRIPTION
48afe61c15SRodney W. Grimes.Tn ICMP
49afe61c15SRodney W. Grimesis the error and control message protocol used
50afe61c15SRodney W. Grimesby
51afe61c15SRodney W. Grimes.Tn IP
52b5e7e999SRuslan Ermilovand the Internet protocol family.
53b5e7e999SRuslan ErmilovIt may be accessed
54afe61c15SRodney W. Grimesthrough a
55afe61c15SRodney W. Grimes.Dq raw socket
56afe61c15SRodney W. Grimesfor network monitoring
57afe61c15SRodney W. Grimesand diagnostic functions.
58afe61c15SRodney W. GrimesThe
59afe61c15SRodney W. Grimes.Fa proto
60afe61c15SRodney W. Grimesparameter to the socket call to create an
61afe61c15SRodney W. Grimes.Tn ICMP
62afe61c15SRodney W. Grimessocket
63afe61c15SRodney W. Grimesis obtained from
64afe61c15SRodney W. Grimes.Xr getprotobyname 3 .
65afe61c15SRodney W. Grimes.Tn ICMP
66afe61c15SRodney W. Grimessockets are connectionless,
67afe61c15SRodney W. Grimesand are normally used with the
68edf0e5b3SMike Pritchard.Xr sendto 2
69afe61c15SRodney W. Grimesand
70edf0e5b3SMike Pritchard.Xr recvfrom 2
71afe61c15SRodney W. Grimescalls, though the
72afe61c15SRodney W. Grimes.Xr connect 2
73afe61c15SRodney W. Grimescall may also be used to fix the destination for future
74afe61c15SRodney W. Grimespackets (in which case the
75afe61c15SRodney W. Grimes.Xr read 2
76afe61c15SRodney W. Grimesor
77afe61c15SRodney W. Grimes.Xr recv 2
78afe61c15SRodney W. Grimesand
79afe61c15SRodney W. Grimes.Xr write 2
80afe61c15SRodney W. Grimesor
81afe61c15SRodney W. Grimes.Xr send 2
82afe61c15SRodney W. Grimessystem calls may be used).
83afe61c15SRodney W. Grimes.Pp
84afe61c15SRodney W. GrimesOutgoing packets automatically have an
85afe61c15SRodney W. Grimes.Tn IP
86afe61c15SRodney W. Grimesheader prepended to
87afe61c15SRodney W. Grimesthem (based on the destination address).
88afe61c15SRodney W. GrimesIncoming packets are received with the
89afe61c15SRodney W. Grimes.Tn IP
90afe61c15SRodney W. Grimesheader and options intact.
917726f76fSRuslan Ermilov.Ss MIB Variables
927726f76fSRuslan ErmilovThe
937726f76fSRuslan Ermilov.Tn ICMP
947726f76fSRuslan Ermilovprotocol implements a number of variables in the
957726f76fSRuslan Ermilov.Va net.inet.icmp
967726f76fSRuslan Ermilovbranch of the
977726f76fSRuslan Ermilov.Xr sysctl 3
987726f76fSRuslan ErmilovMIB.
997726f76fSRuslan Ermilov.Bl -tag -width ".Va icmplim_output"
1007726f76fSRuslan Ermilov.It Va maskrepl
1017726f76fSRuslan Ermilov.Pq Vt boolean
1027726f76fSRuslan ErmilovEnable/disable replies to ICMP Address Mask Request packets.
1037726f76fSRuslan ErmilovDefaults to false.
1047726f76fSRuslan Ermilov.It Va maskfake
1057726f76fSRuslan Ermilov.Pq Vt "unsigned integer"
1067726f76fSRuslan ErmilovWhen
1077726f76fSRuslan Ermilov.Va maskrepl
1087726f76fSRuslan Ermilovis set and this value is non-zero,
1097726f76fSRuslan Ermilovit will be used instead of the real address mask when
1107726f76fSRuslan Ermilovthe system replies to an ICMP Address Mask Request packet.
1117726f76fSRuslan ErmilovDefaults to 0.
1127726f76fSRuslan Ermilov.It Va icmplim
1137726f76fSRuslan Ermilov.Pq Vt integer
1147726f76fSRuslan ErmilovBandwidth limit for ICMP replies in packets/second.
1157726f76fSRuslan ErmilovUsed when
1167726f76fSRuslan Ermilov.Va icmplim_output
1177726f76fSRuslan Ermilovis non-zero.
1187726f76fSRuslan ErmilovDefaults to 200.
1197726f76fSRuslan Ermilov.It Va icmplim_output
1207726f76fSRuslan Ermilov.Pq Vt boolean
1217726f76fSRuslan ErmilovEnable/disable bandwidth limiting of ICMP replies.
1227726f76fSRuslan ErmilovDefaults to true.
1237726f76fSRuslan Ermilov.It Va drop_redirect
1247726f76fSRuslan Ermilov.Pq Vt boolean
1257726f76fSRuslan ErmilovEnable/disable dropping of ICMP Redirect packets.
1267726f76fSRuslan ErmilovDefaults to false.
1277726f76fSRuslan Ermilov.It Va log_redirect
1287726f76fSRuslan Ermilov.Pq Vt boolean
1297726f76fSRuslan ErmilovEnable/disable logging of ICMP Redirect packets.
1307726f76fSRuslan ErmilovDefaults to false.
1317726f76fSRuslan Ermilov.It Va bmcastecho
1327726f76fSRuslan Ermilov.Pq Vt boolean
1337726f76fSRuslan ErmilovEnable/disable ICMP replies received via broadcast or multicast.
1347726f76fSRuslan ErmilovDefaults to false.
135d0946241SMaxim Konovalov.It Va reply_src
136d0946241SMaxim Konovalov.Pq Vt str
137c48524c2SMike PritchardAn interface name used for the ICMP reply source in response to packets
138d0946241SMaxim Konovalovwhich are not directly addressed to us.
139d0946241SMaxim KonovalovBy default continue with normal source selection.
140a0866c8dSAndre Oppermann.It Va reply_from_interface
141a0866c8dSAndre Oppermann.Pq Vt boolean
142a0866c8dSAndre OppermannUse the IP address of the interface the packet came through in for
143a0866c8dSAndre Oppermannresponses to packets which are not directly addressed to us.
144a0866c8dSAndre OppermannIf enabled this rule is processed before all others.
145a0866c8dSAndre OppermannBy default continue with normal source selection.
146a0866c8dSAndre OppermannEnabling this option is particularly useful on routers because it
147a0866c8dSAndre Oppermannmakes external traceroutes show the actual path a packet has taken
148a0866c8dSAndre Oppermanninstead of the possibly different return path.
1497726f76fSRuslan Ermilov.El
150ef0180edSDima Dorfman.Sh ERRORS
151afe61c15SRodney W. GrimesA socket operation may fail with one of the following errors returned:
152ef0180edSDima Dorfman.Bl -tag -width Er
153afe61c15SRodney W. Grimes.It Bq Er EISCONN
154afe61c15SRodney W. Grimeswhen trying to establish a connection on a socket which
155afe61c15SRodney W. Grimesalready has one, or when trying to send a datagram with the destination
156afe61c15SRodney W. Grimesaddress specified and the socket is already connected;
157afe61c15SRodney W. Grimes.It Bq Er ENOTCONN
158afe61c15SRodney W. Grimeswhen trying to send a datagram, but
1590227791bSRuslan Ermilovno destination address is specified, and the socket has not been
160afe61c15SRodney W. Grimesconnected;
161afe61c15SRodney W. Grimes.It Bq Er ENOBUFS
162afe61c15SRodney W. Grimeswhen the system runs out of memory for
163afe61c15SRodney W. Grimesan internal data structure;
164afe61c15SRodney W. Grimes.It Bq Er EADDRNOTAVAIL
165afe61c15SRodney W. Grimeswhen an attempt is made to create a
166afe61c15SRodney W. Grimessocket with a network address for which no network interface
167afe61c15SRodney W. Grimesexists.
168afe61c15SRodney W. Grimes.El
169afe61c15SRodney W. Grimes.Sh SEE ALSO
170afe61c15SRodney W. Grimes.Xr recv 2 ,
1710b992c1dSWolfram Schneider.Xr send 2 ,
172afe61c15SRodney W. Grimes.Xr inet 4 ,
1730b992c1dSWolfram Schneider.Xr intro 4 ,
174afe61c15SRodney W. Grimes.Xr ip 4
175afe61c15SRodney W. Grimes.Sh HISTORY
176afe61c15SRodney W. GrimesThe
177afe61c15SRodney W. Grimes.Nm
178afe61c15SRodney W. Grimesprotocol appeared in
179afe61c15SRodney W. Grimes.Bx 4.3 .
180