From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Netfilter Development Mailinglist <netfilter-devel@vger.kernel.org>
Subject: Re: [RFC NETFILTER 2/4]: Add xt_rateest match
Date: Sun, 25 Nov 2007 18:29:28 +0100 [thread overview]
Message-ID: <4749B0F8.4050500@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0711251824480.9477@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> On Nov 25 2007 18:11, Patrick McHardy wrote:
>
>> Date: Sun, 25 Nov 2007 18:11:48 +0100
>> From: Patrick McHardy <kaber@trash.net>
>> To: Netfilter Development Mailinglist <netfilter-devel@vger.kernel.org>
>> Subject: [RFC NETFILTER 2/4]: Add xt_rateest match
>>
>>
>> index 0000000..e4e0653
>> --- /dev/null
>> +++ b/include/linux/netfilter/xt_rateest.h
>> @@ -0,0 +1,33 @@
>> +#ifndef _XT_RATEEST_MATCH_H
>> +#define _XT_RATEEST_MATCH_H
>> +
>> +enum xt_rateest_match_flags {
>> + XT_RATEEST_MATCH_INVERT = 0x01,
>> + XT_RATEEST_MATCH_ABS = 0x02,
>> + XT_RATEEST_MATCH_REL = 0x04,
>> + XT_RATEEST_MATCH_DELTA = 0x08,
>> + XT_RATEEST_MATCH_BPS = 0x10,
>> + XT_RATEEST_MATCH_PPS = 0x20,
>> +};
>
> Perhaps 1<<0, 1<<1, 1<<2, ...?
I don't really care, so why not :)
>> + spin_lock_bh(&info->est1->lock);
>> + rstats = &info->est1->rstats;
>> + if (info->flags & XT_RATEEST_MATCH_DELTA) {
>> + bps1 = info->bps1 >= rstats->bps ?
>> + info->bps1 - rstats->bps : 0;
>> + pps1 = info->pps1 >= rstats->pps ?
>> + info->pps1 - rstats->pps : 0;
>> + } else {
>> + bps1 = rstats->bps;
>> + pps1 = rstats->pps;
>> + }
>> + spin_unlock_bh(&info->est1->lock);
>> +
>> + if (info->flags & XT_RATEEST_MATCH_ABS) {
>> + bps2 = info->bps2;
>> + pps2 = info->pps2;
>
> I think you can cut down on the extra whitespace around = here,
> it already lines up nicely anyway.
True, that needs some reformatting anyway, especially the ? .. : ..
looks weird.
next prev parent reply other threads:[~2007-11-25 17:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-25 17:11 [RFC NETFILTER 2/4]: Add xt_rateest match Patrick McHardy
2007-11-25 17:28 ` Jan Engelhardt
2007-11-25 17:29 ` Patrick McHardy [this message]
2007-11-25 17:36 ` 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=4749B0F8.4050500@trash.net \
--to=kaber@trash.net \
--cc=jengelh@computergmbh.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 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.