question on redirecting traffic

From: Gong Su (gongsu@lightforge.cs.columbia.edu)
Date: Fri Apr 21 2000 - 15:53:42 EST


Hi all,

This sounds a very simple problem (and someone may already have done
it) but I can't seem to find a good, clean way to do it. Basically,
I would like to redirect certain type of traffic (e.g., http) to a
userspace program _with the network and transport layer header intact_.
I looked at the REDIRECT action in ipchains and it appears to me that
the redirection is to a regular socket so all the network layer (IP)
and transport layer (TCP/UDP) headers would be lost when the packets
get to the userland. I'm aware that it is possible to redirect matching
packets to a char special device (major 36, minor 3) through firewall
netlink (ipfw man page). But the document on this is rather sparse
(it's not clear whether the headers are preserved) and I'd also rather
not to go through that route. I prefer a socket. Could some kind soul
give me some idea on what's the best way of doing this? I'd like to use
as much as possible existing kernel mechanisms but if certain hack needs
to be done I can deal it too. Thanks very much.

/Gong
gongsu@cs.columbia.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:19 EST