Hello,
Here is a new version of the netlink socket parser.
Changes since v1:
* handle io vector with length different than 1
(for sendmsg/recvmsg/sendmmsg/recvmmsg...).
* add nlmsg_ok and nlmsg_next functions which correspond to NLMSG_OK and
NLMSG_NEXT macros.
* handle multiple netlink messages.
* tests/netlink_parsing.test: New test.
* tests/netlink_parsing.c: New file.
* tests/.gitignore: Add netlink_parsing.
* tests/Makefile.am (check_PROGRAMS): Likewise.
---
tests/.gitignore | 1 +
tests/Makefile.am | 2 ++
tests/netlink_parsing.c| 89 +
This commit introduces 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 because the parser needs more
information. It will be done soon.
* net.c (get_family): New function.
(do_msghdr): Call
This commit aims to avoid future string comparisons with getfdproto function
in changing its return type. It also adapts the functions that use it.
* defs.h (print_sockaddr_by_inode): Add.
* socketutils.h (socket_protocols): New enum.
* socketutils.c (print_sockaddr_by_inode): Move proto to int.
*
* defs.h (getfdnlproto): Add.
* utils.c (getfdinode): New function.
(getfdnlproto): Likewise.
---
defs.h | 1 +
util.c | 68 --
2 files changed, 63 insertions(+), 6 deletions(-)
diff --git a/defs.h b/defs.h
index 06dba19..87ae043 10
Since our target is not in the same process, the netlink macros NLMSG_*
must be rewritten for strace.
* netlink.c (nlmsg_ok, nlmsg_next): New functions.
---
netlink.c | 26 ++
1 file changed, 26 insertions(+)
diff --git a/netlink.c b/netlink.c
index 738c639..bb2c3a7 10064
* netlink.c (decode_netlink_or_printaddr_msg): From
decode_netlink_or_printaddr().
(decode_netlink_or_printaddr): Call decode_netlink_or_printaddr_msg().
---
netlink.c | 21 ++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/netlink.c b/netlink.c
index bb2c3a7..9b
Because netlink parsing needs a way to get the netlink protocol and the
socketutils.c file can only print the protocol, this commit adds an interface
to get some socket information without printing it.
* defs.h
(get_sockaddr_by_inode_cached, get_sockaddr_by_inode): Add.
* socketutils.c (cache_prin
Hallo,
I must analyze a library (*.tar.gz) that includes a lot of files and most of
them are not required for a specific run.
I used strace 4.8.1 on Ubuntu Server 16.04 with:
strace -e trace=file -f -v -o /tmp/result.strace ./run.sh
Everything is working fine, but the log sometimes contains rela