All of lore.kernel.org
 help / color / mirror / Atom feed
* NF_QUEUE examples
@ 2004-04-15 16:22 Ulysses Almeida
  2004-04-15 17:25 ` Sven Schuster
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ulysses Almeida @ 2004-04-15 16:22 UTC (permalink / raw)
  To: Netfilter Devel

  I alredy googled for this topic, but couldn't find any nice text
about.

  I want to understand more about NF_QUEUE return, and possibly use
it. So, where can i find simple examples of using it? Or a text
explaining about it.

  What I understand, is: with NF_QUEUE, I can queue some packet to be
manipulated on userspace. After this, can this packet be dequeued back
to kernel space, and continue with it's journey? How can I write a
userspace code, to handle with packetd queued bu NF_QUEUE? Or I didn't
understand nothing about it?

  Thanks for any help in advance!

-- 
    .~.  Ulysses Almeida
   / V \  munky@maluco.com.br
 / (   ) \  Seja livre, use GNU/Linux! 
   ^^-^^

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

* Re: NF_QUEUE examples
  2004-04-15 16:22 NF_QUEUE examples Ulysses Almeida
@ 2004-04-15 17:25 ` Sven Schuster
  2004-04-15 23:55 ` Pablo Neira
  2004-04-16  9:45 ` Henrik Nordstrom
  2 siblings, 0 replies; 5+ messages in thread
From: Sven Schuster @ 2004-04-15 17:25 UTC (permalink / raw)
  To: Ulysses Almeida; +Cc: Netfilter Devel

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

On Thu, Apr 15, 2004 at 12:22:20PM -0400, Ulysses Almeida told us:
>   I alredy googled for this topic, but couldn't find any nice text
> about.
> 
>   I want to understand more about NF_QUEUE return, and possibly use
> it. So, where can i find simple examples of using it? Or a text
> explaining about it.
> 
>   What I understand, is: with NF_QUEUE, I can queue some packet to be
> manipulated on userspace. After this, can this packet be dequeued back
> to kernel space, and continue with it's journey? How can I write a
> userspace code, to handle with packetd queued bu NF_QUEUE? Or I didn't
> understand nothing about it?

You might want to take a look at net/ipv4/netfilter/ip_queue.c. This
registers a queue handler, delivers packets to user space via netlink
and reinjects them into netfilter when the packet is send back from
userspace.


HTH

Sven

> 
>   Thanks for any help in advance!
> 
> -- 
>     .~.  Ulysses Almeida
>    / V \  munky@maluco.com.br
>  / (   ) \  Seja livre, use GNU/Linux! 
>    ^^-^^

-- 
Linux zion 2.6.5 #1 Sun Apr 4 19:56:55 CEST 2004 i686 athlon i386 GNU/Linux
 19:20:35  up 10 days, 20:04,  2 users,  load average: 0.06, 0.03, 0.00

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: NF_QUEUE examples
  2004-04-15 16:22 NF_QUEUE examples Ulysses Almeida
  2004-04-15 17:25 ` Sven Schuster
@ 2004-04-15 23:55 ` Pablo Neira
  2004-04-16  9:45 ` Henrik Nordstrom
  2 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira @ 2004-04-15 23:55 UTC (permalink / raw)
  To: netfilter-devel

Hi Ulysses,

Ulysses Almeida wrote:

> where can i find simple examples of using it? 
>

http://cvs.netfilter.org/netfilter/testsuite/tools/intercept.c

it hasn't been modified for quite some time but it works.

>  What I understand, is: with NF_QUEUE, I can queue some packet to be
>manipulated on userspace. After this, can this packet be dequeued back
>to kernel space, and continue with it's journey?
>

exactly

> How can I write a
>userspace code, to handle with packetd queued bu NF_QUEUE? Or I didn't
>understand nothing about it?
>  
>

as Sven pointed out, if you are interested you could have a look at
ip_queue.c in kernel side.

regards,
Pablo

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

* RE: NF_QUEUE examples
@ 2004-04-16  8:23 Richard Bishop
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Bishop @ 2004-04-16  8:23 UTC (permalink / raw)
  To: netfilter-devel

Ulysses Almeida wrote:

> where can i find simple examples of using it?

Given that there are two parts to the ip_queue system (namely the userspace 
and kernelspace parts), I tried Googling on 'libipq example' and came up with 
quite a few userful pages.

There is an example in the man page for libipq, an online version of which I 
found at http://www.cs.princeton.edu/~nakao/libipq.htm - I used this example 
when I was playing with it a few weeks back so can confirm that it works ok.

Have a look through the list archives too - this must be a very common 
question.  A list poster back in May 2000 was advised 'In cvs, have a look at 
intercept.c in testsuite/tools and ipq_client.c in OLD/tools.' 
http://lists.netfilter.org/pipermail/netfilter/2000-May/004253.html

Hope this helps.

Regards


Richard

__________________________
Richard Bishop
Department of Computer Science
University of Exeter. UK

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

* Re: NF_QUEUE examples
  2004-04-15 16:22 NF_QUEUE examples Ulysses Almeida
  2004-04-15 17:25 ` Sven Schuster
  2004-04-15 23:55 ` Pablo Neira
@ 2004-04-16  9:45 ` Henrik Nordstrom
  2 siblings, 0 replies; 5+ messages in thread
From: Henrik Nordstrom @ 2004-04-16  9:45 UTC (permalink / raw)
  To: Ulysses Almeida; +Cc: Netfilter Devel

On Thu, 15 Apr 2004, Ulysses Almeida wrote:

>   I alredy googled for this topic, but couldn't find any nice text
> about.

See libipq (part of iptables). Includes documentation and samples.

Regards
Henrik

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

end of thread, other threads:[~2004-04-16  9:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-15 16:22 NF_QUEUE examples Ulysses Almeida
2004-04-15 17:25 ` Sven Schuster
2004-04-15 23:55 ` Pablo Neira
2004-04-16  9:45 ` Henrik Nordstrom
  -- strict thread matches above, loose matches on Subject: below --
2004-04-16  8:23 Richard Bishop

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.