netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Miguel Alejandro González" <maggonzz@gmail.com>
To: Jan Engelhardt <jengelh@inai.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: searching tuples in conntrack
Date: Sun, 7 Oct 2012 02:31:41 -0500	[thread overview]
Message-ID: <CA+Z0r8OcKfcVRv4sKnvvNNOs8_An2HRC86sYTi+NHyz_tLKfig@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.01.1209262231180.30346@nerf07.vanv.qr>

Hello

I'm having some problems creating a function like count_them and the
hash table it uses. My module is a target extension and connlimit is a
match extension.

So correct me if I'm wrong... basically connlimit creates an extra
hash table with struct xt_connlimit_info *info = par->matchinfo as a
parameter to save conntracks and tuples, but I don't have such info
because i'm making a target extension... Can't I do a lookup directly
to the NFCT list?

How can I initialize the hash table like in connlimit_mt_check() if I
don't work with const struct xt_mtchk_param *par?

Can you point in the right direction? I'm really new to kernel dev.. I
hope I'm not asking too much of you

Regards


On Wed, Sep 26, 2012 at 3:32 PM, Jan Engelhardt <jengelh@inai.de> wrote:
> On Wednesday 2012-09-26 19:29, Miguel Alejandro González wrote:
>
>>Hello,
>>
>>I have been reading some kernel code trying to find a function that
>>searches the conntrack hash table for a transport address and returns
>>the given tuple. Is there any way to do this? I found a function in
>>the nat code called find_appropriate_src but i think it only works for
>>the nat table...
>
> nf_conntrack_find_get(...) is the one to use for CT lookup.
> (Cf. xt_connlimit.c)
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-10-07  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 17:29 searching tuples in conntrack Miguel Alejandro González
2012-09-26 20:32 ` Jan Engelhardt
2012-10-07  7:31   ` Miguel Alejandro González [this message]
     [not found]   ` <CA+Z0r8P6zFL0jE3soO+OubGg0buzRE7ZiHAMxXZPMNrJH6tiig@mail.gmail.com>
2012-10-07 11:44     ` Jan Engelhardt

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=CA+Z0r8OcKfcVRv4sKnvvNNOs8_An2HRC86sYTi+NHyz_tLKfig@mail.gmail.com \
    --to=maggonzz@gmail.com \
    --cc=jengelh@inai.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 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).