Add support for differing gethostbyaddr(), sethostent() and endhostent().

This commit is contained in:
Mark Andrews
2000-01-24 01:16:43 +00:00
parent 40f2417843
commit 8bddb73c66
2 changed files with 45 additions and 0 deletions
+30
View File
@@ -16,6 +16,19 @@ gethostbyname(const char *name) {
return (he);
}
#ifdef ISC_LWRES_GETHOSTBYADDRVOID
struct hostent *
gethostbyaddr(const void *addr, int len, int type) {
int error;
if (he != NULL)
freehostent(he);
he = getipnodebyaddr(addr, len, type, &error);
h_errno = error;
return (he);
}
#else
struct hostent *
gethostbyaddr(const char *addr, int len, int type) {
int error;
@@ -27,6 +40,7 @@ gethostbyaddr(const char *addr, int len, int type) {
h_errno = error;
return (he);
}
#endif
struct hostent *
gethostent(void) {
@@ -37,12 +51,28 @@ gethostent(void) {
return (NULL);
}
#ifdef ISC_LWRES_SETHOSTENTINT
int
sethostent(int stayopen) {
(void)stayopen;
return (0);
}
#else
void
sethostent(int stayopen) {
/* empty */
(void)stayopen;
}
#endif
#ifdef ISC_LWRES_ENDHOSTENTINT
int
endhostent(void) {
return(0);
}
#else
void
endhostent(void) {
/* empty */
}
#endif
+15
View File
@@ -46,6 +46,21 @@
*/
@ISC_LWRES_SETNETENTINT@
/*
* Define if gethostbyaddr takes a void * as first arguement.
*/
@ISC_LWRES_GETHOSTBYADDRVOID@
/*
* Define if sethostent returns an int.
*/
@ISC_LWRES_SETHOSTENTINT@
/*
* Define if endhostent returns an int.
*/
@ISC_LWRES_ENDHOSTENTINT@
#ifdef ISC_LWRES_NEEDADDRINFO
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */