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