netlink: specs: allow header properties for attribute sets

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>
This commit is contained in:
Jakub Kicinski 2025-04-17 19:16:55 -07:00
parent 87f43e6f06
commit 7965facefa
4 changed files with 10 additions and 1 deletions

View 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.

View 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.

View 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.

View file

@ -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':