aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/net/ynl/lib/nlspec.py
diff options
context:
space:
mode:
authorDonald Hunter <donald.hunter@gmail.com>2023-03-27 09:31:33 +0100
committerJakub Kicinski <kuba@kernel.org>2023-03-28 23:54:43 -0700
commitb423c3c86325192259380ac870aafd370a683e73 (patch)
tree5763fbc93a63ce142c394f9bbb97ed5a3d7b9782 /tools/net/ynl/lib/nlspec.py
parenttools: ynl: Add struct parsing to nlspec (diff)
downloadwireguard-linux-b423c3c86325192259380ac870aafd370a683e73.tar.xz
wireguard-linux-b423c3c86325192259380ac870aafd370a683e73.zip
tools: ynl: Add C array attribute decoding to ynl
Add support for decoding C arrays from binay blobs in genetlink-legacy messages. Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl/lib/nlspec.py')
-rw-r--r--tools/net/ynl/lib/nlspec.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py
index 83de2a1a3cc6..6cc9b7646ae8 100644
--- a/tools/net/ynl/lib/nlspec.py
+++ b/tools/net/ynl/lib/nlspec.py
@@ -149,8 +149,10 @@ class SpecAttr(SpecElement):
Represents a single attribute type within an attr space.
Attributes:
- value numerical ID when serialized
- attr_set Attribute Set containing this attr
+ value numerical ID when serialized
+ attr_set Attribute Set containing this attr
+ is_multi bool, attr may repeat multiple times
+ sub_type string, name of sub type
"""
def __init__(self, family, attr_set, yaml, value):
super().__init__(family, yaml)
@@ -158,6 +160,7 @@ class SpecAttr(SpecElement):
self.value = value
self.attr_set = attr_set
self.is_multi = yaml.get('multi-attr', False)
+ self.sub_type = yaml.get('sub-type')
class SpecAttrSet(SpecElement):