Coding Divert Sockets/Your First Divert Socket
Coding divert sockets take a lot of patience. If you have worked with kernels in the past, this is going to be a cakewalk for you. If not, well, you'll get a lot from the experience. But, we aren't working in the kernel, we're working next to it. Don't let yourself get fooled. Don't let yourself get confident, either. The slightest mistake in your code can set off a completely different, undesired function.
Now that you're scared, let's dig down into the meat.