Add a general netlink socket parser
authorFabien Siron <fabien.siron@epita.fr>
Wed, 6 Jul 2016 15:49:22 +0000 (15:49 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 7 Jul 2016 09:46:51 +0000 (09:46 +0000)
commit2850f745ca49f52b4b1266a6a1b1ec0c58f77c66
treeb597a86fbd60ffb3f64de1e9f078fceebbf64268
parent7499ce024402922e659dee14604173dfeea86be3
Add a general netlink socket parser

Introduce a general socket netlink parser which prints the header and
a string for the remaining part of the buffer.  It doesn't handle all
the netlink flags and types yet because the parser needs more
information, this will be implemented later.

* net.c (decode_sockbuf): New function.
(SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom)):
Use it instead of printstr.
* msghdr.c (print_msghdr): Pass IOV_DECODE_NETLINK to tprint_iov_upto()
for netlink sockets.
* netlink.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (decode_netlink, getfdproto): New prototypes.
(iov_decode): Add IOV_DECODER_NETLINK.
* io.c (print_iovec): Use decode_netlink().
* util.c (getfdproto): Remove static keyword.
* xlat/netlink_flags.in: New file.
* xlat/netlink_types.in: New file.
Makefile.am
defs.h
io.c
msghdr.c
net.c
netlink.c [new file with mode: 0644]
util.c
xlat/netlink_flags.in [new file with mode: 0644]
xlat/netlink_types.in [new file with mode: 0644]