Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/icmp_proto.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/icmp_proto.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/icmp_proto.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/icmp_proto.html on line 8

ICMP

Internet Control Message Protocol

Synopsis:

#include <sys/socket.h>
#include <netinet/in.h>

int socket( AF_INET, 
            SOCK_RAW, 
            proto );

Description:

ICMP is the error- and control-message protocol used by IP and the Internet protocol family. The protocol may be accessed through a “raw socket” for network monitoring and diagnostic functions.

To get the proto parameter to socket() that's used to create an ICMP socket, call getprotobyname(). You normally use ICMP sockets, which are connectionless, with sendto() and recvfrom(), although you can also use connect() to fix the destination for future packets (in which case you can use the read() or recv(), and write() or send() system calls).

Outgoing packets automatically have an IP header prepended to them that's based on the destination address. Incoming packets are received with the IP header and IP options intact.

Returns:

A descriptor referencing the socket, or -1 if an error occurs (errno is set).

Errors:

EADDRNOTAVAIL
Tried to create a socket with a network address for which no network interface exists.
EISCONN
Tried to establish a connection on a socket that already has one, or tried to send a datagram with the destination address specified but the socket is already connected.
ENOBUFS
The system ran out of memory for an internal data structure.
ENOTCONN
Tried to send a datagram, but no destination address was specified, and the socket hasn't been connected.

See also:

ICMP6, IP protocols

connect(), getprotobyname(), read(), recv(), recvfrom(), send(), sendto(), socket(), write()

Based on RFC 792


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/icmp_proto.html on line 149

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/icmp_proto.html on line 149