From: Simon Horman <horms@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, andrew+netdev@lunn.ch,
donald.hunter@gmail.com, jacob.e.keller@intel.com,
sdf@fomichev.me, jdamato@fastly.com
Subject: Re: [PATCH net-next v2 07/12] tools: ynl-gen: multi-attr: type gen for string
Date: Fri, 25 Apr 2025 18:21:44 +0100 [thread overview]
Message-ID: <20250425172144.GT3042781@horms.kernel.org> (raw)
In-Reply-To: <20250425024311.1589323-8-kuba@kernel.org>
On Thu, Apr 24, 2025 at 07:43:06PM -0700, Jakub Kicinski wrote:
> 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: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> tools/net/ynl/lib/ynl.h | 13 +++++++++++++
> tools/net/ynl/pyynl/ynl_gen_c.py | 29 +++++++++++++++++++++++++----
> 2 files changed, 38 insertions(+), 4 deletions(-)
>
> diff --git a/tools/net/ynl/lib/ynl.h b/tools/net/ynl/lib/ynl.h
> index 59256e258130..0b4acc0d288a 100644
> --- a/tools/net/ynl/lib/ynl.h
> +++ b/tools/net/ynl/lib/ynl.h
> @@ -85,6 +85,19 @@ struct ynl_sock {
> unsigned char raw_buf[];
> };
>
> +/**
> + * struct ynl_string - parsed individual string
> + * @len: length of the string (excluding terminating character)
> + * @str: valud of the string
typo: value
...
next prev parent reply other threads:[~2025-04-25 17:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 2:42 [PATCH net-next v2 00/12] tools: ynl-gen: additional C types and classic netlink handling Jakub Kicinski
2025-04-25 2:43 ` [PATCH net-next v2 01/12] tools: ynl-gen: fix comment about nested struct dict Jakub Kicinski
2025-04-25 9:08 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 02/12] tools: ynl-gen: factor out free_needs_iter for a struct Jakub Kicinski
2025-04-25 9:09 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 03/12] tools: ynl-gen: fill in missing empty attr lists Jakub Kicinski
2025-04-25 9:12 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 04/12] tools: ynl: let classic netlink requests specify extra nlflags Jakub Kicinski
2025-04-25 9:15 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 05/12] tools: ynl-gen: support using dump types for ntf Jakub Kicinski
2025-04-25 9:16 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 06/12] tools: ynl-gen: support CRUD-like notifications for classic Netlink Jakub Kicinski
2025-04-25 9:21 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 07/12] tools: ynl-gen: multi-attr: type gen for string Jakub Kicinski
2025-04-25 9:26 ` Donald Hunter
2025-04-25 17:21 ` Simon Horman [this message]
2025-04-25 2:43 ` [PATCH net-next v2 08/12] tools: ynl-gen: mutli-attr: support binary types with struct Jakub Kicinski
2025-04-25 9:27 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 09/12] tools: ynl-gen: array-nest: support put for scalar Jakub Kicinski
2025-04-25 9:48 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 10/12] tools: ynl-gen: array-nest: support binary array with exact-len Jakub Kicinski
2025-04-25 9:56 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 11/12] tools: ynl-gen: don't init enum checks for classic netlink Jakub Kicinski
2025-04-25 10:04 ` Donald Hunter
2025-04-25 2:43 ` [PATCH net-next v2 12/12] tools: ynl: allow fixed-header to be specified per op Jakub Kicinski
2025-04-25 10:08 ` Donald Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250425172144.GT3042781@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).