From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37FE9ECAAD1 for ; Wed, 31 Aug 2022 15:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230141AbiHaPC5 (ORCPT ); Wed, 31 Aug 2022 11:02:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbiHaPCz (ORCPT ); Wed, 31 Aug 2022 11:02:55 -0400 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D68ED399F for ; Wed, 31 Aug 2022 08:02:54 -0700 (PDT) Date: Wed, 31 Aug 2022 17:02:50 +0200 From: Pablo Neira Ayuso To: Fernando Fernandez Mancera Cc: netfilter-devel@vger.kernel.org Subject: Re: [PATCH nft] json: add set statement list support Message-ID: References: <20220831123731.26249-1-ffmancera@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220831123731.26249-1-ffmancera@riseup.net> Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Hi Fernando, On Wed, Aug 31, 2022 at 02:37:31PM +0200, Fernando Fernandez Mancera wrote: > When listing a set with statements with JSON support, the statements were > ignored. > > Output example: > > { > "set": { > "op": "add", > "elem": { > "payload": { > "protocol": "ip", > "field": "saddr" > } > }, > "stmt": [ > { > "limit": { > "rate": 10, > "burst": 5, > "per": "second" > } > }, > { > "counter": { > "packets": 0, > "bytes": 0 > } > } > ], > "set": "@my_ssh_meter" > } > } LGTM, thanks. Would you also extend tests/shell? There is a tests/shell/testcases/json/ folder where you can add one. One example test can be found here: tests/shell/testcases/json/netdev If you also create this folder: tests/shell/testcases/json/dump/mytest.dump where 'mytest' is the name of you script under tests/shell/testcases/json/ Then, it also checks for the expected output via 'nft list ruleset'.