All of lore.kernel.org
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>
Cc: Jacob Keller <jacob.e.keller@intel.com>,
	 "Jason A. Donenfeld" <Jason@zx2c4.com>,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Simon Horman <horms@kernel.org>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	 wireguard@lists.zx2c4.com, netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 10/11] tools: ynl: decode hex input
Date: Mon, 08 Sep 2025 09:28:26 +0100	[thread overview]
Message-ID: <m21pohwdp1.fsf@gmail.com> (raw)
In-Reply-To: <bf530a9a-dca8-4df7-b9f2-9f2b3a1d2ce1@fiberby.net>

Asbjørn Sloth Tønnesen <ast@fiberby.net> writes:

> On 9/6/25 12:27 AM, Jacob Keller wrote:
>> On 9/5/2025 3:51 AM, Donald Hunter wrote:
>>> Asbjørn Sloth Tønnesen <ast@fiberby.net> writes:
>>>
>>>> This patch add support for decoding hex input, so
>>>> that binary attributes can be read through --json.
>>>>
>>>> Example (using future wireguard.yaml):
>>>>   $ sudo ./tools/net/ynl/pyynl/cli.py --family wireguard \
>>>>     --do set-device --json '{"ifindex":3,
>>>>       "private-key":"2a ae 6c 35 c9 4f cf <... to 32 bytes>"}'
>>>>
>>>> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
>>>
>>> Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
>>>
>>> FWIW, the hex can include spaces or not when using bytes.fromhex(). When
>>> formatting hex for output, I chose to include spaces, but I don't really
>>> know if that was a good choice or not.
>> I also prefer the spaces for readability.
> I formatted it with spaces for clarity, even without spaces it was a bit
> long for one line. Spaces also has the advantage that you don't have to
> think about endianness.
>
> Should we define the display hints a bit more in a .rst, or is it OK that
> they end up being implementation specific for each language library? Do we
> want them to behave the same in a Rust YNL library, as they do in Python?

Yes we should probably extend the existing doc to at least describe some
of the defacto behaviour.

https://docs.kernel.org/userspace-api/netlink/specs.html#display-hint

> BTW: The rest of the key used in the example can be found with this key-gen:
> $ printf "hello world" | sha1sum
> [redacted key material]

  reply	other threads:[~2025-09-08 10:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 22:01 [PATCH net-next 00/11] tools: ynl: prepare for wireguard Asbjørn Sloth Tønnesen
2025-09-04 22:01 ` [PATCH net-next 01/11] tools: ynl-gen: allow overriding name-prefix for constants Asbjørn Sloth Tønnesen
2025-09-05 10:36   ` Donald Hunter
2025-09-06  0:07   ` Jakub Kicinski
2025-09-06  0:15   ` Jacob Keller
2025-09-04 22:01 ` [PATCH net-next 02/11] tools: ynl-gen: generate nested array policies Asbjørn Sloth Tønnesen
2025-09-05 10:37   ` Donald Hunter
2025-09-06  0:09   ` Jakub Kicinski
2025-09-06  0:19   ` Jacob Keller
2025-09-06 14:13     ` Asbjørn Sloth Tønnesen
2025-09-08  7:54       ` Johannes Berg
2025-09-08  9:08         ` Asbjørn Sloth Tønnesen
2025-09-08 13:22           ` Johannes Berg
2025-09-09 23:02       ` Jacob Keller
2025-09-04 22:01 ` [PATCH net-next 03/11] tools: ynl-gen: add sub-type check Asbjørn Sloth Tønnesen
2025-09-05 10:37   ` Donald Hunter
2025-09-06  0:12   ` Jakub Kicinski
2025-09-06  0:20   ` Jacob Keller
2025-09-04 22:01 ` [PATCH net-next 04/11] tools: ynl-gen: define count iterator in print_dump() Asbjørn Sloth Tønnesen
2025-09-05 10:37   ` Donald Hunter
2025-09-06  0:13   ` Jakub Kicinski
2025-09-06  0:20   ` Jacob Keller
2025-09-04 22:01 ` [PATCH net-next 05/11] tools: ynl-gen: define nlattr *array in a block scope Asbjørn Sloth Tønnesen
2025-09-05 10:44   ` Donald Hunter
2025-09-06  0:18   ` Jakub Kicinski
2025-09-06 13:13     ` Asbjørn Sloth Tønnesen
2025-09-06 19:07       ` Jakub Kicinski
2025-09-11  0:01         ` Asbjørn Sloth Tønnesen
2025-09-11  0:27           ` Jakub Kicinski
2025-09-04 22:01 ` [PATCH net-next 06/11] tools: ynl-gen: don't validate nested array attribute types Asbjørn Sloth Tønnesen
2025-09-06  0:23   ` Jakub Kicinski
2025-09-06 13:22     ` Asbjørn Sloth Tønnesen
2025-09-06 19:29       ` Jakub Kicinski
2025-09-06  0:24   ` Jacob Keller
2025-09-06 15:10     ` Asbjørn Sloth Tønnesen
2025-09-08  7:55       ` Johannes Berg
2025-09-10 16:58       ` Jacob Keller
2025-09-04 22:01 ` [PATCH net-next 07/11] tools: ynl-gen: rename TypeArrayNest to TypeIndexedArray Asbjørn Sloth Tønnesen
2025-09-05 10:44   ` Donald Hunter
2025-09-06  0:25   ` Jakub Kicinski
2025-09-04 22:01 ` [PATCH net-next 08/11] tools: ynl: move nest packing to a helper function Asbjørn Sloth Tønnesen
2025-09-05 10:45   ` Donald Hunter
2025-09-04 22:01 ` [PATCH net-next 09/11] tools: ynl: encode indexed-array Asbjørn Sloth Tønnesen
2025-09-05 10:49   ` Donald Hunter
2025-09-05 15:34     ` Asbjørn Sloth Tønnesen
2025-09-04 22:01 ` [PATCH net-next 10/11] tools: ynl: decode hex input Asbjørn Sloth Tønnesen
2025-09-05 10:51   ` Donald Hunter
2025-09-06  0:27     ` Jacob Keller
2025-09-06 14:31       ` Asbjørn Sloth Tønnesen
2025-09-08  8:28         ` Donald Hunter [this message]
2025-09-09 18:10   ` Sabrina Dubroca
2025-09-09 20:18     ` Asbjørn Sloth Tønnesen
2025-09-04 22:01 ` [PATCH net-next 11/11] tools: ynl: add ipv4-or-v6 display hint Asbjørn Sloth Tønnesen
2025-09-05 10:53   ` Donald Hunter
2025-09-06 15:59     ` Asbjørn Sloth Tønnesen

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=m21pohwdp1.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@fiberby.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wireguard@lists.zx2c4.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.