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://gist.github.com/eQu1NoX/0c90dbe82e97e636fab8 - Client over UDP(ipv6) - https://gist.github.com/eQu1NoX/e38100ba613066aa3b21 - Server over UDP(ipv4) - https://gist.github.com/eQu1NoX/3c96dec9e24ce0c2046d - Client over UDP(ipv4) - https://gist.github.com/eQu1NoX/ae9aa32c75e2a11af580 - Server over TCP(ipv4) - https://gist.github.com/eQu1NoX/5fe4d144a6d818382399 - Client over TCP(ipv4) - https://gist.github.com/eQu1NoX/69724cc1041d420ac596 - Server over TCP(ipv6) - https://gist.github.com/eQu1NoX/59a162a0e250a473e63f - Client over TCP(ipv6) - https://gist.github.com/eQu1NoX/a97d74bd059682da6fe9 Thanks, -- zm On Tue, Aug 5, 2014 at 9:24 AM, Zubin Mithra <zubin.mit...@gmail.com> wrote: > Hello everyone, > > A few notes on the patch "Print ip and port associated with descriptor > with -yy" :- > > 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 > > 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 have not added in > support for tcp6, udp, udp6). This is how it prints out the ip and > port associated with a file descriptor :- > - If -yy is used and if readlink(fd) results in something starting > with "socket:[", extract the inode number from the path returned from > getfdpath. > - Read lines /proc/net/tcp and parse the ipv4 remote address and > port associated with the inode number and print it out. > - In cases where the remote address and port cannot be found > out(eg:- a connect call, where the inode number does not yet > correspond to an ip and port; or a close of a file descriptor that has > not been "connect"ed yet), it simply prints out the path returned by > getfdpath. > > > If this implementation sounds good, I can add in support to read from > /proc/net/tcp6, /proc/net/udp and /proc/net/udp6. > > > Thanks, > -- zm ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel