tools: ynl-gen: support full range of min/max checks for integer values
authorJakub Kicinski <kuba@kernel.org>
Wed, 18 Oct 2023 16:39:16 +0000 (09:39 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Oct 2023 22:54:56 +0000 (15:54 -0700)
commit668c1ac828fb546b81da6b36dae09d754bd0f59e
tree1df611d3228e128ff868bfc2b05ba7d9fffdbad4
parentee0a4cfcbdcc6a7b2b35dba475e68187ebdafbf1
tools: ynl-gen: support full range of min/max checks for integer values

Extend the support to full range of min/max checks.
None of the existing YNL families required complex integer validation.

The support is less than trivial, because we try to keep struct nla_policy
tiny the min/max members it holds in place are s16. Meaning we can only
express checks in range of s16. For larger ranges we need to define
a structure and link it in the policy.

Link: https://lore.kernel.org/r/20231018163917.2514503-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/genetlink-c.yaml
Documentation/netlink/genetlink-legacy.yaml
Documentation/netlink/genetlink.yaml
tools/net/ynl/ynl-gen-c.py