All of lore.kernel.org
 help / color / mirror / Atom feed
* can a netfilter hook interact with userspace ?
@ 2004-07-19  4:29 Horton, Dave
  2004-07-21 16:09 ` Pablo Neira
  0 siblings, 1 reply; 4+ messages in thread
From: Horton, Dave @ 2004-07-19  4:29 UTC (permalink / raw)
  To: 'netfilter-devel@lists.netfilter.org'


I want to write a netfilter hook to do some specialized packet routing with
greatest efficiency.  However, the actions taken in my netfilter hook need
to be driven by decisions made in a user process (ie which ports to forward,
etc change based on knowledge only known to my user process).  

By what means can my userspace program call into my netfilter hook to
communicate this information?

^ permalink raw reply	[flat|nested] 4+ messages in thread
* RE: can a netfilter hook interact with userspace ?
@ 2004-07-22  1:08 Horton, Dave
  2004-07-22  9:17 ` Pablo Neira
  0 siblings, 1 reply; 4+ messages in thread
From: Horton, Dave @ 2004-07-22  1:08 UTC (permalink / raw)
  To: 'Pablo Neira', Netfilter Development Mailinglist



>>By what means can my userspace program call into my netfilter hook to
>>communicate this information?
>>  
>>

>You can use nf_register_sockopt/nf_unregister_sockopt to do so. See Sect 
>4.6. Writing New modules -> Receiving Commands From Userspace in the 
>netfilter hacking how to. You can find an example in ip_tables.c.

>If you don't like using getsocksopt/setsocksopt to pass information to 
>kernel space, you could also use netlinks sockets.

Thank you, both the example code and the netfilter hacking how to were
helpful as far as how to write the kernel side of things.  However, I'm
unclear how the user program needs to be written, and the how-to doesn't
seem to address this.  I'm quite familiar with sockets programming, though
not in this context (user-kernel communication), and I am wondering exactly
how the user program creates the socket (via socket() I assume, but what
params?) in such a way as to "connect" to my kernel module, such that calls
it issues to getsockopt and setsockopt call my handler.  Sorry for the dumb
question and I will gladly read the relevant docs (or even better: sample
code) if someone can point me to them, but I scoured the netfilter hacking
howto and didn't find the info I need.

Thank you.

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

end of thread, other threads:[~2004-07-22  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-19  4:29 can a netfilter hook interact with userspace ? Horton, Dave
2004-07-21 16:09 ` Pablo Neira
  -- strict thread matches above, loose matches on Subject: below --
2004-07-22  1:08 Horton, Dave
2004-07-22  9:17 ` Pablo Neira

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.