All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mr Dash Four <mr.dash.four@googlemail.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Netfilter Developer Mailing List
	<netfilter-devel@vger.kernel.org>,
	netfilter@vger.kernel.org
Subject: Re: event-driven connection tracking
Date: Wed, 13 Oct 2010 23:18:18 +0100	[thread overview]
Message-ID: <4CB6302A.8080507@googlemail.com> (raw)
In-Reply-To: <alpine.LNX.2.01.1010131747460.27120@obet.zrqbmnf.qr>


>> 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?
>>     
>
> conntrack -Ee NEW,DESTROY
>
> would list you the specified events as they happen. Combined with a 
> script that reacts when a new line is outputted by conntrack should
> do the trick.
>   
That's not what I am after!

If I want to poll a text output every-so-often I can use 
/proc/net/nf_conntrack for that. I am after event-driven tracking 
(without the polling!), informing me when the conditions I initially set 
are satisfied (connection status, source IP, destination IP etc) and I 
pick up the rest (again, via a program interface or a script if there is 
no other choice). A bit like (ng-)cron, but with set filters which 
trigger the events (as oppose to timing as is the case with cron).

  reply	other threads:[~2010-10-13 22:18 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 [this message]
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

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=4CB6302A.8080507@googlemail.com \
    --to=mr.dash.four@googlemail.com \
    --cc=jengelh@medozas.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@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.