netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: nf-devel <netfilter-devel@vger.kernel.org>
Subject: Re: Implicit flow tables can't be listed
Date: Wed, 22 Jun 2016 14:15:03 +0200	[thread overview]
Message-ID: <20160622121503.GA12472@salvia> (raw)
In-Reply-To: <20160616102901.GA27422@breakpoint.cc>

Hi Florian,

On Thu, Jun 16, 2016 at 12:29:01PM +0200, Florian Westphal wrote:
> nft currently can't list implicit flow tables, e.g.:
> 
>  nft add rule ip filter forward flow { ip daddr counter }
> 
> ... will work, and it shows up in
> 
> 'nft list flow tables' as 'flow table __ft0' (or some other number) but
> 
>  nft list flow table filter __ft0
> ... will error out ('unexpected junk, expecting string').
> 
> We can either teach scanner.l that __ft{decstring} is a string,
> or force users to always provide a name.
>
> Any preference?

How can we actually relate the rule with the flow table if we have
several anonymous flow tables?

More thoughts on flow tables thing. I think we should explore flow
table declarations support like:

table ip filter {
        flow table ft {
                ip saddr counter
                # content here
        }

        chain forward {
                type filter hook forward priority 0;
                flow @ft
        }

So we can dereference existing flow tables from rules.

This also provides a way to restore blacklist/whitelist in case we want
to save them into file and restore them later. The original idea is
that flow tables contain volatile information, but I think someone may
want to store the current state into file and restore it, eg. in case
it needs to reboot the system.

Moreover, the output of the list flow tables command in nft should be
parseable, as it is the case for the existing object listings.

This needs a bit of code update so we can get the listing working
properly (currently what Pablo Bermudo added is a bit of a hack just
to allow people inspect their content, but as I said in the nft 0.6
announcement, this output format is not stable).

  reply	other threads:[~2016-06-22 12:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 10:29 Implicit flow tables can't be listed Florian Westphal
2016-06-22 12:15 ` Pablo Neira Ayuso [this message]
2016-06-22 12:25   ` Florian Westphal
2016-06-23 10:11     ` 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=20160622121503.GA12472@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.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).