]> granicus.if.org Git - strace/commit
netlink: add decoding of NETLINK_GENERIC protocol families
authorMasatake YAMATO <yamato@redhat.com>
Tue, 13 Jun 2017 08:26:44 +0000 (17:26 +0900)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 19 Jun 2017 21:45:58 +0000 (21:45 +0000)
commitdc84eddc8169df596fdc87faf7d73820ef73be4b
treed99b6b1c6f82287d82662b15f421d67043e5b00a
parent641f3ef7b62cfa458f65f52ed4b37616a181c051
netlink: add decoding of NETLINK_GENERIC protocol families

NETLINK_GENERIC is a protocol stacked on netlink protocol.

When a NETLINK_GENERIC subsystem registers its "family" name in the
kernel at run time, an integer value associated with this name is
assigned by the kernel.  This integer value is specified in struct
nlmsghdr.nlmsg_type of subsequent communications with the
NETLINK_GENERIC subsystem.

This change implements decoding of NETLINK_GENERIC message types in
symbolic form, for example:

  $ ./strace -yy -e 'sendto' ip tcp_metrics > /dev/null
  sendto(4<NETLINK:[GENERIC:12345]>, {{len=20, type=tcp_metrics, ...
  +++ exited with 0 +++

Note that type= specifying the NETLINK_GENERIC protocol family
is decoded properly.

* netlink.c (decode_nlmsg_type_generic): New function.
(nlmsg_types): Add NETLINK_GENERIC entry.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
netlink.c