ICMP Echo-Request

Hello! I'm in extra urgent need to have a program that sends a series of ICMP echo requests over the network to a specified host and waits until the last echo reply is received.
I know little about socket-programming (in particular I've never dealt with icmp sockets) that's why i'm desperate!! :slight_smile:
thanx for any help
bye! andrea

ping will not work?

i have to structure it like this:

.....
clock_getsystemtime(..)
for(x times){
send(echo_request)
sleep(y)
}
receive(last echo_reply)
clock_getsystemtime(..)
....

:smiley: :smiley: :smiley:

You're working on what OS ??

i'm afraid to say that i have to do this on fedora, with the latest kernel rel.

What you want is a customized version of ping that will send packets on the schedule you need:

Download ping source from the ping page:

http://www.ping127001.com/pingpage.htm

Start with ping.c, which already does a lot of what you want. There are header files you will also need, but they should already be on your system.

You will probably want to remove the 'portability' define statements so it's easier to read.