|
|
1.1 root 1: .\" Copyright (c) 1986 Regents of the University of California.
2: .\" All rights reserved.
3: .\"
4: .\" Redistribution and use in source and binary forms are permitted
5: .\" provided that the above copyright notice and this paragraph are
6: .\" duplicated in all such forms and that any documentation,
7: .\" advertising materials, and other materials related to such
8: .\" distribution and use acknowledge that the software was developed
9: .\" by the University of California, Berkeley. The name of the
10: .\" University may not be used to endorse or promote products derived
11: .\" from this software without specific prior written permission.
12: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14: .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15: .\"
16: .\" @(#)icmp.4 6.3 (Berkeley) 7/9/88
17: .\"
18: .TH ICMP 4P "July 9, 1988"
19: .UC 6
20: .SH NAME
21: icmp \- Internet Control Message Protocol
22: .SH SYNOPSIS
23: .B #include <sys/socket.h>
24: .br
25: .B #include <netinet/in.h>
26: .PP
27: .B s = socket(AF_INET, SOCK_RAW, proto);
28: .SH DESCRIPTION
29: ICMP is the error and control message protocol used
30: by IP and the Internet protocol family. It may be accessed
31: through a \*(lqraw socket\*(rq for network monitoring
32: and diagnostic functions.
33: The
34: .I proto
35: parameter to the socket call to create an ICMP socket
36: is obtained from
37: .IR getprotobyname (3N).
38: ICMP sockets are connectionless,
39: and are normally used with the
40: .I sendto
41: and
42: .I recvfrom
43: calls, though the
44: .IR connect (2)
45: call may also be used to fix the destination for future
46: packets (in which case the
47: .IR read (2)
48: or
49: .IR recv (2)
50: and
51: .IR write (2)
52: or
53: .IR send (2)
54: system calls may be used).
55: .PP
56: Outgoing packets automatically have an IP header prepended to
57: them (based on the destination address).
58: Incoming packets are received with the IP header and options intact.
59: .SH DIAGNOSTICS
60: A socket operation may fail with one of the following errors returned:
61: .TP 15
62: [EISCONN]
63: when trying to establish a connection on a socket which
64: already has one, or when trying to send a datagram with the destination
65: address specified and the socket is already connected;
66: .TP 15
67: [ENOTCONN]
68: when trying to send a datagram, but
69: no destination address is specified, and the socket hasn't been
70: connected;
71: .TP 15
72: [ENOBUFS]
73: when the system runs out of memory for
74: an internal data structure;
75: .TP 15
76: [EADDRNOTAVAIL]
77: when an attempt is made to create a
78: socket with a network address for which no network interface
79: exists.
80: .SH SEE ALSO
81: send(2), recv(2), intro(4N), inet(4F), ip(4P)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.