tools: ynl-gen: submsg: render the structs
authorJakub Kicinski <kuba@kernel.org>
Thu, 15 May 2025 23:16:46 +0000 (16:16 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 16 May 2025 23:32:05 +0000 (16:32 -0700)
commit6366d267788fd9dba20d6dff61e3e05d48ddb0b8
tree7b98b7d077e1a9c2081b7dc20b4d770f5852bb0c
parent3186a8e55ae3428ec1e06af09075e20885376e4e
tools: ynl-gen: submsg: render the structs

The easiest (or perhaps only sane) way to support submessages in C
is to treat them as if they were nests. Build fake attributes to
that effect in the codegen. Render the submsg as a big nest of all
possible values.

With this in place the main missing part is to hook in the switch
which selects how to parse based on the key.

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://patch.msgid.link/20250515231650.1325372-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/pyynl/ynl_gen_c.py