Skip to content

Tracing getipnodesXXXX calls

December 2, 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"
129.42.17.103	ibm.com
129.42.18.103	ibm.com
129.42.16.103	ibm.com
Look up: ibm.com:
Host: ibm.com
      h_address[0]: 0:0:0:0:0:0:0:0:0:0:ff:ff:81:2a:11:67
      h_address[1]: 0:0:0:0:0:0:0:0:0:0:ff:ff:81:2a:12:67
      h_address[2]: 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[0]: 10.18.8.140

The script is here. Feel free to use it.

Advertisements

From → Solaris

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: