From: trustee on 7 Mar 2010 23:00
Ah ok...the function that I posted is *not* the function that gets
The real gethostbyname is automatically generated by the preprocessor
in the files inet/gethstbynm.c, nss/getXXbyYY.c and nss/getXXbyYY_r.c.
IP parsing is done in nss/digits_dots.c.
I could make it accept IPv6 addresses by changing AF_INET to AF_INET6
in the following code. But after that it won't accept IPv4
# define AF_VAL af
# define AF_VAL AF_INET
From: Rick Jones on 8 Mar 2010 13:54
You *really* aught to be migrating to getaddrinfo()/getnodeinfo().
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
From: trustee on 9 Mar 2010 01:43
> You *really* aught to be migrating to getaddrinfo()/getnodeinfo().
I have written two classes, one with getaddrinfo and one with
I implemented the gethostbyname stuff only for fun, i know that it is
not recommended nowadays. :)