
Simon,
Thanks. On Linux I get
[dom@lhrtba8fd85 ping]$ test5
Protocol name: icmp
Protocol aliases: ["ICMP"]
Protocol number: 1
Fail: permission denied
Action: socket
Reason: privileged operation
as expected but on W98 I get
C:\Dom\haskell\ping>main
Protocol name: icmp
Protocol aliases: ["ICMP"]
Protocol number: 1398538241
Fail: failed
Action: socket
Reason: No error
I would have expected success. I haven't got access to C tools so I can't
see if I would get the same if I used the C sockets API.
Dominic.
"Simon Marlow" It looks like you want SOCK_RAW, not AF_RAW. GHC does support this,
with the 'Raw' socket type, something like this: proto <- getProtocolByName "icmp"
s <- socket AF_INT Raw proto should be:
s <- socket AF_INET Raw (protoNumber proto)
and of course you have to be root to send raw packets to the network.
Cheers,
Simon
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-------------------------------------------------------------------------------------------------
Save time by using an eTicket and our Self-Service Check-in Kiosks.
For more information go to http://www.britishairways.com/eservice1