We are implementing a user space router for Linux

*******************************************************Our
architecture is as follows

           User Space Router architecture
           ------------------------------

Incoming packet -> NETFILTER -> Queued
                                packet  -
                                handler  |
                                         |
                                         v
 reinject   <- device driver   <-  User space
 into kernel   for reinjection     router
     |
     V
 packet goes out


We have implemented the "Queued packet handler" to
take the packets given by NETFILTER and gives it to
the user space program

The "user space routing program" takes the routing
decision and write the packet back using write() of
the device driver.

write() calls NETFILTER's nf_reinject() to put the
packet back on track

*******************************************************The
problem we have is:

We want to indicate the next hop IP address for the
packet while reinjecting through nf_reinject(), i.e.
We want the forwarding to be done based on the IP
address supplied by the user space program

*******************************************************How
do we do this ?

We could think of these ways
  1. setting skb->dst to correspond to the information
about this IP address
  2. directly call ip_route_input() with proper
parameters
  3. lookup the information about this IP address from
the kernel's routing table

Is any of these feasible ?
Is there a better way ?
*******************************************************
THANKS IN ADVANCE

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

Reply via email to