All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Peng <jesse@deansoft.com.tw>
To: Henrik Nordstrom <hno@marasystems.com>
Cc: Emmanuel Guiton <emmanuel@netlab.hut.fi>,
	netfilter-devel@lists.netfilter.org
Subject: Re: Counter problem in a new nat target.
Date: Wed, 10 Dec 2003 16:35:52 +0800	[thread overview]
Message-ID: <3FD6DAE8.5040205@deansoft.com.tw> (raw)
In-Reply-To: Pine.LNX.4.44.0312091107570.24092-100000@filer.marasystems.com

[-- Attachment #1: Type: text/plain, Size: 2202 bytes --]

Henrik Nordstrom wrote:

>On Tue, 9 Dec 2003, Emmanuel Guiton wrote:
>
>  
>
>>My problem is that I do not see which data can be accessed by any of the 
>>function involved. To be precise, I need to increment a counter each 
>>time I get one new conntrack. Then I decrement it each time a conntrack 
>>is destroyed or set as assured (tcp connection).
>>    
>>
>
>Then the problem is a lot more complex.
>
>Increasing is not a big problem, but the decreasing are as it is hard to 
>find which counter to decrease from the conntrack and there is no good 
>place to store such information for later without extending the 
>ip_conntrack structure unless you implement this as a conntrack 
>application protocol helper (can be done if no other conntrack helper is 
>needed in the relevant traffic).
>
>Do you really need to decrease the counters?
>  
>
I think there will remain two alternative ways to deal with the 
decrementing counter problem:

1.You maintain a hash struture which list any of your concerning 
conntrack, and while a conntrack facing destroyed then looking  up this 
hash list if it is on the list.
2.I don't think you need any real helper no matter how simple it can 
be.But just to extend your target module while matching ip_ct_new put 
some flags in the help 
information(conntrack->help.Your_patched_private_help_info)indecate that 
this is the conntrack you care. And then while a conntrack facing 
destroyed then looking  up its help info if it is flaged. But if the 
traffic you wanna filter overlaps with other helpers(eg. 
ip_conntrack_ftp),then a somewhat dirty way regarding where you put your 
flags(because help info is only for one helper)is to put them in 
conntrack->nat.help.Your_patched_private_help_info(for this is 
relatively a virgin place seldom touched by famous helpers except as I 
know the pptp helper)

But no matter which above you choose, You can't avoid patching your 
private destroying code like how ip_conntrack_destroyed(destroying code 
for NATed conntrack) been called.Because so far we never see any 
extending conntrack destroying machenism concerning helper's private 
functionality(like helper->destroy).
Hope this can help ;)!

Regards
Jesse

[-- Attachment #2: Type: text/html, Size: 2569 bytes --]

  parent reply	other threads:[~2003-12-10  8:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-08 11:53 Counter problem in a new nat target Emmanuel Guiton
2003-12-08 12:28 ` Henrik Nordstrom
2003-12-09 10:01   ` Emmanuel Guiton
2003-12-09 10:15     ` Henrik Nordstrom
2003-12-09 13:48       ` Emmanuel Guiton
2003-12-09 16:16         ` Henrik Nordstrom
2003-12-10  8:35       ` Jesse Peng [this message]
2003-12-10 11:00         ` Emmanuel Guiton
2003-12-10 11:15           ` Henrik Nordstrom
2003-12-10 12:52             ` Emmanuel Guiton
2003-12-10 14:19               ` Henrik Nordstrom
2003-12-11  3:20                 ` Jesse Peng
2003-12-11  8:20                   ` Henrik Nordstrom

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=3FD6DAE8.5040205@deansoft.com.tw \
    --to=jesse@deansoft.com.tw \
    --cc=emmanuel@netlab.hut.fi \
    --cc=hno@marasystems.com \
    --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.