icmp(4p)icmp(4p)Name
icmp - Internet Control Message Protocol
Syntax
#include <sys/socket.h>
#include <netinet/in.h>
s = socket(AF_INET, SOCK_RAW, proto);
Description
The ICMP is the error and control message protocol used by the Internet Protocol (IP) transport layer and the Internet protocol family. It
can be accessed through a ``raw socket'' for network monitoring and diagnostic functions. The proto argument to the socket call to create
an ICMP socket is obtained from the routine. ICMP sockets are connectionless, and are normally used with the and system calls. The call
can also be used to fix the destination for future packets (in which case the or and or system calls can then 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.
Diagnostics
On failure, a socket operation returns any of the following errors:
[EISCONN] Tried to establish a connection on a socket that already has one, or tried to send a datagram with the destination address
specified and the socket was already connected.
[ENOTCONN] Tried to send a datagram, but no destination address was specified, and the socket has not connected.
[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.
See Alsoinet(4f), intro(4n), ip(4p)icmp(4p)
Check Out this Related Man Page
ICMP(4P)ICMP(4P)NAME
icmp - Internet Control Message Protocol
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
s = socket(AF_INET, SOCK_RAW, proto);
DESCRIPTION
ICMP is the error and control message protocol used by IP and the Internet protocol family. It may be accessed through a "raw socket" for
network monitoring and diagnostic functions. The proto parameter to the socket call to create an ICMP socket is obtained from getprotoby-
name(3N). ICMP sockets are connectionless, and are normally used with the sendto and recvfrom calls, though the connect(2) call may also
be used to fix the destination for future packets (in which case the read(2) or recv(2) and write(2) or send(2) 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.
DIAGNOSTICS
A socket operation may fail with one of the following errors returned:
[EISCONN] when trying to establish a connection on a socket which already has one, or when trying to send a datagram with the destina-
tion address specified and the socket is already connected;
[ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket hasn't been connected;
[ENOBUFS] when the system runs out of memory for an internal data structure;
[EADDRNOTAVAIL]
when an attempt is made to create a socket with a network address for which no network interface exists.
SEE ALSO send(2), recv(2), intro(4N), inet(4F), ip(4P)4.3 Berkeley Distribution May 16, 1986 ICMP(4P)
hi everybody !
i want create server/clients in c++
anyone can give me i little exemple for send a string ?
or give me a good site for explain.
thx (1 Reply)
Hi, does anybody know how to set the IP source address of an IP packet to be zero? The problem is that when you create a raw socket and set the IP_HDRINCL socket option, if you put the ip_src address to zero (INADDR_ANY) the kernel will automatically set the source address to the primary IP address... (2 Replies)
Hello there
The socket option IP_OPTIONS returns an integer value,
supposed to be the contents of the IP header.
Could you please help me out to interpret those values.
ThankYou. (1 Reply)
Could anyone tell me please:
-what the socket number of a network computer is?
-How it is related to the IP address?
-And how can I obtain this information from my work station?
:D (2 Replies)
I have been serching for a guide to unix C network programming everywhere but I have found only some tuorials, very useful but a little bit poors.
My question is if exist a network domain all over the world where C socket is treated with examples.
Programs i have looked into is hard to... (4 Replies)
my system is a stand alone system... i want to try doing socket porgramming..ihave heard that this is usually done during testing...
how can i do that....? (6 Replies)
HI folks,
I am developing a software which one of the module is to interchange the ip address of another active network interface's when making a socket connection.
I would like to know whether there is any function call that would enable me to retrieve the ip address that is obtained by a... (2 Replies)
Hi All,
How to disable ICMP time stamp request and time stamp reply of a machine?
How to test this feature from remote machine?
Please reply back
Vasanth (2 Replies)
I'm not a unix expert so I need to ask what maybe a simple question to some. Is there a log file which records any icmp packets hitting the server? I ask, because I need to verify what the ip is from a server pinging mine. (3 Replies)
I need some help thinking of ways to quickly check if I am connected to the internet while on an internal network. I never lose connection to the internal network but for some annoying reason I lose the internet quite often. I don't get any errors or warnings. I usually find out that I have lost my... (2 Replies)
I am new to using AIX but ive ran into issues with 100% full and then rebooting and having a socket error repeating over and over. My question is, what can I do besides just monitoring to ensure I dont run into these issues? Scripts? anything? Thanks (3 Replies)
Hi,
I am using following command:
tcpdump -i eth1 icmp =8 >output.txt
i want this command to get execute for a minute only. How can we do this?
Thanks.
Please use code tags next time for your code and data. Thanks (2 Replies)
I've been trying to set up the phantom protocol just to try it out. I compiled it fine, but when I ran it I got an error that the configuration file wouldn't load. I found that file didn't exist, so I created it with a blank file, but got this:
./phantom
Loading configuration file... (4 Replies)