netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo@netfilter.org>
Cc: Shyam Saini <mayhs11saini@gmail.com>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>
Subject: Re: [RFC PATCH nft V4] src: Add import command for json
Date: Thu, 21 Sep 2017 13:08:26 +0200	[thread overview]
Message-ID: <20170921110826.GB4504@salvia> (raw)
In-Reply-To: <CAOkSjBj0SZ18kUPrp4r-4P18ZOwmC+6hS16ZSyOU=JOYK6UZTw@mail.gmail.com>

On Thu, Sep 21, 2017 at 08:52:56AM +0200, Arturo Borrero Gonzalez wrote:
> On 20 September 2017 at 12:14, Shyam Saini <mayhs11saini@gmail.com> wrote:
> > This new operation allows to import ruleset in json to make
> > incremental changes using the parse functions of libnftnl.
> >
> > A basic way to test this new functionality is:
> >
> >  % cat file.json | nft import json
> >
> > where the file.json is a ruleset exported in json format.
> >
> > Highly based on work from  Alvaro Neira <alvaroneay@gmail.com>
> > and Arturo Borrero <arturo@netfilter.org>
> >
> > Acked-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
> > Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
> > ---
> > V4:
> >   Fix coding style issues
> >   Avoid nested function calls (As Suggested by Arturo )
> 
> LGTM
> 
> Thanks Shyam!
> 
> Just tested this patch, along with the one adding the testcase.
> All seems fine.
> 
> @Pablo, please, review and apply.

My only concern with this is that we'll end up having a json
representation in high-level format.

So I wonder if it would be good to make a distinction between the
low-level VM (Virtual-Machine) json representation and the high-level
one.

What I'm proposing is that we just add a command like this:

nft add export vm json

So the vm keyword specifies that we want a VM representation. So we
leave room for Eric Leblond's high level json representation.

I would turn 'nft export json' into no-op now, and we document this
change in the 0.8 release, since we aren't yet on 1.0, we still have a
bit of room to make these changes...

Fine with this?

  reply	other threads:[~2017-09-21 11:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 10:14 [RFC PATCH nft V4] src: Add import command for json Shyam Saini
2017-09-21  6:52 ` Arturo Borrero Gonzalez
2017-09-21 11:08   ` Pablo Neira Ayuso [this message]
2017-09-25 17:23     ` Shyam Saini

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=20170921110826.GB4504@salvia \
    --to=pablo@netfilter.org \
    --cc=arturo@netfilter.org \
    --cc=mayhs11saini@gmail.com \
    --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).