This is an old revision of the document!
Retrieve the ports used by a specific process with the pfiles command.
pfiles `ptree | awk '{print $1}'` | egrep '^[0-9]|port:'
Example output:
24168: ssh tcenshwpel2
sockname: AF_INET 165.143.130.21 port: 34820
peername: AF_INET 165.143.129.64 port: 22
4376: /usr/lib/ssh/sshd
sockname: AF_INET 165.143.130.21 port: 22
peername: AF_INET 10.254.39.118 port: 57907
4377: /usr/lib/ssh/sshd
sockname: AF_INET 165.143.130.21 port: 22
peername: AF_INET 10.254.39.118 port: 57907