netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hamid Nassiby <h.nassiby@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: Packet manipulation in user space, drop/reinject modified packets
Date: Fri, 9 Apr 2010 21:23:21 +0430	[thread overview]
Message-ID: <r2tb3f13ff81004090953v4a7eeea7k9072c0e777292407@mail.gmail.com> (raw)

Hello,

I'm working on a project which wants to port a Windows-based network
protocol to Linux. The protocol works as a VPN/Firewall, on packets
copied from Data-Link Layer to user space. In MS Windows
WinpkFilter(C) does copying from kernel space (Data-Link layer)  to
user space and then drops the original packet. In user space, our
protocol does some operation on packet ( e.g. checks  the packet
authority and/or encrypts/decrypts it, ...) and then injects the
packet upward to application layer or downward or simply drops it. The injected
modified packet may not be as the same size of original one.

So our requirements are:

1-Capture each packet which is coming inside or going outside the
computer in Data-link Layer.
2-Create a copy of the packet and drop the original one.
3-Copy of packet must be available in user space to be manipulated by
our protocol.
4-After manipulation in user space, inject encrypted/decrypted version
of the privileged (copy of) packets to the network or upward to the
application layer.

And of course we want to have the minimum changes to be made on our
current protocol.

I tried raw sockets and libnetfilter_queue  , but I didn't find a
suitable solution (specially to let me inject packets upward
to the application layer.)
I need to know if it is possible to do this with libraries/interfaces currently
available in user space or should I write a kernel module to do the
above tasks for us?

It is possible that I be overall in a mistake, so any guidance is pleased,

Thanks in advance,

Hamid.

             reply	other threads:[~2010-04-09 16:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 16:53 Hamid Nassiby [this message]
2010-04-09 23:02 ` Packet manipulation in user space, drop/reinject modified packets Changli Gao

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=r2tb3f13ff81004090953v4a7eeea7k9072c0e777292407@mail.gmail.com \
    --to=h.nassiby@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /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).