
On Sat, Jan 10, 2009 at 5:20 AM, Andrew Coppin
Dominic Steinitz wrote:
John Goerzen
writes: Any idea how I get Haskell to send ICMP ECHO packets? (And, obviously, receive the replies.)
SocketType claims to support Raw, which I think is the conventional means for doing this. Whether all the infrastructure for that is there, I don't know. I have never worked with raw sockets though, so I may be leading you down a dark mugger-laden alley here
Here's an example of a Haskell version of ping, now sadly bit-rotted.
Dominic.
I have a worrying feeling this might be too Unix-specific to work on Windows. But I guess it's a start...
If you want to "ping" on windows, you need to use IcmpCreateFile, IcmpSendEcho, IcmpCloseFile for IPv4 or for IPv6, use the Icmp6CreateFile, Icmp6SendEcho2, and Icmp6ParseReplies which are part of iphlpapi, should be fairly trivial to use the loadLibrary and getProcAddress functions from System.Win32.DLL module to access these. -Jeff