Re: IP and port associated with a socket fd

2014-08-07 Thread Mike Frysinger
On Thu 07 Aug 2014 09:48:34 Zubin Mithra wrote: > On Wed, Aug 6, 2014 at 11:10 PM, Dmitry V. Levin wrote: > > Looks like there are no other viable options but libnl. > > Do we really need libnl? So far the code samples I have seen that does not > use libnl seems fairly straightforward. if you can

Re: IP and port associated with a socket fd

2014-08-07 Thread Masatake YAMATO
On Thu, 7 Aug 2014 09:48:34 +0530, Zubin Mithra wrote: > On Wed, Aug 6, 2014 at 11:10 PM, Dmitry V. Levin wrote: >> On Tue, Aug 05, 2014 at 11:58:35PM -0400, Mike Frysinger wrote: >>> On Wed 06 Aug 2014 12:31:36 Masatake YAMATO wrote: >> [...] >>> > A problem is that many libraries wrapping netli

Re: IP and port associated with a socket fd

2014-08-06 Thread Zubin Mithra
On Wed, Aug 6, 2014 at 11:10 PM, Dmitry V. Levin wrote: > On Tue, Aug 05, 2014 at 11:58:35PM -0400, Mike Frysinger wrote: >> On Wed 06 Aug 2014 12:31:36 Masatake YAMATO wrote: > [...] >> > A problem is that many libraries wrapping netlink interface are >> > distributed under term of GPL or LGPL. I

Re: IP and port associated with a socket fd

2014-08-06 Thread Dmitry V. Levin
On Tue, Aug 05, 2014 at 11:58:35PM -0400, Mike Frysinger wrote: > On Wed 06 Aug 2014 12:31:36 Masatake YAMATO wrote: [...] > > A problem is that many libraries wrapping netlink interface are > > distributed under term of GPL or LGPL. I'm not sure the code using the > > library is acceptable to stra

Re: IP and port associated with a socket fd

2014-08-05 Thread Zubin Mithra
Hi Mike, > > i don't think we want to use that model. the /proc net filesystem is known to > have limitations. instead i think we should do what iproute2's ss tool does > -- use netlink sockets. Looks interesting, I'll change the current implementation to use netlink sockets. Thank you! -- zm

Re: IP and port associated with a socket fd

2014-08-05 Thread Mike Frysinger
On Wed 06 Aug 2014 12:31:36 Masatake YAMATO wrote: > > On Tue 05 Aug 2014 09:24:04 Zubin Mithra wrote: > >> 2. Currently, the ip and port associated with a file descriptor is > >> obtained in a similar way as netstat does it(print_remote_ipport of > >> the patch corresponds to tcp_do_one in netstat

Re: IP and port associated with a socket fd

2014-08-05 Thread Masatake YAMATO
> On Tue 05 Aug 2014 09:24:04 Zubin Mithra wrote: >> 1. A sample output of running it on the client and the server can be >> found here :- >> - client : https://gist.github.com/eQu1NoX/3a325de729b4705dc9c3 >> - server : https://gist.github.com/eQu1NoX/3713abc3bae2657d4d6e > > pretty cool. some th

Re: IP and port associated with a socket fd

2014-08-05 Thread Mike Frysinger
On Tue 05 Aug 2014 09:24:04 Zubin Mithra wrote: > 1. A sample output of running it on the client and the server can be > found here :- > - client : https://gist.github.com/eQu1NoX/3a325de729b4705dc9c3 > - server : https://gist.github.com/eQu1NoX/3713abc3bae2657d4d6e pretty cool. some thoughts: -

Re: IP and port associated with a socket fd

2014-08-05 Thread Zubin Mithra
Hello everyone, I've just sent a V2 of the patch "Print ip and port associated with descriptor with -yy". It adds support for IPv6 and IPv4 over UDP and TCP. I've played around with netcat for setting up the server and client and the output looks as follows :- - Server over UDP(ipv6) - https://