By user12625760 on Dec 02, 2009
When I wrote the D script to decode gethostbyname() and gethostbyaddr() library calls I fully intended to proactive write the script to do getipnodebyname() and getipnodebyaddr() and for that matter all the getXbyY routines. However that spare five minutes never arrived so it was only today while investigating a real issue that I had need for a script to decode getipnodebyaddr(). Fortunately taking the other script and modifying to work with getipnodebyXXXX was not that hard.
It can only decode 5 addresses per call before it runs out of space for DIF as it has to do more than the gethostbyXXXX() version since it has to cope with both IPv4 and IPv6 addresses:
dhcp-10-18-9-247-gmp03# dtrace -32 -CZs gethostbyXXXX.d -c "getent ipnodes ibm.com" 18.104.22.168 ibm.com 22.214.171.124 ibm.com 126.96.36.199 ibm.com Look up: ibm.com: Host: ibm.com h_address: 0:0:0:0:0:0:0:0:0:0:ff:ff:81:2a:11:67 h_address: 0:0:0:0:0:0:0:0:0:0:ff:ff:81:2a:12:67 h_address: 0:0:0:0:0:0:0:0:0:0:ff:ff:81:2a:10:67 dhcp-10-18-9-247-gmp03# dtrace -32 -CZs getipnodebyXXXX.d -c "smbadm list" [\*] [CJG] [\*] [cjg.uk.sun.com] [+x6250a-vbox10.cjg.uk.sun.com] [10.18.8.140] [\*] [CJG] [S-1-5-21-1782774743-1218725973-889210084] [.] [DHCP-10-18-9-24] [S-1-5-21-277162072-319636157-2443625992] Look up: x6250a-vbox10: Host: x6250a-vbox10.cjg.uk.sun.com h_address: 10.18.8.140
The script is here. Feel free to use it.