BSD 4_4 release
[unix-history] / usr / src / share / man / man4 / icmp.4
index 03d49d1..d87772f 100644 (file)
-.\" Copyright (c) 1986 Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1986, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
-.\" Redistribution and use in source and binary forms are permitted
-.\" provided that this notice is preserved and that due credit is given
-.\" to the University of California at Berkeley. The name of the University
-.\" may not be used to endorse or promote products derived from this
-.\" software without specific prior written permission. This software
-.\" is provided ``as is'' without express or implied warranty.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"    @(#)icmp.4      6.2 (Berkeley) %G%
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
 .\"
 .\"
-.TH ICMP 4P ""
-.UC 6
-.SH NAME
-icmp \- Internet Control Message Protocol
-.SH SYNOPSIS
-.B #include <sys/socket.h>
-.br
-.B #include <netinet/in.h>
-.PP
-.B s = socket(AF_INET, SOCK_RAW, proto);
-.SH DESCRIPTION
-ICMP is the error and control message protocol used
-by IP and the Internet protocol family.  It may be accessed
-through a \*(lqraw socket\*(rq for network monitoring
+.\"     @(#)icmp.4     8.1 (Berkeley) 6/5/93
+.\"
+.Dd June 5, 1993
+.Dt ICMP 4
+.Os BSD 4.3
+.Sh NAME
+.Nm icmp
+.Nd Internet Control Message Protocol
+.Sh SYNOPSIS
+.Fd #include <sys/socket.h>
+.Fd #include <netinet/in.h>
+.Ft int
+.Fn socket AF_INET SOCK_RAW proto
+.Sh DESCRIPTION
+.Tn ICMP
+is the error and control message protocol used
+by
+.Tn IP
+and the Internet protocol family.  It may be accessed
+through a
+.Dq raw socket
+for network monitoring
 and diagnostic functions.
 The
 and diagnostic functions.
 The
-.I proto
-parameter to the socket call to create an ICMP socket
+.Fa proto
+parameter to the socket call to create an
+.Tn ICMP
+socket
 is obtained from
 is obtained from
-.IR getprotobyname (3N).
-ICMP sockets are connectionless,
+.Xr getprotobyname 3 .
+.Tn ICMP
+sockets are connectionless,
 and are normally used with the
 and are normally used with the
-.I sendto 
+.Xr sendto
 and
 and
-.I recvfrom 
+.Xr recvfrom
 calls, though the
 calls, though the
-.IR connect (2)
+.Xr connect 2
 call may also be used to fix the destination for future
 packets (in which case the 
 call may also be used to fix the destination for future
 packets (in which case the 
-.IR read (2)
+.Xr read 2
 or
 or
-.IR recv (2)
+.Xr recv 2
 and 
 and 
-.IR write (2)
+.Xr write 2
 or
 or
-.IR send (2)
+.Xr send 2
 system calls may be used).
 system calls may be used).
-.PP
-Outgoing packets automatically have an IP header prepended to
+.Pp
+Outgoing packets automatically have an
+.Tn IP
+header prepended to
 them (based on the destination address).
 them (based on the destination address).
-Incoming packets are received with the IP header and options intact.
-.SH DIAGNOSTICS
+Incoming packets are received with the
+.Tn IP
+header and options intact.
+.Sh DIAGNOSTICS
 A socket operation may fail with one of the following errors returned:
 A socket operation may fail with one of the following errors returned:
-.TP 15
-[EISCONN]
+.Bl -tag -width [EADDRNOTAVAIL]
+.It Bq Er EISCONN
 when trying to establish a connection on a socket which
 already has one, or when trying to send a datagram with the destination
 address specified and the socket is already connected;
 when trying to establish a connection on a socket which
 already has one, or when trying to send a datagram with the destination
 address specified and the socket is already connected;
-.TP 15
-[ENOTCONN]
+.It Bq Er ENOTCONN
 when trying to send a datagram, but
 no destination address is specified, and the socket hasn't been
 connected;
 when trying to send a datagram, but
 no destination address is specified, and the socket hasn't been
 connected;
-.TP 15
-[ENOBUFS]
+.It Bq Er ENOBUFS
 when the system runs out of memory for
 an internal data structure;
 when the system runs out of memory for
 an internal data structure;
-.TP 15
-[EADDRNOTAVAIL]
+.It Bq Er EADDRNOTAVAIL
 when an attempt is made to create a 
 socket with a network address for which no network interface
 exists.
 when an attempt is made to create a 
 socket with a network address for which no network interface
 exists.
-.SH SEE ALSO
-send(2), recv(2), intro(4N), inet(4F), ip(4P)
+.El
+.Sh SEE ALSO
+.Xr send 2 ,
+.Xr recv 2 ,
+.Xr intro 4 ,
+.Xr inet 4 ,
+.Xr ip 4
+.Sh HISTORY
+The
+.Nm
+protocol appeared in
+.Bx 4.3 .