Received: from mail3.g1.pair.com (mail3.g1.pair.com [66.39.3.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F2361C870C for ; Fri, 23 Aug 2024 22:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.3.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724453445; cv=none; b=eqsDFwy9hssGJ0Gdxjm6g6WMqwNN0967mQ6sNQ2kF8HxG/hz0rLvFxZCCfF5ZEklFP2ywv7ubVu/R66LMGiwsM1uOzlyxjI2UaGUVZkTGac0woC7mL8e/DzxrdQ5sh7srFi51TowPdz0st/pW4154H/UUYmUHQXR2BZSl8iTEfA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724453445; c=relaxed/simple; bh=LXDXf9DL9kCvW+jYrsuhlgKqyDufq4EpiNsTWghgUhw=; h=Date:From:To:Subject:Message-Id:Mime-Version:Content-Type; b=EdfbhcI4+rv3Ctk8XF2kn7BsNDof++pNyLWQJZHKFd7KXcuACJbb7ksu4USVKAIHHUHDj+iE0el03YaCPx8zB7pG4ReuY4FVdRd5GZvSMJGpwWTmQU9MfPHZAigBNrHml8Q1sQCk4+Ki3InbLwjk+hSIsk0BVk6PfGH9xHGnLo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fourthriver.com; spf=pass smtp.mailfrom=fourthriver.com; dkim=pass (2048-bit key) header.d=fourthriver.com header.i=@fourthriver.com header.b=OCBmUo/6; arc=none smtp.client-ip=66.39.3.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fourthriver.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fourthriver.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fourthriver.com header.i=@fourthriver.com header.b="OCBmUo/6" Received: from mail3.g1.pair.com (localhost [127.0.0.1]) by mail3.g1.pair.com (Postfix) with ESMTP id E7386A1BA6F for ; Fri, 23 Aug 2024 18:50:34 -0400 (EDT) Received: from Mario (c-174-181-12-36.hsd1.pa.comcast.net [174.181.12.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail3.g1.pair.com (Postfix) with ESMTPSA id BF4E29084F2 for ; Fri, 23 Aug 2024 18:50:34 -0400 (EDT) Date: Fri, 23 Aug 2024 18:50:36 -0400 From: Brian Sammon To: netfilter@vger.kernel.org Subject: Understanding output from "nft list" Message-Id: <20240823185036.85bd988a1ee2baab2f73b307@fourthriver.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Precedence: bulk X-Mailing-List: netfilter@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fourthriver.com; h=date:from:to:subject:message-id:mime-version:content-type:content-transfer-encoding; s=pair-202402142043; bh=77XR5tUQdgUWhVfk0v/alWAmw4TOvX3AyR+OKl0NtWc=; b=OCBmUo/6GRqogzzlxnRPBVJrVqjaOqRKEOGUow2+Kn2ugVHwRPZvnvaFXDWkftf95oOnEBqY+fVVuBsRFlGOOI90LF53sIhPyBwiMpRo9SPdH1rmQup9vZ9ipRCsa054xoCXiMv3OV3zKz+AYKOD1dtkeu4nCDSHbFwjkhfljJYcOSSke5Ogku34yx1S0dsv2Ig2Q/8kVm4vP7at2Pz/t3HhDVIJFK1PqO3NBx/CMrvWZb++ujOWUuYBj9ii8XR/VNxlbxkV+YVDjKjWwY+lZiTr4qSBryriM886ANh7y7zZ9AIUCiLnWpNlaLTOg5SQYqWuIFmVsR6IL5RsL4Vpnw== X-Scanned-By: mailmunge 3.11 on 66.39.3.170 Is there a document that is good for understanding the output of "nft list"? (more specifically the kind of output that comes from "nfs list ruleset") In particular I'm looking for a description of the syntax. I've been browsing around https://www.netfilter.org/ and I've been having trouble finding the kind of information that I'm looking for. The first questions I have: Can/should I assume that each line in the output of "nft list" is a separate, uh... "thing"[1] that can be (human-)parsed independently from every other line? Is there something that signifies "this line should be considered as part of the same Thing as the last/next line"? Should I be reading each line/"thing" from left to right in my attempt to parse/understand it? This is complicated by the fact that the current firewall config is generated by a "front end" package, which I'm also trying to learn. I wonder if the output from "nft list" represents some weird syntax generated by the front end package. Can I assume that the output of "nft list" is _valid_ syntax? [1] - I'm not sure if "expression", "statement", or "rule", or something else, is an appropriate word to use here.