Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-09-24 Thread Zubin Mithra
> Also, I've written a test for this new feature: > http://sourceforge.net/p/strace/code/ci/fdfa72276a16d0bd42b795aef3ac6c8969210469/ > Thank you Dmitry ! - Zubin -- Meet PCI DSS 3.0 Compliance Requirements with EventL

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-09-23 Thread Dmitry V. Levin
On Thu, Sep 18, 2014 at 01:33:54AM +0400, Dmitry V. Levin wrote: > Hi Zubin, > > On Tue, Aug 26, 2014 at 06:28:46PM +0200, Zubin Mithra wrote: > > > I think it would be less confusing to print both src and dst address:port > > > when dst address:port is non-zero, for example: > > > accept(3<0.0.0.

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-09-17 Thread Masatake YAMATO
Zubin, congratulation! This is the feature really I need. My understandig is that this is the initial step for developing a tool unifying strace, lsof, and tcpdump:) Masatake YAMATO > Hi Zubin, > > On Tue, Aug 26, 2014 at 06:28:46PM +0200, Zubin Mithra wrote: >> > I think it would be less conf

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-09-17 Thread Dmitry V. Levin
Hi Zubin, On Tue, Aug 26, 2014 at 06:28:46PM +0200, Zubin Mithra wrote: > > I think it would be less confusing to print both src and dst address:port > > when dst address:port is non-zero, for example: > > accept(3<0.0.0.0:7171>, {sa_family=AF_INET, sin_port=htons(48435), > > sin_addr=inet_addr("

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-26 Thread Dmitry V. Levin
On Tue, Aug 26, 2014 at 06:30:10PM +0200, Zubin Mithra wrote: > >> Hi Dmitry, > >> > >>> Actually, it is quite linux specific: SOCK_DIAG_BY_FAMILY needs tcp_diag > >>> kernel module to handle IPPROTO_TCP, and udp_diag - for IPPROTO_UDP > >>> sockets. > >> > >> I’m not sure I understand the proble

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-26 Thread Zubin Mithra
>> Hi Dmitry, >> >>> Actually, it is quite linux specific: SOCK_DIAG_BY_FAMILY needs tcp_diag >>> kernel module to handle IPPROTO_TCP, and udp_diag - for IPPROTO_UDP >>> sockets. >> >> I’m not sure I understand the problem here — could you tell me which kernel >> version you had used so that I

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-26 Thread Zubin Mithra
> I think it would be less confusing to print both src and dst address:port > when dst address:port is non-zero, for example: > accept(3<0.0.0.0:7171>, {sa_family=AF_INET, sin_port=htons(48435), > sin_addr=inet_addr("127.0.0.1")}, [16]) = 4<127.0.0.1:7171->127.0.0.1:48435> > Got it, thanks Dmitr

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-25 Thread Dmitry V. Levin
On Sun, Aug 24, 2014 at 04:38:51PM +0200, Zubin Mithra wrote: > Hi Dmitry, > > > Actually, it is quite linux specific: SOCK_DIAG_BY_FAMILY needs tcp_diag > > kernel module to handle IPPROTO_TCP, and udp_diag - for IPPROTO_UDP > > sockets. > > I’m not sure I understand the problem here — could you

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-25 Thread Dmitry V. Levin
On Sun, Aug 24, 2014 at 04:44:23PM +0200, Zubin Mithra wrote: > On 21-Aug-2014, at 4:27, Dmitry V. Levin wrote: > > On Thu, Aug 21, 2014 at 02:53:46AM +0400, Dmitry V. Levin wrote: > >> On Mon, Aug 11, 2014 at 02:21:01PM +0530, zubin.mit...@gmail.com wrote: > > [...] > >>if (!inet_ntop(diag_ms

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-24 Thread Zubin Mithra
Hi Dmitry, On 21-Aug-2014, at 4:27, Dmitry V. Levin wrote: > On Thu, Aug 21, 2014 at 02:53:46AM +0400, Dmitry V. Levin wrote: >> On Mon, Aug 11, 2014 at 02:21:01PM +0530, zubin.mit...@gmail.com wrote: > [...] >> if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_dst, >>

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-24 Thread Zubin Mithra
Hi Dmitry, > Actually, it is quite linux specific: SOCK_DIAG_BY_FAMILY needs tcp_diag > kernel module to handle IPPROTO_TCP, and udp_diag - for IPPROTO_UDP > sockets. I’m not sure I understand the problem here — could you tell me which kernel version you had used so that I could try compiling th

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-24 Thread Zubin Mithra
On Thu, Aug 21, 2014 at 02:53:46AM +0400, Dmitry V. Levin wrote: > On Mon, Aug 11, 2014 at 02:21:01PM +0530, zubin.mit...@gmail.com wrote: [...] > if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_dst, > remote_addr_buf, size) || !remote_addr_buf[0]) >

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-20 Thread Dmitry V. Levin
On Thu, Aug 21, 2014 at 02:53:46AM +0400, Dmitry V. Levin wrote: > On Mon, Aug 11, 2014 at 02:21:01PM +0530, zubin.mit...@gmail.com wrote: [...] > if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_dst, > remote_addr_buf, size) || !remote_addr_buf[0]) >

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-20 Thread Dmitry V. Levin
On Thu, Aug 21, 2014 at 02:53:46AM +0400, Dmitry V. Levin wrote: [...] > > + else if (nlh->nlmsg_type == NLMSG_ERROR) > > + return -1; > > > I tested this patch on a x86_64 system with a fresh kernel. > It always returns NLMSG_ERROR. > I suppose somethi

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-20 Thread Dmitry V. Levin
On Mon, Aug 11, 2014 at 02:21:01PM +0530, zubin.mit...@gmail.com wrote: [...] > diff --git a/configure.ac b/configure.ac > index 9aeb3a6..21dcc0e 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -228,8 +228,11 @@ AC_CHECK_HEADERS(m4_normalize([ > inttypes.h > ioctls.h > linux

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-11 Thread Zubin Mithra
> > >> >> > Unless I'm mistaken this header is present on all linux systems in > /usr/include even with the dev packages installed. > > Typo, sorry. "this header is *not* present on all" Thanks, -- zm -- ___

Re: [PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-11 Thread Zubin Mithra
Hello all, This is the latest patch for extended socket fd decoding. A few points :- > + > +#ifdef HAVE_LINUX_SOCK_DIAG_H > +# include > +#else > +# define SOCK_DIAG_BY_FAMILY 20 > + struct sock_diag_req { > + __u8sdiag_family; > + __u8sdiag_protocol; > + }; > +#endif

[PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-11 Thread zubin . mithra
From: Zubin Mithra * Makefile.am (strace_SOURCES): Add socketutils.c. * configure.ac (AC_CHECK_HEADERS): Add linux/inet_diag.h, linux/netlink.h, linux/sock_diag.h. (AC_CHECK_TYPES): Add inet_diag_req_v2. * defs.h (get_pagesize): Add declaration. (printsockdetails): Add declaration. * mem.c (get

[PATCH v5] Print ip and port associated with descriptor with -yy

2014-08-11 Thread zubin . mithra
From: Zubin Mithra * Makefile.am (strace_SOURCES): Add socketutils.c. * configure.ac (AC_CHECK_HEADERS): Add linux/inet_diag.h, linux/netlink.h, linux/sock_diag.h. (AC_CHECK_TYPES): Add inet_diag_req_v2. * defs.h (get_pagesize): Add declaration. (printsockdetails): Add declaration. * mem.c (get