Socket API from Kernel Space
I need to write a device driver for a network storage device (no, not NAS or iSCSI), and am having difficulty understanding just where the network stack resides -- user or kernel space. I have found some information (on the web and other sources) that might indicate that the stack resides in kernel space. However, the code does not appear to be __KERNEL__ code.
My driver needs to be a kernel mode block device, but how do I access the stack from within kernel space? I have seen other implementations using a daemon, but I would like this to be a purely kernel space ipmlementation. Using BSD sockets would be ideal. However, the /usr/src/linux-2.4.xx/include/linux/sockets.h does not seem to prototype any socket functions. The user space sockets.h does, but I can't get there from kernel space.
Any constructive suggestions would be greatly appreciated.