gethost.c revision dafcb997e390efa4423883dafd100c975c4095d6
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Copyright (C) 2000, 2001 Internet Software Consortium.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Permission to use, copy, modify, and distribute this software for any
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * purpose with or without fee is hereby granted, provided that the above
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * copyright notice and this permission notice appear in all copies.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * PERFORMANCE OF THIS SOFTWARE.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews/* $Id: gethost.c,v 1.30 2004/03/05 05:12:45 marka Exp $ */
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews (((unsigned long)(p) + LWRES_ALIGNBYTES) &~ LWRES_ALIGNBYTES)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsstatic int copytobuf(struct hostent *, struct hostent *, char *, int);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews he = lwres_getipnodebyname(name, AF_INET, 0, &lwres_h_errno);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewslwres_gethostbyname2(const char *name, int af) {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews he = lwres_getipnodebyname(name, af, 0, &lwres_h_errno);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewslwres_gethostbyaddr(const char *addr, int len, int type) {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews he = lwres_getipnodebyaddr(addr, len, type, &lwres_h_errno);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewslwres_gethostbyname_r(const char *name, struct hostent *resbuf,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews he = lwres_getipnodebyname(name, AF_INET, 0, error);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewslwres_gethostbyaddr_r(const char *addr, int len, int type,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews he = lwres_getipnodebyaddr(addr, len, type, error);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewslwres_gethostent_r(struct hostent *resbuf, char *buf, int buflen, int *error) {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscopytobuf(struct hostent *he, struct hostent *hptr, char *buf, int buflen) {
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Find out the amount of space required to store the answer.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews return (-1);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Copy address size and type.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews cp = (char *)LWRES_ALIGN(buf) + nptr * sizeof(char *);
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Copy address list.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Copy official name.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews * Copy aliases.