netdev
[Top] [All Lists]

Re: filtering packtes before OS takes care about them

To: "Weber Matthias" <weber@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: filtering packtes before OS takes care about them
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Tue, 1 Mar 2005 09:20:58 -0800
Cc: <netdev@xxxxxxxxxxx>
In-reply-to: <09766A6E64A068419B362367800D50C0B58A17@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Organization: Open Source Development Lab
References: <09766A6E64A068419B362367800D50C0B58A17@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Mon, 28 Feb 2005 17:16:57 +0100
"Weber Matthias" <weber@xxxxxxxxxxxxxxxxxxxx> wrote:

> Hi,
> 
> i need a possibility to catch IP4 packets (from ethernet devices) before OS' 
> netmodules (IP, UDP, TCP, ICMP, ARP, ROUTE, NETFILTER ...) takes care about 
> them and 
> * to delete them from input buffer such that OS' netmodules can't receive them
> * to modify packet headers and move packets to interface related output 
> buffers
> * to keep them in input buffers such that OS' netmodules can take care about 
> them.
> 
> I would be thankfull for any hint, link or code example.
> 
> Bye
> Matthias

If you need this as a "one off" type project, then another possibility is
to hook onto netif_rx with jprobe (part of the kprobe) to redirect traffic
to a local function first.  
It wouldn't useable for a real production type protocol.

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