Internet control message protocol
s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
fd = open(_PATH_ICMP, flags);
ICMP is the error and control message (or device)
protocol used by IP and the Internet protocol
family. It may be accessed through a ``raw socket''
for network monitoring and diagnostic functions. The
IPPROTO_ICMP parameter to the socket call to
create an ICMP socket is obtained from
ICMP sockets are connectionless, and are normally
used with the sendto and recvfrom
call may also be used to fix the destination for future
packets (in which case the
system calls 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.
driver can also be accessed by opening it directly. Networking
statistics can be gathered by issuing an
directive to the driver.
The following STREAMS
requests, defined in
are supported by the
statistics structure. The argument passed to the
call is a pointer to an
To set the
associated with that end-point as a management
(to distinguish it from others when network statistics are gathered).
A socket operation may fail with one of the following errors returned:
The errno is set to the following value upon the
failure of the ioctl operation:
when trying 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.
when trying to send a datagram, but
no destination address is specified, and the socket hasn't been
when the system runs out of memory for
an internal data structure.
when an attempt is made to create a
socket with a network address for which no network interface
when no argument/NULL argument is passed to the driver.
icmp is conformant with:
RFC 792 (STD 5), RFC 950 (STD 5)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003