From: Patrick McHardy <kaber@trash.net>
To: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org
Subject: Re: [nft RFC PATCH 0/6] events
Date: Tue, 18 Feb 2014 01:43:49 +0000 [thread overview]
Message-ID: <20140218014348.GD12893@macbook.localnet> (raw)
In-Reply-To: <20140217231654.19943.18736.stgit@nfdev.cica.es>
On Tue, Feb 18, 2014 at 12:18:06AM +0100, Arturo Borrero Gonzalez wrote:
> This series implements basic event reporting in the nftables CLI tool.
Nice.
> The first patches are some neccesary code factorization changes.
> The last patch is the event reporting itself.
>
> Its quite simple, the syntax is:
> % nft event <all|table|chain|rule|set> [xml|json]
So far we're pretty much (except for shortcuts like default "add rule")
following the scheme "nft action object". "event" doesn't fit in this
scheme, so I'd propose to change this to "monitor". Also I guess object
specification could be optional so "all" wouldn't be needed, but that's
not too important.
> To quit, fire CTRL+C (^C).
>
> Currently, 3 possible output formats:
> * A basic XML, provided by libnftnl.
> * A basic JSON, provided by libnftnl.
> * nft default-like syntax.
>
> About this last format:
>
> Rules are hard to print exactly as the user typed because sets and other
> nuances. Possible solutions I've found:
> - assume that an anonymous set event will happen always before a new rule event.
> Cache the anon-set for the following rule event.
> Maybe there are many anon-sets per rule.
That should work fine. But why only cache one set? Basically you can assume
all anonymous sets to be constant once they have been bound.
> - when a rule event happens, query for sets inside the event cb.
> - for this to run smoothly, we need to keep tables info in sync with the
> kernel, so in each relevant event, the netlink_ctx is needed to be updated and
> this allows to reuse netlink_delinearize_rule().
>
> But I think this first approach is valid.
>
> So, the format with this series is as follow:
>
> % nft event all
> delete table ip6 filter
> add table ip6 filter
> add chain ip6 filter input { type filter hook input priority 0;}
> add chain ip6 filter forward { type filter hook forward priority 0;}
> add chain ip6 filter output { type filter hook output priority 0;}
> add rule ip6 filter input handle 4
No expressions in the output? Why the set caching then?
> delete rule ip6 filter input handle 4
> add set ip6 filter set1 {type ipv6_address}
Inconsistent wrt. chain blocks. We should have spaces between {} and
the content and too make things parsable it should contain a statement
separator (;) in the single line output.
> delete chain ip6 filter input
> delete set ip6 filter set1
next prev parent reply other threads:[~2014-02-18 1:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 23:18 [nft RFC PATCH 0/6] events Arturo Borrero Gonzalez
2014-02-17 23:18 ` [nft RFC PATCH 1/6] rule: make family2str() public Arturo Borrero Gonzalez
2014-02-18 1:01 ` Pablo Neira Ayuso
2014-02-17 23:18 ` [nft RFC PATCH 2/6] rule: allow to print sets in plain format Arturo Borrero Gonzalez
2014-02-18 1:54 ` Patrick McHardy
2014-02-17 23:18 ` [nft RFC PATCH 3/6] netlink: add netlink_delinearize_set() func Arturo Borrero Gonzalez
2014-02-18 1:56 ` Patrick McHardy
2014-02-18 9:11 ` Arturo Borrero Gonzalez
2014-02-18 9:21 ` Patrick McHardy
2014-02-17 23:18 ` [nft RFC PATCH 4/6] rule: generalize chain_print() Arturo Borrero Gonzalez
2014-02-17 23:18 ` [nft RFC PATCH 5/6] netlink: add netlink_delinearize_rule() func Arturo Borrero Gonzalez
2014-02-17 23:18 ` [nft RFC PATCH 6/6] src: add events reporting Arturo Borrero Gonzalez
2014-02-18 1:10 ` Pablo Neira Ayuso
2014-02-18 2:03 ` Patrick McHardy
2014-02-18 9:28 ` Pablo Neira Ayuso
2014-02-18 9:33 ` Patrick McHardy
2014-02-18 9:43 ` Pablo Neira Ayuso
2014-02-18 9:52 ` Patrick McHardy
2014-02-18 9:58 ` Pablo Neira Ayuso
2014-02-18 10:12 ` Patrick McHardy
2014-02-18 14:21 ` Arturo Borrero Gonzalez
2014-02-18 14:46 ` Patrick McHardy
2014-02-18 1:07 ` [nft RFC PATCH 0/6] events Pablo Neira Ayuso
2014-02-18 1:43 ` Patrick McHardy [this message]
2014-02-18 9:20 ` Arturo Borrero Gonzalez
2014-02-18 9:24 ` Patrick McHardy
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=20140218014348.GD12893@macbook.localnet \
--to=kaber@trash.net \
--cc=arturo.borrero.glez@gmail.com \
--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 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).