netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tun.c non formal header protocol?
       [not found] <AANLkTin-PJs07ruhhbC5U0DmqFd-rP8Csorethz_1kes@mail.gmail.com>
@ 2011-02-24 18:37 ` Kfir Lavi
  2011-02-24 19:04   ` Rémi Denis-Courmont
  0 siblings, 1 reply; 2+ messages in thread
From: Kfir Lavi @ 2011-02-24 18:37 UTC (permalink / raw)
  To: netdev

Hi,
I would like to use custom protocol over tun/tap device.
I'm grabbing packets, and changing them, to deliver via tap,
to a listener that knows this custom protocol.
The custom protocol is just wrapping the packet with another
small header.
Is it possible to move custom packets via tun.c ?
Is it possible to have a hook, just before the receiver gets
the packet, and then modify the header of the packet, so
it will not disturb tun.c ?

Is there any other options having the power of Linux stack
and netfilter, and using this custom protocol.

I'm grabbing the packets to userspace using nfq, and then with
verdict I'm returning them to the tap device.

Thanks,
Kfir

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tun.c non formal header protocol?
  2011-02-24 18:37 ` tun.c non formal header protocol? Kfir Lavi
@ 2011-02-24 19:04   ` Rémi Denis-Courmont
  0 siblings, 0 replies; 2+ messages in thread
From: Rémi Denis-Courmont @ 2011-02-24 19:04 UTC (permalink / raw)
  To: Kfir Lavi; +Cc: netdev

Le jeudi 24 février 2011 20:37:32 Kfir Lavi, vous avez écrit :
> I would like to use custom protocol over tun/tap device.

Over TAP, you can only exchange Ethernet frames. However you can use whatever 
network layer you like (so long as it has an Ethernet type associated).

Over TUN, you can exchange packets without any link layer header, for any 
network layer protocol defined in Linux.

In principles, you can probably just use a (Ethernet) type that is not used by 
any existing stack in the Linux kernel. But I don't see any point in doing so, 
as the kernel will just drop the packets on the floor afterward.

> I'm grabbing packets, and changing them, to deliver via tap,
> to a listener that knows this custom protocol.
> The custom protocol is just wrapping the packet with another
> small header.
> Is it possible to move custom packets via tun.c ?

It's difficult to say without a clearer picture what you are trying to do.

-- 
Rémi Denis-Courmont
http://www.remlab.info/
http://fi.linkedin.com/in/remidenis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-24 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <AANLkTin-PJs07ruhhbC5U0DmqFd-rP8Csorethz_1kes@mail.gmail.com>
2011-02-24 18:37 ` tun.c non formal header protocol? Kfir Lavi
2011-02-24 19:04   ` Rémi Denis-Courmont

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