Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

icmp(7) [osf1 man page]

icmp(7) 						 Miscellaneous Information Manual						   icmp(7)

NAME
icmp - Internet Control Message Protocol SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> The following is the socket call for sockets using the IPv4 address format: s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); The following is the socket call for sockets using the IPv6 address format: s = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); DESCRIPTION
The Internet Control Message Protocol (ICMP) is the error and control message protocol used by the Internet Protocol (IP) and the Internet Protocol family. It may be accessed through a raw socket for network monitoring and diagnostic functions. ICMP sockets are connection- less, and are normally used with the sendto() and recvfrom() functions. The connect() function may also be used to fix the destination for future packets, in which case the read() or recv() and write() or send() functions may be used. Outgoing packets automatically have an IP header prepended to them (based on the destination address). Incoming packets are received with the IP header and options intact. ERRORS
If a socket operation fails, errno may be set to one of the following values: The socket is already connected. This error occurs when try- ing to establish connection on a socket or when trying to send a datagram with the destination address specified. The destination address of a datagram was not specified, and the socket has not been connected. The system ran out of memory for an internal data structure. An attempt was made to create a socket with a network address for which no network interface exists. RELATED INFORMATION
Functions: send(2), recv(2) Files: netintro(7), inet(7), ip(7) RFC 792, "Internet Control Message Protocol" RFC 2463, "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6)" delim off icmp(7)

Check Out this Related Man Page

icmp(7P)							     Protocols								  icmp(7P)

NAME
icmp, ICMP - Internet Control Message Protocol SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> #include <netinet/ip_icmp.h> s = socket(AF_INET, SOCK_RAW, proto); t = t_open("/dev/icmp", O_RDWR); DESCRIPTION
ICMP is the error and control message protocol used by the Internet protocol family. It is used by the kernel to handle and report errors in protocol processing. It may also be accessed by programs using the socket interface or the Transport Level Interface (TLI) for network monitoring and diagnostic functions. When used with the socket interface, a "raw socket" type is used. The protocol number for ICMP, used in the proto parameter to the socket call, can be obtained from getprotobyname(3SOCKET). ICMP file descriptors and sockets are connection- less, and are normally used with the t_sndudata / t_rcvudata and the sendto() / recvfrom() calls. Outgoing packets automatically have an Internet Protocol (IP) header prepended to them. Incoming packets are provided to the user with the IP header and options intact. ICMP is an datagram protocol layered above IP. It is used internally by the protcol code for various purposes including routing, fault iso- lation, and congestion control. Receipt of an ICMP "redirect" message will add a new entry in the routing table, or modify an existing one. ICMP messages are routinely sent by the protocol code. Received ICMP messages may be reflected back to users of higher-level protocols such as TCP or UDP as error returns from system calls. A copy of all ICMP message received by the system is provided to every holder of an open ICMP socket or TLI descriptor. SEE ALSO
getprotobyname(3SOCKET), recv(3SOCKET), send(3SOCKET), t_rcvudata(3NSL), t_sndudata(3NSL), inet(7P), ip(7P), routing(7P) Postel, Jon, Internet Control Message Protocol -- DARPA Internet Program Protocol Specification, RFC 792, Network Information Center, SRI International, Menlo Park, Calif., September 1981. DIAGNOSTICS
A socket operation may fail with one of the following errors returned: EISCONN An attempt was made 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. ENOTCONN An attempt was made to send a datagram, but no destination address is specified, and the socket has not been con- nected. ENOBUFS The system ran out of memory for an internal data structure. EADDRNOTAVAIL An attempt was made to create a socket with a network address for which no network interface exists. NOTES
Replies to ICMP "echo" messages which are source routed are not sent back using inverted source routes, but rather go back through the nor- mal routing mechanisms. SunOS 5.10 3 Jul 1990 icmp(7P)
Man Page