xref: /386bsd/usr/share/man/cat4/icmp.0 (revision a2142627)
1ICMP(4)                   386BSD Programmer's Manual                   ICMP(4)
2
3NNAAMMEE
4     iiccmmpp - Internet Control Message Protocol
5
6SSYYNNOOPPSSIISS
7     MMaakkeeffiillee::
8     $$((NNOONNSSTTDDIINNCC)) ++== $$((IINNCCNNEETT))
9     CC::
10     ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
11     ##iinncclluuddee ""iinn..hh""
12
13     _i_n_t
14     ssoocckkeett(_A_F__I_N_E_T, _S_O_C_K__R_A_W, _p_r_o_t_o)
15
16DDEESSCCRRIIPPTTIIOONN
17     ICMP is the error and control message protocol used by IP and the
18     Internet protocol family.  It may be accessed through a ``raw socket''
19     for network monitoring and diagnostic functions.  The _p_r_o_t_o parameter to
20     the socket call to create an ICMP socket is obtained from
21     getprotobyname(3).  ICMP sockets are connectionless, and are normally
22     used with the sendto and recvfrom calls, though the connect(2) call may
23     also be used to fix the destination for future packets (in which case the
24     read(2) or recv(2) and write(2) or send(2) system calls may be used).
25
26     Outgoing packets automatically have an IP header prepended to them (based
27     on the destination address).  Incoming packets are received with the IP
28     header and options intact.
29
30DDIIAAGGNNOOSSTTIICCSS
31     A socket operation may fail with one of the following errors returned:
32
33     [EISCONN]        when trying to establish a connection on a socket which
34                      already has one, or when trying to send a datagram with
35                      the destination address specified and the socket is
36                      already connected;
37
38     [ENOTCONN]       when trying to send a datagram, but no destination
39                      address is specified, and the socket hasn't been
40                      connected;
41
42     [ENOBUFS]        when the system runs out of memory for an internal data
43                      structure;
44
45     [EADDRNOTAVAIL]  when an attempt is made to create a socket with a
46                      network address for which no network interface exists.
47
48SSEEEE AALLSSOO
49     send(2),  recv(2),  intro(4),  inet(4),  ip(4)
50
51HHIISSTTOORRYY
52     The iiccmmpp protocol appeared in 4.3BSD.
53
544.3 Berkeley Distribution       March 28, 1991                               1
55
56
57
58
59
60
61
62
63
64
65
66
67