
4 Mar
2002
4 Mar
'02
11:16 a.m.
Thanks for the reply.
I wanted to send ICMP packets. Linux does support AF_RAW. This compiles and runs on my linux system.
/* * Create the socket. */ if ( (proto = getprotobyname("icmp")) == NULL) err_quit("unknown protocol: icmp"); if ( (sockfd = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0) err_sys("can't create raw socket");
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 Cheers, Simon
8479
Age (days ago)
8479
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow