netdev
[Top] [All Lists]

Re: RFC: Redirect-Device

To: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Subject: Re: RFC: Redirect-Device
From: jamal <hadi@xxxxxxxxxx>
Date: 31 Mar 2005 18:46:48 -0500
Cc: "'netdev@xxxxxxxxxxx'" <netdev@xxxxxxxxxxx>
In-reply-to: <424C893A.20601@xxxxxxxxxxxxxxx>
Organization: jamalopolous
References: <424C6089.1080507@xxxxxxxxxxxxxxx> <1112303627.1073.71.camel@xxxxxxxxxxxxxxxx> <424C6B10.6030200@xxxxxxxxxxxxxxx> <1112306031.1073.109.camel@xxxxxxxxxxxxxxxx> <424C7813.4000101@xxxxxxxxxxxxxxx> <1112311240.1096.13.camel@xxxxxxxxxxxxxxxx> <424C893A.20601@xxxxxxxxxxxxxxx>
Reply-to: hadi@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
On Thu, 2005-03-31 at 18:35, Ben Greear wrote:
> jamal wrote:
> 
> > One thing you probably havent understood is that all the action stuff
> > that happens on ingress happens before dev.c pkt receive.
> 
> Could you point me to where this is, or give me something to
> search for?  I'm curious how/where it does the hook, and if I
> understand that better, maybe I can start thinking about how
> to make use of it for future hacks...

dev.c
search for CONFIG_NET_CLS_ACT

To see how simple an action can look like, take a look at
net/sched/gact.c (which does simple drop/accept etc); I have some
patches i need to submit to Dave that would make it even simpler to use
(and write less code). Attached is an example. 

Actually gact may have gotten a little bit complex because it now allows
you to add randomness to accepting, dropping, going to next action etc.

The one thing you have to understand is filters and actions are
separate. So what i am pointing to you is a simple action that is
executed after a packet matches a specified filter. Thomas has been
working on providing what are know as ematches which are very simple
filters that you could program.
You can match a packet and pass it through a series of actions of your
choice.

Also note: This stuff can be done at egress (not just restricted to
ingress).

cheers,
jamal

Attachment: p16
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>