From patchwork Wed Mar 6 12:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13584043 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6033B130AEB for ; Wed, 6 Mar 2024 12:57:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729833; cv=none; b=C7jgqPHJ9hzvK9x8D/a+bAiLUUXyw01LeYFZnUJXqE1cwm8Ri/d1TYC/tjPwTfvXJMZatkaXTT74/wiR+H8gzEedBcFG7ZYMfEFBRO7+iSWM7zzBbbDT4MvfuN2Ca/ZonDTs95Z1mOaA8fBIKAK7q3HF1Y/9xz0aHOap+vMHuvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729833; c=relaxed/simple; bh=dPoLKWVS4dABvAcIwjgCoLL1hJojn22hz99RFo/YbFI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=thXSD33hkerhJQb796ZZwWTp30rK7ojNFFhWy2FmnvDb/2FMqdFOdJjbnum2M+dPdRJ0YyimvaaRjk5ZOJ3SJKVg0EIwh2ORE5EG68dEknjhwpNwYZbsVQguqjQ848hVz6lpXlAF+xA9Z+RZst0lI7D7Iiuej/05yQauSUkR9ns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KRQeQF2Y; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KRQeQF2Y" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-412eced6d1aso13892445e9.3 for ; Wed, 06 Mar 2024 04:57:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709729829; x=1710334629; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dzuU4+6cXvMlJeXmYFWKyXaVUJ9CABu9KBmAr9ervN0=; b=KRQeQF2YbwXI7C0UX4XJ+tvC+NTWLAs5Dz5Gl2OS2Qzx00qLJEujj3evD0kBoC2Zhv 7tb4uWVsrlyf1mpeyjvRM1ZHBtKPJXsamaKzR2xfZ+j5Abp7xQgrttEUrN9wzkUUmId4 AqmtXCUIkAQFMfaElZRQFd66NJ+khbhioKwDK/HulP8Qz7Wl/nUrh36FeK6kBpBwOBoB MewHPKz7ylgXrWrjPF3ILUOs5ajuEjBBX1k99heWg0Duf6foaYKiLye4AqHYlVPzyfuu 4hqMvOFV/4aPOXq5cN4qutkUeqwnYsB2IB1ZqShK2IJPhKOCy0hIRTehYcHSpAIsJ043 gtfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709729829; x=1710334629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dzuU4+6cXvMlJeXmYFWKyXaVUJ9CABu9KBmAr9ervN0=; b=WyD+y6lBR5ORAJV7T6MWPNiEMGpuEnmQ3m5x+lOPx6sl+UyH+0WTO/TIhZdvXgHYPH j9ZvdZdSskhjgwcnxvUtgySz6IC1DqTS6UMiXnWeB0N28CS0BD56rolPKg9REsdTwt8u 4P1ibEWSx3EVoPbGCIFgqmIYNaUpBhduXIDq8EP/0izysysHNsRfDKQANZvEt4yZfEKl Cwu7U5f1hh0NGEcnCr+Sg62VmBBVlENPjKIZxWQBP6Z5cc9W3N8C3ye/20oxdib1eskH GbbZAzDZUia7I8DiyvwkeU17f6Hl0ucRvxn944lBX9VC6Tn+Szt+VIMVQyCT8WAjO497 bHxg== X-Gm-Message-State: AOJu0YzyeQJJdzW2KouCH/+aGmqsDt9V0x1+RkOjJtmA5B52z748yXRB ZdyZ9qgrByFAljmXElSiAEqVDl0N0YwRSly/OkH8B9/pbYb8Z+s7hqrpPxVbaVU= X-Google-Smtp-Source: AGHT+IEFjZDOj5pcYYckR0TM1mO5SbDCcD44vUvc6RXz8jGUBYriII7JWeidBMrmigUiWmE0fjadIQ== X-Received: by 2002:a05:600c:4e90:b0:411:c9c0:eddf with SMTP id f16-20020a05600c4e9000b00411c9c0eddfmr12126146wmq.36.1709729829117; Wed, 06 Mar 2024 04:57:09 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:503c:e93d:cfcc:281b]) by smtp.gmail.com with ESMTPSA id p7-20020a05600c358700b00412b6fbb9b5sm11857279wmq.8.2024.03.06.04.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:57:08 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jacob Keller , Jiri Pirko , Stanislav Fomichev Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v2 1/5] tools/net/ynl: Fix extack decoding for netlink-raw Date: Wed, 6 Mar 2024 12:57:00 +0000 Message-ID: <20240306125704.63934-2-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240306125704.63934-1-donald.hunter@gmail.com> References: <20240306125704.63934-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Extack decoding was using a hard-coded msg header size of 20 but netlink-raw has a header size of 16. Use a protocol specific msghdr_size() when decoding the attr offssets. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- tools/net/ynl/lib/ynl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 239e22b7a85f..b810a478a304 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -353,6 +353,9 @@ class NetlinkProtocol: raise Exception(f'Multicast group "{mcast_name}" not present in the spec') return mcast_groups[mcast_name].value + def msghdr_size(self): + return 16 + class GenlProtocol(NetlinkProtocol): def __init__(self, family_name): @@ -378,6 +381,8 @@ class GenlProtocol(NetlinkProtocol): raise Exception(f'Multicast group "{mcast_name}" not present in the family') return self.genl_family['mcast'][mcast_name] + def msghdr_size(self): + return super().msghdr_size() + 4 class SpaceAttrs: @@ -721,7 +726,7 @@ class YnlFamily(SpecFamily): return msg = self.nlproto.decode(self, NlMsg(request, 0, op.attr_set)) - offset = 20 + self._struct_size(op.fixed_header) + offset = self.nlproto.msghdr_size() + self._struct_size(op.fixed_header) path = self._decode_extack_path(msg.raw_attrs, op.attr_set, offset, extack['bad-attr-offs']) if path: From patchwork Wed Mar 6 12:57:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13584044 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B22FC86AE9 for ; Wed, 6 Mar 2024 12:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729834; cv=none; b=beVehF0GfVSgGH+I2X9Wo5LnF+aOU6ee00Cynht1PzntreQaG7304gi0dYJthYEpA3snySR1fHOi+XyYWJVkRYKy8N6W9rjzTvPKOHoLd3Jfs1vJ8VI8iBg1ckyUf41bexczvD19Inu13iQP955LV81Xgp6Kd7Q+4xq4RbRFnGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729834; c=relaxed/simple; bh=nDCJ3eaSXIg6bwGEZ1SyaLIaxerMhudsN4/UrqnAu58=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hb07Jqrw0D7+b4w//1nwDEn6m2ojuMAGJOKv0naieQj52p77Zlt2JGAeTS+E5L7imPa3+xCNKr6jfEHFCyuDjE5lhiUbXPQORdnCyYCc1HTr1/M2q9qjdtWIzIrOr0HlisLz3nBqmie3FBO8pLm7JBspvR/5I02jOnWmb1o0us8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RFFo6g/v; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RFFo6g/v" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-412f8d2b0fcso2702445e9.2 for ; Wed, 06 Mar 2024 04:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709729831; x=1710334631; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KAD2BKLxK8AlKfwB8eeB8Ra1Y5lNbnQ/Edb//dSEFhQ=; b=RFFo6g/vt9GWXjqy9pxWRjMYbFHjGJ62ojbYirmT6ztuAeIzEwklhmw95hZPBXS2F9 iQuYEeX2P64TrvF4DXoVDU0Ka0/J0cNa+34hm9YeAxGSALCJW60mvbvc5l6mEIfEj48e Bijd5altbT4NKv+3pl3hJav4JeLR6B32UlAew9CjdxfaLp5mRlMrm6X/4nkYjCv/GFcl lV3lf9S64gC/DXMMWQfjKxUiyOtUPuw4s4YPduL3Lmhlm1iXfWWIsgfJhqj7doNulrKR jDAYEB2YmEwoX7r9NboIF2F3tGjKpOu72s3v+YRDwA2Gf0hzaCi0OEj68j4bDswDOUTz 4/Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709729831; x=1710334631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KAD2BKLxK8AlKfwB8eeB8Ra1Y5lNbnQ/Edb//dSEFhQ=; b=jZFqOHOA+QWJ1IZRBaWGS6wByxU+I4g1rCvSCj0pe55L0xytpTxI7ofrxUU5+JeQoX QN7MV85hfQC1cOnhppUd00u6ReCz92x0r0PWc0P+8yDL1hdgBkbplUAUfz6oZiuGvifj SC8ixhBoypLLm1kWZaTtEyR51yYm9w24IEQg7gticyYxlNkMVHDe1HuosZan4dPIelHP 1xyEJ1ggOCIs98va5mMj3LlZmWIem1ilDjK/r7IlamfOWgSJUORWu3jx3YmhSuNI8vMn hiIU30hznqomEBEbiPD5S3i/4ympuNtF+HM20XI63FIq6E0BcWaFxBE8ZOekeHNDzFGH dX5Q== X-Gm-Message-State: AOJu0Yw5otzsi9JwjMFXGX3GccVlCRzXq07msGn3rzeREKeKaMa3uG9N cWMwCa7+w0xTeeatA42+lZzxJmeUo9IqK5k4Xvs8K5Jya2tdGyNNovexvGWWdg8= X-Google-Smtp-Source: AGHT+IEVChPT6nWDMZdDH0EuEjPwCtbpHQuyUZ1sOSwTG/0syG06xYdMsiq9nMZa6P1iQ8j7Tce6oQ== X-Received: by 2002:a05:600c:458b:b0:412:bd3e:9fee with SMTP id r11-20020a05600c458b00b00412bd3e9feemr11136501wmo.0.1709729830441; Wed, 06 Mar 2024 04:57:10 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:503c:e93d:cfcc:281b]) by smtp.gmail.com with ESMTPSA id p7-20020a05600c358700b00412b6fbb9b5sm11857279wmq.8.2024.03.06.04.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:57:09 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jacob Keller , Jiri Pirko , Stanislav Fomichev Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v2 2/5] tools/net/ynl: Report netlink errors without stacktrace Date: Wed, 6 Mar 2024 12:57:01 +0000 Message-ID: <20240306125704.63934-3-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240306125704.63934-1-donald.hunter@gmail.com> References: <20240306125704.63934-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org ynl does not handle NlError exceptions so they get reported like program failures. Handle the NlError exceptions and report the netlink errors more cleanly. Example now: Netlink error: No such file or directory nl_len = 44 (28) nl_flags = 0x300 nl_type = 2 error: -2 extack: {'bad-attr': '.op'} Example before: Traceback (most recent call last): File "/home/donaldh/net-next/./tools/net/ynl/cli.py", line 81, in main() File "/home/donaldh/net-next/./tools/net/ynl/cli.py", line 69, in main reply = ynl.dump(args.dump, attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/donaldh/net-next/tools/net/ynl/lib/ynl.py", line 906, in dump return self._op(method, vals, [], dump=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/donaldh/net-next/tools/net/ynl/lib/ynl.py", line 872, in _op raise NlError(nl_msg) lib.ynl.NlError: Netlink error: No such file or directory nl_len = 44 (28) nl_flags = 0x300 nl_type = 2 error: -2 extack: {'bad-attr': '.op'} Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- tools/net/ynl/cli.py | 18 +++++++++++------- tools/net/ynl/lib/__init__.py | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tools/net/ynl/cli.py b/tools/net/ynl/cli.py index e8a65fbc3698..f131e33ac3ee 100755 --- a/tools/net/ynl/cli.py +++ b/tools/net/ynl/cli.py @@ -6,7 +6,7 @@ import json import pprint import time -from lib import YnlFamily, Netlink +from lib import YnlFamily, Netlink, NlError class YnlEncoder(json.JSONEncoder): @@ -66,12 +66,16 @@ def main(): if args.sleep: time.sleep(args.sleep) - if args.do: - reply = ynl.do(args.do, attrs, args.flags) - output(reply) - if args.dump: - reply = ynl.dump(args.dump, attrs) - output(reply) + try: + if args.do: + reply = ynl.do(args.do, attrs, args.flags) + output(reply) + if args.dump: + reply = ynl.dump(args.dump, attrs) + output(reply) + except NlError as e: + print(e) + exit(1) if args.ntf: ynl.check_ntf() diff --git a/tools/net/ynl/lib/__init__.py b/tools/net/ynl/lib/__init__.py index f7eaa07783e7..9137b83e580a 100644 --- a/tools/net/ynl/lib/__init__.py +++ b/tools/net/ynl/lib/__init__.py @@ -2,7 +2,7 @@ from .nlspec import SpecAttr, SpecAttrSet, SpecEnumEntry, SpecEnumSet, \ SpecFamily, SpecOperation -from .ynl import YnlFamily, Netlink +from .ynl import YnlFamily, Netlink, NlError __all__ = ["SpecAttr", "SpecAttrSet", "SpecEnumEntry", "SpecEnumSet", - "SpecFamily", "SpecOperation", "YnlFamily", "Netlink"] + "SpecFamily", "SpecOperation", "YnlFamily", "Netlink", "NlError"] From patchwork Wed Mar 6 12:57:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13584045 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4697130AFC for ; Wed, 6 Mar 2024 12:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729835; cv=none; b=vFBqgc5iPf7jiNvnDehaGboy/1D6btqHATN9wIYUWfVUSzfqpsZhT5cs7N3auzFkbVs6cjZDk2DbsT9TKhr2WMOAuAw+sJU0VP75fEkXnwBDNBW5UlSO6EIjSRN+olgGd0y3Rz6IDDsHJR3jdWM5qHb1/ZvDd9W2GoJJGJ0Y1Jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729835; c=relaxed/simple; bh=mg/UZ10lUIJR6L8vBorKVPxjtr0FBSGdxnD0GdZmyn8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jQDIvPfFfin4OhiN+8SqnPcTk5qiu1TICHurPWwhIfRUbWipL4tbymvCgDQSfMK10dKW+hen8ZSEzTWjwSAo010LuUQT6I3O+rU3qzbeI5l/YwMC4gtuMQ/AgCzaMwZI/yYSpLeXLLWE82yxRlF2AY9hXvw+Chg/8ajzlZRHCLI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ClBLBASr; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ClBLBASr" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-412fe981ef1so1228555e9.1 for ; Wed, 06 Mar 2024 04:57:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709729832; x=1710334632; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rByjwE896DjP1LtWWLouiY+4s6xLQ7nyieKzDD4yd3c=; b=ClBLBASr24WlUvPqBfS+Gc5bnQ/AcsuX1s1ygHs50NyB1qCfFlhGWO4lH7ZHgt6B/Z +o946f12BOMTC8XotCy+L1mFby1NyNkb6YcELHmUv65sIBJfTne6zSjPM420H+aVmRir LCwaPIAEumZ0CtZtXzWUZm0yE1JTrMPttECtfemcRVUNgjftVhV9Afz12XmCyuAqn0js l7niUXS26DjSp/OuEW5Yu14TAiyNhPsJlL7faQA8BMyezAnxC5iE55T4eCNYLVsZur56 /loY7QAZaaCDk5t7zrOUH9TM9MfpBQqU7+ezsUIenbAG4+e+9HY5pgTzrcZWdjfRrYqM 8Xmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709729832; x=1710334632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rByjwE896DjP1LtWWLouiY+4s6xLQ7nyieKzDD4yd3c=; b=sNgbhNTNQYvoKjna24V32brv9xGsWnU308OsMnnqI887cC9fApDxB7QE5gA9SeJVqB tW2a75Hd0PxUz9Is5DxjPVkOrI8kmDYt0Vn3o2WRqVWC+s10oci4/CA7wbt03MX/XbGl XIBsyLJO2+MMEo+tp69mwpxaLB/KVqH2Jjju0DfvZ+uYalKHwePSw+L8jteE0ecJ8ShE xFtDat2UTchrwdui1eXENWbZdfrwsJezEnhHkPxeLLjnwEl/dzCWLpDMejawDfmVZiAH 9dyxVk1N19KLnbYOemoLjW5iZcCPhey5WC/HzdQpJexi2UZ7YhINE5TlMqwJONyop3av OECg== X-Gm-Message-State: AOJu0YxA2Z7cUHjTw1tuhOxgfBskUlMuIrS9UnOFzKQyu/XX8G7yqXqC m0QEtfdn3OTj2+nlPuvrNKzi8f0ni8NQ4qcLpth2USUEHGcxHcpkdaG1KdlpyKA= X-Google-Smtp-Source: AGHT+IFigH0qeQs0sVpVQbaCNzTRLdRn7gJmt6uK9+GhhEq1V53oTwY3bs31MlOxsExstCfCBQ5QPg== X-Received: by 2002:a05:600c:4e4f:b0:412:b02d:71f9 with SMTP id e15-20020a05600c4e4f00b00412b02d71f9mr5136952wmq.2.1709729831711; Wed, 06 Mar 2024 04:57:11 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:503c:e93d:cfcc:281b]) by smtp.gmail.com with ESMTPSA id p7-20020a05600c358700b00412b6fbb9b5sm11857279wmq.8.2024.03.06.04.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:57:10 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jacob Keller , Jiri Pirko , Stanislav Fomichev Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v2 3/5] tools/net/ynl: Fix c codegen for array-nest Date: Wed, 6 Mar 2024 12:57:02 +0000 Message-ID: <20240306125704.63934-4-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240306125704.63934-1-donald.hunter@gmail.com> References: <20240306125704.63934-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org ynl-gen-c generates e.g. 'calloc(mcast_groups, sizeof(*dst->mcast_groups))' for array-nest attrs when it should be 'n_mcast_groups'. Add a 'n_' prefix in the generated code for array-nests. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- tools/net/ynl/ynl-gen-c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index 2f5febfe66a1..67bfaff05154 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -1667,7 +1667,7 @@ def _multi_parse(ri, struct, init_lines, local_vars): aspec = struct[anest] ri.cw.block_start(line=f"if (n_{aspec.c_name})") - ri.cw.p(f"dst->{aspec.c_name} = calloc({aspec.c_name}, sizeof(*dst->{aspec.c_name}));") + ri.cw.p(f"dst->{aspec.c_name} = calloc(n_{aspec.c_name}, sizeof(*dst->{aspec.c_name}));") ri.cw.p(f"dst->n_{aspec.c_name} = n_{aspec.c_name};") ri.cw.p('i = 0;') ri.cw.p(f"parg.rsp_policy = &{aspec.nested_render_name}_nest;") From patchwork Wed Mar 6 12:57:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13584046 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 969FB5D726 for ; Wed, 6 Mar 2024 12:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729837; cv=none; b=J4RzAfnwqtlKQ8jPKTw1eAGYYUZeMRXZNI2O63FvswurM5riQMQDGoaiXjExEPrvATuC4e8ZoEaGB4tvVBC3SvuE+5eHcsKX3EGJVHInKUFAkihahf9OZY3jZkW1pTPuFw/LBAsHkwe1Tfh8h7aUTdVIl+bIn1DcfoCwev9dXCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729837; c=relaxed/simple; bh=5edzrjx4uNp5QEAJW2CNjX/cJtWwOK4axA9UXwPxAuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WEd2P6XpboiNjKDs9NypLG30D25FcJYhy8dbtmHu4RezIOz+sxkhrOPaHHTk1khdQAEKinXCXwO4jHEkbxXtsPvZ5XN3B1vYwfhf7tRx0bgbpdQXgTsWkRwhHQu7RIauaP++4I/U41YdqyxfpZmd10ZP5NWFohq+XWpcUlua+yc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Og+ZDqCw; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Og+ZDqCw" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-51320ca689aso8260644e87.2 for ; Wed, 06 Mar 2024 04:57:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709729833; x=1710334633; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rx3djLYpAVy9FECdw453JIST0YBWxKr7tniWxul4drI=; b=Og+ZDqCwYpClz54xjB1SisEubBs4+Lk1IOFYsOyUU5AOkF/FUQ0XcIUjpM3M2m+LAq RV3Ggnn1R3hHt9qE8GybXA69cz6QqcFm2rIqU9QB+RUO38RnEo9RzNsaZYPCCRjqM/UU l7H2nAr8DeYqI9XLoddRjPZTyIesM61uEfGKJrEGbTPrKDuj5Vh3NwFQfbWaexhF/sKQ 7iuFeKF1HLwGXVQ9Z1d+iox5i0M/jq1Z/1GhiI1O9L4N+WT0ip1kMp9i8ncGLwtPbUFl rCUsPy2A2pgvnNjCcduGvyr46VatR3IqBFstmg6DWWbUejz7q+U2vLj7CXTrJQkuyPQd EPAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709729833; x=1710334633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rx3djLYpAVy9FECdw453JIST0YBWxKr7tniWxul4drI=; b=G8YU71u0TJwLVYrk1ABoixyc9JBHX17XtFN7fmF3xKkGqHA+OsbB/mgfqCq0Ey6kLK y98bfDbcg47BDIRpwjfev5etGJcx3SsXtP8fHWeRylrffDkFNtLzLiVYr5kPx5TY2SkL FrmaUo5uRI1lTp5k7VEyydLwqwzkPkZKp3IkoE3jXSaEBkclSS0vvahYu0eqtbQcy+bY HpQsQxNN3ogctdfVrWKk+EMBzvitqN3AjJhbs3LgOpePxOm4vqN0oSOta5Q9FlIwT24u 7gM28MYMzSOywRItWyTwIVhn2U5tAVplUWkWE5/8tuwTJaphV5EuHpFi7IpH8VlIVvAO PvHw== X-Gm-Message-State: AOJu0YzXmL1niqVjEmboTU+bZCd4Dkv1fnNF53q53hRCLya55KbQ9krg BVVf3dlMO1HxbeFN9dMIAjtrvgjG4PoXeVaNNgy5GhGyvNI1OYcpDm+FS2zXQTU= X-Google-Smtp-Source: AGHT+IHCP7G/ptSSFpfTZT5FEDiMpeDGj3HwtZcQxhRYSOB9Dv7WvNmrRFu1wtKtUqeG2wfV/lKM8A== X-Received: by 2002:ac2:442d:0:b0:513:685a:8696 with SMTP id w13-20020ac2442d000000b00513685a8696mr544777lfl.10.1709729833077; Wed, 06 Mar 2024 04:57:13 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:503c:e93d:cfcc:281b]) by smtp.gmail.com with ESMTPSA id p7-20020a05600c358700b00412b6fbb9b5sm11857279wmq.8.2024.03.06.04.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:57:12 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jacob Keller , Jiri Pirko , Stanislav Fomichev Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v2 4/5] tools/net/ynl: Add nest-type-value decoding Date: Wed, 6 Mar 2024 12:57:03 +0000 Message-ID: <20240306125704.63934-5-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240306125704.63934-1-donald.hunter@gmail.com> References: <20240306125704.63934-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The nlctrl genetlink-legacy family uses nest-type-value encoding as described in Documentation/userspace-api/netlink/genetlink-legacy.rst Add nest-type-value decoding to ynl. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- tools/net/ynl/lib/ynl.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index b810a478a304..2d7fdd903d9e 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -595,6 +595,16 @@ class YnlFamily(SpecFamily): decoded.append({ item.type: subattrs }) return decoded + def _decode_nest_type_value(self, attr, attr_spec): + decoded = {} + value = attr + for name in attr_spec['type-value']: + value = NlAttr(value.raw, 0) + decoded[name] = value.type + subattrs = self._decode(NlAttrs(value.raw), attr_spec['nested-attributes']) + decoded.update(subattrs) + return decoded + def _decode_unknown(self, attr): if attr.is_nest: return self._decode(NlAttrs(attr.raw), None) @@ -686,6 +696,8 @@ class YnlFamily(SpecFamily): decoded = {"value": value, "selector": selector} elif attr_spec["type"] == 'sub-message': decoded = self._decode_sub_msg(attr, attr_spec, search_attrs) + elif attr_spec["type"] == 'nest-type-value': + decoded = self._decode_nest_type_value(attr, attr_spec) else: if not self.process_unknown: raise Exception(f'Unknown {attr_spec["type"]} with name {attr_spec["name"]}') From patchwork Wed Mar 6 12:57:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13584047 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05482130AFC for ; Wed, 6 Mar 2024 12:57:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729838; cv=none; b=E4iEgPtUNMf5YHqSVZtcu0x4WV/3PGlGsChRs5e505XvEmSeXAeqnwJHn8m2LUr0oFY5mHtTqSZHjDhEn1NgrEBbhA3Yeyj7Q3PAPHtE2kZn9TtZAujaQshJ0SlQKYTBYQS4rrpLsMCwMXV8hk8dwyEdPmApaT4jVjT7JkNq08g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709729838; c=relaxed/simple; bh=LNhHtjjKiO66wuzCvV8h/rAdQdAYk3CcCuwunqmvIyw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f4/VTbPe+X9F60fGZiOF9wJLojFJkCnbm1OmoWQrVrxgxOp1+icjDfBB2K+WXaG94mSIXNa9dQTUwAch2DIaJd7FcOkdA3dmgumESJ+etau9XOkCyJVimJGSqE4U9prtQCrkerXEuYXneVjG3XhL7wEHK8ps4A/Df2tFwl0bov4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OmG9Q/HB; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OmG9Q/HB" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-51364c3d5abso443840e87.2 for ; Wed, 06 Mar 2024 04:57:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709729835; x=1710334635; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hCZAK3Ii/hnvHy+vEnXOA+S4Q0EMIqgCX16Mb5G/BgM=; b=OmG9Q/HBKsdW+o7nFjnArm9GzP6XCDuykcbziyraVr+jJlIsB9FoXtwRRLIRZR9ixC iNB2TunoqY6oEJxUZZGiJ1Tj4nvrc0rnv2A44p8aK1YdOLkr3CW3tuLNv6Y8uB+JApsH Q7ETVSFDxjl35mK0dUPmTCGyg/eJt35mxXOIuvNJX6Lrwvv+tIlXuriXgH+6Ot3/fI1t TZSGyeVg36l6b3o+0JfT0tBkjfNsuNqPjXsvJWepf/82abAnPO/e5KssU8UEXaima00c PyELdN4rPVDm6vPMm2WgFBbkJQV7LGPR9SRiYDqoKEqQF4tt6ChKeABpMqC1xzYKtYVJ +0CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709729835; x=1710334635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hCZAK3Ii/hnvHy+vEnXOA+S4Q0EMIqgCX16Mb5G/BgM=; b=P/5nZnimX9+NcKS/HrjKjdNvY2K/xmDwiTbVvhHd9ipReLL0Ffbdl/JO0jd/48wrrX IyJCGBLMD8gsOvlIFGz9WOATzE8foqltH/6989bpg2MDeaSO0dNxq2ZAwHfDFYPlScGb IN1tX40ld7A4Plk2oJTZCeixlJdLLPCWIkoCy7dM1wRdyS1sBKlXP37bpFXw2WMSs3rL 1pDU773GcBetCE0jPury9+5bX3MYXz0npMnc8sQUE+rziIv90WObS9SueC++oEDZL4dS yBM0z96gfc2wNbEwSCjqoRB671rRHpo6umP86ydMdWv19CiiA3QwLyyS4ekoy1xsvKAo sPrw== X-Gm-Message-State: AOJu0YxsqiajyBmITTSo1BEBCNJsWk6qhr50JuCD2ImQicp1M1rM8vpe n+N3I5FDpSXtVkE7rHKyDiOLEaP0Hyn8rFEpC11HklCnJI2N/Z1+eS1iXKGx6yo= X-Google-Smtp-Source: AGHT+IFY6079Asdqz4eLTn/hcBoNe2Q1CmVt1Mjtpbo4Xjpg4ur/2t2NkgAom0EHYZtE7u5+J4ye5A== X-Received: by 2002:a05:6512:282c:b0:513:5217:6201 with SMTP id cf44-20020a056512282c00b0051352176201mr4347881lfb.59.1709729834389; Wed, 06 Mar 2024 04:57:14 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:503c:e93d:cfcc:281b]) by smtp.gmail.com with ESMTPSA id p7-20020a05600c358700b00412b6fbb9b5sm11857279wmq.8.2024.03.06.04.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:57:13 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jacob Keller , Jiri Pirko , Stanislav Fomichev Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v2 5/5] doc/netlink/specs: Add spec for nlctrl netlink family Date: Wed, 6 Mar 2024 12:57:04 +0000 Message-ID: <20240306125704.63934-6-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240306125704.63934-1-donald.hunter@gmail.com> References: <20240306125704.63934-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add a spec for the nlctrl family. Example usage: ./tools/net/ynl/cli.py \ --spec Documentation/netlink/specs/nlctrl.yaml \ --do getfamily --json '{"family-name": "nlctrl"}' ./tools/net/ynl/cli.py \ --spec Documentation/netlink/specs/nlctrl.yaml \ --dump getpolicy --json '{"family-name": "nlctrl"}' Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- Documentation/netlink/specs/nlctrl.yaml | 206 ++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 Documentation/netlink/specs/nlctrl.yaml diff --git a/Documentation/netlink/specs/nlctrl.yaml b/Documentation/netlink/specs/nlctrl.yaml new file mode 100644 index 000000000000..2e55e61aea11 --- /dev/null +++ b/Documentation/netlink/specs/nlctrl.yaml @@ -0,0 +1,206 @@ +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) + +name: nlctrl +protocol: genetlink-legacy +uapi-header: linux/genetlink.h + +doc: | + Genetlink control. + +definitions: + - + name: op-flags + type: flags + enum-name: '' + entries: + - admin-perm + - cmd-cap-do + - cmd-cap-dump + - cmd-cap-haspol + - uns-admin-perm + - + name: attr-type + enum-name: netlink_attribute_type + type: enum + entries: + - invalid + - flag + - u8 + - u16 + - u32 + - u64 + - s8 + - s16 + - s32 + - s64 + - binary + - string + - nul-string + - nested + - nested-array + - bitfield32 + - sint + - uint + +attribute-sets: + - + name: ctrl-attrs + name-prefix: CTRL_ATTR_ + attributes: + - + name: family-id + type: u16 + - + name: family-name + type: string + - + name: version + type: u32 + - + name: hdrsize + type: u32 + - + name: maxattr + type: u32 + - + name: ops + type: array-nest + nested-attributes: op-attrs + - + name: mcast-groups + type: array-nest + nested-attributes: mcast-group-attrs + - + name: policy + type: nest-type-value + type-value: [ policy-id, attr-id ] + nested-attributes: policy-attrs + - + name: op-policy + type: nest-type-value + type-value: [ op-id ] + nested-attributes: op-policy-attrs + - + name: op + type: u32 + - + name: mcast-group-attrs + name-prefix: CTRL_ATTR_MCAST_GRP_ + enum-name: '' + attributes: + - + name: name + type: string + - + name: id + type: u32 + - + name: op-attrs + name-prefix: CTRL_ATTR_OP_ + enum-name: '' + attributes: + - + name: id + type: u32 + - + name: flags + type: u32 + enum: op-flags + enum-as-flags: true + - + name: policy-attrs + name-prefix: NL_POLICY_TYPE_ATTR_ + enum-name: '' + attributes: + - + name: type + type: u32 + enum: attr-type + - + name: min-value-s + type: s64 + - + name: max-value-s + type: s64 + - + name: min-value-u + type: u64 + - + name: max-value-u + type: u64 + - + name: min-length + type: u32 + - + name: max-length + type: u32 + - + name: policy-idx + type: u32 + - + name: policy-maxtype + type: u32 + - + name: bitfield32-mask + type: u32 + - + name: mask + type: u64 + - + name: pad + type: pad + - + name: op-policy-attrs + name-prefix: CTRL_ATTR_POLICY_ + enum-name: '' + attributes: + - + name: do + type: u32 + - + name: dump + type: u32 + +operations: + enum-model: directional + name-prefix: CTRL_CMD_ + list: + - + name: getfamily + doc: Get / dump genetlink families + attribute-set: ctrl-attrs + do: + request: + value: 3 + attributes: + - family-name + reply: &all_attrs + value: 1 + attributes: + - family-id + - family-name + - hdrsize + - maxattr + - mcast-groups + - ops + - version + dump: + reply: *all_attrs + - + name: getpolicy + doc: Get / dump genetlink policies + attribute-set: ctrl-attrs + dump: + request: + value: 10 + attributes: + - family-name + - family-id + - op + reply: + value: 10 + attributes: + - family-id + - op-policy + - policy +