IP and port associated with a socket fd

Mike Frysinger vapier at gentoo.org
Tue Aug 5 23:50:58 UTC 2014


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:
 - should lookup IP addresses
 - should lookup ports using getservent
 - add a flag to enable that look up logic since it'll probably be too slow 
for default behavior

> 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;

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.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140805/b84d7d5e/attachment.bin>


More information about the Strace-devel mailing list