]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools: ynl-gen: multi-attr: type gen for string
authorJakub Kicinski <kuba@kernel.org>
Tue, 29 Apr 2025 15:46:59 +0000 (08:46 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Fri, 2 May 2025 10:41:02 +0000 (12:41 +0200)
commit0ea8cf56cc20ed51cfbef7c6410874ac7fd07642
treec97c26fa4812415fd3df3d71bea9bc22b914d082
parent49398830a4aa650c00b402477042c90db7d6214c
tools: ynl-gen: multi-attr: type gen for string

Add support for multi attr strings (needed for link alt_names).
We record the length individual strings in a len member, to do
the same for multi-attr create a struct ynl_string in ynl.h
and use it as a layer holding both the string and its length.
Since strings may be arbitrary length dynamically allocate each
individual one.

Adjust arg_member and struct member to avoid spacing the double
pointers to get "type **name;" rather than "type * *name;"

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250429154704.2613851-8-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/net/ynl/lib/ynl.h
tools/net/ynl/pyynl/ynl_gen_c.py