[comp.protocols.tcp-ip] inet_ntoa

greene@coral.com (Jeremy Greene) (01/11/91)

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?
 
JAG

backman@FTP.COM (Larry Backman) (01/15/91)

    
    
    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?
     
    JAG
    



   JAG of ex-Interlan fame?

		

			Larry

jc@minya.UUCP (John Chambers) (01/24/91)

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