]> granicus.if.org Git - strace/commit
Add -yy option: print ip and port associated with socket descriptors
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 21 Aug 2014 03:17:48 +0000 (03:17 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 17 Sep 2014 20:03:38 +0000 (20:03 +0000)
commit2f6510c8a6a358ec00f56a491318181bc068a1fc
treed4bdca23c7a3cfcc7e363e1c6ec30b96e4d7b17d
parentc3a5c01051ba29a9f421f4d45d96bbc32df2b796
Add -yy option: print ip and port associated with socket descriptors

When two ore more -y options are given, print local and remote ip:port
pairs associated with socket descriptors.  This implementation uses
NETLINK_INET_DIAG for sockaddr lookup; it's based on the patch
prepared by Zubin Mithra as a part of his GSoC 2014 strace project.

* Makefile.am (strace_SOURCES): Add socketutils.c
(EXTRA_DIST): Add linux/inet_diag.h and linux/sock_diag.h.
* defs.h (print_sockaddr_by_inode): New prototype.
* linux/inet_diag.h: New file.
* linux/sock_diag.h: Likewise.
* socketutils.c: Likewise.
* strace.1: Document -yy option.
* strace.c (usage): Likewise.
* util.c (printfd): Use print_sockaddr_by_inode.
Makefile.am
defs.h
linux/inet_diag.h [new file with mode: 0644]
linux/sock_diag.h [new file with mode: 0644]
socketutils.c [new file with mode: 0644]
strace.1
strace.c
util.c