| 1b255e1b | 15-Sep-2025 |
Asbjørn Sloth Tønnesen <ast@fiberby.net> |
tools: ynl: add ipv4-or-v6 display hint
The attribute WGALLOWEDIP_A_IPADDR can contain either an IPv4 or an IPv6 address depending on WGALLOWEDIP_A_FAMILY, however in practice it is enough to look a
tools: ynl: add ipv4-or-v6 display hint
The attribute WGALLOWEDIP_A_IPADDR can contain either an IPv4 or an IPv6 address depending on WGALLOWEDIP_A_FAMILY, however in practice it is enough to look at the attribute length.
This patch implements an ipv4-or-v6 display hint, that can deal with this kind of attribute.
It only implements this display hint for genetlink-legacy, it can be added to other protocol variants if needed, but we don't want to encourage it's use.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250915144301.725949-12-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 52550d51 | 15-Sep-2025 |
Asbjørn Sloth Tønnesen <ast@fiberby.net> |
tools: ynl: decode hex input
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/pyy
tools: ynl: decode hex input
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@fiberby.net> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250915144301.725949-11-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 5c51ae24 | 15-Sep-2025 |
Asbjørn Sloth Tønnesen <ast@fiberby.net> |
tools: ynl: encode indexed-arrays
This patch adds support for encoding indexed-array attributes with sub-type nest in pyynl.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Don
tools: ynl: encode indexed-arrays
This patch adds support for encoding indexed-array attributes with sub-type nest in pyynl.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250915144301.725949-10-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 10d32b0d | 09-Sep-2025 |
Matthieu Baerts (NGI0) <matttbe@kernel.org> |
tools: ynl: use 'cond is None'
It is better to use the 'is' keyword instead of comparing to None according to Ruff.
This is linked to Ruff error E711 [1]:
According to PEP 8, "Comparisons to sin
tools: ynl: use 'cond is None'
It is better to use the 'is' keyword instead of comparing to None according to Ruff.
This is linked to Ruff error E711 [1]:
According to PEP 8, "Comparisons to singletons like None should always be done with is or is not, never the equality operators."
Link: https://docs.astral.sh/ruff/rules/none-comparison/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-7-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 616129d6 | 09-Sep-2025 |
Matthieu Baerts (NGI0) <matttbe@kernel.org> |
tools: ynl: remove unnecessary semicolons
These semicolons are not required according to Ruff. Simply remove them.
This is linked to Ruff error E703 [1]:
A trailing semicolon is unnecessary and
tools: ynl: remove unnecessary semicolons
These semicolons are not required according to Ruff. Simply remove them.
This is linked to Ruff error E703 [1]:
A trailing semicolon is unnecessary and should be removed.
Link: https://docs.astral.sh/ruff/rules/useless-semicolon/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-6-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 389712b0 | 09-Sep-2025 |
Matthieu Baerts (NGI0) <matttbe@kernel.org> |
tools: ynl: remove unused imports
These imports are not used according to Ruff, and can be safely removed.
This is linked to Ruff error F401 [1]:
Unused imports add a performance overhead at run
tools: ynl: remove unused imports
These imports are not used according to Ruff, and can be safely removed.
This is linked to Ruff error F401 [1]:
Unused imports add a performance overhead at runtime, and risk creating import cycles. They also increase the cognitive load of reading the code.
There is one exception with 'YnlDocGenerator' which is added in __all__: it is used by ynl_gen_rst.py.
Link: https://docs.astral.sh/ruff/rules/unused-import/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-5-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 0b24dfdd | 17-Jun-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: parser_yaml.py: add support for line numbers from the parser
Instead of printing line numbers from the temp converted ReST file, get them from the original source.
Signed-off-by: Mauro Carval
docs: parser_yaml.py: add support for line numbers from the parser
Instead of printing line numbers from the temp converted ReST file, get them from the original source.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
| ad06a878 | 17-Jun-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
tools: netlink_yml_parser.py: add line numbers to parsed data
When something goes wrong, we want Sphinx error to point to the right line number from the original source, not from the processed ReST
tools: netlink_yml_parser.py: add line numbers to parsed data
When something goes wrong, we want Sphinx error to point to the right line number from the original source, not from the processed ReST data.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
| 3a3b8a14 | 13-Jun-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
tools: ynl_gen_rst.py: cleanup coding style
Cleanup some coding style issues pointed by pylint and flake8.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> R
tools: ynl_gen_rst.py: cleanup coding style
Cleanup some coding style issues pointed by pylint and flake8.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Reviewed-by: Breno Leitao <leitao@debian.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
show more ...
|
| c578bc3a | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: accept IP string inputs
The ynl tool uses display-hint to know when to format IP addresses in printed output, but not to parse IP addresses from --json input. Add support for parsing
tools/net/ynl: accept IP string inputs
The ynl tool uses display-hint to know when to format IP addresses in printed output, but not to parse IP addresses from --json input. Add support for parsing ipv4 and ipv6 strings.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-5-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 569a5d63 | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: support rendering C array members to strings
The nl80211 family encodes the list of supported ciphers as a C array of u32 values. Add support for translating arrays of scalars into st
tools/net/ynl: support rendering C array members to strings
The nl80211 family encodes the list of supported ciphers as a C array of u32 values. Add support for translating arrays of scalars into strings for enum names and display hints.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-4-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 678d8ddd | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: support decoding indexed arrays as enums
When decoding an indexed-array with a scalar subtype, it is currently only possible to add a display-hint. Add support for decoding each value
tools/net/ynl: support decoding indexed arrays as enums
When decoding an indexed-array with a scalar subtype, it is currently only possible to add a display-hint. Add support for decoding each value as an enum.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-3-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|