All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schultz <aschultz@tpip.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH RFC nf-next 0/3] named expressions for nf_tables
Date: Mon, 11 Apr 2016 17:27:59 +0200	[thread overview]
Message-ID: <570BC27F.9080409@tpip.net> (raw)
In-Reply-To: <1459961493-7494-1-git-send-email-pablo@netfilter.org>

Hi,

On 04/06/2016 06:51 PM, Pablo Neira Ayuso wrote:
> Hi,
>
> This patchset introduces the named stateful expressions for nf_tables,
> that allows userspace to set a name for the stateful expression for
> several reasons:
>
>   * Provide a unique identifier to fetch and reset it internal state.
>   * Allow to update of their parameters and internal state.
>   * Allow to fetch and reset its internal state.
>   * Refer to the same stateful expression from one or more rules.

Would this support to have rules based on the value of a counter and/or
the current rate (like quotas in nfacct)?

something like this:

nft add rule filter tcp-chain counter name tcp-counter bytes > 10000 jump deny

A more realistic setup might more look like:

table ip filter {
          counter counter-user1234 {
                  packets 6086 bytes 6278052
          }

          chain chain-user1234 {
                  counter name counter-user1234
		 counter name counter-user1234 > 10000000 goto chain-user1234-overlimit
		 counter name counter-user1234 > 500000 goto rate-limit
		 accept
          }

          chain chain-user1234-overlimit {
                  do-once notify userspace somehow
		 reject
          }
}

As far as I know there is currently no mechanism in nft that could do
the "do-once notify userspace somehow", or is there???

The other issue I have with such a scheme that it requires lots of chains per
client and might limit the number of clients that could be supported.

Regards
Andreas

  parent reply	other threads:[~2016-04-11 15:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 16:51 [PATCH RFC nf-next 0/3] named expressions for nf_tables Pablo Neira Ayuso
2016-04-06 16:51 ` [PATCH RFC nf-next 1/3] netfilter: nf_tables: add stateful named expressions Pablo Neira Ayuso
2016-04-06 16:51 ` [PATCH RFC nf-next 2/3] netfilter: nf_tables: support for named expression reference Pablo Neira Ayuso
2016-04-06 16:51 ` [PATCH RFC nf-next 3/3] netfilter: nf_tables: support dump and reset for named expressions Pablo Neira Ayuso
2016-04-07 21:49 ` [PATCH RFC nf-next 0/3] named expressions for nf_tables Florian Westphal
2016-04-08 11:43   ` Pablo Neira Ayuso
2016-04-08 12:04     ` Florian Westphal
2016-04-08 12:12 ` Florian Westphal
2016-04-11 15:27 ` Andreas Schultz [this message]
2016-04-19 19:46   ` Pablo Neira Ayuso
2016-04-20  6:41     ` Pablo Neira Ayuso

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=570BC27F.9080409@tpip.net \
    --to=aschultz@tpip.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@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.