]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools: ynl: add Python API for easier access to policies
authorJakub Kicinski <kuba@kernel.org>
Tue, 10 Mar 2026 00:53:36 +0000 (17:53 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Mar 2026 02:32:46 +0000 (19:32 -0700)
commit77a6401a8722be20ea8db98ac900c93ccc7068ff
tree32364d49f98a8ce5b9900be87f28ca1c011a1838
parent8bbcfce5db97abc6ca2066b540e88702f461128b
tools: ynl: add Python API for easier access to policies

The format of Netlink policy dump is a bit curious with messages
in the same dump carrying both attrs and mapping info. Plus each
message carries a single piece of the puzzle the caller must then
reassemble.

I need to do this reassembly for a test, but I think it's generally
useful. So let's add proper support to YnlFamily to return more
user-friendly representation. See the various docs in the patch
for more details.

Link: https://patch.msgid.link/20260310005337.3594225-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/pyynl/lib/__init__.py
tools/net/ynl/pyynl/lib/ynl.py
tools/testing/selftests/net/lib/py/ynl.py