All of lore.kernel.org
 help / color / mirror / Atom feed
* using ip_queue in kernel space
@ 2004-03-04 22:21 Unit Zero
  2004-03-04 22:56 ` Henrik Nordstrom
  2004-03-04 23:20 ` Jon Webb
  0 siblings, 2 replies; 4+ messages in thread
From: Unit Zero @ 2004-03-04 22:21 UTC (permalink / raw)
  To: netfilter-devel

I've been curious for a while about the viability of using ip_queue from 
a kernel module, without any userland side. It seems that ip_queue is 
really only used for deferring the verdict on packets to a userspace 
program, but if I simply install a queue handler in the module init 
entrypoint and then install a netfilter hook that returns a QUEUE verdict 
on packets I want, and then do whatever in my queue handler, (kick off 
timer tasks to issue verdicts or some other such thing) will this work? 

I've been meaning to just throw together a quickie test module, strap on 
my kernel-panic helmet and give it a spin, but haven't gotten around to 
it, since I've been busy developing alot of traffic/bandwidth stuff 
(hashing dest-host/port pairs in a netfilter hook and counting total 
incoming/outgoing traffic per port on a server is fun!)

- Vic M. Condino

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

* Re: using ip_queue in kernel space
  2004-03-04 22:21 using ip_queue in kernel space Unit Zero
@ 2004-03-04 22:56 ` Henrik Nordstrom
  2004-03-04 23:32   ` Unit Zero
  2004-03-04 23:20 ` Jon Webb
  1 sibling, 1 reply; 4+ messages in thread
From: Henrik Nordstrom @ 2004-03-04 22:56 UTC (permalink / raw)
  To: Unit Zero; +Cc: netfilter-devel

On Thu, 4 Mar 2004, Unit Zero wrote:

> I've been curious for a while about the viability of using ip_queue from 
> a kernel module, without any userland side. It seems that ip_queue is 
> really only used for deferring the verdict on packets to a userspace 
> program

This is the purpose of the ip_queue module yes, but another QUEUE handlers
may be installed if you prefer differently.

QUEUE is a function of netfilter to defer the verdict of a packet.

ip_queue is a QUEUE handler communicating to userspace to get the 
verdirct.

As long as your QUEUE handler follows the defined API for QUEUE handlers 
it should work. Netfilter does not care what the QUEUE handler does, only 
that there is a handler and how/when it returns the verdict.

Regards
Henrik

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

* Re: using ip_queue in kernel space
  2004-03-04 22:21 using ip_queue in kernel space Unit Zero
  2004-03-04 22:56 ` Henrik Nordstrom
@ 2004-03-04 23:20 ` Jon Webb
  1 sibling, 0 replies; 4+ messages in thread
From: Jon Webb @ 2004-03-04 23:20 UTC (permalink / raw)
  To: netfilter-devel


Unit Zero wrote:

>I've been curious for a while about the viability of using ip_queue from 
>a kernel module, without any userland side. It seems that ip_queue is 
>really only used for deferring the verdict on packets to a userspace 
>program, but if I simply install a queue handler in the module init 
>entrypoint and then install a netfilter hook that returns a QUEUE verdict 
>on packets I want, and then do whatever in my queue handler, (kick off 
>timer tasks to issue verdicts or some other such thing) will this work? 
>
>  
>
Of course, there are kernel level calls for getting packets out and 
reinjecting them... They can be called from a kernel module. I tried to 
do this once, and it worked ok, except that I needed access to the 
kernel routing table flags to decide what to do with the packets, and I 
could only get at those from userspace (ironically), so I had to abandon 
that implementation.

- Jon Webb

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

* Re: using ip_queue in kernel space
  2004-03-04 22:56 ` Henrik Nordstrom
@ 2004-03-04 23:32   ` Unit Zero
  0 siblings, 0 replies; 4+ messages in thread
From: Unit Zero @ 2004-03-04 23:32 UTC (permalink / raw)
  To: Henrik Nordstrom; +Cc: netfilter-devel

Great, thanks. This is exactly what I wanted to know. Well, time to go 
play with queue handler code I guess :)

- Vic M. Condino

On Thu, 4 Mar 2004, Henrik Nordstrom wrote:

> On Thu, 4 Mar 2004, Unit Zero wrote:
> 
> > I've been curious for a while about the viability of using ip_queue from 
> > a kernel module, without any userland side. It seems that ip_queue is 
> > really only used for deferring the verdict on packets to a userspace 
> > program
> 
> This is the purpose of the ip_queue module yes, but another QUEUE handlers
> may be installed if you prefer differently.
> 
> QUEUE is a function of netfilter to defer the verdict of a packet.
> 
> ip_queue is a QUEUE handler communicating to userspace to get the 
> verdirct.
> 
> As long as your QUEUE handler follows the defined API for QUEUE handlers 
> it should work. Netfilter does not care what the QUEUE handler does, only 
> that there is a handler and how/when it returns the verdict.
> 
> Regards
> Henrik

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

end of thread, other threads:[~2004-03-04 23:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-04 22:21 using ip_queue in kernel space Unit Zero
2004-03-04 22:56 ` Henrik Nordstrom
2004-03-04 23:32   ` Unit Zero
2004-03-04 23:20 ` Jon Webb

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.