Hello,
I am a kernel hacking newbie and am struggling to understand the
networking subsystem. I would like to be able to add a systemcall,
preferably asynchronous, that connects a socket with a filedescriptor
(proxy(srcsd, dstfd)) so that everything received on srcsd is directly
written to dstfd. The proxy should close when srcsd is closed or when
a zero-size packet is sent (or something like that..).
I started digging in the source yesterday, and have read a little
in "The Linux Kernel" document and a few others, but can't say I
feel much wiser. :-) I was thinking about creating a custom "data_ready"
function that I set for the socket to be forwarded (in "struct sock"),
does this make sense? How would I go about to write the data to the
destination file/socket descriptor?
I am of course fully aware that it is not of public interest and
have certainly not intended to try getting it into the mainstream
kernel. :-) I'm just going to use it for a web server I am developing
that communicates with applications via sockets (UNIX domain for
local apps and TCP for remote), portability is not an issue in this
particular case. Another obvious use is for bouncers.
I would like to avoid the kernel -> userspace -> kernel copying
of data just to forward a packet.. The web server should be able
to scale up to a couple of thousands simultaneous connections
without significant performance penalty, so I plan to use multiple
processes or perhaps threads to avoid the bad scalability of
select()/poll().
When I (or if I :-) get more proficient in kernel hacking I will
perhaps try adding support for fully event-driven I/O handling.
Or are there perhaps any similar patches available from somewhere
already?
-- Joel Eriksson - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon Apr 23 2001 - 21:00:28 EST