All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH] clean up nf_log API
@ 2006-05-10 19:10 Harald Welte
  2006-05-11  5:36 ` Gregor Maier
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Harald Welte @ 2006-05-10 19:10 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Patrick McHardy

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

Hi!

After spending some more time with the nf_log API, I think it still
needs some further cleanup.

The main point of nf_log was to get some unfied support for packet
logging backends, independent of the ruleset.  We currently have logging
backend functionality tied to ipt_LOG, ipt_ULOG packet filter rules,
which is inflexible and unsuitable for other entities within netfilter
that want to log packets.

However, on thing that I missed during the nf_log implementation was the
fact that it was no longer possible to have some rules using LOG, some
others ULOG.  With the introduction of nf_log, it was only possible to
use only one logging mechanism at any given point in time.

Also, there was no fallback support.  If you had configured
nfnetlink_log as your backend and the admin decides to remove that
module, nothing will be logged, even though other mechanisms might be
available and present in the kernel.

Another problem was that neither the ULOG nor the LOG target supported
all of the arguments/parameters that the nfnetlink_log backend needed.
Therefore, it is practically impossible to exploit all the features 
with the current kernel.

Therefore, I now propose the following patchset, which

1) enhances 'struct nf_logger' with a list_head, usage counter a
   priority and pf field
2) cleans up the api.  we now call nf_log_[un]register() once from every
   backend.  registering doesn't mean that it's actually active.
   successive calls to nf_log_[un]bind_pf() will actually bind a given
   backend to the specified protocol family.
3) introduction of a new NFLOG target.  Only that NFLOG target supports
   all the arguments that all our backends support.
4) Adds 'fallback' support.  This means that during unbind or
   unregistration of a given backend, we check in the global list of
   logging backends and chose the one with the hightest priority that
   supports our protocol family.
4) modify ipt_LOG, ipt_ULOG, ip6t_LOG and nfnetlink_log to reflect the
   abovementioned changes.

I have implemented the NFLOG target as iptables target (not xtables) due
to 'customer need'.  However, once we decide that this patch should be
merged, I'll provide an x_tables version.

There are some open questions:

a) we only search for 'fallback' backends during unregistration/unbind.
   Should we also do this during registration?  Or whenever we receive
   a packet and don't have a backend?  Early registration might become
   problematic, since we don't really know what the user wants...
b) reference counting.  We could actually get_module / put_module the
   module that implements a specific backend rather than using our own
   use counter.

Comments welcome.

-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

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

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

end of thread, other threads:[~2006-05-11 11:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-10 19:10 [RFC] [PATCH] clean up nf_log API Harald Welte
2006-05-11  5:36 ` Gregor Maier
2006-05-11  8:39   ` Harald Welte
2006-05-11  8:44     ` Patrick McHardy
2006-05-11  8:59       ` Holger Eitzenberger
2006-05-11 11:55         ` Harald Welte
2006-05-11  6:56 ` Patrick McHardy
2006-05-11  8:25   ` Harald Welte
2006-05-11  8:39     ` Patrick McHardy
2006-05-11  8:58     ` Philip Craig
2006-05-11  8:54 ` Holger Eitzenberger

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.