Raw Sockets

Simon Marlow simonmar@microsoft.com
Mon, 4 Mar 2002 12:00:33 -0000

> How do I use raw sockets? According to the documentation I=20
> can use AF_RAW.
> It also refers the user to the implementation in
> fptools/hslibs/net/SocketPrim.lhs. Do I really need to do=20
> this and if so
> how do I get it?

The SocketPrim library (aka Network.Socket) really only supports AF_INET
and AF_UNIX.  Many of the other AF_ things are quite system-dependent;
eg. Linux doesn't have AF_RAW.

The documentation is a bit slack, although it does mention at the top of
the Family(..) definition that "your mileage may vary depending on the
OS you use".

Do you really want a raw socket, or will a datagram (UDP) socket do?  If
so, you can just pass Datagram as the SocketType argument to