Masatake YAMATO 120e5dbcac Support unix domain sockets in -yy option
This change extends -yy option to handle unix domain sockets:
their peer addresses will be printed, similar to inet sockets.

For a listening socket, its socket inode and socket path are printed.
For an accepted socket, its socket inode, the peer inode, and the
socket path are printed.
For a client socket, its socket inode and the peer inode are printed.

An example of a server side communication using netcat:

	$ ./strace -yy -e network nc -l -U /tmp/example.sock
	socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
	setsockopt(3<UNIX:[14728348]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
	bind(3<UNIX:[14728348]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
	listen(3<UNIX:[14728348,"/tmp/example.sock"]>, 10) = 0
	accept(3<UNIX:[14728348,"/tmp/example.sock"]>, {sa_family=AF_LOCAL, NULL}, [2]) = 4<UNIX:[14727246->14727245,"/tmp/example.sock"]>
	recvfrom(4<UNIX:[14727246->14727245,"/tmp/example.sock"]>, "INPUT\n", 8192, 0, NULL, NULL) = 6
	INPUT

An example of a client side communication using netcat:

	$ ./strace -yy -e network nc -U /tmp/example.sock
	socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
	connect(3<UNIX:[14727245]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
	getsockopt(3<UNIX:[14727245]>, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
	INPUT
	...
	sendto(3<UNIX:[14727245->14727246]>, "INPUT\n", 6, 0, NULL, 0) = 6

* linux/unix_diag.h: New file.
* socketutils.c (send_query): Rename to inet_send_query.
(parse_response): Rename to inet_parse_response.
(unix_print, unix_send_query, unix_parse_response): New functions.
(receive_responses): Add a new argument named parser: a function for
handling protocol specific data parts of diag messages.
(print_sockaddr_by_inode): Call unix_print.
Replace NETLINK_INET_DIAG with NETLINK_SOCK_DIAG, they are equal
but NETLINK_SOCK_DIAG looks more generic.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2014-12-25 01:00:48 +00:00
2014-08-15 13:14:15 +00:00
2014-12-13 01:56:56 +00:00
2013-05-02 22:06:12 +00:00
2012-05-01 21:51:38 +00:00
2014-09-08 16:43:36 +00:00
2014-06-04 16:29:18 +00:00
2014-11-21 21:41:32 +00:00
2014-05-30 21:31:08 +00:00
2009-07-08 21:01:21 +00:00
2013-05-17 23:18:55 +00:00
2012-05-01 21:51:38 +00:00
2014-05-30 22:10:21 +00:00
2014-12-15 23:54:37 +00:00
2014-05-30 21:40:03 +00:00
2014-05-30 22:10:21 +00:00
2012-02-25 15:29:21 +01:00
2014-11-21 20:46:16 +00:00
2014-11-21 21:41:32 +00:00
2014-05-30 21:40:03 +00:00
2014-05-30 22:10:21 +00:00
2014-05-30 22:10:21 +00:00
2014-05-30 21:40:03 +00:00
2014-04-10 15:29:13 +00:00
2014-05-30 22:10:21 +00:00
2014-05-30 21:31:08 +00:00
2014-12-02 20:39:13 +00:00
2014-12-04 02:23:40 +00:00
2014-12-02 21:36:04 +00:00
2014-08-19 11:34:44 +00:00
2014-12-11 23:32:59 +00:00
2014-05-30 22:10:21 +00:00
2014-05-30 22:10:21 +00:00
2013-05-17 23:18:55 +00:00
2014-11-21 22:28:34 +00:00
2014-08-15 13:14:15 +00:00
2014-05-30 21:40:03 +00:00
2014-12-13 01:34:47 +00:00
2014-12-03 21:21:04 +00:00
2014-09-29 23:29:56 +00:00
2014-12-04 02:23:40 +00:00
2014-05-30 22:10:21 +00:00
2014-12-02 20:47:30 +00:00
2014-02-26 00:01:00 +00:00

This is strace, a system call tracer for Linux.

strace is released under a Berkeley-style license at the request
of Paul Kranenburg; see the file COPYING for details.

See the file CREDITS for a list of authors and other contributors.

See the file INSTALL for compilation and installation instructions.

See the file NEWS for information on what has changed in recent
versions.

You can get the latest version of strace from its homepage at
http://sourceforge.net/projects/strace/ .

Please send bug reports and enhancements to the strace
mailinglist at strace-devel@lists.sourceforge.net.
Description
No description provided
Readme 17 MiB
Languages
C 92.2%
Shell 3.4%
M4 1.4%
Makefile 0.8%
Roff 0.7%
Other 1.5%