summaryrefslogtreecommitdiff
path: root/tools/net/ynl
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-03-09 17:53:35 -0700
committerJakub Kicinski <kuba@kernel.org>2026-03-10 19:30:03 -0700
commit8bbcfce5db97abc6ca2066b540e88702f461128b (patch)
tree7338ead293ebdd18b1ac71e04b1507c61e64d567 /tools/net/ynl
parentc26fda6212b88af1e667474728dd241ebf6ba1d1 (diff)
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 <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl')
-rw-r--r--tools/net/ynl/pyynl/lib/ynl.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py
index 17482c17a976..ec4d95f583fe 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.<op_name>(attrs, ...)
+
+ By default this will execute the <op_name> as "do", pass dump=True
+ to perform a dump operation.
+
+ ynl.<op_name> 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)