netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mr Dash Four <mr.dash.four@googlemail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Developer Mailing List
	<netfilter-devel@vger.kernel.org>,
	netfilter@vger.kernel.org
Subject: Re: event-driven connection tracking
Date: Thu, 14 Oct 2010 14:14:21 +0100	[thread overview]
Message-ID: <4CB7022D.3010209@googlemail.com> (raw)
In-Reply-To: <4CB6F11B.6000103@netfilter.org>


>> Is it possible to use event-driven connection tracking - with
>> conntrack-utils or by other means?
>>
>> Ideally, what I would like to do is 'register' a handler for particular
>> connection events (when new connection is established and then closed
>> for example) based on particular pre-defined filter (say, by protocol,
>> source/destination ip etc) and execute a program code/function (if done
>> programmatically) or a script (if done outside the connection-tracking
>> domain) to do what I want?
>> Currently, the only way to track such 'events' is if I include a
>> separate chain in iptables tracking a particular connection (and logging
>> the event via a normal log jump), but that is not enough for me as I
>> also need to trigger a full dump based on that particular 'filter' and
>> end this dump when the connection is closed. Any ideas?
>>     
>
> You can use libnetfilter_conntrack for that:
> http://www.netfilter.org/projects/libnetfilter_conntrack/index.html
>   
THAT is exactly what I was after - program interface through which I can 
register the events I am interested in and handle them in my own way.

> There are several examples under utils/ in the tarballs that are
> distributed.
>   
Yep, conntrack_events.c and expect_events.c seem to be a good match and 
provide me with a decent skeleton on which to base my own code. Thanks 
for your input, much appreciated.

      reply	other threads:[~2010-10-14 13:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 15:24 event-driven connection tracking Mr Dash Four
2010-10-13 15:48 ` Jan Engelhardt
2010-10-13 22:18   ` Mr Dash Four
2010-10-13 22:56     ` Jan Engelhardt
2010-10-14 12:04       ` Pablo Neira Ayuso
2010-10-14 13:26         ` Mr Dash Four
2010-10-15  7:17           ` Pablo Neira Ayuso
2010-10-14 12:01 ` Pablo Neira Ayuso
2010-10-14 13:14   ` Mr Dash Four [this message]

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=4CB7022D.3010209@googlemail.com \
    --to=mr.dash.four@googlemail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).