From patchwork Mon May 28 13:48:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 921547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=nwl.cc Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40vdVw1DsRz9s08 for ; Mon, 28 May 2018 23:48:56 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754745AbeE1Nsy (ORCPT ); Mon, 28 May 2018 09:48:54 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:33664 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753169AbeE1Nsf (ORCPT ); Mon, 28 May 2018 09:48:35 -0400 Received: from localhost ([::1]:48940 helo=tatos) by orbyte.nwl.cc with esmtp (Exim 4.90_1) (envelope-from ) id 1fNIVm-0000Xz-Ub; Mon, 28 May 2018 15:48:35 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [nft PATCH 00/14] JSON: Some minor schema changes Date: Mon, 28 May 2018 15:48:05 +0200 Message-Id: <20180528134819.13625-1-phil@nwl.cc> X-Mailer: git-send-email 2.17.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org While writing JSON schema documentation, a number of ugly/broken bits were identified which this series addresses in patches 1-7. Patches 8-11 contain some fixes and improvements to parser_json.c which don't change the schema. Patches 12 and 13 contain fixes for JSON part of tests/py, identified while testing the above. In patch 14, there is a change which affects standard syntax: Printing of the default meter size is removed - if the user didn't specify it, he will not expect it as part of the output. If he did, it not being part of the output indicates that it wasn't necessary, like with other redundant expressions which are optimized away. Phil Sutter (14): objref: Use "ct helper" for NFT_OBJECT_CT_HELPER JSON: Use "type" for CT helper object JSON: Disallow non-array concat expression values JSON: Sort out rule position and handles in general JSON: Review meter statement support JSON: Review set elem expressions JSON: Fix parsing and printing of limit objects JSON: Simplify tcp option expression parsing a bit JSON: Improve prefix expression parsing error message a bit JSON: Fix parsing of meter statement key JSON: Simplify immediate value parsing tests/py: Adjust JSON for changes in any/ct.t tests/py: Add missing JSON equivalent for inet/sets.t meter: Don't print default size value include/statement.h | 2 + src/json.c | 92 +++++++------- src/parser_bison.y | 1 - src/parser_json.c | 183 +++++++++++++--------------- src/statement.c | 12 +- tests/py/any/ct.t.json | 39 +++++- tests/py/any/ct.t.json.output | 59 +++++++++ tests/py/inet/sets.t.json | 37 ++++++ tests/py/ip/flowtable.t | 2 +- tests/py/ip/flowtable.t.json | 5 +- tests/py/ip/flowtable.t.json.output | 23 ++++ tests/py/ip/flowtable.t.payload | 4 +- tests/py/ip/objects.t.json | 4 +- tests/py/ip6/flowtable.t | 4 +- tests/py/ip6/flowtable.t.json | 4 +- tests/py/nft-test.py | 10 +- 16 files changed, 305 insertions(+), 176 deletions(-) create mode 100644 tests/py/inet/sets.t.json create mode 100644 tests/py/ip/flowtable.t.json.output