From: Emmanuel Guiton <emmanuel@netlab.hut.fi>
To: netfilter-devel@lists.netfilter.org
Subject: Re: How do I use ip_conntrack_destroyed?
Date: Thu, 04 Dec 2003 16:14:21 +0200 [thread overview]
Message-ID: <3FCF413D.1060405@netlab.hut.fi> (raw)
In-Reply-To: 3FCEE93C.5040104@balabit.hu
Hi!
KOVACS Krisztian wrote:
>
> Hi,
>
> Henrik Nordstrom wrote:
>
>>> /* Call me when a conntrack is destroyed. */
>>> extern void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack);
>>
>>
>> If you want to do this I think you should first extend
>> ip_conntrack_destroyed into a list of handlers with a suitable
>> registration functions to allow more than one module to register a
>> "ip_conntrack_destroyed" function.
>
>
> As I've mentioned, this is already done in the nfnetlink-ctnetlink
> patch.
>
Thanks, it seems to be what I need.
Then, if I'm correct, I should register a function in my module as follows:
static struct ip_conntrack_notify ctnl_notify = { { NULL, NULL },
my_function_destroy,
NULL };
But where is "struct ip_conntrack_notify" defined?
I found the following code in a patch using google. It seems to be a
modification of ip_conntrack.h, but my ip_conntrack.h file does not
include these lines. And it's not in the nfnetlink patch neither. Is
there any other patch that I should install?
-/* These are for NAT. Icky. */
-/* Call me when a conntrack is destroyed. */
-extern void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack);
+/* This is for the ip_conntrack_notify facilities. */
+struct ip_conntrack_notify
+{
+ /* Internal use. */
+ struct list_head list;
+
+ void (*destroyed)(struct ip_conntrack *conntrack);
+ void (*created)(struct ip_conntrack *conntrack,
+ enum ip_conntrack_info info,
+ const struct net_device *in,
+ const struct net_device *out);
+};
+
+extern int ip_conntrack_notify_register(struct ip_conntrack_notify *nb);
+extern int ip_conntrack_notify_unregister(struct ip_conntrack_notify *nb);
Emmanuel
next prev parent reply other threads:[~2003-12-04 14:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-03 12:05 How do I use ip_conntrack_destroyed? Emmanuel Guiton
2003-12-03 14:10 ` KOVACS Krisztian
2003-12-03 21:57 ` Henrik Nordstrom
2003-12-04 7:58 ` KOVACS Krisztian
2003-12-04 14:14 ` Emmanuel Guiton [this message]
2003-12-04 15:10 ` KOVACS Krisztian
2003-12-04 15:32 ` Emmanuel Guiton
2003-12-05 14:57 ` Emmanuel Guiton
2003-12-05 15:56 ` How do I use ip_conntrack_destroyed? [previous message erratum] Emmanuel Guiton
-- strict thread matches above, loose matches on Subject: below --
2003-12-03 10:17 How do I use ip_conntrack_destroyed? Emmanuel Guiton
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=3FCF413D.1060405@netlab.hut.fi \
--to=emmanuel@netlab.hut.fi \
--cc=netfilter-devel@lists.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 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.