All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Nils Rennebarth <Nils.Rennebarth@web.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: How to register conntrack notifier
Date: Wed, 28 Oct 2009 13:14:31 +0100	[thread overview]
Message-ID: <4AE835A7.7040400@netfilter.org> (raw)
In-Reply-To: <894367326@web.de>

Nils Rennebarth wrote:
> Hi,
> 
> The help text for NF_CONNTRACK_EVENTS reads:
>   If this option is enabled, the connection tracking code will
>   provide a notifier chain that can be used by other kernel code
>   to get notified about changes in the connection tracking state.
> which sounds just like what I need: I want to execute a callback
> whenever a conntrack gets destroyed. However studying
> nf_conntrack_netlink.c, nf_conntrack_ecache.c and related header files
> for quite a while now, i am still unable to figure out how to do that.
> 
> Can someone enlighten me?

You have to register a structure nf_ct_event_notifier with the callback
function, you have to look at nf_conntrack_ecache.c and
nf_conntrack_netlink.c. There one problem though since you can only
register one callback and that one is usually used by nf_conntrack_netlink.c

You can also catch events from user-space by means of
libnetfilter_conntrack, have a look at utils/, it includes some examples.

  reply	other threads:[~2009-10-28 12:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27 15:03 How to register conntrack notifier Nils Rennebarth
2009-10-28 12:14 ` Pablo Neira Ayuso [this message]
2009-11-12 10:52   ` Luca Pesce
2009-11-12 12:13     ` Pablo Neira Ayuso
2009-11-13  8:39       ` Luca Pesce
2009-11-13 10:50         ` Pablo Neira Ayuso
2009-11-13 14:18           ` Luca Pesce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AE835A7.7040400@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=Nils.Rennebarth@web.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.