From: Pedro Fortuna <pedro.fortuna@gmail.com>
To: netdev@oss.sgi.com
Subject: Re: filtering packtes before OS takes care about them
Date: Tue, 1 Mar 2005 00:30:51 +0000 [thread overview]
Message-ID: <db95d40c05022816301520b0a6@mail.gmail.com> (raw)
In-Reply-To: <7bca1cb50502281209798e8a00@mail.gmail.com>
Hello,
I was searching for something like this also.
In my case, I'll need to intercept all outgoing IP packets and change
them (including L2 frame) before they are passed to the network
interface driver.
The changes are:
-modify the ethertype number in the L2 frame (e.g. DIX frames) to a
private not used one
-complety modify the IP packet header and payload
After this, the packets are sent on their way (passed to the network driver)
The reverse operation is applied to incoming IP Packets in the destination host.
I didnt investigate the packet_type example you provided but I hope I
will be able to used for the purposes I explained.
Best Regards,
Pedro Fortuna
On Mon, 28 Feb 2005 14:09:56 -0600, Asim Shankar <asimshankar@gmail.com> wrote:
> > 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
>
>
next prev parent reply other threads:[~2005-03-01 0:30 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
2005-03-01 0:30 ` Pedro Fortuna [this message]
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=db95d40c05022816301520b0a6@mail.gmail.com \
--to=pedro.fortuna@gmail.com \
--cc=netdev@oss.sgi.com \
/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).