Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool2.mu.edu!think.com!snorkelwacker.mit.edu!mit-eddie!minya!jc From: jc@minya.UUCP (John Chambers) Newsgroups: comp.protocols.tcp-ip Subject: Re: inet_ntoa() Message-ID: <451@minya.UUCP> Date: 24 Jan 91 04:24:45 GMT References: <9101111551.AA02933@taipan.coral.com> Lines: 33 In article <9101111551.AA02933@taipan.coral.com>, greene@coral.com (Jeremy Greene) writes: > > The Sun man pages has the following definition: > char *inet_ntoa( ipAddr ) > struct in_addr ipAddr; > which use to work, instead of > char *inet_ntoa( ipAddr ) > struct in_addr *ipAddr > which now works. Has anyone else had this problem? Yeah; it bit me a couple months ago, while working on some SNMP agents that had to be coded portably across a set of machines that included Suns, DECstations, HPs, Convexes, ... I solved the problem by replacing all the calls on inet_ntoa with a routine that I spent about 3 minutes writing. It's easy to do, it's portable, and it took me far less time to write it than it did to diagnose the problem caused by this @#*&$@ variability in inet_ntoa. (Grumble. Gripe. Why do they do this to us? Do they think that there is a need of makework, so that programmers will still have jobs? ;-) Actually, it was benificial, too. I added a length parameter (which is always 4 where inet_ntoa was used). The routine works just fine in converting ASN.1 object ids to dotted-decimal notation. Consider it one small step in replacing TCP/IP with OSI. Enough snafus like this, and it'll all be OSI... -- All opinions Copyright (c) 1991 by John Chambers. Inquire for licensing at: Home: 1-617-484-6393 Work: 1-508-486-5475 Uucp: ...!{bu.edu,harvard.edu,ima.com,eddie.mit.edu,ora.com}!minya!jc