Luke writes:
>
> Nice one. On the subject of sockets my holidays are finally here, and I'm
> gonna play some more with TCP/IP. It would be a lot easier though if I new
> how to link the kernel up to the user space network stack.
>
> Could people give me a few hints on this?
>
Okay, now I have got the top level socket code working, it should be simple
for me to write the framework for a backend to the socket code which
creates a character device it uses to communicate with the user space
networking code. The network program (socket server?) would open
/dev/socket and use select() and ioctl() to tell when another process opens
a socket. When a socket has been created, the socket server uses ioctl to
get the details of the socket, and opens /dev/sock(n) as it communications
end point for that socket. It then calls select() again waiting for more
events to happen (accept, bind, listen, connect, socket) or for data to
be read or written to/from a socket.
I can put together the outline for this code, and get it to work in a
primitive way. Then as the actual network code fleshes out, the socket
layer code can be enhanced, tuned, and cleaned up.
Al