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.\" 357726f76fSRuslan Ermilov.Dd March 21, 2003 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 52afe61c15SRodney W. Grimesand the Internet protocol family. It may be accessed 53afe61c15SRodney W. Grimesthrough a 54afe61c15SRodney W. Grimes.Dq raw socket 55afe61c15SRodney W. Grimesfor network monitoring 56afe61c15SRodney W. Grimesand diagnostic functions. 57afe61c15SRodney W. GrimesThe 58afe61c15SRodney W. Grimes.Fa proto 59afe61c15SRodney W. Grimesparameter to the socket call to create an 60afe61c15SRodney W. Grimes.Tn ICMP 61afe61c15SRodney W. Grimessocket 62afe61c15SRodney W. Grimesis obtained from 63afe61c15SRodney W. Grimes.Xr getprotobyname 3 . 64afe61c15SRodney W. Grimes.Tn ICMP 65afe61c15SRodney W. Grimessockets are connectionless, 66afe61c15SRodney W. Grimesand are normally used with the 67edf0e5b3SMike Pritchard.Xr sendto 2 68afe61c15SRodney W. Grimesand 69edf0e5b3SMike Pritchard.Xr recvfrom 2 70afe61c15SRodney W. Grimescalls, though the 71afe61c15SRodney W. Grimes.Xr connect 2 72afe61c15SRodney W. Grimescall may also be used to fix the destination for future 73afe61c15SRodney W. Grimespackets (in which case the 74afe61c15SRodney W. Grimes.Xr read 2 75afe61c15SRodney W. Grimesor 76afe61c15SRodney W. Grimes.Xr recv 2 77afe61c15SRodney W. Grimesand 78afe61c15SRodney W. Grimes.Xr write 2 79afe61c15SRodney W. Grimesor 80afe61c15SRodney W. Grimes.Xr send 2 81afe61c15SRodney W. Grimessystem calls may be used). 82afe61c15SRodney W. Grimes.Pp 83afe61c15SRodney W. GrimesOutgoing packets automatically have an 84afe61c15SRodney W. Grimes.Tn IP 85afe61c15SRodney W. Grimesheader prepended to 86afe61c15SRodney W. Grimesthem (based on the destination address). 87afe61c15SRodney W. GrimesIncoming packets are received with the 88afe61c15SRodney W. Grimes.Tn IP 89afe61c15SRodney W. Grimesheader and options intact. 907726f76fSRuslan Ermilov.Ss MIB Variables 917726f76fSRuslan ErmilovThe 927726f76fSRuslan Ermilov.Tn ICMP 937726f76fSRuslan Ermilovprotocol implements a number of variables in the 947726f76fSRuslan Ermilov.Va net.inet.icmp 957726f76fSRuslan Ermilovbranch of the 967726f76fSRuslan Ermilov.Xr sysctl 3 977726f76fSRuslan ErmilovMIB. 987726f76fSRuslan Ermilov.Bl -tag -width ".Va icmplim_output" 997726f76fSRuslan Ermilov.It Va maskrepl 1007726f76fSRuslan Ermilov.Pq Vt boolean 1017726f76fSRuslan ErmilovEnable/disable replies to ICMP Address Mask Request packets. 1027726f76fSRuslan ErmilovDefaults to false. 1037726f76fSRuslan Ermilov.It Va maskfake 1047726f76fSRuslan Ermilov.Pq Vt "unsigned integer" 1057726f76fSRuslan ErmilovWhen 1067726f76fSRuslan Ermilov.Va maskrepl 1077726f76fSRuslan Ermilovis set and this value is non-zero, 1087726f76fSRuslan Ermilovit will be used instead of the real address mask when 1097726f76fSRuslan Ermilovthe system replies to an ICMP Address Mask Request packet. 1107726f76fSRuslan ErmilovDefaults to 0. 1117726f76fSRuslan Ermilov.It Va icmplim 1127726f76fSRuslan Ermilov.Pq Vt integer 1137726f76fSRuslan ErmilovBandwidth limit for ICMP replies in packets/second. 1147726f76fSRuslan ErmilovUsed when 1157726f76fSRuslan Ermilov.Va icmplim_output 1167726f76fSRuslan Ermilovis non-zero. 1177726f76fSRuslan ErmilovDefaults to 200. 1187726f76fSRuslan Ermilov.It Va icmplim_output 1197726f76fSRuslan Ermilov.Pq Vt boolean 1207726f76fSRuslan ErmilovEnable/disable bandwidth limiting of ICMP replies. 1217726f76fSRuslan ErmilovDefaults to true. 1227726f76fSRuslan Ermilov.It Va drop_redirect 1237726f76fSRuslan Ermilov.Pq Vt boolean 1247726f76fSRuslan ErmilovEnable/disable dropping of ICMP Redirect packets. 1257726f76fSRuslan ErmilovDefaults to false. 1267726f76fSRuslan Ermilov.It Va log_redirect 1277726f76fSRuslan Ermilov.Pq Vt boolean 1287726f76fSRuslan ErmilovEnable/disable logging of ICMP Redirect packets. 1297726f76fSRuslan ErmilovDefaults to false. 1307726f76fSRuslan Ermilov.It Va bmcastecho 1317726f76fSRuslan Ermilov.Pq Vt boolean 1327726f76fSRuslan ErmilovEnable/disable ICMP replies received via broadcast or multicast. 1337726f76fSRuslan ErmilovDefaults to false. 1347726f76fSRuslan Ermilov.El 135ef0180edSDima Dorfman.Sh ERRORS 136afe61c15SRodney W. GrimesA socket operation may fail with one of the following errors returned: 137ef0180edSDima Dorfman.Bl -tag -width Er 138afe61c15SRodney W. Grimes.It Bq Er EISCONN 139afe61c15SRodney W. Grimeswhen trying to establish a connection on a socket which 140afe61c15SRodney W. Grimesalready has one, or when trying to send a datagram with the destination 141afe61c15SRodney W. Grimesaddress specified and the socket is already connected; 142afe61c15SRodney W. Grimes.It Bq Er ENOTCONN 143afe61c15SRodney W. Grimeswhen trying to send a datagram, but 144afe61c15SRodney W. Grimesno destination address is specified, and the socket hasn't been 145afe61c15SRodney W. Grimesconnected; 146afe61c15SRodney W. Grimes.It Bq Er ENOBUFS 147afe61c15SRodney W. Grimeswhen the system runs out of memory for 148afe61c15SRodney W. Grimesan internal data structure; 149afe61c15SRodney W. Grimes.It Bq Er EADDRNOTAVAIL 150afe61c15SRodney W. Grimeswhen an attempt is made to create a 151afe61c15SRodney W. Grimessocket with a network address for which no network interface 152afe61c15SRodney W. Grimesexists. 153afe61c15SRodney W. Grimes.El 154afe61c15SRodney W. Grimes.Sh SEE ALSO 155afe61c15SRodney W. Grimes.Xr recv 2 , 1560b992c1dSWolfram Schneider.Xr send 2 , 157afe61c15SRodney W. Grimes.Xr inet 4 , 1580b992c1dSWolfram Schneider.Xr intro 4 , 159afe61c15SRodney W. Grimes.Xr ip 4 160afe61c15SRodney W. Grimes.Sh HISTORY 161afe61c15SRodney W. GrimesThe 162afe61c15SRodney W. Grimes.Nm 163afe61c15SRodney W. Grimesprotocol appeared in 164afe61c15SRodney W. Grimes.Bx 4.3 . 165