[PATCH net-next v3 12/13] tools: ynl: decode hex input

Donald Hunter donald.hunter at gmail.com
Fri Sep 12 12:08:57 UTC 2025


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

> This patch adds 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>"}'
>
> In order to somewhat mirror what is done in _formatted_string(),
> then for non-binary attributes attempt to convert it to an int.
>
> Signed-off-by: Asbjørn Sloth Tønnesen <ast at fiberby.net>

Reviewed-by: Donald Hunter <donald.hunter at gmail.com>


More information about the WireGuard mailing list