ynl: support binary and integer sub-type for indexed-array
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 4 Apr 2024 06:31:13 +0000 (14:31 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Apr 2024 05:32:49 +0000 (22:32 -0700)
commita7408b56e5f9e96c486cec9aaf7490452b713ebf
treee7d185beb9f52363bd79dfbdcbf26680f3eff416
parentaa6485d813ad6d884d23e1e9cf3913be29a1f229
ynl: support binary and integer sub-type for indexed-array

Add binary and integer sub-type support for indexed-array to display bond
arp and ns targets. Here is what the result looks like:

 # ip link add bond0 type bond mode 1 \
   arp_ip_target 192.168.1.1,192.168.1.2 ns_ip6_target 2001::1,2001::2
 # ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_link.yaml \
   --do getlink --json '{"ifname": "bond0"}' --output-json | jq '.linkinfo'

    "arp-ip-target": [
      "192.168.1.1",
      "192.168.1.2"
    ],
    [...]
    "ns-ip6-target": [
      "2001::1",
      "2001::2"
    ],

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20240404063114.1221532-3-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/userspace-api/netlink/genetlink-legacy.rst
tools/net/ynl/lib/ynl.py