11dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*	$NetBSD: resolv.h,v 1.31 2005/12/26 19:01:47 perry Exp $	*/
21dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
31dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
41dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Copyright (c) 1983, 1987, 1989
51dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    The Regents of the University of California.  All rights reserved.
61dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
71dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Redistribution and use in source and binary forms, with or without
81dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * modification, are permitted provided that the following conditions
91dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * are met:
101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    notice, this list of conditions and the following disclaimer in the
141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    documentation and/or other materials provided with the distribution.
151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * 3. Neither the name of the University nor the names of its contributors
161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    may be used to endorse or promote products derived from this software
171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    without specific prior written permission.
181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * SUCH DAMAGE.
301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Permission to use, copy, modify, and distribute this software for any
371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * purpose with or without fee is hereby granted, provided that the above
381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * copyright notice and this permission notice appear in all copies.
391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *	@(#)resolv.h	8.1 (Berkeley) 6/2/93
511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *	Id: resolv.h,v 1.7.2.11.4.2 2004/06/25 00:41:05 marka Exp
521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef _RESOLV_PRIVATE_H_
551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	_RESOLV_PRIVATE_H_
561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
5736fa67bcdd90f18a3c68f8637ae836762407fa51Elliott Hughes#include <sys/cdefs.h>
5836fa67bcdd90f18a3c68f8637ae836762407fa51Elliott Hughes
591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include <resolv.h>
601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include "resolv_static.h"
61c63e59039d28c352e3053bb81319e960c392dbd4Mattias Falk#include <net/if.h>
621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
63e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes/* Despite this file's name, it's part of libresolv. On Android, that means it's part of libc :-( */
64e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes#pragma GCC visibility push(default)
65e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes
662d8f9b5aea90b57cd01c0a07cfff032092b4672eYabin Cui// Linux defines MAXHOSTNAMELEN as 64, while the domain name limit in
672d8f9b5aea90b57cd01c0a07cfff032092b4672eYabin Cui// RFC 1034 and RFC 1035 is 255 octets.
682d8f9b5aea90b57cd01c0a07cfff032092b4672eYabin Cui#ifdef MAXHOSTNAMELEN
692d8f9b5aea90b57cd01c0a07cfff032092b4672eYabin Cui#undef MAXHOSTNAMELEN
702d8f9b5aea90b57cd01c0a07cfff032092b4672eYabin Cui#endif
712d8f9b5aea90b57cd01c0a07cfff032092b4672eYabin Cui#define MAXHOSTNAMELEN 256
722d8f9b5aea90b57cd01c0a07cfff032092b4672eYabin Cui
731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Revision information.  This is the release date in YYYYMMDD format.
751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * It can change every day so the right thing to do with it is use it
761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * in preprocessor commands such as "#if (__RES > 19931104)".  Do not
771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * compare for equality; rather, use it to determine whether your resolver
781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * is new enough to contain a certain feature.
791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	__RES	20030124
821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * This used to be defined in res_query.c, now it's in herror.c.
851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * [XXX no it's not.  It's in irs/irs_data.c]
861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * It was
871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * never extern'd by any *.h file before it was placed here.  For thread
881dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * aware programs, the last h_errno value set is stored in res->h_errno.
891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * XXX:	There doesn't seem to be a good reason for exposing RES_SET_H_ERRNO
911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *	(and __h_errno_set) to the public via <resolv.h>.
921dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * XXX:	__h_errno_set is really part of IRS, not part of the resolver.
931dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *	If somebody wants to build and use a resolver that doesn't use IRS,
941dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *	what do they do?  Perhaps something like
951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *		#ifdef WANT_IRS
961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *		# define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
971dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *		#else
981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *		# define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x))
991dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *		#endif
1001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
1011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x))
1031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct __res_state; /* forward */
1041dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
1061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Resolver configuration file.
1071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Normally not present, but may contain the address of the
1081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * initial name server(s) to query and the domain search list.
1091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
1101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef _PATH_RESCONF
1121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifdef ANDROID_CHANGES
1131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define _PATH_RESCONF        "/etc/ppp/resolv.conf"
1141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#else
1151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define _PATH_RESCONF        "/etc/resolv.conf"
1161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
1171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
1181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
1201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	res_sendhookact;
1211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef res_sendhookact (*res_send_qhook)(struct sockaddr * const *,
1231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project					      const u_char **, int *,
1241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project					      u_char *, int, int *);
1251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef res_sendhookact (*res_send_rhook)(const struct sockaddr *,
1271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project					      const u_char *, int, u_char *,
1281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project					      int, int *);
1291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct res_sym {
1311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int		number;	   /* Identifying number, like T_MX */
1321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	const char *	name;	   /* Its symbolic name, like "MX" */
1331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	const char *	humanname; /* Its fun name, like "mail exchanger" */
1341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
1351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
1371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Global defines and variables for resolver stub.
1381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
1391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	MAXNS			3	/* max # name servers we'll track */
1401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	MAXDFLSRCH		3	/* # default domain levels to try */
1411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	MAXDNSRCH		6	/* max # domains in search path */
1421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	LOCALDOMAINPARTS	2	/* min levels in name that is "local" */
1431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_TIMEOUT		5	/* min. seconds between retries */
1451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	MAXRESOLVSORT		10	/* number of net to sort on */
1461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_MAXNDOTS		15	/* should reflect bit field size */
1471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_MAXRETRANS		30	/* only for resolv.conf/RES_OPTIONS */
1481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_MAXRETRY		5	/* only for resolv.conf/RES_OPTIONS */
1491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_DFLRETRY		2	/* Default #/tries. */
1501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_MAXTIME		65535	/* Infinity, in milliseconds. */
1511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct __res_state_ext;
1531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct __res_state {
155ea9bf6788144b83cc51c454b2bfe6b980d6e947cSzymon Jakubczak	unsigned	netid;			/* NetId: cache key and socket mark */
1561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int	retrans;	 	/* retransmission time interval */
1571dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int	retry;			/* number of times to retransmit */
1581dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifdef sun
1591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_int	options;		/* option flags - see below. */
1601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#else
1611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_long	options;		/* option flags - see below. */
1621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
1631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int	nscount;		/* number of name servers */
1641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	struct sockaddr_in
1651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project		nsaddr_list[MAXNS];	/* address of name server */
1661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	nsaddr	nsaddr_list[0]		/* for backward compatibility */
1671dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_short	id;			/* current message id */
1681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	char	*dnsrch[MAXDNSRCH+1];	/* components of domain to search */
1691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	char	defdname[256];		/* default domain (deprecated) */
1701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifdef sun
1711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_int	pfcode;			/* RES_PRF_ flags - see below. */
1721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#else
1731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_long	pfcode;			/* RES_PRF_ flags - see below. */
1741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
1751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	unsigned ndots:4;		/* threshold for initial abs. query */
1761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	unsigned nsort:4;		/* number of elements in sort_list[] */
1771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	char	unused[3];
1781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	struct {
1791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project		struct in_addr	addr;
1801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project		uint32_t	mask;
1811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	} sort_list[MAXRESOLVSORT];
1821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifdef __OLD_RES_STATE
1831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	char lookups[4];
1841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#else
1851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	res_send_qhook qhook;		/* query hook */
1861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	res_send_rhook rhook;		/* response hook */
1871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int	res_h_errno;		/* last one set for this context */
188ea9bf6788144b83cc51c454b2bfe6b980d6e947cSzymon Jakubczak	unsigned _mark;			/* If non-0 SET_MARK to _mark on all request sockets */
1891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int	_vcsock;		/* PRIVATE: for res_send VC i/o */
1901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_int	_flags;			/* PRIVATE: see below */
1911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_int	_pad;			/* make _u 64 bit aligned */
1921dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	union {
1931dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project		/* On an 32-bit arch this means 512b total. */
1941dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project		char	pad[72 - 4*sizeof (int) - 2*sizeof (void *)];
1951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project		struct {
1961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project			uint16_t		nscount;
1971dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project			uint16_t		nstimes[MAXNS];	/* ms. */
1981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project			int			nssocks[MAXNS];
1991dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project			struct __res_state_ext *ext;	/* extention for IPv6 */
2001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project		} _ext;
2011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	} _u;
2021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project        struct res_static   rstatic[1];
2041dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
2051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef struct __res_state *res_state;
2071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectunion res_sockaddr_union {
2091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	struct sockaddr_in	sin;
2101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifdef IN6ADDR_ANY_INIT
2111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	struct sockaddr_in6	sin6;
2121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifdef ISC_ALIGN64
2141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int64_t			__align64;	/* 64bit alignment */
2151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#else
2161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	int32_t			__align32;	/* 32bit alignment */
2171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	char			__space[128];   /* max size */
2191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
2201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
2221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Resolver flags (used to be discrete per-module statics ints).
2231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
2241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_F_VC	0x00000001	/* socket is TCP */
2251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_F_CONN	0x00000002	/* socket is connected */
2261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_F_EDNS0ERR	0x00000004	/* EDNS0 caused errors */
2271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_F__UNUSED	0x00000008	/* (unused) */
2281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_F_LASTMASK	0x000000F0	/* ordinal server of last res_nsend */
2291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_F_LASTSHIFT	4		/* bit position of LASTMASK "flag" */
2301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)
2311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* res_findzonecut2() options */
2331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_EXHAUSTIVE	0x00000001	/* always do all queries */
2341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_IPV4ONLY	0x00000002	/* IPv4 only */
2351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_IPV6ONLY	0x00000004	/* IPv6 only */
2361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
2381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Resolver options (keep these in synch with res_debug.c, please)
2391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
2401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_INIT	0x00000001	/* address initialized */
2411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_DEBUG	0x00000002	/* print debug messages */
2421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_AAONLY	0x00000004	/* authoritative answers only (!IMPL)*/
2431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_USEVC	0x00000008	/* use virtual circuit */
2441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRIMARY	0x00000010	/* query primary server only (!IMPL) */
2451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_IGNTC	0x00000020	/* ignore trucation errors */
2461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_RECURSE	0x00000040	/* recursion desired */
2471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_DEFNAMES	0x00000080	/* use default domain name */
2481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_STAYOPEN	0x00000100	/* Keep TCP socket open */
2491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_DNSRCH	0x00000200	/* search up local domain tree */
2501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_INSECURE1	0x00000400	/* type 1 security disabled */
2511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_INSECURE2	0x00000800	/* type 2 security disabled */
2521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_NOALIASES	0x00001000	/* shuts off HOSTALIASES feature */
2531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_USE_INET6	0x00002000	/* use/map IPv6 in gethostbyname() */
2541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_ROTATE	0x00004000	/* rotate ns list after each query */
2551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_NOCHECKNAME	0x00008000	/* do not check names for sanity. */
2561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_KEEPTSIG	0x00010000	/* do not strip TSIG records */
2571dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	RES_BLAST	0x00020000	/* blast all recursive servers */
2581dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_NOTLDQUERY	0x00100000	/* don't unqualified name as a tld */
2591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_USE_DNSSEC	0x00200000	/* use DNSSEC using OK bit in OPT */
2601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* #define RES_DEBUG2	0x00400000 */	/* nslookup internal */
2611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* KAME extensions: use higher bit to avoid conflict with ISC use */
2621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_USE_DNAME	0x10000000	/* use DNAME */
2631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_USE_EDNS0	0x40000000	/* use EDNS0 if configured */
2641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_NO_NIBBLE2	0x80000000	/* disable alternate nibble lookup */
2651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_DEFAULT	(RES_RECURSE | RES_DEFNAMES | \
2671dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project			 RES_DNSRCH | RES_NO_NIBBLE2)
2681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
2701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Resolver "pfcode" values.  Used by dig.
2711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
2721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_STATS	0x00000001
2731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_UPDATE	0x00000002
2741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_CLASS   0x00000004
2751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_CMD	0x00000008
2761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_QUES	0x00000010
2771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_ANS	0x00000020
2781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_AUTH	0x00000040
2791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_ADD	0x00000080
2801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_HEAD1	0x00000100
2811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_HEAD2	0x00000200
2821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_TTLID	0x00000400
2831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_HEADX	0x00000800
2841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_QUERY	0x00001000
2851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_REPLY	0x00002000
2861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_INIT	0x00004000
2871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define RES_PRF_TRUNC	0x00008000
2881dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*			0x00010000	*/
2891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* Things involving an internal (static) resolver context. */
2911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__BEGIN_DECLS
292e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes
293e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ extern struct __res_state *__res_get_state(void);
294e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ extern void __res_put_state(struct __res_state *);
2951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef ANDROID_CHANGES
2971dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
2981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Source and Binary compatibility; _res will not work properly
2991dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * with multi-threaded programs.
3001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
3011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectextern struct __res_state *__res_state(void);
3021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define _res (*__res_state())
3031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
3041dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
3051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__END_DECLS
3061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
3071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef __BIND_NOSTATIC
3081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define fp_nquery		__fp_nquery
3091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define fp_query		__fp_query
3101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define hostalias		__hostalias
3111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_query			__p_query
3121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_close		__res_close
3131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_opt			__res_opt
3141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_isourserver		__res_isourserver
3151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_querydomain		__res_querydomain
3161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_send		__res_send
3171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_sendsigned		__res_sendsigned
3181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
3191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifdef BIND_RES_POSIX3
3201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	dn_expand	__dn_expand
3211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_init	__res_init
3221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_query	__res_query
3231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_search	__res_search
3241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_mkquery	__res_mkquery
3251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
3261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
3271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__BEGIN_DECLS
3281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		fp_nquery(const u_char *, int, FILE *);
3291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		fp_query(const u_char *, FILE *);
3301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	hostalias(const char *);
3311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		p_query(const u_char *);
3321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		res_close(void);
3331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_init(void);
334e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ int		res_opt(int, u_char *, int, int);
3351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_isourserver(const struct sockaddr_in *);
3361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_mkquery(int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int);
3371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_query(const char *, int, int, u_char *, int);
3381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_querydomain(const char *, const char *, int, int, u_char *, int);
3391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_search(const char *, int, int, u_char *, int);
3401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_send(const u_char *, int, u_char *, int);
3411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_sendsigned(const u_char *, int, ns_tsig_key *, u_char *, int);
3421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__END_DECLS
3431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
3441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
3451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#if !defined(SHARED_LIBBIND) || defined(LIB)
3461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
3471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * If libbind is a shared object (well, DLL anyway)
3481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * these externs break the linker when resolv.h is
3491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * included by a lib client (like named)
3501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Make them go away if a client is including this
3511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
3521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
353e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ extern const struct res_sym __p_key_syms[];
354e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ extern const struct res_sym __p_cert_syms[];
3551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectextern const struct res_sym __p_class_syms[];
3561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectextern const struct res_sym __p_type_syms[];
357e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ extern const struct res_sym __p_rcode_syms[];
3581dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif /* SHARED_LIBBIND */
3591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
360b8e435c1d5593422349534c1cb356d11273ba1dbLorenzo Colitti#ifndef ANDROID_CHANGES
3611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define dn_comp			__dn_comp
362b8e435c1d5593422349534c1cb356d11273ba1dbLorenzo Colitti#endif
3631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define dn_count_labels		__dn_count_labels
3641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define dn_skipname		__dn_skipname
3651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define fp_resstat		__fp_resstat
3661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define loc_aton		__loc_aton
3671dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define loc_ntoa		__loc_ntoa
3681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_cdname		__p_cdname
3691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_cdnname		__p_cdnname
3701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_class			__p_class
3711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_fqname		__p_fqname
3721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_fqnname		__p_fqnname
3731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_option		__p_option
3741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_secstodate		__p_secstodate
3751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_section		__p_section
3761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_time			__p_time
3771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_type			__p_type
3781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_rcode			__p_rcode
3791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define p_sockun		__p_sockun
3801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define putlong			__putlong
3811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define putshort		__putshort
3821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_dnok		__res_dnok
3831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_findzonecut		__res_findzonecut
3841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_findzonecut2	__res_findzonecut2
3851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_hnok		__res_hnok
3861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_hostalias		__res_hostalias
3871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_mailok		__res_mailok
3881dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nameinquery		__res_nameinquery
3891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nclose		__res_nclose
3901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_ninit		__res_ninit
3911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nmkquery		__res_nmkquery
3921dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_pquery		__res_pquery
3931dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nquery		__res_nquery
3941dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nquerydomain	__res_nquerydomain
3951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nsearch		__res_nsearch
3961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nsend		__res_nsend
3971dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nsendsigned		__res_nsendsigned
3981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nisourserver	__res_nisourserver
3991dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_ownok		__res_ownok
4001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_queriesmatch	__res_queriesmatch
4011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_randomid		__res_randomid
4021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define sym_ntop		__sym_ntop
4031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define sym_ntos		__sym_ntos
4041dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define sym_ston		__sym_ston
4051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_nopt		__res_nopt
4061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define res_ndestroy		__res_ndestroy
4071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_nametoclass		__res_nametoclass
4081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_nametotype		__res_nametotype
4091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_setservers		__res_setservers
4101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_getservers		__res_getservers
4111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_buildprotolist	__res_buildprotolist
4121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_destroyprotolist	__res_destroyprotolist
4131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_destroyservicelist	__res_destroyservicelist
4141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_get_nibblesuffix	__res_get_nibblesuffix
4151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_get_nibblesuffix2	__res_get_nibblesuffix2
4161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_ourserver_p		__res_ourserver_p
4171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_protocolname	__res_protocolname
4181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_protocolnumber	__res_protocolnumber
4191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_send_setqhook	__res_send_setqhook
4201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_send_setrhook	__res_send_setrhook
4211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_servicename		__res_servicename
4221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	res_servicenumber	__res_servicenumber
4231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__BEGIN_DECLS
4241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_hnok(const char *);
4251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_ownok(const char *);
4261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_mailok(const char *);
4271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_dnok(const char *);
4281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		sym_ston(const struct res_sym *, const char *, int *);
4291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	sym_ntos(const struct res_sym *, int, int *);
4301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	sym_ntop(const struct res_sym *, int, int *);
4311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef ANDROID_CHANGES
4321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		b64_ntop(u_char const *, size_t, char *, size_t);
4331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		b64_pton(char const *, u_char *, size_t);
4341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
4351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		loc_aton(const char *, u_char *);
436cfd8c45725d85f3e2bfccb6b14a9bff59fd5c4c7Dan Albertconst char *	loc_ntoa(const u_char *, char *, size_t);
4371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		dn_skipname(const u_char *, const u_char *);
4381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		putlong(uint32_t, u_char *);
4391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		putshort(uint16_t, u_char *);
4401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef __ultrix__
4411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectuint16_t	_getshort(const u_char *);
4421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectuint32_t	_getlong(const u_char *);
4431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
4441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	p_class(int);
4451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	p_time(uint32_t);
4461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	p_type(int);
4471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	p_rcode(int);
448e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ const char *	p_sockun(union res_sockaddr_union, char *, size_t);
4491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst u_char *	p_cdnname(const u_char *, const u_char *, int, FILE *);
4501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst u_char *	p_cdname(const u_char *, const u_char *, FILE *);
4511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst u_char *	p_fqnname(const u_char *, const u_char *,
4521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project			       int, char *, int);
4531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst u_char *	p_fqname(const u_char *, const u_char *, FILE *);
4541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	p_option(u_long);
4551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectchar *		p_secstodate(u_long);
4561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		dn_count_labels(const char *);
4571dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectu_int		res_randomid(void);
4581dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nameinquery(const char *, int, int, const u_char *,
4591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				     const u_char *);
4601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_queriesmatch(const u_char *, const u_char *,
4611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				      const u_char *, const u_char *);
462e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ const char *	p_section(int, int);
4631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* Things involving a resolver context. */
4641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_ninit(res_state);
4651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nisourserver(const res_state, const struct sockaddr_in *);
4661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		fp_resstat(const res_state, FILE *);
467e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ void		res_pquery(const res_state, const u_char *, int, FILE *);
4681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	res_hostalias(const res_state, const char *, char *, size_t);
4691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nquery(res_state, const char *, int, int, u_char *, int);
4701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nsearch(res_state, const char *, int, int, u_char *, int);
4711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nquerydomain(res_state, const char *, const char *,
4721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				      int, int, u_char *, int);
4731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nmkquery(res_state, int, const char *, int, int,
4741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				  const u_char *, int, const u_char *,
4751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				  u_char *, int);
4761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nsend(res_state, const u_char *, int, u_char *, int);
4771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_nsendsigned(res_state, const u_char *, int,
4781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				     ns_tsig_key *, u_char *, int);
4791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_findzonecut(res_state, const char *, ns_class, int,
4801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				     char *, size_t, struct in_addr *, int);
4811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectint		res_findzonecut2(res_state, const char *, ns_class, int,
4821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				      char *, size_t,
4831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				      union res_sockaddr_union *, int);
4841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		res_nclose(res_state);
485e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ int		res_nopt(res_state, int, u_char *, int, int);
4861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		res_send_setqhook(res_send_qhook);
4871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		res_send_setrhook(res_send_rhook);
488e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ int		__res_vinit(res_state, int);
4891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		res_destroyservicelist(void);
4901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	res_servicename(uint16_t, const char *);
4911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectconst char *	res_protocolname(int);
4921dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		res_destroyprotolist(void);
4931dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid		res_buildprotolist(void);
494e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ const char *	res_get_nibblesuffix(res_state);
495e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ const char *	res_get_nibblesuffix2(res_state);
496e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ void		res_ndestroy(res_state);
497e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ uint16_t	res_nametoclass(const char *, int *);
498e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ uint16_t	res_nametotype(const char *, int *);
499e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ void		res_setservers(res_state,
5001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				    const union res_sockaddr_union *, int);
501e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ int		res_getservers(res_state,
5021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project				    union res_sockaddr_union *, int);
5031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
504e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ void res_setnetid(res_state, unsigned);
505e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes__LIBC_HIDDEN__ void res_setmark(res_state, unsigned);
5061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectu_int  res_randomid(void);
5071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
50831ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen#ifdef __i386__
50931ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen# define __socketcall extern __attribute__((__cdecl__))
51031ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen#else
51131ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen# define __socketcall extern
51231ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen#endif
51331ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen
51431ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen__socketcall int __connect(int, const struct sockaddr*, socklen_t);
51531ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen
51631ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen#undef __socketcall
51731ad03761d35ce5bff48cc1cb3764816727ac1f0Paul Jensen
5181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__END_DECLS
5191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
520e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes#pragma GCC visibility pop
521e8e453439fa87d9fccf03006cc4dac76acadf44cElliott Hughes
5221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif /* !_RESOLV_PRIVATE_H_ */
523