netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Asim Shankar <asimshankar@gmail.com>
To: Weber Matthias <weber@faps.uni-erlangen.de>
Cc: netdev@oss.sgi.com
Subject: Re: filtering packtes before OS takes care about them
Date: Mon, 28 Feb 2005 14:09:56 -0600	[thread overview]
Message-ID: <7bca1cb50502281209798e8a00@mail.gmail.com> (raw)
In-Reply-To: <09766A6E64A068419B362367800D50C0B58A17@moritz.faps.uni-erlangen.de>

> 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.

You can process packets even before ip_rcv() gets them by registering
your own packet handler (struct packet_type) using dev_add_pack().  I
have a small sample at:
http://limnos.csrd.uiuc.edu/notes/code-samples/samples/kernel/packet_type/packet_type_test.c
This may not be the cleanest way, but it isn't that dirty either.

Also see:
http://www.phrack.org/show.php?p=55&a=12

-- Asim

  parent reply	other threads:[~2005-02-28 20:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-28 16:16 filtering packtes before OS takes care about them Weber Matthias
2005-02-28 17:38 ` bert hubert
2005-02-28 20:09 ` Asim Shankar [this message]
2005-03-01  0:30   ` Pedro Fortuna
2005-03-01  1:53     ` jamal
2005-03-01  3:35     ` Asim Shankar
2005-03-01 16:33       ` Pedro Fortuna
2005-03-05 14:08   ` Pedro Fortuna
2005-03-05 18:58     ` Asim Shankar
2005-03-05 19:36       ` Pedro Fortuna
     [not found]         ` <7bca1cb50503051729e3273d3@mail.gmail.com>
2005-03-06  2:04           ` Pedro Fortuna
2005-03-07  2:46           ` Pedro Fortuna
2005-03-01 17:20 ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2005-02-28 18:59 AW: " Weber Matthias
2005-03-01  0:26 ` Thomas Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bca1cb50502281209798e8a00@mail.gmail.com \
    --to=asimshankar@gmail.com \
    --cc=netdev@oss.sgi.com \
    --cc=weber@faps.uni-erlangen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).