From: Jakub Kicinski Date: Tue, 10 Mar 2026 00:53:35 +0000 (-0700) Subject: tools: ynl: add short doc to class YnlFamily X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8bbcfce5db97abc6ca2066b540e88702f461128b;p=thirdparty%2Fkernel%2Flinux.git tools: ynl: add short doc to class YnlFamily The class is quite long. It's getting hard to find the user-facing methods. Add a short doc at the class level explaining the main API. Link: https://patch.msgid.link/20260310005337.3594225-4-kuba@kernel.org Signed-off-by: Jakub Kicinski --- diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py index 17482c17a9765..ec4d95f583fe9 100644 --- a/tools/net/ynl/pyynl/lib/ynl.py +++ b/tools/net/ynl/pyynl/lib/ynl.py @@ -491,6 +491,32 @@ class SpaceAttrs: class YnlFamily(SpecFamily): + """ + YNL family -- a Netlink interface built from a YAML spec. + + Primary use of the class is to execute Netlink commands: + + ynl.(attrs, ...) + + By default this will execute the as "do", pass dump=True + to perform a dump operation. + + ynl. is a shorthand / convenience wrapper for the following + methods which take the op_name as a string: + + ynl.do(op_name, attrs, flags=None) -- execute a do operation + ynl.dump(op_name, attrs) -- execute a dump operation + ynl.do_multi(ops) -- batch multiple do operations + + The flags argument in ynl.do() allows passing in extra NLM_F_* flags + which may be necessary for old families. + + Notification API: + + ynl.ntf_subscribe(mcast_name) -- join a multicast group + ynl.check_ntf() -- drain pending notifications + ynl.poll_ntf(duration=None) -- yield notifications + """ def __init__(self, def_path, schema=None, process_unknown=False, recv_size=0): super().__init__(def_path, schema)