netlink: specs: allow header properties for attribute sets
authorJakub Kicinski <kuba@kernel.org>
Fri, 18 Apr 2025 02:16:55 +0000 (19:16 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Apr 2025 23:07:15 +0000 (16:07 -0700)
rt-link has a number of disjoint headers, plus it uses attributes
of other families (e.g. DPLL). Allow declaring a attribute set
as "foreign" by specifying which header its definition is coming
from.

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://patch.msgid.link/20250418021706.1967583-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/genetlink-c.yaml
Documentation/netlink/genetlink-legacy.yaml
Documentation/netlink/netlink-raw.yaml
tools/net/ynl/pyynl/ynl_gen_c.py

index 96fa1f1522ed18d831d84d5130701b9f74f3dea0..5a234e9b5fa2ef47b97c8c5839ba1f40096a58b8 100644 (file)
@@ -148,6 +148,9 @@ properties:
         attr-max-name:
           description: The explicit name for last member of attribute enum.
           type: string
+        header:
+          description: For C-compatible languages, header which already defines this attribute set.
+          type: string
         # End genetlink-c
         attributes:
           description: List of attributes in the space.
index a8c5b521937d12b529be72ec919e24e70dc512f4..4cbfe666e6f5f838047a8f7aa27f1959f80fb57f 100644 (file)
@@ -193,6 +193,9 @@ properties:
         attr-max-name:
           description: The explicit name for last member of attribute enum.
           type: string
+        header:
+          description: For C-compatible languages, header which already defines this attribute set.
+          type: string
         # End genetlink-c
         attributes:
           description: List of attributes in the space.
index 1b0772c8e333a68677c4e1e2027340b6a5cb7022..e34bf23897fabda78f36ffe372a3bc207feaa12e 100644 (file)
@@ -207,6 +207,9 @@ properties:
         attr-max-name:
           description: The explicit name for last member of attribute enum.
           type: string
+        header:
+          description: For C-compatible languages, header which already defines this attribute set.
+          type: string
         # End genetlink-c
         attributes:
           description: List of attributes in the space.
index 0d930c17f9638e4425f8fd6d2e1ef3983c763f9a..9613a6135003721ba558fb110f7a4220b07131fd 100755 (executable)
@@ -2909,7 +2909,7 @@ def main():
             cw.p(f'#include "{hdr_file}"')
             cw.p('#include "ynl.h"')
         headers = []
-    for definition in parsed['definitions']:
+    for definition in parsed['definitions'] + parsed['attribute-sets']:
         if 'header' in definition:
             headers.append(definition['header'])
     if args.mode == 'user':