How to do a ping with ICMP in Java under Linux?

Does anyone know an easy way to do a ping with ICMPs under Linux? I did it under Windows, but under Linux, I've got some issues. I need a procedure that sends a ping with a id number and a seq number and another function pong that waits for a reply and returns the seq and id of the packets it received.

if anyone did this, please tell me how. I know it should be a native method, but how do I implement it...

[430 byte] By [vikingu] at [2007-9-26 4:30:20]
# 1
Current production Java implementations do not provide the necessary support for ICMP in java.net classes. You could do this by either executing the ping command via Runtime.exec() or by calling the OS code via JNI.Chuck
cmccorvey at 2007-6-29 17:42:38 > top of Java-index,Archived Forums,Java Programming...
# 2

rigth, i thought of that. but imagine that i have something like 100 hosts wich i must ping something like 20 times and get all the results in something like 5 seconds.

so i don't think that runtime will be a solution because that kind of pings tend to be safe and wait 1 sec between 2 succesive pings in order to prevent a flood.

i already did it in windows with a native dll. but i'm not so experienced in linux... :( so, if anyone can help...please do

vikingu at 2007-6-29 17:42:38 > top of Java-index,Archived Forums,Java Programming...