Add a function for dumping iovec in msghdr used in sendmsg and recvmsg
Here is an example session:
$ ./strace -e write=all ip link change dev enp0s25 mtu 1501 > /dev/null
sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=
00000000}, msg_iov(1)=[{"(...
* 40 bytes in buffer 0
| 00000 28 00 00 00 10 00 05 00 d0 d9 aa 53 00 00 00 00 (..........S.... |
| 00010 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................ |
| 00020 08 00 04 00 dd 05 00 00 ........ |
...
$ ./strace -e read=all ip link show > /dev/null
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=
00000000}, msg_iov(1)=[{"...
* 8192 bytes in buffer 0
| 00000 34 00 00 00 02 00 00 00 00 00 00 00 ff 23 00 00 4............#.. |
| 00010 ff ff ff ff 20 00 00 00 10 00 05 00 00 00 00 00 .... ........... |
...
* defs.h (dumpiov_in_msghdr): New prototype.
* net.c (extractmsghdr): New function derived from printmsghdr.
(printmsghdr): Use extractmsghdr.
(dumpiov_in_msghdr): New function.
* syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_msghdr for recvmsg
and sendmsg syscalls.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>